X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FPassManager.cpp;h=e1f8afe3b0ea069f77589a5e26e8ac05ab080731;hb=51cd9d6e073932fcb37f1857c66249d6c7d368ee;hp=c76a9e873927ce73bf72b851578fceb2a131e6e0;hpb=b9c432fe77d4b3bc5e7f09aa79ac703362296b52;p=oota-llvm.git diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index c76a9e87392..e1f8afe3b0e 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -360,10 +360,10 @@ public: } }; -static TimingInfo *TheTimeInfo; - } // End of anon namespace +static TimingInfo *TheTimeInfo; + //===----------------------------------------------------------------------===// // PMTopLevelManager implementation @@ -621,9 +621,15 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) { std::map::iterator Info = I++; if (!dynamic_cast(Info->second) && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == - PreservedSet.end()) + PreservedSet.end()) { // Remove this analysis AvailableAnalysis.erase(Info); + if (PassDebugging >= Details) { + Pass *S = Info->second; + cerr << " -- " << P->getPassName() << " is not preserving "; + cerr << S->getPassName() << "\n"; + } + } } // Check inherited analysis also. If P is not preserving analysis @@ -659,6 +665,12 @@ void PMDataManager::removeDeadPasses(Pass *P, const char *Msg, TPM->collectLastUses(DeadPasses, P); + if (PassDebugging >= Details && !DeadPasses.empty()) { + cerr << " -*- " << P->getPassName(); + cerr << " is the last user of following pass instances."; + cerr << " Free these instances\n"; + } + for (SmallVector::iterator I = DeadPasses.begin(), E = DeadPasses.end(); I != E; ++I) { @@ -924,7 +936,11 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) { // When Pass manager is not able to order required analysis info, Pass manager // checks whether any lower level manager will be able to provide this // analysis info on demand or not. - assert (0 && "Unable to handle Pass that requires lower level Analysis pass"); +#ifndef NDEBUG + cerr << "Unable to schedule " << RequiredPass->getPassName(); + cerr << " required by " << P->getPassName() << "\n"; +#endif + assert (0 && "Unable to schedule pass"); } // Destructor @@ -1159,6 +1175,9 @@ bool FPPassManager::runOnFunction(Function &F) { if (F.isDeclaration()) return false; + + // Collect inherited analysis from Module level pass manager. + populateInheritedAnalysis(TPM->activeStack); for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); @@ -1471,6 +1490,7 @@ void FunctionPass::assignPassManager(PMStack &PMS, // [1] Create new Function Pass Manager FPP = new FPPassManager(PMD->getDepth() + 1); + FPP->populateInheritedAnalysis(PMS); // [2] Set up new manager's top level manager PMTopLevelManager *TPM = PMD->getTopLevelManager();