From be04dc1413bdab0c8687a8086792af6cfd7540c0 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 3 Jul 2008 00:07:19 +0000 Subject: - 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 --- lib/CodeGen/LiveVariables.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/CodeGen/LiveVariables.cpp') diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index ab73c97ec9..ee4492b6dd 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/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) { -- cgit v1.2.3-18-g5258