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 006eb5f..eabdc24 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);
 }