[llvm-commits] CVS: llvm/lib/Analysis/LoopPass.cpp
Devang Patel
dpatel at apple.com
Tue Mar 6 11:11:47 PST 2007
Changes in directory llvm/lib/Analysis:
LoopPass.cpp updated: 1.14 -> 1.15
---
Log message:
Use schedulePass() instead of assignPassManager() to add new LPPassManager.
This ensures that require analysis info is available.
---
Diffs of the changes: (+11 -3)
LoopPass.cpp | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
Index: llvm/lib/Analysis/LoopPass.cpp
diff -u llvm/lib/Analysis/LoopPass.cpp:1.14 llvm/lib/Analysis/LoopPass.cpp:1.15
--- llvm/lib/Analysis/LoopPass.cpp:1.14 Tue Mar 6 13:00:02 2007
+++ llvm/lib/Analysis/LoopPass.cpp Tue Mar 6 13:11:25 2007
@@ -143,14 +143,22 @@
LQ.push_back(L);
}
+/// Pass Manager itself does not invalidate any analysis info.
+void LPPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
+ // LPPassManager needs LoopInfo. In the long term LoopInfo class will
+ // become part of LPPassManager.
+ Info.addRequired<LoopInfo>();
+ Info.setPreservesAll();
+}
+
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the function, and if so, return true.
bool LPPassManager::runOnFunction(Function &F) {
- LoopInfo &LI = getAnalysis<LoopInfo>();
+ LI = &getAnalysis<LoopInfo>();
bool Changed = false;
// Populate Loop Queue
- for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I)
+ for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
addLoopIntoQueue(*I, LQ);
// Initialization
@@ -279,7 +287,7 @@
// [3] Assign manager to manage this new manager. This may create
// and push new managers into PMS
Pass *P = dynamic_cast<Pass *>(LPPM);
- P->assignPassManager(PMS);
+ TPM->schedulePass(P);
// [4] Push new manager into PMS
PMS.push(LPPM);
More information about the llvm-commits
mailing list