[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Devang Patel
dpatel at apple.com
Tue Mar 6 09:53:12 PST 2007
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.144 -> 1.145
---
Log message:
Keep track of higher level analysis.
---
Diffs of the changes: (+26 -0)
PassManager.cpp | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.144 llvm/lib/VMCore/PassManager.cpp:1.145
--- llvm/lib/VMCore/PassManager.cpp:1.144 Mon Mar 5 19:55:46 2007
+++ llvm/lib/VMCore/PassManager.cpp Tue Mar 6 11:52:53 2007
@@ -532,6 +532,30 @@
}
}
+// Return true if P preserves high level analysis used by other
+// passes managed by this manager
+bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
+
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
+
+ if (AnUsage.getPreservesAll())
+ return true;
+
+ const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
+ for (std::vector<Pass *>::iterator I = HigherLevelAnalysis.begin(),
+ E = HigherLevelAnalysis.end(); I != E; ++I) {
+ Pass *P1 = *I;
+ if (std::find(PreservedSet.begin(), PreservedSet.end(), P1->getPassInfo()) ==
+ PreservedSet.end()) {
+ if (!dynamic_cast<ImmutablePass*>(P1))
+ return false;
+ }
+ }
+
+ return true;
+}
+
/// Remove Analyss not preserved by Pass P
void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
AnalysisUsage AnUsage;
@@ -634,6 +658,8 @@
else if (PDepth > RDepth) {
// Let the parent claim responsibility of last use
TransferLastUses.push_back(PRequired);
+ // Keep track of higher level analysis used by this manager.
+ HigherLevelAnalysis.push_back(PRequired);
} else {
// Note : This feature is not yet implemented
assert (0 &&
More information about the llvm-commits
mailing list