[llvm] eb00e79 - [DebugInfo] Reflect switched variable order from instruction referencing

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 09:17:35 PST 2021


Author: Jeremy Morse
Date: 2021-11-24T17:16:35Z
New Revision: eb00e79bd97446c2dd16f9937c299ef7919ecb60

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

LOG: [DebugInfo] Reflect switched variable order from instruction referencing

Enabling instruction referencing causes a few variable locations to switch
order -- i.e., they switch position in the output DWARF, or sometimes the
order of DBG_VALUEs. Update a few tests to reflect this.

Differential Revision: https://reviews.llvm.org/D114261

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/debug-loclists.ll
    llvm/test/DebugInfo/X86/basic-block-sections-debug-loclist-3.ll
    llvm/test/DebugInfo/X86/constant-loclist.ll
    llvm/test/DebugInfo/X86/float_const_loclist.ll
    llvm/test/DebugInfo/X86/pieces-4.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/debug-loclists.ll b/llvm/test/CodeGen/X86/debug-loclists.ll
index e93a0a599fe76..406bce587b904 100644
--- a/llvm/test/CodeGen/X86/debug-loclists.ll
+++ b/llvm/test/CodeGen/X86/debug-loclists.ll
@@ -1,32 +1,32 @@
-; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=false < %s
+; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=true < %s
 ; RUN: llvm-dwarfdump -v -debug-info -debug-loclists %t | \
 ; RUN:   FileCheck %s --check-prefixes=CHECK,DWARF32
 
-; RUN: llc -dwarf64 -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=false < %s
+; RUN: llc -dwarf64 -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=true < %s
 ; RUN: llvm-dwarfdump -v -debug-info -debug-loclists %t | \
 ; RUN:   FileCheck %s --check-prefixes=CHECK,DWARF64
 
-; RUN: llc -dwarf-version=5 -split-dwarf-file=foo.dwo -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=false < %s
+; RUN: llc -dwarf-version=5 -split-dwarf-file=foo.dwo -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=true < %s
 ; RUN: llvm-dwarfdump -v -debug-info -debug-loclists %t | \
 ; RUN:   FileCheck %s --check-prefixes=DWO,DWO32
 
-; RUN: llc -dwarf64 -dwarf-version=5 -split-dwarf-file=foo.dwo -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=false < %s
+; RUN: llc -dwarf64 -dwarf-version=5 -split-dwarf-file=foo.dwo -mtriple=x86_64-pc-linux -filetype=obj -function-sections -o %t -experimental-debug-variable-locations=true < %s
 ; RUN: llvm-dwarfdump -v -debug-info -debug-loclists %t | \
 ; RUN:   FileCheck %s --check-prefixes=DWO,DWO64
 
 ; CHECK:        DW_TAG_variable
 ; DWARF32-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x0) loclist = 0x00000018:
 ; DWARF64-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x0) loclist = 0x0000002c:
+; CHECK-NEXT:       [0x0000000000000000, 0x0000000000000003) ".text._Z2f1ii": DW_OP_consts +5, DW_OP_stack_value)
+; CHECK-NEXT:     DW_AT_name {{.*}} "x"
+
+; CHECK:        DW_TAG_variable
+; DWARF32-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x1) loclist = 0x00000020:
+; DWARF64-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x1) loclist = 0x00000034:
 ; CHECK-NEXT:       [0x0000000000000000, 0x0000000000000003) ".text._Z2f1ii": DW_OP_consts +3, DW_OP_stack_value
 ; CHECK-NEXT:       [0x0000000000000003, 0x0000000000000004) ".text._Z2f1ii": DW_OP_consts +4, DW_OP_stack_value)
 ; CHECK-NEXT:     DW_AT_name {{.*}} "y"
 
-; CHECK:        DW_TAG_variable
-; DWARF32-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x1) loclist = 0x00000029:
-; DWARF64-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x1) loclist = 0x0000003d:
-; CHECK-NEXT:       [0x0000000000000000, 0x0000000000000003) ".text._Z2f1ii": DW_OP_consts +5, DW_OP_stack_value)
-; CHECK-NEXT:     DW_AT_name {{.*}} "x"
-
 ; CHECK:        DW_TAG_variable
 ; DWARF32-NEXT:   DW_AT_location [DW_FORM_loclistx]   (indexed (0x2) loclist = 0x00000031:
 ; DWARF64-NEXT:   DW_AT_location [DW_FORM_loclistx]	(indexed (0x2) loclist = 0x00000045:
@@ -43,31 +43,33 @@
 
 ; CHECK-NEXT:   offsets: [
 ; DWARF32-NEXT: 0x0000000c => 0x00000018
-; DWARF32-NEXT: 0x0000001d => 0x00000029
+; DWARF32-NEXT: 0x00000014 => 0x00000020
 ; DWARF32-NEXT: 0x00000025 => 0x00000031
 ; DWARF64-NEXT: 0x0000000000000018 => 0x0000002c
-; DWARF64-NEXT: 0x0000000000000029 => 0x0000003d
+; DWARF64-NEXT: 0x0000000000000020 => 0x00000034
 ; DWARF64-NEXT: 0x0000000000000031 => 0x00000045
 ; CHECK-NEXT:   ]
 
+; DWARF32-NEXT: 0x00000018:
+; DWARF64-NEXT: 0x0000002c:
+
+; Show that startx_length can be used when the address range starts at the start of the function.
+
+; CHECK-NEXT:             DW_LLE_startx_length (0x0000000000000000, 0x0000000000000003): DW_OP_consts +5, DW_OP_stack_value
+; CHECK-NEXT:             DW_LLE_end_of_list   ()
+
 ; Don't use startx_length if there's more than one entry, because the shared
 ; base address will be useful for both the range that does start at the start of
 ; the function, and the one that doesn't.
 
-; DWARF32-NEXT: 0x00000018:
-; DWARF64-NEXT: 0x0000002c:
+; DWARF32:      0x00000020:
+; DWARF64:      0x00000034:
+
 ; CHECK-NEXT:             DW_LLE_base_addressx (0x0000000000000000)
 ; CHECK-NEXT:             DW_LLE_offset_pair   (0x0000000000000000, 0x0000000000000003): DW_OP_consts +3, DW_OP_stack_value
 ; CHECK-NEXT:             DW_LLE_offset_pair   (0x0000000000000003, 0x0000000000000004): DW_OP_consts +4, DW_OP_stack_value
 ; CHECK-NEXT:             DW_LLE_end_of_list   ()
 
-; Show that startx_length can be used when the address range starts at the start of the function.
-
-; DWARF32:      0x00000029:
-; DWARF64:      0x0000003d:
-; CHECK-NEXT:             DW_LLE_startx_length (0x0000000000000000, 0x0000000000000003): DW_OP_consts +5, DW_OP_stack_value
-; CHECK-NEXT:             DW_LLE_end_of_list   ()
-
 ; And use a base address when the range doesn't start at an existing/useful
 ; address in the pool.
 

diff  --git a/llvm/test/DebugInfo/X86/basic-block-sections-debug-loclist-3.ll b/llvm/test/DebugInfo/X86/basic-block-sections-debug-loclist-3.ll
index 5d75a43d2335a..f8a0a110048ea 100644
--- a/llvm/test/DebugInfo/X86/basic-block-sections-debug-loclist-3.ll
+++ b/llvm/test/DebugInfo/X86/basic-block-sections-debug-loclist-3.ll
@@ -1,8 +1,11 @@
-; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=4 --basic-block-sections=none -filetype=obj -o - -experimental-debug-variable-locations=false | llvm-dwarfdump - | FileCheck %s
-; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=4 --basic-block-sections=all -filetype=obj -o - -experimental-debug-variable-locations=false | llvm-dwarfdump - | FileCheck %s
-; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=5 --basic-block-sections=none -filetype=obj -o - -experimental-debug-variable-locations=false | llvm-dwarfdump - | FileCheck %s
-; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=5 --basic-block-sections=all -filetype=obj -o - -experimental-debug-variable-locations=false| llvm-dwarfdump - | FileCheck %s
+; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=4 --basic-block-sections=none -filetype=obj -o - -experimental-debug-variable-locations=true | llvm-dwarfdump - | FileCheck %s
+; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=4 --basic-block-sections=all -filetype=obj -o - -experimental-debug-variable-locations=true | llvm-dwarfdump - | FileCheck %s
+; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=5 --basic-block-sections=none -filetype=obj -o - -experimental-debug-variable-locations=true | llvm-dwarfdump - | FileCheck %s
+; RUN: llc %s -mtriple=x86_64-unknown-linux-gnu --dwarf-version=5 --basic-block-sections=all -filetype=obj -o - -experimental-debug-variable-locations=true| llvm-dwarfdump - | FileCheck %s
 
+; CHECK:      DW_TAG_variable
+; CHECK-NOT:  DW_TAG
+; CHECK:      DW_AT_name ("tmp")
 ; CHECK:      DW_TAG_variable
 ; CHECK-NEXT: DW_AT_location
 ; CHECK-NEXT: [0x{{[0-9a-f]+}}, 0x{{[0-9a-f]+}}): DW_OP_reg3

diff  --git a/llvm/test/DebugInfo/X86/constant-loclist.ll b/llvm/test/DebugInfo/X86/constant-loclist.ll
index bbef1c342d747..c0c89a059e248 100644
--- a/llvm/test/DebugInfo/X86/constant-loclist.ll
+++ b/llvm/test/DebugInfo/X86/constant-loclist.ll
@@ -1,12 +1,13 @@
-; RUN: llc -filetype=obj %s -o - -experimental-debug-variable-locations=false | llvm-dwarfdump -v -debug-info - | FileCheck %s
+; RUN: llc -filetype=obj %s -o - -experimental-debug-variable-locations=true | llvm-dwarfdump -v -debug-info - | FileCheck %s
 
 ; A hand-written testcase to check 64-bit constant handling in location lists.
 
 ; CHECK: .debug_info contents:
 ; CHECK: DW_TAG_variable
 ; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(
+; CHECK-NEXT:   {{.*}}: DW_OP_lit0
 ; CHECK-NEXT:   {{.*}}: DW_OP_constu 0x4000000000000000)
-; CHECK-NEXT: DW_AT_name {{.*}}"d"
+; CHECK-NEXT: DW_AT_name {{.*}}"u"
 ; CHECK: DW_TAG_variable
 ; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(
 ; CHECK-NEXT:   {{.*}}: DW_OP_consts +0
@@ -14,9 +15,8 @@
 ; CHECK-NEXT: DW_AT_name {{.*}}"i"
 ; CHECK: DW_TAG_variable
 ; CHECK-NEXT: DW_AT_location [DW_FORM_data4]	(
-; CHECK-NEXT:   {{.*}}: DW_OP_lit0
 ; CHECK-NEXT:   {{.*}}: DW_OP_constu 0x4000000000000000)
-; CHECK-NEXT: DW_AT_name {{.*}}"u"
+; CHECK-NEXT: DW_AT_name {{.*}}"d"
 
 source_filename = "test.c"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

diff  --git a/llvm/test/DebugInfo/X86/float_const_loclist.ll b/llvm/test/DebugInfo/X86/float_const_loclist.ll
index 491d3c12a5845..4483370c82859 100644
--- a/llvm/test/DebugInfo/X86/float_const_loclist.ll
+++ b/llvm/test/DebugInfo/X86/float_const_loclist.ll
@@ -1,5 +1,5 @@
-; RUN: llc %s -stop-after=livedebugvalues -o - -experimental-debug-variable-locations=false | FileCheck --check-prefix=SANITY %s
-; RUN: llc < %s -filetype=obj -experimental-debug-variable-locations=false | llvm-dwarfdump -v - | FileCheck %s
+; RUN: llc %s -stop-after=livedebugvalues -o - -experimental-debug-variable-locations=true | FileCheck --check-prefix=SANITY %s
+; RUN: llc < %s -filetype=obj -experimental-debug-variable-locations=true | llvm-dwarfdump -v - | FileCheck %s
 ; Test debug_loc support for floating point constants.
 ;
 ; Created from clang -O1:
@@ -14,17 +14,17 @@
 ;   }
 ;
 ; SANITY: CALL{{.*}} @barrier
-; SANITY: DBG_VALUE x86_fp80 0xK4000C8F5C28F5C28F800
 ; SANITY: DBG_VALUE float 0x40091EB860000000
+; SANITY: DBG_VALUE x86_fp80 0xK4000C8F5C28F5C28F800
 ; SANITY: TAILJMP{{.*}} @barrier
 ;
 ; CHECK: .debug_info contents:
 ; CHECK: DW_TAG_variable
-; CHECK-NEXT:  DW_AT_name {{.*}}"ld"
-; CHECK: DW_TAG_variable
 ; CHECK-NEXT:  DW_AT_location {{.*}} (
 ; CHECK-NEXT:    [0x{{.*}}, 0x{{.*}}): DW_OP_constu 0x4048f5c3)
 ; CHECK-NEXT:  DW_AT_name {{.*}}"f"
+; CHECK: DW_TAG_variable
+; CHECK-NEXT:  DW_AT_name {{.*}}"ld"
 
 source_filename = "test.c"
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

diff  --git a/llvm/test/DebugInfo/X86/pieces-4.ll b/llvm/test/DebugInfo/X86/pieces-4.ll
index a52b78a9861ec..5be89a7a86c18 100644
--- a/llvm/test/DebugInfo/X86/pieces-4.ll
+++ b/llvm/test/DebugInfo/X86/pieces-4.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -experimental-debug-variable-locations=false | FileCheck %s
-; RUN: llc -filetype=obj < %s -experimental-debug-variable-locations=false | llvm-dwarfdump -debug-loc - | FileCheck %s --check-prefix=DWARF
+; RUN: llc < %s -experimental-debug-variable-locations=true | FileCheck %s
+; RUN: llc -filetype=obj < %s -experimental-debug-variable-locations=true | llvm-dwarfdump -debug-loc - | FileCheck %s --check-prefix=DWARF
 
 ; Compile the following with -O1:
 
@@ -16,8 +16,8 @@
 ; CHECK-LABEL: bitpiece_spill:                         # @bitpiece_spill
 ; CHECK:               callq   g
 ; CHECK:               movl    %eax, [[offs:[0-9]+]](%rsp)          # 4-byte Spill
-; CHECK:               #DEBUG_VALUE: bitpiece_spill:o <- [DW_OP_LLVM_fragment 32 32] 0
 ; CHECK:               #DEBUG_VALUE: bitpiece_spill:o <- [DW_OP_plus_uconst [[offs]], DW_OP_LLVM_fragment 0 32] [$rsp+0]
+; CHECK:               #DEBUG_VALUE: bitpiece_spill:o <- [DW_OP_LLVM_fragment 32 32] 0
 ; CHECK:               #APP
 ; CHECK:               #NO_APP
 ; CHECK:               movl    [[offs]](%rsp), %eax          # 4-byte Reload


        


More information about the llvm-commits mailing list