[llvm] r215587 - [MachineCombiner] Removal of dangling DBG_VALUES after combining [20598]

Gerolf Hoflehner ghoflehner at apple.com
Wed Aug 13 15:07:37 PDT 2014


Author: ghoflehner
Date: Wed Aug 13 17:07:36 2014
New Revision: 215587

URL: http://llvm.org/viewvc/llvm-project?rev=215587&view=rev
Log:
[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.


Modified:
    llvm/trunk/lib/CodeGen/MachineCombiner.cpp
    llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp

Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=215587&r1=215586&r2=215587&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Wed Aug 13 17:07:36 2014
@@ -380,7 +380,7 @@ bool MachineCombiner::combineInstruction
             MBB->insert((MachineBasicBlock::iterator) & MI,
                         (MachineInstr *)InstrPtr);
           for (auto *InstrPtr : DelInstrs)
-            InstrPtr->eraseFromParent();
+            InstrPtr->eraseFromParentAndMarkDBGValuesForRemoval();
 
           Changed = true;
           ++NumInstCombined;

Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=215587&r1=215586&r2=215587&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Wed Aug 13 17:07:36 2014
@@ -2293,8 +2293,7 @@ static bool canCombineWithMUL(MachineBas
     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;





More information about the llvm-commits mailing list