Delete this default branch, because we're going to generate our own.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66234
91177308-0d34-0410-b5e6-
96231b3b80d8
// Split the basic block before the return instruction.
BasicBlock *NewBB = BB->splitBasicBlock(RI, "SP_return");
+ // Remove default branch instruction to the new BB.
+ BB->getTerminator()->eraseFromParent();
+
// Move the newly created basic block to the point right after the old basic
// block so that it's in the "fall through" position.
NewBB->moveAfter(BB);