[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp

Devang Patel dpatel at apple.com
Mon Mar 5 17:56:07 PST 2007



Changes in directory llvm/lib/VMCore:

PassManager.cpp updated: 1.143 -> 1.144
---
Log message:

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.


---
Diffs of the changes:  (+21 -0)

 PassManager.cpp |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+)


Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.143 llvm/lib/VMCore/PassManager.cpp:1.144
--- llvm/lib/VMCore/PassManager.cpp:1.143	Mon Mar  5 19:06:16 2007
+++ llvm/lib/VMCore/PassManager.cpp	Mon Mar  5 19:55:46 2007
@@ -551,6 +551,27 @@
         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






More information about the llvm-commits mailing list