[llvm-commits] [llvm] r82945 - /llvm/trunk/lib/Analysis/LoopPass.cpp

Dan Gohman gohman at apple.com
Sun Sep 27 18:43:07 CDT 2009


Author: djg
Date: Sun Sep 27 18:43:07 2009
New Revision: 82945

URL: http://llvm.org/viewvc/llvm-project?rev=82945&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Analysis/LoopPass.cpp

Modified: llvm/trunk/lib/Analysis/LoopPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=82945&r1=82944&r2=82945&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/LoopPass.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopPass.cpp Sun Sep 27 18:43:07 2009
@@ -253,6 +253,15 @@
         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();
     





More information about the llvm-commits mailing list