glsl: run do_lower_jumps properly in do_common_optimizations
authorMarek Olšák <marek.olsak@amd.com>
Sat, 31 Dec 2016 11:02:26 +0000 (12:02 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 5 Jan 2017 12:07:12 +0000 (13:07 +0100)
so that backends don't have to run it manually

Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/glsl_parser_extras.cpp
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 4566aa92ecdf11d2e34e15d7f3018f46eaa93164..b12cf3d90c0073a84a2e87c7ca8a5028223ce537 100644 (file)
@@ -2106,7 +2106,8 @@ do_common_optimization(exec_list *ir, bool linked,
    OPT(do_minmax_prune, ir);
    OPT(do_rebalance_tree, ir);
    OPT(do_algebraic, ir, native_integers, options);
-   OPT(do_lower_jumps, ir);
+   OPT(do_lower_jumps, ir, true, true, options->EmitNoMainReturn,
+       options->EmitNoCont, options->EmitNoLoops);
    OPT(do_vec_index_to_swizzle, ir);
    OPT(lower_vector_insert, ir, false);
    OPT(do_swizzle_swizzle, ir);
index 653b8221deedec203ad92d54f00b5730f74182b8..0089e80faa37d5c6e611e2646a9157d4b50b6e27 100644 (file)
@@ -2979,8 +2979,6 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
                                 | LOG_TO_LOG2 | INT_DIV_TO_MUL_RCP
                                 | ((options->EmitNoPow) ? POW_TO_EXP2 : 0)));
 
-        progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
-
         progress = do_common_optimization(ir, true, true,
                                            options, ctx->Const.NativeIntegers)
           || progress;
index 95992965ed8d20cfc3cdf6252c3feac75712a258..af4dd0e6b7f41711f6c2590802db0e74c617a093 100644 (file)
@@ -6872,14 +6872,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       }
 
       do {
-         progress = false;
-
-         progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
-
          progress = do_common_optimization(ir, true, true, options,
-                                           ctx->Const.NativeIntegers)
-           || progress;
-
+                                           ctx->Const.NativeIntegers);
          progress = lower_if_to_cond_assign((gl_shader_stage)i, ir,
                                             options->MaxIfDepth, if_threshold) ||
                     progress;