[llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Tue May 13 08:55:52 PDT 2025


================
@@ -0,0 +1,75 @@
+# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \
+# RUN: | llvm-objdump -d - --no-show-raw-insn \
+# RUN: | FileCheck %s --check-prefix=OBJ
+
+# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \
+# RUN: | llvm-dwarfdump - --debug-line \
+# RUN: | FileCheck %s --check-prefix=DBG
+
+# OBJ: 0000000000000000 <_Z1fPiii>:
+# OBJ-NEXT:  0:       movl    $0x0, %ebx
+# OBJ-NEXT:  5:       movl    $0x1, %ebx
+# OBJ-NEXT:  a:       movl    $0x2, %ebx
+# OBJ-NEXT:  f:       movl    $0x3, %ebx
+# OBJ-NEXT: 14:       movl    $0x4, %eax
+# OBJ-NEXT: 19:       movl    $0x5, %eax
+# OBJ-NEXT: 1e:       movl    $0x6, %eax
+# OBJ-NEXT: 23:       movl    $0x7, %eax
+# OBJ-NEXT: 28:       retq
+
+# DBG:      Address            Line   Column File   ISA Discriminator OpIndex Flags
+# DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
+# DBG-NEXT: 0x0000000000000000      1      0      0   0             0       0  is_stmt prologue_end
+# DBG-NEXT: 0x0000000000000005      2      0      0   0             0       0  is_stmt
+# DBG-NEXT: 0x0000000000000019      2      0      0   0             0       0  is_stmt
+# DBG-NEXT: 0x000000000000001e      2      0      0   0             0       0  is_stmt
+# DBG-NEXT: 0x0000000000000023      2      0      0   0             0       0  is_stmt
+# DBG-NEXT: 0x0000000000000029      2      0      0   0             0       0  is_stmt end_sequence
----------------
OCHyams wrote:

It's "normal" - I think the end_sequence entry probably leaves all the other registers untouched to avoid unnecessary bloat? Replicating the is_stmt end_sequence with simple input without key instructions: https://godbolt.org/z/TsbTM8j8q 

https://github.com/llvm/llvm-project/pull/133495


More information about the llvm-commits mailing list