diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-08 19:48:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-08 19:48:43 +0000 |
commit | 989f6229bcef6e7a0ec8f5c8b0013051c0b56b59 (patch) | |
tree | b2a3aeceb9c4709149c7600d257f5e621e31d76d /lib/Transforms/Scalar/Reassociate.cpp | |
parent | 1f243e9f43e3552c28331c2e17b7c19bdfc889f6 (diff) |
eliminate gotos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r-- | lib/Transforms/Scalar/Reassociate.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 8bf918a018..840b8f2e81 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -365,7 +365,6 @@ void Reassociate::OptimizeExpression(unsigned Opcode, 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; @@ -373,7 +372,8 @@ Iterate: 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. @@ -494,7 +494,8 @@ Iterate: //case Instruction::Mul: } - if (IterateOptimization) goto Iterate; + if (IterateOptimization) + OptimizeExpression(Opcode, Ops); } |