aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-29 22:59:29 +0000
committerChris Lattner <sabre@nondot.org>2002-09-29 22:59:29 +0000
commitc8f25d91bd1cf4e7cf0127a169c04d5128cdd9e3 (patch)
tree8176f64793a6c88a15a65b6574b01eb98c1dea5e /lib/Analysis/LoopInfo.cpp
parent76e51a87e74a18aae72521d618a0c571a6263c30 (diff)
Minor tweak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index 1c3d5ee565..1f8e34ca7e 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -147,8 +147,9 @@ BasicBlock *Loop::getLoopPreheader() const {
BasicBlock *Header = getHeader();
for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
PI != PE; ++PI)
- if (!contains(*PI)) { // If the block is not in the loop...
- if (Out) return 0; // Multiple predecessors outside the loop
+ if (!contains(*PI)) { // If the block is not in the loop...
+ if (Out && Out != *PI)
+ return 0; // Multiple predecessors outside the loop
Out = *PI;
}