summaryrefslogtreecommitdiffstats
path: root/src/glsl/loop_analysis.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-11-28 12:44:53 -0800
committerPaul Berry <[email protected]>2013-12-09 10:54:49 -0800
commit714e1b331ed1b2dfffac4accb4ebf5a01d3f961f (patch)
tree55e28f094eda50017c627a9fc694665bb4159065 /src/glsl/loop_analysis.h
parent115fd75ab06b858b83173f7d76eada8ea417fc86 (diff)
glsl/loops: Remove unnecessary list walk from loop_control_visitor.
When loop_control_visitor::visit_leave(ir_loop *) is analyzing a loop terminator that acts on a certain ir_variable, it doesn't need to walk the list of induction variables to find the loop_variable entry corresponding to the variable. It can just look it up in the loop_variable_state hashtable and verify that the loop_variable entry represents an induction variable. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/loop_analysis.h')
-rw-r--r--src/glsl/loop_analysis.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
index 961ea40c079..8e57dacbf6b 100644
--- a/src/glsl/loop_analysis.h
+++ b/src/glsl/loop_analysis.h
@@ -189,6 +189,15 @@ public:
ir_rvalue *increment;
+ inline bool is_induction_var() const
+ {
+ /* Induction variables always have a non-null increment, and vice
+ * versa.
+ */
+ return this->increment != NULL;
+ }
+
+
inline bool is_loop_constant() const
{
const bool is_const = (this->num_assignments == 0)