mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
[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:
parent
a0c81f0639
commit
2205044968
@ -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
Block a user