diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 00:07:19 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 00:07:19 +0000 |
commit | 7a265d83bf9ad4e691f6f980afa709591dc57058 (patch) | |
tree | 7b7f8e7e18157359cfe6f9221c46703b9078ef12 /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | c939f45fe79b10f441c35cea6f0dae9c602a8497 (diff) | |
download | llvm-7a265d83bf9ad4e691f6f980afa709591dc57058.zip llvm-7a265d83bf9ad4e691f6f980afa709591dc57058.tar.gz llvm-7a265d83bf9ad4e691f6f980afa709591dc57058.tar.bz2 |
- Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.
llvm-svn: 53061
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index ab73c97..ee4492b 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/lib/CodeGen/LiveVariables.cpp @@ -684,6 +684,15 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI, } } +/// replaceKillInstruction - Update register kill info by replacing a kill +/// instruction with a new one. +void LiveVariables::replaceKillInstruction(unsigned Reg, MachineInstr *OldMI, + MachineInstr *NewMI) { + VarInfo &VI = getVarInfo(Reg); + if (VI.removeKill(OldMI)) + VI.Kills.push_back(NewMI); // Yes, there was a kill of it +} + /// removeVirtualRegistersKilled - Remove all killed info for the specified /// instruction. void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) { |