Mesa (master): i965: make use of nir_lower_returns() for GL

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Dec 22 23:59:44 UTC 2016


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

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Fri Dec  9 16:49:10 2016 +1100

i965: make use of nir_lower_returns() for GL

Fixes two new piglit tests:

spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test

shader-db results for BDW:

total instructions in shared programs: 12903158 -> 12903134 (-0.00%)
instructions in affected programs: 27100 -> 27076 (-0.09%)
helped: 32
HURT: 6

total cycles in shared programs: 294922518 -> 294922804 (0.00%)
cycles in affected programs: 4372828 -> 4373114 (0.01%)
helped: 31
HURT: 8

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_link.cpp  | 6 ------
 src/mesa/drivers/dri/i965/brw_program.c | 2 ++
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 0d8a626..60eb8dc 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -145,12 +145,6 @@ process_glsl_ir(struct brw_context *brw,
          brw_do_vector_splitting(shader->ir);
       }
 
-      progress = do_lower_jumps(shader->ir, true, true,
-                                true, /* main return */
-                                false, /* continue */
-                                false /* loops */
-                                ) || progress;
-
       progress = do_common_optimization(shader->ir, true, true,
                                         options, ctx->Const.NativeIntegers) || progress;
    } while (progress);
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 7f69977..fa54c2a 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -78,6 +78,8 @@ brw_create_nir(struct brw_context *brw,
    if (shader_prog) {
       nir = glsl_to_nir(shader_prog, stage, options);
       nir_remove_dead_variables(nir, nir_var_shader_in | nir_var_shader_out);
+      nir_lower_returns(nir);
+      nir_validate_shader(nir);
       NIR_PASS_V(nir, nir_lower_io_to_temporaries,
                  nir_shader_get_entrypoint(nir), true, false);
    } else {




More information about the mesa-commit mailing list