<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Could it be pushed? The commit is independent from other in
      series.</p>
    <p>- Danil<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 12.07.18 00:27, Jason Ekstrand
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOFGe97buR5SAoz9hygZU8udtj_R5cB9PazLgwNV1PHyiq7Qjg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">Reviewed-by: Jason Ekstrand <<a
          href="mailto:jason@jlekstrand.net" moz-do-not-send="true">jason@jlekstrand.net</a>><br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Wed, Jul 11, 2018 at 5:29 AM Danylo Piliaiev
          <<a href="mailto:danylo.piliaiev@gmail.com"
            moz-do-not-send="true">danylo.piliaiev@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">After
          optimization passes and many trasfromations most of memory<br>
          NIR holds is a garbage which was being freed only after shader
          deletion.<br>
          Freeing it at the end of linking will save memory which would
          be useful<br>
          in case there are a lot of complex shaders being compiled.<br>
          The common case for this issue is 32bit game running under
          Wine.<br>
          <br>
          The cost of the optimization is around ~3-5% of compilation
          speed<br>
          with complex shaders.<br>
          <br>
          V2: by Jason Ekstrand<br>
              - Move nir_sweep up, right after the last change of NIR<br>
          <br>
          Bugzilla: <a
            href="https://bugs.freedesktop.org/show_bug.cgi?id=103274"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://bugs.freedesktop.org/show_bug.cgi?id=103274</a><br>
          <br>
          Signed-off-by: Danylo Piliaiev <<a
            href="mailto:danylo.piliaiev@globallogic.com"
            target="_blank" moz-do-not-send="true">danylo.piliaiev@globallogic.com</a>><br>
          ---<br>
           src/mesa/drivers/dri/i965/brw_link.cpp | 2 ++<br>
           1 file changed, 2 insertions(+)<br>
          <br>
          diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
          b/src/mesa/drivers/dri/i965/brw_link.cpp<br>
          index 1071056f14..378426101b 100644<br>
          --- a/src/mesa/drivers/dri/i965/brw_link.cpp<br>
          +++ b/src/mesa/drivers/dri/i965/brw_link.cpp<br>
          @@ -317,6 +317,8 @@ brw_link_shader(struct gl_context *ctx,
          struct gl_shader_program *shProg)<br>
                 NIR_PASS_V(prog->nir, nir_lower_atomics_to_ssbo,<br>
                            prog->nir->info.num_abos);<br>
          <br>
          +      nir_sweep(prog->nir);<br>
          +<br>
                 infos[stage] = &prog->nir->info;<br>
          <br>
                 update_xfb_info(prog->sh.LinkedTransformFeedback,
          infos[stage]);<br>
          -- <br>
          2.17.1<br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>