summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commite591411fd69bb669a5aefe414bb81479ddb1cbb3 (patch)
tree46d779871b047f789a6184f1808d8374de614750 /llvm/lib/Transforms
parent726fd5cbf5774ebc7e727dac9365b6dd796a6e69 (diff)
downloadbcm5719-llvm-e591411fd69bb669a5aefe414bb81479ddb1cbb3.tar.gz
bcm5719-llvm-e591411fd69bb669a5aefe414bb81479ddb1cbb3.zip
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. llvm-svn: 65323
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopDeletion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 86edcfaac80..ac807a4c9b2 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/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>();
OpenPOWER on IntegriCloud