summaryrefslogtreecommitdiff
path: root/lib/CodeGen/IfConversion.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-05 21:10:19 +0000
committerDan Gohman <gohman@apple.com>2009-05-05 21:10:19 +0000
commit5412d06e9c352c9795f4a71b91c4f869585866eb (patch)
treeb9dd046cc5947a1881033e8a0c35e6bbd85d944b /lib/CodeGen/IfConversion.cpp
parent8c87ae229c43939f5868b5778c53e787df0927ef (diff)
downloadllvm-5412d06e9c352c9795f4a71b91c4f869585866eb.tar.gz
llvm-5412d06e9c352c9795f4a71b91c4f869585866eb.tar.bz2
llvm-5412d06e9c352c9795f4a71b91c4f869585866eb.tar.xz
If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed to allow MachineBasicBlock::isOnlyReachableByFallthrough to work correctly. This fixes PR4126. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IfConversion.cpp')
-rw-r--r--lib/CodeGen/IfConversion.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index 8d212a606f..b9ee23ae9b 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -1174,8 +1174,7 @@ void IfConverter::CopyAndPredicateBlock(BBInfo &ToBBI, BBInfo &FromBBI,
// Fallthrough edge can't be transferred.
if (Succ == FallThrough)
continue;
- if (!ToBBI.BB->isSuccessor(Succ))
- ToBBI.BB->addSuccessor(Succ);
+ ToBBI.BB->addSuccessor(Succ);
}
std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),
@@ -1215,12 +1214,11 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI) {
if (Succ == FallThrough)
continue;
FromBBI.BB->removeSuccessor(Succ);
- if (!ToBBI.BB->isSuccessor(Succ))
- ToBBI.BB->addSuccessor(Succ);
+ ToBBI.BB->addSuccessor(Succ);
}
// Now FromBBI always fall through to the next block!
- if (NBB && !FromBBI.BB->isSuccessor(NBB))
+ if (NBB)
FromBBI.BB->addSuccessor(NBB);
std::copy(FromBBI.Predicate.begin(), FromBBI.Predicate.end(),