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:
parent
f477746a61
commit
45cb0b871d
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user