[llvm-commits] CVS: llvm/lib/Analysis/LoopPass.cpp
Devang Patel
dpatel at apple.com
Tue Mar 6 09:59:54 PST 2007
Changes in directory llvm/lib/Analysis:
LoopPass.cpp updated: 1.11 -> 1.12
---
Log message:
LPPassManager. Implement preparePassManager() hook.
---
Diffs of the changes: (+25 -0)
LoopPass.cpp | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+)
Index: llvm/lib/Analysis/LoopPass.cpp
diff -u llvm/lib/Analysis/LoopPass.cpp:1.11 llvm/lib/Analysis/LoopPass.cpp:1.12
--- llvm/lib/Analysis/LoopPass.cpp:1.11 Tue Mar 6 10:59:03 2007
+++ llvm/lib/Analysis/LoopPass.cpp Tue Mar 6 11:59:37 2007
@@ -129,6 +129,31 @@
//===----------------------------------------------------------------------===//
// LoopPass
+// Check if this pass is suitable for the current LPPassManager, if
+// available. This pass P is not suitable for a LPPassManager if P
+// is not preserving higher level analysis info used by other
+// LPPassManager passes. In such case, pop LPPassManager from the
+// stack. This will force assignPassManager() to create new
+// LPPassManger as expected.
+void LoopPass::preparePassManager(PMStack &PMS) {
+
+ // Find LPPassManager
+ while (!PMS.empty()) {
+ if (PMS.top()->getPassManagerType() > PMT_LoopPassManager)
+ PMS.pop();
+ else;
+ break;
+ }
+
+ LPPassManager *LPPM = dynamic_cast<LPPassManager *>(PMS.top());
+
+ // If this pass is destroying high level information that is used
+ // by other passes that are managed by LPM then do not insert
+ // this pass in current LPM. Use new LPPassManager.
+ if (LPPM && !LPPM->preserveHigherLevelAnalysis(this))
+ PMS.pop();
+}
+
/// Assign pass manager to manage this pass.
void LoopPass::assignPassManager(PMStack &PMS,
PassManagerType PreferredType) {
More information about the llvm-commits
mailing list