summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-19 17:09:15 +0000
committerChris Lattner <sabre@nondot.org>2005-01-19 17:09:15 +0000
commit00c436824fd4027799b3e6c344babd24b1d5861d (patch)
treeb6aeecc4a379eaea82f816913e875b350e0f4701 /llvm/lib/CodeGen
parent25be208e0204c3c112db6e790630e3adfc07b54e (diff)
downloadbcm5719-llvm-00c436824fd4027799b3e6c344babd24b1d5861d.tar.gz
bcm5719-llvm-00c436824fd4027799b3e6c344babd24b1d5861d.zip
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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index d4d71dc472f..291cc7934a4 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -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 (VI.DefInst == OldMI)
- VI.DefInst = NewMI;
+ 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
+ }
}
}
OpenPOWER on IntegriCloud