- if (MI->isDebugValue()) {
- // Don't delete the DBG_VALUE itself, but if its Value operand is
- // a vreg and this is the only use, substitute an undef operand;
- // the former operand will then be deleted normally.
- if (MI->getNumOperands()==3 && MI->getOperand(0).isReg()) {
- unsigned Reg = MI->getOperand(0).getReg();
- 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);
- }
- }
-