mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Fix for PR1279. Dead def has a live interval of length 1. Copy coalescing should
not violate that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -935,9 +935,9 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
|
|||||||
// The instruction which defines the src is only truly dead if there are
|
// The instruction which defines the src is only truly dead if there are
|
||||||
// no intermediate uses and there isn't a use beyond the copy.
|
// no intermediate uses and there isn't a use beyond the copy.
|
||||||
// FIXME: find the last use, mark is kill and shorten the live range.
|
// FIXME: find the last use, mark is kill and shorten the live range.
|
||||||
if (SrcEnd > getDefIndex(CopyIdx))
|
if (SrcEnd > getDefIndex(CopyIdx)) {
|
||||||
isDead = false;
|
isDead = false;
|
||||||
else {
|
} else {
|
||||||
MachineOperand *MOU;
|
MachineOperand *MOU;
|
||||||
MachineInstr *LastUse= lastRegisterUse(repSrcReg, SrcStart, CopyIdx, MOU);
|
MachineInstr *LastUse= lastRegisterUse(repSrcReg, SrcStart, CopyIdx, MOU);
|
||||||
if (LastUse) {
|
if (LastUse) {
|
||||||
@ -947,7 +947,9 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
|
|||||||
isShorten = true;
|
isShorten = true;
|
||||||
RemoveStart = getDefIndex(getInstructionIndex(LastUse));
|
RemoveStart = getDefIndex(getInstructionIndex(LastUse));
|
||||||
RemoveEnd = SrcEnd;
|
RemoveEnd = SrcEnd;
|
||||||
}
|
} else if (RemoveStart > 0)
|
||||||
|
// A dead def should have a single cycle interval.
|
||||||
|
++RemoveStart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user