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

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 05:09:53 PDT 2025


================
@@ -0,0 +1,78 @@
+# 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: 0x000000000000000a      2      0      0   0             0       0
+# DBG-NEXT: 0x000000000000000f      2      0      0   0             0       0
+# DBG-NEXT: 0x0000000000000014      2      0      0   0             0       0
+# DBG-NEXT: 0x0000000000000019      2      0      0   0             0       0
----------------
OCHyams wrote:

Good spot. Fixed in commit "fix line entries not folding together properly". That also fixes a bug where a line should have been is_stmt but wasn't (accidentally floated is_stmt past a different atom, which was unintended)

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


More information about the llvm-commits mailing list