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

src/glsl/opt_if_simplification.cpp

index 618bacfecf17ea2a6cc4666af2bdfa67a207e64d..29b1d18aa59259b37eb61d45589b91aa3a10b142 100644 (file)
@@ -38,10 +38,20 @@ public:
    }
 
    ir_visitor_status visit_leave(ir_if *);
+   ir_visitor_status visit_enter(ir_assignment *);
 
    bool made_progress;
 };
 
+/* We only care about the top level "if" instructions, so don't
+ * descend into expressions.
+ */
+ir_visitor_status
+ir_if_simplification_visitor::visit_enter(ir_assignment *ir)
+{
+   return visit_continue_with_parent;
+}
+
 bool
 do_if_simplification(exec_list *instructions)
 {