[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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gerolf Hoflehner 2014-08-13 22:07:36 +00:00
parent a0c81f0639
commit 2205044968
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -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;