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

Chris Lattner sabre at nondot.org
Tue Jun 5 18:24:17 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

LoopStrengthReduce.cpp updated: 1.138 -> 1.139
---
Log message:

Fix PR1495: http://llvm.org/PR1495  and CodeGen/X86/2007-06-05-LSR-Dominator.ll


---
Diffs of the changes:  (+6 -0)

 LoopStrengthReduce.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.138 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.139
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.138	Fri May 18 20:22:21 2007
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp	Tue Jun  5 20:23:55 2007
@@ -560,11 +560,17 @@
                                     OperandValToReplace->getType());
 
   Value *Base = Rewriter.expandCodeFor(NewBase, BaseInsertPt);
+
+  // If we are inserting the base and imm values in the same block, make sure to
+  // adjust the IP position if insertion reused a result.
+  if (IP == BaseInsertPt)
+    IP = Rewriter.getInsertionPoint();
   
   // Always emit the immediate (if non-zero) into the same block as the user.
   SCEVHandle NewValSCEV = SCEVAddExpr::get(SCEVUnknown::get(Base), Imm);
   return Rewriter.expandCodeFor(NewValSCEV, IP,
                                 OperandValToReplace->getType());
+  
 }
 
 






More information about the llvm-commits mailing list