aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-05-24 18:31:55 +0000
committerDale Johannesen <dalej@apple.com>2007-05-24 18:31:55 +0000
commit035fdeb37048bae2f49d3c3b8c246cfc26d9a80d (patch)
tree4f1ef16611827e3fa2ec803be8c5db5b8e25c8c2 /lib/CodeGen/BranchFolding.cpp
parentde0963df420f408b2d813bd16f3c040c2d189f63 (diff)
Blocks that cond-br and uncond-br/fallthrough to same block should have
only one successor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 6c632c2aee..1fe2962a36 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -672,7 +672,10 @@ static bool CorrectExtraCFGEdges(MachineBasicBlock &MBB,
MachineBasicBlock::pred_iterator SI = MBB.succ_begin();
while (SI != MBB.succ_end()) {
- if (*SI == DestA) {
+ if (*SI == DestA && DestA == DestB) {
+ DestA = DestB = 0;
+ ++SI;
+ } else if (*SI == DestA) {
DestA = 0;
++SI;
} else if (*SI == DestB) {