forked from OSchip/llvm-project
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
This commit is contained in:
parent
5e8ba5d514
commit
37a99664ff
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue