forked from OSchip/llvm-project
Fix PR8612 in the standard spiller as well.
The live range of a register defined by an early clobber starts at the use slot, not the def slot. llvm-svn: 119183
This commit is contained in:
parent
ddf25c341c
commit
97825bcbfd
|
@ -1136,11 +1136,14 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
|
|||
rewriteImplicitOps(li, MI, NewVReg, vrm);
|
||||
|
||||
// Reuse NewVReg for other reads.
|
||||
bool HasEarlyClobber = false;
|
||||
for (unsigned j = 0, e = Ops.size(); j != e; ++j) {
|
||||
MachineOperand &mopj = MI->getOperand(Ops[j]);
|
||||
mopj.setReg(NewVReg);
|
||||
if (mopj.isImplicit())
|
||||
rewriteImplicitOps(li, MI, NewVReg, vrm);
|
||||
if (mopj.isEarlyClobber())
|
||||
HasEarlyClobber = true;
|
||||
}
|
||||
|
||||
if (CreatedNewVReg) {
|
||||
|
@ -1199,7 +1202,8 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
|
|||
}
|
||||
}
|
||||
if (HasDef) {
|
||||
LiveRange LR(index.getDefIndex(), index.getStoreIndex(),
|
||||
LiveRange LR(HasEarlyClobber ? index.getUseIndex() : index.getDefIndex(),
|
||||
index.getStoreIndex(),
|
||||
nI.getNextValue(SlotIndex(), 0, VNInfoAllocator));
|
||||
DEBUG(dbgs() << " +" << LR);
|
||||
nI.addRange(LR);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
; RUN: llc < %s -verify-machineinstrs -spiller=standard
|
||||
; RUN: llc < %s -verify-machineinstrs -spiller=inline
|
||||
; PR8612
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue