From: Chris Lattner Date: Fri, 25 Mar 2005 00:22:36 +0000 (+0000) Subject: Fix a bug where LICM was not updating AA information properly when sinking X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=70ac2dcb841dc62f08e16f0b0e2cefbf01baa4c5;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20828 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index f8fba1b3b43..880739849ea 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/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);