diff options
author | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-08-13 22:07:36 +0000 |
---|---|---|
committer | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-08-13 22:07:36 +0000 |
commit | fe2c11ffd6b0ac7686ac99ad5e53e6a8e3dfe151 (patch) | |
tree | 46d70108d3aa433c593eb9a1cf7412aced7180f3 /llvm/lib | |
parent | 2b98e393f2f12faf79162594b30f71e49a06c118 (diff) | |
download | bcm5719-llvm-fe2c11ffd6b0ac7686ac99ad5e53e6a8e3dfe151.tar.gz bcm5719-llvm-fe2c11ffd6b0ac7686ac99ad5e53e6a8e3dfe151.zip |
[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
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineCombiner.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp index 032b4ee5cbb..aeb864efa34 100644 --- a/llvm/lib/CodeGen/MachineCombiner.cpp +++ b/llvm/lib/CodeGen/MachineCombiner.cpp @@ -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; diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index fcf04dd2c04..df883d35fa1 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -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; |