File: dwarf-buoy-multi-key.mir

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (75 lines) | stat: -rw-r--r-- 3,703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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

## Check that interleaving atoms on the same line still produces reasonable
## is_stmt placement (the is_stmts want to "float up" to the first instruction
## in a contiguous set with the same line, but we don't let them float past
## other atom groups).

--- |
  target triple = "x86_64-unknown-linux-gnu"

  define hidden noundef i32 @_Z1fPiii(ptr %a, i32 %b, i32 %c, i1 %cond) local_unnamed_addr !dbg !5 {
  entry:
    ret i32 2
  }

  !llvm.dbg.cu = !{!0}
  !llvm.module.flags = !{!2, !3}
  !llvm.ident = !{!4}

  !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)
  !1 = !DIFile(filename: "test.cpp", directory: "/")
  !2 = !{i32 7, !"Dwarf Version", i32 5}
  !3 = !{i32 2, !"Debug Info Version", i32 3}
  !4 = !{!"clang version 19.0.0"}
  !5 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)
  !6 = !DISubroutineType(types: !7)
  !7 = !{}
  !8 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 1, type: !7)

...
---
name:            _Z1fPiii
alignment:       16
body:             |
  bb.0.entry:
    $ebx = MOV32ri 0, debug-location !DILocation(line: 1, scope: !5) 
    ;; is_stmt floats up here from mov 3.
    $ebx = MOV32ri 1, debug-location !DILocation(line: 2, scope: !5, atomGroup: 1, atomRank: 1)
    $ebx = MOV32ri 2, debug-location !DILocation(line: 2, scope: !5, atomGroup: 1, atomRank: 2)
    $ebx = MOV32ri 3, debug-location !DILocation(line: 2, scope: !5, atomGroup: 1, atomRank: 1)
    $eax = MOV32ri 4, debug-location !DILocation(line: 2, scope: !5)
    $eax = MOV32ri 5, debug-location !DILocation(line: 2, scope: !5, atomGroup: 2, atomRank: 1)
    ;; is_stmt for this group can't float higher due to atom group above.
    $eax = MOV32ri 6, debug-location !DILocation(line: 2, scope: !5, atomGroup: 3, atomRank: 1)
    ;; Same again.
    $eax = MOV32ri 7, debug-location !DILocation(line: 2, scope: !5, atomGroup: 2, atomRank: 1)
    RET64 $eax

...