summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp b/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
index 96bb6175080..efafdd00728 100644
--- a/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp
@@ -186,13 +186,11 @@ bool HexagonCFGOptimizer::runOnMachineFunction(MachineFunction &Fn) {
if (case1 || case2) {
InvertAndChangeJumpTarget(MI, UncondTarget);
- MBB->removeSuccessor(JumpAroundTarget);
- MBB->addSuccessor(UncondTarget);
+ MBB->replaceSuccessor(JumpAroundTarget, UncondTarget);
// Remove the unconditional branch in LayoutSucc.
LayoutSucc->erase(LayoutSucc->begin());
- LayoutSucc->removeSuccessor(UncondTarget);
- LayoutSucc->addSuccessor(JumpAroundTarget);
+ LayoutSucc->replaceSuccessor(UncondTarget, JumpAroundTarget);
// This code performs the conversion for case 2, which moves
// the block to the fall-thru case (BB3 in the code above).
OpenPOWER on IntegriCloud