Skip to content

Commit cc8e0f3

Browse files
author
Yuanke Luo
committed
[LiveRangeEdit] Fix the live range issue
1 parent 8aa4fc0 commit cc8e0f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/LiveRangeEdit.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ SlotIndex LiveRangeEdit::rematerializeAt(MachineBasicBlock &MBB,
192192

193193
if (ReplaceIndexMI)
194194
return LIS.ReplaceMachineInstrInMaps(*ReplaceIndexMI, *MI).getRegSlot();
195-
return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot();
195+
bool EarlyClobber = MI->getOperand(0).isEarlyClobber();
196+
return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot(
197+
EarlyClobber);
196198
}
197199

198200
void LiveRangeEdit::eraseVirtReg(Register Reg) {

0 commit comments

Comments
 (0)