70 lines · plain
1; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \2; RUN: | llvm-objdump -d - --no-show-raw-insn \3; RUN: | FileCheck %s --check-prefix=OBJ4 5; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \6; RUN: | llvm-dwarfdump - --debug-line \7; RUN: | FileCheck %s --check-prefix=DBG8 9;; 1. [[gnu::nodebug]] void prologue_end();10;; 2.11;; 3. int f(int *a, int b, int c) {12;; 4. prologue_end();13;; 5. *a =14;; 6. b + c;15;; 7. return *a;16;; 8. }17;;18;; The add and store are in the same group (1). The add (line 6) has lower19;; precedence (rank 2) so should not get is_stmt applied.20 21; OBJ: 0000000000000000 <_Z1fPiii>:22; OBJ-NEXT: 0: pushq %rbp23; OBJ-NEXT: 1: pushq %r1424; OBJ-NEXT: 3: pushq %rbx25; OBJ-NEXT: 4: movl %edx, %ebx26; OBJ-NEXT: 6: movl %esi, %ebp27; OBJ-NEXT: 8: movq %rdi, %r1428; OBJ-NEXT: b: callq 0x10 <_Z1fPiii+0x10>29; OBJ-NEXT: 10: addl %ebx, %ebp30; OBJ-NEXT: 12: movl %ebp, (%r14)31; OBJ-NEXT: 15: movl %ebp, %eax32; OBJ-NEXT: 17: popq %rbx33; OBJ-NEXT: 18: popq %r1434; OBJ-NEXT: 1a: popq %rbp35 36; DBG: Address Line Column File ISA Discriminator OpIndex Flags37; DBG-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------38; DBG-NEXT: 0x0000000000000000 3 0 0 0 0 0 is_stmt39; DBG-NEXT: 0x000000000000000b 4 0 0 0 0 0 is_stmt prologue_end40; DBG-NEXT: 0x0000000000000010 6 0 0 0 0 041; DBG-NEXT: 0x0000000000000012 5 0 0 0 0 0 is_stmt42; DBG-NEXT: 0x0000000000000015 7 0 0 0 0 0 is_stmt43; DBG-NEXT: 0x0000000000000017 7 0 0 0 0 0 epilogue_begin44; DBG-NEXT: 0x000000000000001c 7 0 0 0 0 0 end_sequence45 46target triple = "x86_64-unknown-linux-gnu"47 48define hidden noundef i32 @_Z1fPiii(ptr %a, i32 %b, i32 %c) local_unnamed_addr !dbg !11 {49entry:50 tail call void @_Z12prologue_endv(), !dbg !DILocation(line: 4, scope: !11)51 %add = add nsw i32 %c, %b, !dbg !DILocation(line: 6, scope: !11, atomGroup: 1, atomRank: 2)52 store i32 %add, ptr %a, align 4, !dbg !DILocation(line: 5, scope: !11, atomGroup: 1, atomRank: 1)53 ret i32 %add, !dbg !DILocation(line: 7, scope: !11, atomGroup: 2, atomRank: 1)54}55 56declare void @_Z12prologue_endv() local_unnamed_addr #157 58!llvm.dbg.cu = !{!0}59!llvm.module.flags = !{!2, !3}60!llvm.ident = !{!10}61 62!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_17, file: !1, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)63!1 = !DIFile(filename: "test.cpp", directory: "/")64!2 = !{i32 7, !"Dwarf Version", i32 5}65!3 = !{i32 2, !"Debug Info Version", i32 3}66!10 = !{!"clang version 19.0.0"}67!11 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !12, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)68!12 = !DISubroutineType(types: !13)69!13 = !{}70