From: Bob Wilson Date: Tue, 1 Sep 2009 23:18:46 +0000 (+0000) Subject: Avoid calling removeVirtualRegisterKilled which iterates over the operands X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=86f7cd786eecc74e0480c0f8ab6a4234bb72bfbb;p=oota-llvm.git Avoid calling removeVirtualRegisterKilled which iterates over the operands to find the kill, since we already have the operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80736 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index b50d53ce59b..1938b4bd369 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -1032,7 +1032,8 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { if (KillMO) { if (!FirstKeptMO) { // All uses of regB are being replaced; move the kill to prevMI. - if (LV && LV->removeVirtualRegisterKilled(regB, mi)) + KillMO->setIsKill(false); + if (LV && LV->getVarInfo(regB).removeKill(mi)) LV->addVirtualRegisterKilled(regB, prevMI); } else { if (!KillMOKept) {