diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp index a3858efbdc5e1..bd388b97cbcd4 100644 --- a/llvm/lib/CodeGen/LiveRangeEdit.cpp +++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp @@ -192,7 +192,9 @@ SlotIndex LiveRangeEdit::rematerializeAt(MachineBasicBlock &MBB, if (ReplaceIndexMI) return LIS.ReplaceMachineInstrInMaps(*ReplaceIndexMI, *MI).getRegSlot(); - return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot(); + bool EarlyClobber = MI->getOperand(0).isEarlyClobber(); + return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot( + EarlyClobber); } void LiveRangeEdit::eraseVirtReg(Register Reg) {