[Mesa-dev] [PATCH 01/22] glsl: Reorder optimization-passes

Thomas Helland thomashelland90 at gmail.com
Sat Jan 3 11:18:06 PST 2015


This allows opt_algebraic to resolve open-coded
saturates into ir_unop_saturate before we potentially
mess it up by removing the min or max in min/max-pruning.

Since we are now emitting more free saturates on i965
this gives us some decrease in instruction count.

total instructions in shared programs: 1317459 -> 1317065 (-0.03%)
instructions in affected programs:     4084 -> 3690 (-9.65%)
GAINED:                                0
LOST:                                  0

---
 src/glsl/glsl_parser_extras.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 27e2eaf3..54ec67c 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -1625,10 +1625,10 @@ do_common_optimization(exec_list *ir, bool linked,
    else
       progress = do_constant_variable_unlinked(ir) || progress;
    progress = do_constant_folding(ir) || progress;
+   progress = do_algebraic(ir, native_integers, options) || progress;
    progress = do_minmax_prune(ir) || progress;
    progress = do_cse(ir) || progress;
    progress = do_rebalance_tree(ir) || progress;
-   progress = do_algebraic(ir, native_integers, options) || progress;
    progress = do_lower_jumps(ir) || progress;
    progress = do_vec_index_to_swizzle(ir) || progress;
    progress = lower_vector_insert(ir, false) || progress;
-- 
2.2.1



More information about the mesa-dev mailing list