aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 00:07:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 00:07:19 +0000
commitbe04dc1413bdab0c8687a8086792af6cfd7540c0 (patch)
treeec20a72422a289cd10907a1515c5a6812064e1ec /lib/CodeGen/TwoAddressInstructionPass.cpp
parent457b88fb95be895d914e52f3b44014a82e645e4a (diff)
- 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index d2e5288d34..480d6dd389 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -375,10 +375,9 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
DOUT << "2addr: COMMUTED TO: " << *NewMI;
// If the instruction changed to commute it, update livevar.
if (NewMI != mi) {
- if (LV) {
+ if (LV)
// Update live variables
- LV->instructionChanged(mi, NewMI);
- }
+ LV->replaceKillInstruction(regC, mi, NewMI);
mbbi->insert(mi, NewMI); // Insert the new inst
mbbi->erase(mi); // Nuke the old inst.