[VENTUS][RISCV][Fix] Add PseudoBR when converge return bb in InsertJoinToVBranch pass.

This commit is contained in:
yanming 2023-06-30 12:03:25 +08:00
parent fe3244b577
commit 41564530d5
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ bool VentusInsertJoinToVBranch::convergeReturnBlock(MachineFunction &MF) {
auto &RetMI = RetBB->back();
assert(RetMI.getOpcode() == RISCV::PseudoRET && "Unexpected opcode");
RetMI.eraseFromParent();
if (RetBB->getFallThrough() != NewRetBB)
BuildMI(RetBB, DebugLoc(), TII->get(RISCV::PseudoBR)).addMBB(NewRetBB);
RetBB->addSuccessor(NewRetBB);
}