Skip to content

Commit

Permalink
[SystemZ] Call erase() on the right MBB in SystemZTargetLowering::emi…
Browse files Browse the repository at this point in the history
…tSelect()

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
  • Loading branch information
JonPsson committed Sep 16, 2019
1 parent 98cb8db commit b7dadc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit b7dadc3

Please sign in to comment.