diff options
author | Ian Romanick <[email protected]> | 2010-09-02 14:53:17 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-03 11:55:22 -0700 |
commit | f061524f0737bf59dad6ab9bb2e0015df804e4b5 (patch) | |
tree | 75a813e7411f78a7f16ef2e4a067ad2d4c145319 /src/glsl/loop_analysis.cpp | |
parent | 4e5b41c2f6b6423d0df260a9dea7938546134ec6 (diff) |
glsl2: Use as_constant some places instead of constant_expression_value
The places where constant_expression_value are still used in loop
analysis are places where a new expression tree is created and
constant folding won't have happened. This is used, for example, when
we try to determine the maximal loop iteration count.
Based on review comments by Eric. "...rely on constant folding to
have done its job, instead of going all through the subtree again when
it wasn't a constant."
Diffstat (limited to 'src/glsl/loop_analysis.cpp')
-rw-r--r-- | src/glsl/loop_analysis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/loop_analysis.cpp b/src/glsl/loop_analysis.cpp index f1268c04c4d..32e8b8c85b3 100644 --- a/src/glsl/loop_analysis.cpp +++ b/src/glsl/loop_analysis.cpp @@ -433,7 +433,7 @@ get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash) ir_rvalue *inc = (op0 == var) ? rhs->operands[1] : rhs->operands[0]; - if (inc->constant_expression_value() == NULL) { + if (inc->as_constant() == NULL) { ir_variable *const inc_var = inc->variable_referenced(); if (inc_var != NULL) { loop_variable *lv = |