diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-19 17:09:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-19 17:09:15 +0000 |
commit | d45be36965470710eb18662fc716243ea384bf2f (patch) | |
tree | fef23d0ff4fb1c7290059d0cb5a605b5877dfeb6 /lib/CodeGen/LiveVariables.cpp | |
parent | a76f04828ab32c70d2358fec18e4dd941d281c4e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index d4d71dc472..291cc7934a 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/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 + } } } |