Mesa (master): glsl: Skip processing expression trees in do_if_simplification().

Eric Anholt anholt at kemper.freedesktop.org
Tue Mar 15 17:23:03 UTC 2011


Module: Mesa
Branch: master
Commit: 991fa4d3d07a3ebda2a1398d346b18b3afbaa736
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=991fa4d3d07a3ebda2a1398d346b18b3afbaa736

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 11 13:08:26 2011 -0800

glsl: Skip processing expression trees in do_if_simplification().

Reduces time spent in this during glean texCombine by about 2/3.

---

 src/glsl/opt_if_simplification.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/glsl/opt_if_simplification.cpp b/src/glsl/opt_if_simplification.cpp
index 618bacf..29b1d18 100644
--- a/src/glsl/opt_if_simplification.cpp
+++ b/src/glsl/opt_if_simplification.cpp
@@ -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)
 {




More information about the mesa-commit mailing list