diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-27 23:49:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-27 23:49:43 +0000 |
commit | 3069b3193de74bb8b76e5c0f612b4a97abf9dea6 (patch) | |
tree | 8196b3dedbd068046f8e1856cb56e9261bf21356 /lib/Analysis | |
parent | 9702901a1efb85792c35dc33831583e9e4045cf7 (diff) | |
download | external_llvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.zip external_llvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.tar.gz external_llvm-3069b3193de74bb8b76e5c0f612b4a97abf9dea6.tar.bz2 |
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')
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 4f7018d..4ed802c 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); |