Descend down the tree in more locations in constant folding.
authorEric Anholt <eric@anholt.net>
Tue, 6 Apr 2010 18:42:01 +0000 (11:42 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 6 Apr 2010 18:42:34 +0000 (11:42 -0700)
ir_constant_folding.cpp

index 006eb5ffcfcec733c25f64f28ec6c06cef2f2d37..eabdc240ad34a3b4dbae7c75a67e3b1e55f7d53b 100644 (file)
@@ -73,6 +73,8 @@ ir_constant_folding_visitor::visit(ir_expression *ir)
       op[operand] = ir->operands[operand]->constant_expression_value();
       if (op[operand]) {
         ir->operands[operand] = op[operand];
+      } else {
+        ir->operands[operand]->accept(this);
       }
    }
 }
@@ -81,7 +83,7 @@ ir_constant_folding_visitor::visit(ir_expression *ir)
 void
 ir_constant_folding_visitor::visit(ir_swizzle *ir)
 {
-   (void) ir;
+   ir->val->accept(this);
 }