summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-18 08:12:32 +0000
committerChris Lattner <sabre@nondot.org>2003-12-18 08:12:32 +0000
commit9e2b42a0c8be56ee360fe9a177cf01019f9d3cc7 (patch)
treedc980f61393f844bb0e56a7749aaf53a564c8851 /llvm/lib/Transforms/Scalar/LICM.cpp
parent44fea5416dead613c17ddaf987f1ec8c838080cd (diff)
downloadbcm5719-llvm-9e2b42a0c8be56ee360fe9a177cf01019f9d3cc7.tar.gz
bcm5719-llvm-9e2b42a0c8be56ee360fe9a177cf01019f9d3cc7.zip
When we delete instructions from the loop, make sure to remove them from the
AliasSetTracker as well. llvm-svn: 10507
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 6046f02563e..19162292ee1 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -387,6 +387,7 @@ void LICM::sink(Instruction &I) {
if (ExitBlocks.size() == 1) {
if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[0], I.getParent())) {
// Instruction is not used, just delete it.
+ CurAST->remove(&I);
I.getParent()->getInstList().erase(&I);
} else {
// Move the instruction to the start of the exit block, after any PHI
@@ -399,6 +400,7 @@ void LICM::sink(Instruction &I) {
}
} else if (ExitBlocks.size() == 0) {
// The instruction is actually dead if there ARE NO exit blocks.
+ CurAST->remove(&I);
I.getParent()->getInstList().erase(&I);
} else {
// Otherwise, if we have multiple exits, use the PromoteMem2Reg function to
OpenPOWER on IntegriCloud