diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -1768,7 +1768,7 @@ 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); } }