mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-20 02:58:10 +00:00
Allow for more than one DBG_VALUE targeting the
same dead instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3bfef03eb6
commit
39c7a198ea
@ -117,10 +117,10 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user