diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-25 00:22:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-25 00:22:36 +0000 |
commit | faf7791fea2edb07ba308e8e22e8157877145d47 (patch) | |
tree | d2697d76541ac73e7b42226a156f5d431fe010e4 /llvm/lib | |
parent | 3322e28f75c5e6c36d5dc47ee529d3d4a38a4869 (diff) | |
download | bcm5719-llvm-faf7791fea2edb07ba308e8e22e8157877145d47.tar.gz bcm5719-llvm-faf7791fea2edb07ba308e8e22e8157877145d47.zip |
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.
llvm-svn: 20828
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index f8fba1b3b43..880739849ea 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -302,7 +302,7 @@ void LICM::SinkRegion(DominatorTree::Node *N) { // 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 @@ void LICM::sink(Instruction &I) { New = &I; } else { New = I.clone(); + CurAST->copyValue(&I, New); if (!I.getName().empty()) New->setName(I.getName()+".le"); ExitBlock->getInstList().insert(InsertPt, New); |