summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-03-30 22:44:39 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-03-30 22:44:39 +0000
commita333b1382f6883c6ad6626e899c0f027c1e5ae9d (patch)
treeb5f10ac2291637bd0ac747fe2713845267c5b76f /llvm/lib/CodeGen/LiveVariables.cpp
parent32817f5985eeaf60bb1cb76e3e12821ce3978466 (diff)
downloadbcm5719-llvm-a333b1382f6883c6ad6626e899c0f027c1e5ae9d.tar.gz
bcm5719-llvm-a333b1382f6883c6ad6626e899c0f027c1e5ae9d.zip
Correctly update LiveVariables when an instruction changes
llvm-svn: 12561
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 10c215885f7..1b43ff3866a 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -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;
}
}
OpenPOWER on IntegriCloud