From 8d4636d516a5f8675fe7d30bc85cd9144f65ba3c Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Wed, 13 May 2009 04:18:47 +0000 Subject: Fix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regB operand was killed, the kill needs to be removed from regB's VarInfo. llvm-svn: 71635 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp') diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index e37639e068a..2ec0c712222 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -858,6 +858,12 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { } } } + + // We're really going to nuke the old inst. If regB was marked + // as a kill we need to update its Kills list. + if (mi->getOperand(si).isKill()) + LV->removeVirtualRegisterKilled(regB, mi); + mbbi->erase(mi); // Nuke the old inst. mi = nmi; ++NumDeletes; -- cgit v1.2.3