summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_dead_code_local.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-01-30 07:59:14 +1000
committerEric Anholt <[email protected]>2011-02-04 12:18:38 -0600
commit29a2e9133e415de8b010df5b80db758aaf1007a6 (patch)
tree146ef5788bce45b707b983caac8d8f74d41f9814 /src/glsl/opt_dead_code_local.cpp
parentb6d49ab843ff7ee989e99bb28a36eb53f704c879 (diff)
glsl: Remove extra checks for constant true assignment conditions.
These are already stripped by opt_constant_folding.cpp.
Diffstat (limited to 'src/glsl/opt_dead_code_local.cpp')
-rw-r--r--src/glsl/opt_dead_code_local.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/glsl/opt_dead_code_local.cpp b/src/glsl/opt_dead_code_local.cpp
index 88dcdc25176..f67b4633740 100644
--- a/src/glsl/opt_dead_code_local.cpp
+++ b/src/glsl/opt_dead_code_local.cpp
@@ -131,15 +131,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
var = ir->lhs->variable_referenced();
assert(var);
- bool always_assign = true;
- if (ir->condition) {
- ir_constant *condition = ir->condition->as_constant();
- if (!condition || !condition->value.b[0])
- always_assign = false;
- }
-
/* Now, check if we did a whole-variable assignment. */
- if (always_assign && (ir->whole_variable_written() != NULL)) {
+ if (!ir->condition && (ir->whole_variable_written() != NULL)) {
/* We did a whole-variable assignment. So, any instruction in
* the assignment list with the same LHS is dead.
*/