summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-17 21:47:33 +0000
committerChris Lattner <sabre@nondot.org>2003-08-17 21:47:33 +0000
commitc01f05f4be474e59184d3c90a6032654eabccf28 (patch)
treebbb3057da3fd0cb30a24920c4f1697c024812c79 /llvm/lib/Analysis/LoopInfo.cpp
parent61b05eaeecb99c7c94ab8a619a081f32dba31fa8 (diff)
downloadbcm5719-llvm-c01f05f4be474e59184d3c90a6032654eabccf28.tar.gz
bcm5719-llvm-c01f05f4be474e59184d3c90a6032654eabccf28.zip
Fix the bug that broke the nightly tester in McCat/18-imp last night. :(
llvm-svn: 7925
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index a86d73b34a4..c31e55511b0 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -220,15 +220,15 @@ Loop *LoopInfo::ConsiderForLoop(BasicBlock *BB, const DominatorSet &DS) {
if (BlockLoop == 0) { // Child block not processed yet...
BlockLoop = Child;
} else if (BlockLoop != Child) {
+ Loop *SubLoop = BlockLoop;
+ // Reparent all of the blocks which used to belong to BlockLoops
+ for (unsigned j = 0, e = SubLoop->Blocks.size(); j != e; ++j)
+ ContainingLoops[SubLoop->Blocks[j]] = Child;
+
// There is already a loop which contains this block, that means
// that we should reparent the loop which the block is currently
// considered to belong to to be a child of this loop.
- MoveSiblingLoopInto(BlockLoop, Child);
-
- // Reparent all of the blocks which used to belong to BlockLoops
- for (unsigned j = 0, e = BlockLoop->Blocks.size(); j != e; ++j)
- ContainingLoops[BlockLoop->Blocks[j]] = Child;
-
+ MoveSiblingLoopInto(SubLoop, Child);
--i; // We just shrunk the SubLoops list.
}
}
OpenPOWER on IntegriCloud