aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-02-23 00:10:16 +0000
committerDevang Patel <dpatel@apple.com>2007-02-23 00:10:16 +0000
commit5afdc7d78526622034932e6d07871c7b25d87361 (patch)
treebcb51d72ecc7c56e957c36623c76d6fe8bef1c45 /lib/Analysis/LoopPass.cpp
parent7d35c0e2b987a631019feb746ea577346abb1fee (diff)
Add LPPassManager interface that LoopPass can use to skip
rest of the passes in the queue for a loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopPass.cpp')
-rw-r--r--lib/Analysis/LoopPass.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index 95a18e5b00..22d542b05b 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -57,6 +57,13 @@ LPPassManager::~LPPassManager() {
delete LQ;
}
+/// Delete loop from the loop queue. This is used by Loop pass to inform
+/// Loop Pass Manager that it should skip rest of the passes for this loop.
+void LPPassManager::deleteLoopFromQueue(Loop *L) {
+ // Do not pop loop from LQ here. It will be done by runOnFunction while loop.
+ skipThisLoop = true;
+}
+
// Recurse through all subloops and all loops into LQ.
static void addLoopIntoQueue(Loop *L, LoopQueue *LQ) {
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
@@ -81,6 +88,8 @@ bool LPPassManager::runOnFunction(Function &F) {
while (!LQ->empty()) {
Loop *L = LQ->top();
+ skipThisLoop = false;
+
// Run all passes on current SCC
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
@@ -107,6 +116,10 @@ bool LPPassManager::runOnFunction(Function &F) {
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P, Msg2);
+
+ if (skipThisLoop)
+ // Do not run other passes on this loop.
+ break;
}
// Pop the loop from queue after running all passes.