diff options
Diffstat (limited to 'llvm/lib/CodeGen/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplication.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index da593ce..2a8431c 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -749,9 +749,6 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB, TII->RemoveBranch(*PredBB); - if (PredTBB) - TII->InsertBranch(*PredBB, PredTBB, PredFBB, PredCond, DebugLoc()); - if (!PredBB->isSuccessor(NewTarget)) PredBB->replaceSuccessor(TailBB, NewTarget); else { @@ -759,6 +756,9 @@ TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB, assert(PredBB->succ_size() <= 1); } + if (PredTBB) + TII->InsertBranch(*PredBB, PredTBB, PredFBB, PredCond, DebugLoc()); + TDBBs.push_back(PredBB); } return Changed; |