[MachineCombiner] Removal of dangling DBG_VALUES after combining [20598]
This is a cleaner solution to the problem described in r215431. When instructions are combined a dangling DBG_VALUE is removed. This resolves bug 20598. llvm-svn: 215587
This commit is contained in:
parent
2b98e393f2
commit
fe2c11ffd6
|
@ -380,7 +380,7 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
|
|||
MBB->insert((MachineBasicBlock::iterator) & MI,
|
||||
(MachineInstr *)InstrPtr);
|
||||
for (auto *InstrPtr : DelInstrs)
|
||||
InstrPtr->eraseFromParent();
|
||||
InstrPtr->eraseFromParentAndMarkDBGValuesForRemoval();
|
||||
|
||||
Changed = true;
|
||||
++NumInstCombined;
|
||||
|
|
|
@ -2293,8 +2293,7 @@ static bool canCombineWithMUL(MachineBasicBlock &MBB, MachineOperand &MO,
|
|||
return false;
|
||||
|
||||
// Must only used by the user we combine with.
|
||||
// FIXME: handle the case of DBG uses gracefully
|
||||
if (!MRI.hasOneUse(MI->getOperand(0).getReg()))
|
||||
if (!MRI.hasOneNonDBGUse(MI->getOperand(0).getReg()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue