xref: /llvm-project/llvm/test/CodeGen/AArch64/debug-info-sve-dbg-value.mir (revision 5bd01ac822d1d700623790ef146fb78216576616)
1# RUN: llc -o %t -filetype=obj -start-before=prologepilog %s
2# RUN: llvm-dwarfdump --name="value0" %t | FileCheck %s --check-prefix=CHECK0
3# RUN: llvm-dwarfdump --name="value1" %t | FileCheck %s --check-prefix=CHECK1
4# RUN: llvm-dwarfdump --name="value2" %t | FileCheck %s --check-prefix=CHECK2
5# RUN: llvm-dwarfdump --name="value3" %t | FileCheck %s --check-prefix=CHECK3
6# RUN: llvm-dwarfdump --name="value4" %t | FileCheck %s --check-prefix=CHECK4
7# RUN: llvm-dwarfdump --name="value5" %t | FileCheck %s --check-prefix=CHECK5
8
9# CHECK0: : DW_OP_breg31 WSP+8, DW_OP_lit16, DW_OP_plus)
10# CHECK0: DW_AT_type {{.*}}ty32
11#
12# CHECK1: : DW_OP_breg31 WSP+16)
13# CHECK1: DW_AT_type {{.*}}ty32
14#
15# CHECK2: : DW_OP_breg31 WSP+16, DW_OP_lit16, DW_OP_bregx VG+0, DW_OP_mul, DW_OP_plus)
16# CHECK2: DW_AT_type {{.*}}svint32_t
17#
18# CHECK3: : DW_OP_breg31 WSP+16, DW_OP_lit8, DW_OP_bregx VG+0, DW_OP_mul, DW_OP_plus)
19# CHECK3: DW_AT_type {{.*}}svint32_t
20#
21# CHECK4: : DW_OP_breg31 WSP+16, DW_OP_lit7, DW_OP_bregx VG+0, DW_OP_mul, DW_OP_plus)
22# CHECK4: DW_AT_type {{.*}}svbool_t
23#
24# CHECK5: : DW_OP_breg31 WSP+16, DW_OP_lit6, DW_OP_bregx VG+0, DW_OP_mul, DW_OP_plus)
25# CHECK5: DW_AT_type {{.*}}svbool_t
26
27--- |
28  ; ModuleID = 'bla.mir'
29  source_filename = "bla.mir"
30  target triple = "aarch64-unknown-linux-gnu"
31  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
32
33  define void @foo() #0 !dbg !5 {
34  entry:
35    unreachable, !dbg !8
36  }
37
38  ; Function Attrs: nounwind readnone speculatable willreturn
39  declare void @llvm.dbg.value(metadata, metadata, metadata)
40
41  attributes #0 = { "target-features"="+sve" }
42
43  !llvm.dbg.cu = !{!0}
44  !llvm.debugify = !{!3, !3}
45  !llvm.module.flags = !{!4}
46
47  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
48  !1 = !DIFile(filename: "bla.mir", directory: "/")
49  !2 = !{}
50  !3 = !{i32 1}
51  !4 = !{i32 2, !"Debug Info Version", i32 3}
52  !5 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !9)
53  !6 = !DISubroutineType(types: !2)
54  !7 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_signed)
55  !8 = !DILocation(line: 1, column: 1, scope: !5)
56  !9 = !{!10, !11, !12, !13, !14, !15}
57  !10 = !DILocalVariable(name: "value0", scope: !5, file: !1, line: 1, type: !7)
58  !11 = !DILocalVariable(name: "value1", scope: !5, file: !1, line: 1, type: !7)
59  !12 = !DILocalVariable(name: "value2", scope: !5, file: !1, line: 1, type: !16)
60  !13 = !DILocalVariable(name: "value3", scope: !5, file: !1, line: 1, type: !16)
61  !14 = !DILocalVariable(name: "value4", scope: !5, file: !1, line: 1, type: !21)
62  !15 = !DILocalVariable(name: "value5", scope: !5, file: !1, line: 1, type: !21)
63  !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "svint32_t", file: !1, line: 1, baseType: !17)
64  !17 = !DIDerivedType(tag: DW_TAG_typedef, name: "__SVInt32_t", file: !1, baseType: !18)
65  !18 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, flags: DIFlagVector, elements: !19)
66  !19 = !{!20}
67  !20 = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 2, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
68  !21 = !DIDerivedType(tag: DW_TAG_typedef, name: "svbool_t", file: !1, line: 90, baseType: !22)
69  !22 = !DIDerivedType(tag: DW_TAG_typedef, name: "__SVBool_t", file: !1, baseType: !23)
70  !23 = !DICompositeType(tag: DW_TAG_array_type, baseType: !24, flags: DIFlagVector, elements: !25)
71  !24 = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char)
72  !25 = !{!26}
73  !26 = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 1, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus))
74
75
76...
77---
78name:            foo
79alignment:       4
80tracksRegLiveness: true
81liveins:
82  - { reg: '$z0' }
83  - { reg: '$z1' }
84  - { reg: '$p0' }
85  - { reg: '$p1' }
86  - { reg: '$x0' }
87  - { reg: '$x1' }
88frameInfo:
89  maxAlignment:    16
90  adjustsStack:    true
91  hasCalls:        true
92  maxCallFrameSize: 0
93  localFrameSize:  4
94stack:
95  - { id: 0, size: 8,  alignment: 8 }
96  - { id: 1, size: 8,  alignment: 8 }
97  - { id: 2, size: 16, alignment: 16, stack-id: scalable-vector }
98  - { id: 3, size: 16, alignment: 16, stack-id: scalable-vector }
99  - { id: 4, size: 2,  alignment: 2,  stack-id: scalable-vector }
100  - { id: 5, size: 2,  alignment: 2,  stack-id: scalable-vector }
101machineFunctionInfo: {}
102body:             |
103  bb.0.entry:
104    liveins: $p0, $p1, $w0, $x1, $z0, $z1
105
106    ; Avoid stack slot scavenging.
107    $lr = IMPLICIT_DEF
108
109    STRXui killed renamable $x0, %stack.0, 0, debug-location !8
110    DBG_VALUE %stack.0, $noreg, !10, !DIExpression(DW_OP_constu, 16, DW_OP_plus, DW_OP_deref), debug-location !8
111    STRXui killed renamable $x1, %stack.1, 0, debug-location !8
112    DBG_VALUE %stack.1, $noreg, !11, !DIExpression(DW_OP_constu, 16, DW_OP_plus, DW_OP_deref), debug-location !8
113
114    renamable $p2 = PTRUE_S 31, implicit $vg, debug-location !DILocation(line: 4, column: 1, scope: !5)
115    ST1W_IMM renamable $z0, renamable $p2, %stack.2, 0, debug-location !DILocation(line: 5, column: 1, scope: !5)
116    DBG_VALUE %stack.2, $noreg, !12, !DIExpression(DW_OP_deref), debug-location !DILocation(line: 5, column: 1, scope: !5)
117    ST1W_IMM renamable $z1, killed renamable $p2, %stack.3, 0, debug-location !DILocation(line: 6, column: 1, scope: !5)
118    DBG_VALUE %stack.3, $noreg, !13, !DIExpression(DW_OP_deref), debug-location !DILocation(line: 6, column: 1, scope: !5)
119
120    STR_PXI killed renamable $p0, %stack.4, 0, debug-location !DILocation(line: 2, column: 1, scope: !5)
121    DBG_VALUE %stack.4, $noreg, !14, !DIExpression(DW_OP_deref), debug-location !DILocation(line: 2, column: 1, scope: !5)
122    STR_PXI killed renamable $p1, %stack.5, 0, debug-location !DILocation(line: 3, column: 1, scope: !5)
123    DBG_VALUE %stack.5, $noreg, !15, !DIExpression(DW_OP_deref), debug-location !DILocation(line: 3, column: 1, scope: !5)
124
125    RET_ReallyLR implicit $z0, implicit $z1, debug-location !DILocation(line: 7, column: 1, scope: !5)
126
127...
128