mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-24 13:06:56 +00:00
Handle cases when joining live intervals of two virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2a27a7598b
commit
da2295e631
@ -960,21 +960,31 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
|
|||||||
DOUT << "\n\t\tJoined. Result = "; DestInt.print(DOUT, mri_);
|
DOUT << "\n\t\tJoined. Result = "; DestInt.print(DOUT, mri_);
|
||||||
DOUT << "\n";
|
DOUT << "\n";
|
||||||
|
|
||||||
// If the intervals were swapped by Join, swap them back so that the register
|
|
||||||
// mapping (in the r2i map) is correct.
|
|
||||||
if (Swapped) SrcInt.swap(DestInt);
|
|
||||||
|
|
||||||
// Live range has been lengthened due to colaescing, eliminate the
|
// Live range has been lengthened due to colaescing, eliminate the
|
||||||
// unnecessary kills at the end of the source live ranges.
|
// unnecessary kills at the end of the source live ranges.
|
||||||
LiveVariables::VarInfo& vi = lv_->getVarInfo(repSrcReg);
|
LiveVariables::VarInfo& svi = lv_->getVarInfo(repSrcReg);
|
||||||
for (unsigned i = 0, e = vi.Kills.size(); i != e; ++i) {
|
for (unsigned i = 0, e = svi.Kills.size(); i != e; ++i) {
|
||||||
MachineInstr *Kill = vi.Kills[i];
|
MachineInstr *Kill = svi.Kills[i];
|
||||||
if (Kill == CopyMI || isRemoved(Kill))
|
if (Kill == CopyMI || isRemoved(Kill))
|
||||||
continue;
|
continue;
|
||||||
if (DestInt.liveAt(getInstructionIndex(Kill) + InstrSlots::NUM))
|
if (DestInt.liveAt(getInstructionIndex(Kill) + InstrSlots::NUM))
|
||||||
unsetRegisterKill(Kill, repSrcReg);
|
unsetRegisterKill(Kill, repSrcReg);
|
||||||
}
|
}
|
||||||
|
if (MRegisterInfo::isVirtualRegister(repDstReg)) {
|
||||||
|
// If both are virtual registers...
|
||||||
|
LiveVariables::VarInfo& dvi = lv_->getVarInfo(repDstReg);
|
||||||
|
for (unsigned i = 0, e = dvi.Kills.size(); i != e; ++i) {
|
||||||
|
MachineInstr *Kill = dvi.Kills[i];
|
||||||
|
if (Kill == CopyMI || isRemoved(Kill))
|
||||||
|
continue;
|
||||||
|
if (DestInt.liveAt(getInstructionIndex(Kill) + InstrSlots::NUM))
|
||||||
|
unsetRegisterKill(Kill, repDstReg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the intervals were swapped by Join, swap them back so that the register
|
||||||
|
// mapping (in the r2i map) is correct.
|
||||||
|
if (Swapped) SrcInt.swap(DestInt);
|
||||||
removeInterval(repSrcReg);
|
removeInterval(repSrcReg);
|
||||||
r2rMap_[repSrcReg] = repDstReg;
|
r2rMap_[repSrcReg] = repDstReg;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user