aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/IfConversion.cpp8
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp6
2 files changed, 5 insertions, 9 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(),
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 5ac54ea8a4..71e6b3e4d0 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -305,11 +305,9 @@ void MachineBasicBlock::ReplaceUsesOfBlockWith(MachineBasicBlock *Old,
I->getOperand(i).setMBB(New);
}
- // Update the successor information. If New was already a successor, just
- // remove the link to Old instead of creating another one. PR 1444.
+ // Update the successor information.
removeSuccessor(Old);
- if (!isSuccessor(New))
- addSuccessor(New);
+ addSuccessor(New);
}
/// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in the