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.

llvm-svn: 19695
This commit is contained in:
Chris Lattner 2005-01-19 17:09:15 +00:00
parent 25be208e02
commit 00c436824f
1 changed files with 10 additions and 3 deletions

View File

@ -302,12 +302,19 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI,
// the instruction.
for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = OldMI->getOperand(i);
if (MO.isRegister() && MO.isDef() && MO.getReg() &&
if (MO.isRegister() && MO.getReg() &&
MRegisterInfo::isVirtualRegister(MO.getReg())) {
unsigned Reg = MO.getReg();
VarInfo &VI = getVarInfo(Reg);
if (MO.isDef()) {
// Update the defining instruction.
if (VI.DefInst == OldMI)
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
}
}
}