[llvm-commits] CVS: llvm/lib/Transforms/Scalar/Reassociate.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun May 8 12:48:57 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

Reassociate.cpp updated: 1.42 -> 1.43
---
Log message:

eliminate gotos


---
Diffs of the changes:  (+4 -3)

 Reassociate.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.42 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.43
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.42	Sun May  8 13:59:37 2005
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp	Sun May  8 14:48:43 2005
@@ -365,7 +365,6 @@
                                      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 @@
     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 @@
   //case Instruction::Mul:
   }
 
-  if (IterateOptimization) goto Iterate;
+  if (IterateOptimization) 
+    OptimizeExpression(Opcode, Ops);
 }
 
 






More information about the llvm-commits mailing list