mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
When an instruction moves, make sure to update the VarInfo::Kills list as
well as all of teh other stuff in livevar. This fixes the compiler crash on fourinarow last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -302,12 +302,19 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI,
|
|||||||
// the instruction.
|
// the instruction.
|
||||||
for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
|
||||||
MachineOperand &MO = OldMI->getOperand(i);
|
MachineOperand &MO = OldMI->getOperand(i);
|
||||||
if (MO.isRegister() && MO.isDef() && MO.getReg() &&
|
if (MO.isRegister() && MO.getReg() &&
|
||||||
MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
MRegisterInfo::isVirtualRegister(MO.getReg())) {
|
||||||
unsigned Reg = MO.getReg();
|
unsigned Reg = MO.getReg();
|
||||||
VarInfo &VI = getVarInfo(Reg);
|
VarInfo &VI = getVarInfo(Reg);
|
||||||
|
if (MO.isDef()) {
|
||||||
|
// Update the defining instruction.
|
||||||
if (VI.DefInst == OldMI)
|
if (VI.DefInst == OldMI)
|
||||||
VI.DefInst = NewMI;
|
VI.DefInst = NewMI;
|
||||||
|
} else if (MO.isUse()) {
|
||||||
|
// If this is a kill of the value, update the VI kills list.
|
||||||
|
if (VI.removeKill(OldMI))
|
||||||
|
VI.Kills.push_back(NewMI); // Yes, there was a kill of it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user