[llvm] 4fe81b6 - Revert "[DebugInfo] Shorten legacy [s|z]ext dwarf expressions"

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 18:57:32 PDT 2020


Author: Vedant Kumar
Date: 2020-10-28T18:57:17-07:00
New Revision: 4fe81b6b6a732d17101ef03eb24925c965164901

URL: https://github.com/llvm/llvm-project/commit/4fe81b6b6a732d17101ef03eb24925c965164901
DIFF: https://github.com/llvm/llvm-project/commit/4fe81b6b6a732d17101ef03eb24925c965164901.diff

LOG: Revert "[DebugInfo] Shorten legacy [s|z]ext dwarf expressions"

This reverts commit 2ce36ebca544dd71075a7818ff4070da5667603b. It depends
on https://reviews.llvm.org/D89838, which needs to be reverted.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
    llvm/test/DebugInfo/X86/convert-debugloc.ll
    llvm/test/DebugInfo/X86/convert-inlined.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
index db4af6d971dd..c7071132cb2c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -642,12 +642,14 @@ void DwarfExpression::addFragmentOffset(const DIExpression *Expr) {
 void DwarfExpression::emitLegacySExt(unsigned FromBits) {
   // (((X >> (FromBits - 1)) * (~0)) << FromBits) | X
   emitOp(dwarf::DW_OP_dup);
-  emitConstu(FromBits - 1);
+  emitOp(dwarf::DW_OP_constu);
+  emitUnsigned(FromBits - 1);
   emitOp(dwarf::DW_OP_shr);
   emitOp(dwarf::DW_OP_lit0);
   emitOp(dwarf::DW_OP_not);
   emitOp(dwarf::DW_OP_mul);
-  emitConstu(FromBits);
+  emitOp(dwarf::DW_OP_constu);
+  emitUnsigned(FromBits);
   emitOp(dwarf::DW_OP_shl);
   emitOp(dwarf::DW_OP_or);
 }
@@ -655,7 +657,8 @@ void DwarfExpression::emitLegacySExt(unsigned FromBits) {
 void DwarfExpression::emitLegacyZExt(unsigned FromBits, unsigned ToBits) {
   if (FromBits < 64) {
     // X & ((1 << FromBits) - 1)
-    emitConstu((1ULL << FromBits) - 1);
+    emitOp(dwarf::DW_OP_constu);
+    emitUnsigned((1ULL << FromBits) - 1);
     emitOp(dwarf::DW_OP_and);
   } else {
     addOpPiece(FromBits, 0);

diff  --git a/llvm/test/DebugInfo/X86/convert-debugloc.ll b/llvm/test/DebugInfo/X86/convert-debugloc.ll
index f00079556de2..a61127ab6932 100644
--- a/llvm/test/DebugInfo/X86/convert-debugloc.ll
+++ b/llvm/test/DebugInfo/X86/convert-debugloc.ll
@@ -62,7 +62,7 @@
 ; NOCONV:     DW_TAG_formal_parameter
 ; NOCONV:     DW_TAG_variable
 ; NOCONV:       DW_AT_location (
-; NOCONV:         {{.*}}, DW_OP_dup, DW_OP_lit7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_lit8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
+; NOCONV:         {{.*}}, DW_OP_dup, DW_OP_constu 0x7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_constu 0x8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
 ; NOCONV:       DW_AT_name ("y")
 ; NOCONV:     NULL
 ; NOCONV:   DW_TAG_base_type

diff  --git a/llvm/test/DebugInfo/X86/convert-inlined.ll b/llvm/test/DebugInfo/X86/convert-inlined.ll
index 56379b2215c5..5e28a7293d80 100644
--- a/llvm/test/DebugInfo/X86/convert-inlined.ll
+++ b/llvm/test/DebugInfo/X86/convert-inlined.ll
@@ -26,7 +26,7 @@
 ; DW4: DW_TAG_compile_unit
 ; DW4:   DW_TAG_variable
 ; DW4:     DW_AT_name ("global")
-; DW4:     DW_AT_location (DW_OP_addr 0x0, DW_OP_deref, DW_OP_dup, DW_OP_lit7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_lit8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
+; DW4:     DW_AT_location (DW_OP_addr 0x0, DW_OP_deref, DW_OP_dup, DW_OP_constu 0x7, DW_OP_shr, DW_OP_lit0, DW_OP_not, DW_OP_mul, DW_OP_constu 0x8, DW_OP_shl, DW_OP_or, DW_OP_stack_value)
 ; DW4:   DW_TAG_base_type
 ; DW4:     DW_AT_name ("int")
 ; DW4:   NULL


        


More information about the llvm-commits mailing list