1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Correctly update LiveVariables when an instruction changes

llvm-svn: 12561
This commit is contained in:
Alkis Evlogimenos 2004-03-30 22:44:39 +00:00
parent f477746a61
commit 45cb0b871d

View File

@ -326,14 +326,14 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI,
MachineInstr *NewMI) {
// If the instruction defines any virtual registers, update the VarInfo for
// the instruction.
for (unsigned i = 0, e = NewMI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = NewMI->getOperand(i);
for (unsigned i = 0, e = OldMI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = OldMI->getOperand(i);
if (MO.isRegister() && MO.isDef() && MO.getReg() &&
MRegisterInfo::isVirtualRegister(MO.getReg())) {
unsigned Reg = MO.getReg();
VarInfo &VI = getVarInfo(Reg);
if (VI.DefInst == OldMI)
VI.DefInst = NewMI;
VI.DefInst = NewMI;
}
}