From d3a444af2d4c42a23e9ec78dbef4c3ee45e1e50c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 11 Mar 2011 13:03:54 -0800 Subject: [PATCH] glsl: Skip processing expression trees in optimize_redundant_jumps() Cuts the time spent in this function during glean texCombine by 2/3. --- src/glsl/opt_redundant_jumps.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/glsl/opt_redundant_jumps.cpp b/src/glsl/opt_redundant_jumps.cpp index edf4bb6..f350fa9 100644 --- a/src/glsl/opt_redundant_jumps.cpp +++ b/src/glsl/opt_redundant_jumps.cpp @@ -37,10 +37,19 @@ public: virtual ir_visitor_status visit_leave(ir_if *); virtual ir_visitor_status visit_leave(ir_loop *); + virtual ir_visitor_status visit_enter(ir_assignment *); bool progress; }; +/* We only care about the top level instructions, so don't descend + * into expressions. + */ +ir_visitor_status +redundant_jumps_visitor::visit_enter(ir_assignment *ir) +{ + return visit_continue_with_parent; +} ir_visitor_status redundant_jumps_visitor::visit_leave(ir_if *ir) -- 2.7.4