aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-12-22 01:32:53 +0000
committerDevang Patel <dpatel@apple.com>2007-12-22 01:32:53 +0000
commit01666bf74bd72d43426e62ac9d921a8db0a9179e (patch)
tree75076d8d285f394a097943404d6db1f7d29dd36f /lib/Transforms/Utils/SimplifyCFG.cpp
parent889ac61113e82abb71138d91a9b7edd6be76cbe0 (diff)
If succ has succ itself as one of the predecessors then do
not merge current bb and succ even if bb's terminator is unconditional branch to succ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 1305fd92c7..ee283a04c5 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -110,10 +110,10 @@ static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
// update the PHI nodes correctly.
if (!isa<PHINode>(BB->begin()) || Succ->getSinglePredecessor()) return true;
- // If the predecessors of Succ are only BB and Succ itself, handle it.
+ // If the predecessors of Succ are only BB, handle it.
bool IsSafe = true;
for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
- if (*PI != Succ && *PI != BB) {
+ if (*PI != BB) {
IsSafe = false;
break;
}