[llvm-commits] [llvm] r68254 - in /llvm/trunk: include/llvm/PassAnalysisSupport.h include/llvm/PassManagers.h lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Wed Apr 1 15:34:42 PDT 2009
Author: dpatel
Date: Wed Apr 1 17:34:41 2009
New Revision: 68254
URL: http://llvm.org/viewvc/llvm-project?rev=68254&view=rev
Log:
Clean up pass manager cache after each run.
Modified:
llvm/trunk/include/llvm/PassAnalysisSupport.h
llvm/trunk/include/llvm/PassManagers.h
llvm/trunk/lib/VMCore/PassManager.cpp
Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=68254&r1=68253&r2=68254&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassAnalysisSupport.h (original)
+++ llvm/trunk/include/llvm/PassAnalysisSupport.h Wed Apr 1 17:34:41 2009
@@ -143,6 +143,12 @@
AnalysisImpls.push_back(pir);
}
+ /// clearAnalysisImpls - Clear cache that is used to connect a pass to the
+ /// the analysis (PassInfo).
+ void clearAnalysisImpls() {
+ AnalysisImpls.clear();
+ }
+
// getAnalysisIfAvailable - Return analysis result or null if it doesn't exist
Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const;
Modified: llvm/trunk/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=68254&r1=68253&r2=68254&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassManagers.h (original)
+++ llvm/trunk/include/llvm/PassManagers.h Wed Apr 1 17:34:41 2009
@@ -414,6 +414,9 @@
/// whether any of the passes modifies the module, and if so, return true.
bool runOnFunction(Function &F);
bool runOnModule(Module &M);
+
+ /// cleanup - After running all passes, clean up pass manager cache.
+ void cleanup();
/// doInitialization - Run all of the initializers for the function passes.
///
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=68254&r1=68253&r2=68254&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Apr 1 17:34:41 2009
@@ -1267,6 +1267,16 @@
return Changed;
}
+/// cleanup - After running all passes, clean up pass manager cache.
+void FPPassManager::cleanup() {
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ FunctionPass *FP = getContainedPass(Index);
+ AnalysisResolver *AR = FP->getResolver();
+ assert(AR && "Analysis Resolver is not set");
+ AR->clearAnalysisImpls();
+ }
+}
+
// Execute all the passes managed by this top level manager.
// Return true if any function is modified by a pass.
bool FunctionPassManagerImpl::run(Function &F) {
@@ -1279,6 +1289,10 @@
initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
Changed |= getContainedManager(Index)->runOnFunction(F);
+
+ for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
+ getContainedManager(Index)->cleanup();
+
return Changed;
}
More information about the llvm-commits
mailing list