Skip to content

Commit 3694e61

Browse files
committed
Use remove/insert branch instead of direct eraseFromParent
1 parent fd7036e commit 3694e61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/BranchRelaxation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ bool BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {
501501
//
502502
// Just remove conditional branch.
503503
if (TBB == FBB) {
504-
BlockInfo[MBB->getNumber()].Size -= TII->getInstSizeInBytes(MI);
505-
MI.eraseFromParent();
504+
removeBranch(MBB);
505+
insertUncondBranch(MBB, TBB);
506506
return true;
507507
}
508508
// We need to split the basic block here to obtain two long-range

0 commit comments

Comments
 (0)