std::vector<ValueEntry> &Ops) {
// Now that we have the linearized expression tree, try to optimize it.
// Start by folding any constants that we found.
-Iterate:
bool IterateOptimization = false;
if (Ops.size() == 1) return;
if (Constant *V2 = dyn_cast<Constant>(Ops.back().Op)) {
Ops.pop_back();
Ops.back().Op = ConstantExpr::get(Opcode, V1, V2);
- goto Iterate;
+ OptimizeExpression(Opcode, Ops);
+ return;
}
// Check for destructive annihilation due to a constant being used.
//case Instruction::Mul:
}
- if (IterateOptimization) goto Iterate;
+ if (IterateOptimization)
+ OptimizeExpression(Opcode, Ops);
}