[llvm-commits] CVS: llvm/lib/Analysis/LoopPass.cpp
Devang Patel
dpatel at apple.com
Tue Mar 6 08:59:22 PST 2007
Changes in directory llvm/lib/Analysis:
LoopPass.cpp updated: 1.10 -> 1.11
---
Log message:
LPPassManager : Add initialization and finalizatino hooks.
---
Diffs of the changes: (+20 -0)
LoopPass.cpp | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
Index: llvm/lib/Analysis/LoopPass.cpp
diff -u llvm/lib/Analysis/LoopPass.cpp:1.10 llvm/lib/Analysis/LoopPass.cpp:1.11
--- llvm/lib/Analysis/LoopPass.cpp:1.10 Mon Mar 5 20:30:46 2007
+++ llvm/lib/Analysis/LoopPass.cpp Tue Mar 6 10:59:03 2007
@@ -57,6 +57,18 @@
for (LoopInfo::iterator I = LI.begin(), E = LI.end(); I != E; ++I)
addLoopIntoQueue(*I, LQ);
+ // Initialization
+ for (std::deque<Loop *>::const_iterator I = LQ.begin(), E = LQ.end();
+ I != E; ++I) {
+ Loop *L = *I;
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ LoopPass *LP = dynamic_cast<LoopPass *>(P);
+ if (LP)
+ Changed |= LP->doInitialization(L, *this);
+ }
+ }
+
// Walk Loops
while (!LQ.empty()) {
@@ -101,6 +113,14 @@
if (redoThisLoop)
LQ.push_back(L);
}
+
+ // Finalization
+ for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
+ Pass *P = getContainedPass(Index);
+ LoopPass *LP = dynamic_cast <LoopPass *>(P);
+ if (LP)
+ Changed |= LP->doFinalization();
+ }
return Changed;
}
More information about the llvm-commits
mailing list