diff options
author | Devang Patel <dpatel@apple.com> | 2007-07-19 18:02:32 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-07-19 18:02:32 +0000 |
commit | 58e0ef1e90c3f6dbae213612b44e56f7d6d65ea7 (patch) | |
tree | 2bb0d2cd6c88f0733743b527d4e72274f9d332c7 /lib/VMCore/PassManager.cpp | |
parent | 6b8337392cbdaacbdd8326f731daff1b11eba275 (diff) | |
download | external_llvm-58e0ef1e90c3f6dbae213612b44e56f7d6d65ea7.zip external_llvm-58e0ef1e90c3f6dbae213612b44e56f7d6d65ea7.tar.gz external_llvm-58e0ef1e90c3f6dbae213612b44e56f7d6d65ea7.tar.bz2 |
Verify loop info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40062 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 8d780e9..bf43bb1 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -594,22 +594,30 @@ bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) { return true; } -/// Remove Analyss not preserved by Pass P -void PMDataManager::removeNotPreservedAnalysis(Pass *P) { +/// verifyPreservedAnalysis -- Verify analysis presreved by pass P. +void PMDataManager::verifyPreservedAnalysis(Pass *P) { AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet(); // Verify preserved analysis - for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(), - E = AvailableAnalysis.end(); I != E; ++I) { - Pass *AP = I->second; - AP->verifyAnalysis(); + for (std::vector<AnalysisID>::const_iterator I = PreservedSet.begin(), + E = PreservedSet.end(); I != E; ++I) { + AnalysisID AID = *I; + Pass *AP = findAnalysisPass(AID, true); + if (AP) + AP->verifyAnalysis(); } - +} + +/// Remove Analyss not preserved by Pass P +void PMDataManager::removeNotPreservedAnalysis(Pass *P) { + AnalysisUsage AnUsage; + P->getAnalysisUsage(AnUsage); if (AnUsage.getPreservesAll()) return; + const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet(); for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(), E = AvailableAnalysis.end(); I != E; ) { std::map<AnalysisID, Pass*>::iterator Info = I++; @@ -954,6 +962,7 @@ BBPassManager::runOnFunction(Function &F) { dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, (*I).getName()); dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet()); + verifyPreservedAnalysis(BP); removeNotPreservedAnalysis(BP); recordAvailableAnalysis(BP); removeDeadPasses(BP, (*I).getName(), ON_BASICBLOCK_MSG); @@ -1151,6 +1160,7 @@ bool FPPassManager::runOnFunction(Function &F) { dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getName()); dumpAnalysisSetInfo("Preserved", FP, AnUsage.getPreservedSet()); + verifyPreservedAnalysis(FP); removeNotPreservedAnalysis(FP); recordAvailableAnalysis(FP); removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG); @@ -1220,6 +1230,7 @@ MPPassManager::runOnModule(Module &M) { M.getModuleIdentifier()); dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet()); + verifyPreservedAnalysis(MP); removeNotPreservedAnalysis(MP); recordAvailableAnalysis(MP); removeDeadPasses(MP, M.getModuleIdentifier(), ON_MODULE_MSG); |