[llvm] 83d4851 - Revert "[DebugInfo] Variables with only empty values emitting when one is variadic"

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 21:58:04 PST 2022


Author: Vitaly Buka
Date: 2022-12-23T21:57:53-08:00
New Revision: 83d4851436904c005ff0831e38e1814a0a8f00ac

URL: https://github.com/llvm/llvm-project/commit/83d4851436904c005ff0831e38e1814a0a8f00ac
DIFF: https://github.com/llvm/llvm-project/commit/83d4851436904c005ff0831e38e1814a0a8f00ac.diff

LOG: Revert "[DebugInfo] Variables with only empty values emitting when one is variadic"

Breaks HWASAN somehow.

Fails at def915c39cc4e18b304c7a8c4761cc4531c3bc4b
https://lab.llvm.org/buildbot/#/builders/236/builds/1547

Pass at def915c39cc4e18b304c7a8c4761cc4531c3bc4b^
https://lab.llvm.org/buildbot/#/builders/236/builds/1529

This reverts commit def915c39cc4e18b304c7a8c4761cc4531c3bc4b.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
    llvm/test/DebugInfo/X86/dbg_value_list_emission.mir

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
index 2c90b9c150098..42715efbee09d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
@@ -264,7 +264,7 @@ bool DbgValueHistoryMap::hasNonEmptyLocation(const Entries &Entries) const {
     const MachineInstr *MI = Entry.getInstr();
     assert(MI->isDebugValue());
     // A DBG_VALUE $noreg is an empty variable location
-    if (MI->isUndefDebugValue())
+    if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == 0)
       continue;
 
     return true;

diff  --git a/llvm/test/DebugInfo/X86/dbg_value_list_emission.mir b/llvm/test/DebugInfo/X86/dbg_value_list_emission.mir
index b96582473cd0b..e447fa82f95b3 100644
--- a/llvm/test/DebugInfo/X86/dbg_value_list_emission.mir
+++ b/llvm/test/DebugInfo/X86/dbg_value_list_emission.mir
@@ -93,7 +93,9 @@ body:             |
     
     ; (8) Check that a single $noreg location invalidates the entire entry.
     DBG_VALUE_LIST !30, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), $eax, $noreg, debug-location !15
-    ; CHECK-NOT:   DW_AT_name ("localh")
+    ; CHECK:      DW_TAG_variable
+    ; CHECK-NEXT:   DW_AT_name ("localh")
+    ; CHECK-NOT:   DW_AT_location
 
     RET64 debug-location !15
 ...


        


More information about the llvm-commits mailing list