Skip to content

Commit

Permalink
[X86] Add necessary check isReg() when updating LiveVariables in conv…
Browse files Browse the repository at this point in the history
…ertToThreeAddress

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D137388
  • Loading branch information
yubingex007-a11y committed Nov 10, 2022
1 parent 27091e6 commit 5bc36c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86InstrInfo.cpp
Expand Up @@ -1768,7 +1768,7 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
if (LV) { // Update live variables
for (unsigned I = 0; I < NumRegOperands; ++I) {
MachineOperand &Op = MI.getOperand(I);
if (Op.isDead() || Op.isKill())
if (Op.isReg() && (Op.isDead() || Op.isKill()))
LV->replaceKillInstruction(Op.getReg(), MI, *NewMI);
}
}
Expand Down

0 comments on commit 5bc36c8

Please sign in to comment.