Skip to content

Commit

Permalink
[MachineLateInstrsCleanup] Bugfix for handling of kill flags.
Browse files Browse the repository at this point in the history
With cb57b7a, the kill flags are now tracked during the forward search over
the instructions and the call to findRegisterUseOperandIdx() should therefore
only check for killing uses.

As shown with the failing test CodeGen/Hexagon/vector-sint-to-fp.ll, it could
otherwise be the case that an undef use after the instruction that killed the
register will be inserted into MBBKills, and the kill flag will not be
cleared.
  • Loading branch information
JonPsson committed May 8, 2023
1 parent 1768898 commit 10f0158
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachineLateInstrsCleanup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ bool MachineLateInstrsCleanup::processBlock(MachineBasicBlock *MBB) {
if (MI.modifiesRegister(Reg, TRI)) {
MBBDefs.erase(Reg);
MBBKills.erase(Reg);
} else if (MI.findRegisterUseOperandIdx(Reg, false /*isKill*/, TRI) != -1)
// Keep track of the last use seen so far.
} else if (MI.findRegisterUseOperandIdx(Reg, true /*isKill*/, TRI) != -1)
// Keep track of register kills.
MBBKills[Reg] = &MI;
}

Expand Down

0 comments on commit 10f0158

Please sign in to comment.