aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LoopDeletion.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-23 17:10:29 +0000
committerDan Gohman <gohman@apple.com>2009-02-23 17:10:29 +0000
commit6476cbe408cf5dd026a75a7560069eb5889895f7 (patch)
tree52bb762d44c28adbae6584b38ab1b56ac17e51f7 /lib/Transforms/Scalar/LoopDeletion.cpp
parent0b9e4710e4315595d147fc8dfa6ab63049eef1fb (diff)
downloadexternal_llvm-6476cbe408cf5dd026a75a7560069eb5889895f7.zip
external_llvm-6476cbe408cf5dd026a75a7560069eb5889895f7.tar.gz
external_llvm-6476cbe408cf5dd026a75a7560069eb5889895f7.tar.bz2
LoopDeletion needs to inform ScalarEvolution when a loop is deleted,
so that ScalarEvolution doesn't hang onto a dangling Loop*, which could be a problem if another Loop happens to get allocated at the same address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopDeletion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp
index 86edcfa..ac807a4 100644
--- a/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -260,7 +260,10 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
LI != LE; ++LI)
(*LI)->eraseFromParent();
-
+
+ // Tell ScalarEvolution that the loop is deleted.
+ SE.forgetLoopIterationCount(L);
+
// Finally, the blocks from loopinfo. This has to happen late because
// otherwise our loop iterators won't work.
LoopInfo& loopInfo = getAnalysis<LoopInfo>();