summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-27 23:43:07 +0000
committerDan Gohman <gohman@apple.com>2009-09-27 23:43:07 +0000
commit37a99664ff19891f625a3c7c8bbd0a1f12b503ee (patch)
tree784f21a65a361ef2a7ac2f50d38855d46185b9f1 /llvm/lib/Analysis/LoopPass.cpp
parent5e8ba5d51469dd75a971dee88ec578f706f5b887 (diff)
downloadbcm5719-llvm-37a99664ff19891f625a3c7c8bbd0a1f12b503ee.tar.gz
bcm5719-llvm-37a99664ff19891f625a3c7c8bbd0a1f12b503ee.zip
When a loop is deleted, immediately release all of the active
LoopPasses for that loop. This avoids trouble with the PassManager trying to call verifyAnalysis on them, and frees up some memory sooner rather than later. llvm-svn: 82945
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r--llvm/lib/Analysis/LoopPass.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 08615c4e14e..4f7018da1ac 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -253,6 +253,15 @@ bool LPPassManager::runOnFunction(Function &F) {
break;
}
+ // If the loop was deleted, release all the loop passes. This frees up
+ // some memory, and avoids trouble with the pass manager trying to call
+ // verifyAnalysis on them.
+ if (skipThisLoop)
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ freePass(P, "", ON_LOOP_MSG);
+ }
+
// Pop the loop from queue after running all passes.
LQ.pop_back();
OpenPOWER on IntegriCloud