Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 2205044

Browse files
committed
[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
1 parent a0c81f0 commit 2205044

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/CodeGen/MachineCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
380380
MBB->insert((MachineBasicBlock::iterator) & MI,
381381
(MachineInstr *)InstrPtr);
382382
for (auto *InstrPtr : DelInstrs)
383-
InstrPtr->eraseFromParent();
383+
InstrPtr->eraseFromParentAndMarkDBGValuesForRemoval();
384384

385385
Changed = true;
386386
++NumInstCombined;

lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,7 @@ static bool canCombineWithMUL(MachineBasicBlock &MBB, MachineOperand &MO,
22932293
return false;
22942294

22952295
// Must only used by the user we combine with.
2296-
// FIXME: handle the case of DBG uses gracefully
2297-
if (!MRI.hasOneUse(MI->getOperand(0).getReg()))
2296+
if (!MRI.hasOneNonDBGUse(MI->getOperand(0).getReg()))
22982297
return false;
22992298

23002299
return true;

0 commit comments

Comments
 (0)