Don't assume that only Uses can be kills. Defs are marked as kills initially
when there are no uses. This fixes a dangling-pointer bug, where pointers to deleted instructions were not removed from kills lists. More info here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html llvm-svn: 40131
This commit is contained in:
@@ -582,15 +582,13 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI,
|
||||
if (VI.DefInst == OldMI)
|
||||
VI.DefInst = NewMI;
|
||||
}
|
||||
if (MO.isUse()) {
|
||||
if (MO.isKill()) {
|
||||
MO.unsetIsKill();
|
||||
addVirtualRegisterKilled(Reg, NewMI);
|
||||
}
|
||||
// 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
|
||||
if (MO.isKill()) {
|
||||
MO.unsetIsKill();
|
||||
addVirtualRegisterKilled(Reg, NewMI);
|
||||
}
|
||||
// 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