[llvm-commits] [llvm] r65323 - /llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Dan Gohman
gohman at apple.com
Mon Feb 23 09:10:29 PST 2009
Author: djg
Date: Mon Feb 23 11:10:29 2009
New Revision: 65323
URL: http://llvm.org/viewvc/llvm-project?rev=65323&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=65323&r1=65322&r2=65323&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Mon Feb 23 11:10:29 2009
@@ -260,7 +260,10 @@
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>();
More information about the llvm-commits
mailing list