[llvm-commits] [llvm] r95890 - /llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp
Dale Johannesen
dalej at apple.com
Thu Feb 11 10:23:24 PST 2010
Author: johannes
Date: Thu Feb 11 12:23:23 2010
New Revision: 95890
URL: http://llvm.org/viewvc/llvm-project?rev=95890&view=rev
Log:
Allow for more than one DBG_VALUE targeting the
same dead instruction.
Modified:
llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp
Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=95890&r1=95889&r2=95890&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Thu Feb 11 12:23:23 2010
@@ -117,10 +117,10 @@
// the former operand will then be deleted normally.
if (MI->getNumOperands()==3 && MI->getOperand(0).isReg()) {
unsigned Reg = MI->getOperand(0).getReg();
- MachineRegisterInfo::use_iterator I = MRI->use_begin(Reg);
- assert(I != MRI->use_end());
- if (++I == MRI->use_end())
- // only one use, which must be this DBG_VALUE.
+ MachineRegisterInfo::use_nodbg_iterator I = MRI->use_nodbg_begin(Reg);
+ if (I == MRI->use_nodbg_end())
+ // All uses are DBG_VALUEs. Nullify this one; if we find
+ // others later we will nullify them then.
MI->getOperand(0).setReg(0U);
}
}
More information about the llvm-commits
mailing list