diff options
| author | Devang Patel <dpatel@apple.com> | 2007-03-06 01:55:46 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-03-06 01:55:46 +0000 |
| commit | 42dd1e92c74be37d93c4c8f258710d8c038850ad (patch) | |
| tree | 22dec36dbf083ce93d373756acb12df73dfee66c /llvm/lib | |
| parent | d74ede70fb38da4e4ec9c809454d1e8fade5150f (diff) | |
| download | bcm5719-llvm-42dd1e92c74be37d93c4c8f258710d8c038850ad.tar.gz bcm5719-llvm-42dd1e92c74be37d93c4c8f258710d8c038850ad.zip | |
Keep track of inherited analysis. For example, if a loop pass does not
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
llvm-svn: 34942
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index 25353082433..72804be1007 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -551,6 +551,27 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) { AvailableAnalysis.erase(Info); } } + + // Check inherited analysis also. If P is not preserving analysis + // provided by parent manager then remove it here. + for (unsigned Index = 0; Index < PMT_Last; ++Index) { + + if (!InheritedAnalysis[Index]) + continue; + + for (std::map<AnalysisID, Pass*>::iterator + I = InheritedAnalysis[Index]->begin(), + E = InheritedAnalysis[Index]->end(); I != E; ) { + std::map<AnalysisID, Pass *>::iterator Info = I++; + if (std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == + PreservedSet.end()) { + // Remove this analysis + if (!dynamic_cast<ImmutablePass*>(Info->second)) + InheritedAnalysis[Index]->erase(Info); + } + } + } + } /// Remove analysis passes that are not used any longer |

