aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-25 00:22:36 +0000
committerChris Lattner <sabre@nondot.org>2005-03-25 00:22:36 +0000
commit70ac2dcb841dc62f08e16f0b0e2cefbf01baa4c5 (patch)
tree0cd5c9a5d4e7b8350f1b3532bb98fdc531d44693 /lib/Transforms
parent20da24c4b9e42fbef32e8f7fec3cc6bf1928df23 (diff)
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index f8fba1b3b4..880739849e 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);