1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix PR8612 in the standard spiller, take two.

The live range of a register defined by an early clobber starts at the use slot,
not the def slot.

Except when it is an early clobber tied to a use operand. Then it starts at the
def slot like a standard def.

llvm-svn: 119305
This commit is contained in:
Jakob Stoklund Olesen 2010-11-16 00:40:59 +00:00
parent 686fae59e6
commit ea79975a68
2 changed files with 9 additions and 1 deletions

View File

@ -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,11 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
}
}
if (HasDef) {
LiveRange LR(index.getDefIndex(), index.getStoreIndex(),
// An early clobber starts at the use slot, except for an early clobber
// tied to a use operand (yes, that is a thing).
LiveRange LR(HasEarlyClobber && !HasUse ?
index.getUseIndex() : index.getDefIndex(),
index.getStoreIndex(),
nI.getNextValue(SlotIndex(), 0, VNInfoAllocator));
DEBUG(dbgs() << " +" << LR);
nI.addRange(LR);

View File

@ -1,3 +1,4 @@
; RUN: llc < %s -verify-machineinstrs -spiller=standard
; RUN: llc < %s -verify-machineinstrs -spiller=inline
; PR8612
;