From: Dan Gohman Date: Mon, 23 Feb 2009 17:10:29 +0000 (+0000) Subject: LoopDeletion needs to inform ScalarEvolution when a loop is deleted, X-Git-Tag: android-x86-6.0-r1~1003^2~22300 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e2abdd3ff0dd54a59edbd114ebb1d7728040a2d9;p=android-x86%2Fexternal-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index 86edcfaac80..ac807a4c9b2 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();