[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Wed Dec 20 16:17:06 PST 2006
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.109 -> 1.110
---
Log message:
At the beginning of run, initialize analyis info availability for _ALL_
pass managers. Otherwise, stale available analysis info, from the managers not
yet run, may cause pass manager to take wrong turn.
This fixes CBE test failures reported by nightly tester.
---
Diffs of the changes: (+19 -5)
PassManager.cpp | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.109 llvm/lib/VMCore/PassManager.cpp:1.110
--- llvm/lib/VMCore/PassManager.cpp:1.109 Tue Dec 19 14:12:38 2006
+++ llvm/lib/VMCore/PassManager.cpp Wed Dec 20 18:16:50 2006
@@ -189,6 +189,8 @@
void dumpPasses() const;
void dumpArguments() const;
+ void initializeAllAnalysisInfo();
+
protected:
/// Collection of pass managers
@@ -773,6 +775,21 @@
cerr << "\n";
}
+void PMTopLevelManager::initializeAllAnalysisInfo() {
+
+ for (std::vector<Pass *>::iterator I = PassManagers.begin(),
+ E = PassManagers.end(); I != E; ++I) {
+ PMDataManager *PMD = dynamic_cast<PMDataManager *>(*I);
+ assert(PMD && "This is not a PassManager");
+ PMD->initializeAnalysisInfo();
+ }
+
+ // Initailize other pass managers
+ for (std::vector<PMDataManager *>::iterator I = IndirectPassManagers.begin(),
+ E = IndirectPassManagers.end(); I != E; ++I)
+ (*I)->initializeAnalysisInfo();
+}
+
//===----------------------------------------------------------------------===//
// PMDataManager implementation
@@ -1051,7 +1068,6 @@
return false;
bool Changed = doInitialization(F);
- initializeAnalysisInfo();
std::string Msg1 = "Executing Pass '";
std::string Msg3 = "' Made Modification '";
@@ -1240,6 +1256,7 @@
dumpArguments();
dumpPasses();
+ initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
FPPassManager *FP = getContainedManager(Index);
Changed |= FP->runOnFunction(F);
@@ -1322,8 +1339,6 @@
if (F.isExternal())
return false;
- initializeAnalysisInfo();
-
std::string Msg1 = "Executing Pass '";
std::string Msg3 = "' Made Modification '";
@@ -1357,7 +1372,6 @@
bool FPPassManager::runOnModule(Module &M) {
bool Changed = doInitialization(M);
- initializeAnalysisInfo();
for(Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
this->runOnFunction(*I);
@@ -1462,7 +1476,6 @@
bool
MPPassManager::runOnModule(Module &M) {
bool Changed = false;
- initializeAnalysisInfo();
std::string Msg1 = "Executing Pass '";
std::string Msg3 = "' Made Modification '";
@@ -1528,6 +1541,7 @@
dumpArguments();
dumpPasses();
+ initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index) {
MPPassManager *MP = getContainedManager(Index);
Changed |= MP->runOnModule(M);
More information about the llvm-commits
mailing list