summaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-27 23:49:43 +0000
committerDan Gohman <gohman@apple.com>2009-09-27 23:49:43 +0000
commit3069b3193de74bb8b76e5c0f612b4a97abf9dea6 (patch)
tree8196b3dedbd068046f8e1856cb56e9261bf21356 /lib/Analysis/LoopPass.cpp
parent9702901a1efb85792c35dc33831583e9e4045cf7 (diff)
downloadllvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.tar.gz
llvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.tar.bz2
llvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.tar.xz
Extract the code for inserting a loop into the loop queue into
a separate function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopPass.cpp')
-rw-r--r--lib/Analysis/LoopPass.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index 4f7018da1a..4ed802cb3f 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -110,17 +110,21 @@ void LPPassManager::insertLoop(Loop *L, Loop *ParentLoop) {
else
LI->addTopLevelLoop(L);
+ insertLoopIntoQueue(L);
+}
+
+void LPPassManager::insertLoopIntoQueue(Loop *L) {
// Insert L into loop queue
if (L == CurrentLoop)
redoLoop(L);
- else if (!ParentLoop)
+ else if (!L->getParentLoop())
// This is top level loop.
LQ.push_front(L);
else {
- // Insert L after ParentLoop
+ // Insert L after the parent loop.
for (std::deque<Loop *>::iterator I = LQ.begin(),
E = LQ.end(); I != E; ++I) {
- if (*I == ParentLoop) {
+ if (*I == L->getParentLoop()) {
// deque does not support insert after.
++I;
LQ.insert(I, 1, L);