[SystemZ] Call erase() on the right MBB in SystemZTargetLowering::emitSelect()

Since MBB was split *before* MI, the MI(s) will reside in JoinMBB (MBB) at
the point of erasing them, so calling StartMBB->erase() is actually wrong,
although it is "working" by all appearances.

Review: Ulrich Weigand
llvm-svn: 371995
This commit is contained in:
Jonas Paulsson 2019-09-16 14:49:36 +00:00
parent 98cb8db836
commit b7dadc3562
1 changed files with 1 additions and 1 deletions

View File

@ -6678,7 +6678,7 @@ SystemZTargetLowering::emitSelect(MachineInstr &MI,
std::next(MachineBasicBlock::iterator(LastMI)), MBB->end());
createPHIsForSelects(MIItBegin, MIItEnd, StartMBB, FalseMBB, MBB);
StartMBB->erase(MIItBegin, MIItEnd);
MBB->erase(MIItBegin, MIItEnd);
return JoinMBB;
}