[Mesa-stable] [PATCH 4/6] i965: Copy propagate before doing variable index lowering.

Kenneth Graunke kenneth at whitecape.org
Wed Jun 22 03:02:53 UTC 2016


The scalar backend currently doesn't support variable indexing on
temporary arrays, but it does support it on uniform arrays, and
some stages support it for input arrays.  Make sure these are
propagated through before exploding indirects into piles of
if-ladders unnecessarily.

On Broadwell, no instruction count change in shader-db.

total cycles in shared programs: 80675652 -> 80674928 (-0.00%)
cycles in affected programs: 649972 -> 649248 (-0.11%)
helped: 386
HURT: 165

This will help avoid code quality regressions in a future commit.

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_link.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 3bb04fa..76c580b 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -130,6 +130,8 @@ process_glsl_ir(gl_shader_stage stage,
    lower_noise(shader->ir);
    lower_quadop_vector(shader->ir, false);
 
+   do_copy_propagation(shader->ir);
+
    bool lowered_variable_indexing =
       lower_variable_index_to_cond_assign((gl_shader_stage)stage,
                                           shader->ir,
-- 
2.9.0



More information about the mesa-stable mailing list