mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 05:27:43 +00:00
Fix broken isCopy handling in TrimLiveIntervalToLastUse.
llvm-svn: 107950
This commit is contained in:
parent
7824ff3af8
commit
daef6696d5
@ -618,10 +618,14 @@ SimpleRegisterCoalescing::TrimLiveIntervalToLastUse(SlotIndex CopyIdx,
|
||||
// of last use.
|
||||
LastUse->setIsKill();
|
||||
removeRange(li, LastUseIdx.getDefIndex(), LR->end, li_, tri_);
|
||||
if (LastUseMI->isCopy()) {
|
||||
MachineOperand &DefMO = LastUseMI->getOperand(0);
|
||||
if (DefMO.getReg() == li.reg && !DefMO.getSubReg())
|
||||
DefMO.setIsDead();
|
||||
}
|
||||
unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
|
||||
if ((LastUseMI->isCopy() && !LastUseMI->getOperand(0).getSubReg()) ||
|
||||
(tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
|
||||
DstReg == li.reg && DstSubIdx == 0)) {
|
||||
if (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
|
||||
DstReg == li.reg && DstSubIdx == 0) {
|
||||
// Last use is itself an identity code.
|
||||
int DeadIdx = LastUseMI->findRegisterDefOperandIdx(li.reg,
|
||||
false, false, tri_);
|
||||
|
Loading…
Reference in New Issue
Block a user