summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-29 18:11:16 +0000
committerChris Lattner <sabre@nondot.org>2010-08-29 18:11:16 +0000
commitf03b4eac482d0d02ee4465ad6f88a36e0bccd731 (patch)
tree9d925cb37368306c71fb9fd6047444b163430cb1 /llvm/lib/Transforms
parent11f8ad8211512b8e46bfd6c5967e32486aa0f8d3 (diff)
downloadbcm5719-llvm-f03b4eac482d0d02ee4465ad6f88a36e0bccd731.tar.gz
bcm5719-llvm-f03b4eac482d0d02ee4465ad6f88a36e0bccd731.zip
revert 112448 for now.
llvm-svn: 112449
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index a214d969e9a..e6a8b2d572e 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -574,11 +574,12 @@ void LICM::hoist(Instruction &I) {
DEBUG(dbgs() << "LICM hoisting to " << Preheader->getName() << ": "
<< I << "\n");
- // The instruction is no longer in this loop.
- CurAST->deleteValue(&I);
-
- // Move the new node to the Preheader, before its terminator.
- I.moveBefore(Preheader->getTerminator());
+ // Remove the instruction from its current basic block... but don't delete the
+ // instruction.
+ I.removeFromParent();
+
+ // Insert the new node in Preheader, before the terminator.
+ Preheader->getInstList().insert(Preheader->getTerminator(), &I);
if (isa<LoadInst>(I)) ++NumMovedLoads;
else if (isa<CallInst>(I)) ++NumMovedCalls;
OpenPOWER on IntegriCloud