glsl: Skip processing expression trees in optimize_redundant_jumps()
authorEric Anholt <eric@anholt.net>
Fri, 11 Mar 2011 21:03:54 +0000 (13:03 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 15 Mar 2011 16:49:00 +0000 (09:49 -0700)
Cuts the time spent in this function during glean texCombine by 2/3.

src/glsl/opt_redundant_jumps.cpp

index edf4bb6c224f9669514410f34a7537035f0dc2e3..f350fa947c94b78fcdf6ce86e30cff17923ad869 100644 (file)
@@ -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)