<div dir="auto"><div>Hi, sorry for the drive-by but a comment in line below<br><br><div class="gmail_quote"><div dir="ltr">Den tis 31 juli 2018 16:09Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Shader-db results on Kaby Lake:<br>
<br>
    total instructions in shared programs: 15166953 -> 15073611 (-0.62%)<br>
    instructions in affected programs: 2390284 -> 2296942 (-3.91%)<br>
    helped: 16469<br>
    HURT: 505<br>
<br>
    total loops in shared programs: 4954 -> 4951 (-0.06%)<br>
    loops in affected programs: 3 -> 0<br>
    helped: 3<br>
    HURT: 0<br>
---<br>
 src/intel/compiler/brw_nir.c | 17 ++++++++++++-----<br>
 1 file changed, 12 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c<br>
index 99ef6bec77f..a6e3e502cdd 100644<br>
--- a/src/intel/compiler/brw_nir.c<br>
+++ b/src/intel/compiler/brw_nir.c<br>
@@ -713,6 +713,18 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,<br>
    nir_validate_shader(*producer);<br>
    nir_validate_shader(*consumer);<br>
<br>
+   const bool p_is_scalar =<br>
+      compiler->scalar_stage[(*producer)->info.stage];<br>
+   const bool c_is_scalar =<br>
+      compiler->scalar_stage[(*producer)->info.stage];<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Shouldn't the above index be s/producer/consumer/ ? else both booleans are the same.</div><div dir="auto"><br></div><div dir="auto">BR</div><div dir="auto">Nils</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+   if (p_is_scalar && c_is_scalar) {<br>
+      NIR_PASS_V(*producer, nir_lower_io_to_scalar_early, nir_var_shader_out);<br>
+      NIR_PASS_V(*consumer, nir_lower_io_to_scalar_early, nir_var_shader_in);<br>
+      *producer = brw_nir_optimize(*producer, compiler, p_is_scalar);<br>
+      *consumer = brw_nir_optimize(*consumer, compiler, c_is_scalar);<br>
+   }<br>
+<br>
    NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);<br>
    NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in);<br>
<br>
@@ -729,12 +741,7 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,<br>
       NIR_PASS_V(*consumer, nir_lower_indirect_derefs,<br>
                  brw_nir_no_indirect_mask(compiler, (*consumer)->info.stage));<br>
<br>
-      const bool p_is_scalar =<br>
-         compiler->scalar_stage[(*producer)->info.stage];<br>
       *producer = brw_nir_optimize(*producer, compiler, p_is_scalar);<br>
-<br>
-      const bool c_is_scalar =<br>
-         compiler->scalar_stage[(*producer)->info.stage];<br>
       *consumer = brw_nir_optimize(*consumer, compiler, c_is_scalar);<br>
    }<br>
 }<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank" rel="noreferrer">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div></div>