aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/loop_analysis.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-08-27 15:41:20 -0700
committerIan Romanick <[email protected]>2010-09-03 11:55:22 -0700
commit3bcfafcf0320ee5407716ff67062e80d162760d4 (patch)
tree9e3b0591373f04c68da6d39dbc819257a9c96344 /src/glsl/loop_analysis.cpp
parent351525d534268b08c090f9ce42a67e9329a969ae (diff)
glsl2: Track the number of ir_loop_jump instructions that are in a loop
Diffstat (limited to 'src/glsl/loop_analysis.cpp')
-rw-r--r--src/glsl/loop_analysis.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp
index 2ea2f3dbe39..f1268c04c4d 100644
--- a/src/glsl/loop_analysis.cpp
+++ b/src/glsl/loop_analysis.cpp
@@ -103,6 +103,7 @@ class loop_analysis : public ir_hierarchical_visitor {
public:
loop_analysis();
+ virtual ir_visitor_status visit(ir_loop_jump *);
virtual ir_visitor_status visit(ir_dereference_variable *);
virtual ir_visitor_status visit_enter(ir_loop *);
@@ -132,6 +133,22 @@ loop_analysis::loop_analysis()
ir_visitor_status
+loop_analysis::visit(ir_loop_jump *ir)
+{
+ (void) ir;
+
+ assert(!this->state.is_empty());
+
+ loop_variable_state *const ls =
+ (loop_variable_state *) this->state.get_head();
+
+ ls->num_loop_jumps++;
+
+ return visit_continue;
+}
+
+
+ir_visitor_status
loop_analysis::visit(ir_dereference_variable *ir)
{
/* If we're not somewhere inside a loop, there's nothing to do.