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

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 24 16:22:52 PST 2005



Changes in directory llvm/lib/Transforms/Scalar:

LICM.cpp updated: 1.71 -> 1.72
---
Log message:

Fix a bug where LICM was not updating AA information properly when sinking
a pointer value out of a loop causing it to be duplicated.


---
Diffs of the changes:  (+2 -1)

 LICM.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.71 llvm/lib/Transforms/Scalar/LICM.cpp:1.72
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.71	Wed Mar 23 15:00:12 2005
+++ llvm/lib/Transforms/Scalar/LICM.cpp	Thu Mar 24 18:22:36 2005
@@ -302,7 +302,7 @@
     // outside of the loop.  In this case, it doesn't even matter if the
     // operands of the instruction are loop invariant.
     //
-    if (canSinkOrHoistInst(I) && isNotUsedInLoop(I)) {
+    if (isNotUsedInLoop(I) && canSinkOrHoistInst(I)) {
       ++II;
       sink(I);
     }
@@ -530,6 +530,7 @@
             New = &I;
           } else {
             New = I.clone();
+            CurAST->copyValue(&I, New);
             if (!I.getName().empty())
               New->setName(I.getName()+".le");
             ExitBlock->getInstList().insert(InsertPt, New);






More information about the llvm-commits mailing list