Mesa (master): i965: remove GLSL IR optimisation loop

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Apr 24 02:48:26 UTC 2017


Module: Mesa
Branch: master
Commit: ad55b1a7701ad51234af3b9fc30f4c54d2546b86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad55b1a7701ad51234af3b9fc30f4c54d2546b86

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Wed Jan 18 10:28:22 2017 +1100

i965: remove GLSL IR optimisation loop

IVB is running into some spilling issues in piglit with the
loop removed. However those tests are not really reflective
of a real world use case, also fp64 is brand new to IVB
so we leave the spilling issues to be resolved at a later
time.

Run time for shader-db on my machine goes from ~795 seconds to
~665 seconds.

shader-db results BDW:

total instructions in shared programs: 12969459 -> 12968891 (-0.00%)
instructions in affected programs: 1463154 -> 1462586 (-0.04%)
helped: 3622
HURT: 3326

total cycles in shared programs: 246453572 -> 246504318 (0.02%)
cycles in affected programs: 208842622 -> 208893368 (0.02%)
helped: 24029
HURT: 35407

total loops in shared programs: 2931 -> 2931 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

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.

Acked-by: Elie Tournier <elie.tournier at collabora.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_link.cpp | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 7c10a40bdf..2e75b8a47c 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -88,7 +88,6 @@ process_glsl_ir(struct brw_context *brw,
                 struct gl_linked_shader *shader)
 {
    struct gl_context *ctx = &brw->ctx;
-   const struct brw_compiler *compiler = brw->screen->compiler;
    const struct gl_shader_compiler_options *options =
       &ctx->Const.ShaderCompilerOptions[shader->Stage];
 
@@ -132,21 +131,6 @@ 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);
-
    validate_ir_tree(shader->ir);
 
    /* Now that we've finished altering the linked IR, reparent any live IR back




More information about the mesa-commit mailing list