[Mesa-dev] [PATCH 5/5] i965: remove GLSL IR optimisation loop

Timothy Arceri timothy.arceri at collabora.com
Wed Jan 18 02:12:38 UTC 2017


Run time for shader-db on my machine goes from ~750 seconds to
~630 seconds.

shader-db results BDW:

total instructions in shared programs: 12968880 -> 12968298 (-0.00%)
instructions in affected programs: 1467035 -> 1466453 (-0.04%)
helped: 3632
HURT: 3331

total cycles in shared programs: 246501486 -> 246566354 (0.03%)
cycles in affected programs: 208986974 -> 209051842 (0.03%)
helped: 24215
HURT: 34884

total spills in shared programs: 14560 -> 14498 (-0.43%)
spills in affected programs: 2270 -> 2208 (-2.73%)
helped: 17
HURT: 2

total fills in shared programs: 19671 -> 19632 (-0.20%)
fills in affected programs: 2060 -> 2021 (-1.89%)
helped: 17
HURT: 2

LOST:   17
GAINED: 40

Most of the hurt shaders are 1-2 instructions, with what looks like a max of 7.

I've looked at the worst cycles regressions and as far as I can tell its just
a scheduling difference.
---
 src/mesa/drivers/dri/i965/brw_link.cpp | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 4159756..bee9ce9 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -134,20 +134,7 @@ process_glsl_ir(struct brw_context *brw,
    lower_noise(shader->ir);
    lower_quadop_vector(shader->ir, false);
 
-   bool progress;
-   do {
-      progress = false;
-
-      if (compiler->scalar_stage[shader->Stage]) {
-         if (shader->Stage == MESA_SHADER_VERTEX ||
-             shader->Stage == MESA_SHADER_FRAGMENT)
-            brw_do_channel_expressions(shader->ir);
-         brw_do_vector_splitting(shader->ir);
-      }
-
-      progress = do_common_optimization(shader->ir, true, true,
-                                        options, ctx->Const.NativeIntegers) || progress;
-   } while (progress);
+   do_dead_code(shader->ir, true);
 
    validate_ir_tree(shader->ir);
 
-- 
2.9.3



More information about the mesa-dev mailing list