xref: /llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/store-merging-debug.mir (revision 29c851f4e2ff9dc55146be88ae0df3d378a7be9f)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64-apple-ios -global-isel -global-isel-abort=1 -run-pass=loadstore-opt %s -o - | FileCheck %s
3
4--- |
5  source_filename = "store-merging-debug.mir"
6  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7  target triple = "aarch64-apple-ios"
8
9  define void @test_simple_4xs16() !dbg !5 {
10  entry:
11    call void @llvm.dbg.value(metadata i32 0, metadata !9, metadata !DIExpression()), !dbg !11
12    unreachable, !dbg !11
13  }
14
15  ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
16  declare void @llvm.dbg.value(metadata, metadata, metadata) #0
17
18  attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
19
20  !llvm.dbg.cu = !{!0}
21  !llvm.mir.debugify = !{!2, !3}
22  !llvm.debugify = !{!3, !3}
23  !llvm.module.flags = !{!4}
24
25  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
26  !1 = !DIFile(filename: "store-merging-debug.mir", directory: "/")
27  !2 = !{i32 16}
28  !3 = !{i32 1}
29  !4 = !{i32 2, !"Debug Info Version", i32 3}
30  !5 = distinct !DISubprogram(name: "test_simple_4xs16", linkageName: "test_simple_4xs16", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
31  !6 = !DISubroutineType(types: !7)
32  !7 = !{}
33  !8 = !{!9}
34  !9 = !DILocalVariable(name: "1", scope: !5, file: !1, line: 1, type: !10)
35  !10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
36  !11 = !DILocation(line: 1, column: 1, scope: !5)
37
38...
39---
40name:            test_simple_4xs16
41alignment:       4
42exposesReturnsTwice: false
43legalized:       false
44regBankSelected: false
45selected:        false
46failedISel:      false
47tracksRegLiveness: true
48hasWinCFI:       false
49callsEHReturn:   false
50callsUnwindInit: false
51hasEHCatchret:   false
52hasEHScopes:     false
53hasEHFunclets:   false
54failsVerification: false
55tracksDebugUserValues: false
56registers:
57  - { id: 0, class: _, preferred-register: '' }
58  - { id: 1, class: _, preferred-register: '' }
59  - { id: 2, class: _, preferred-register: '' }
60  - { id: 3, class: _, preferred-register: '' }
61  - { id: 4, class: _, preferred-register: '' }
62  - { id: 5, class: _, preferred-register: '' }
63  - { id: 6, class: _, preferred-register: '' }
64  - { id: 7, class: _, preferred-register: '' }
65  - { id: 8, class: _, preferred-register: '' }
66  - { id: 9, class: _, preferred-register: '' }
67  - { id: 10, class: _, preferred-register: '' }
68liveins:
69  - { reg: '$x0', virtual-reg: '' }
70frameInfo:
71  isFrameAddressTaken: false
72  isReturnAddressTaken: false
73  hasStackMap:     false
74  hasPatchPoint:   false
75  stackSize:       0
76  offsetAdjustment: 0
77  maxAlignment:    1
78  adjustsStack:    false
79  hasCalls:        false
80  stackProtector:  ''
81  functionContext: ''
82  maxCallFrameSize: 0
83  cvBytesOfCalleeSavedRegisters: 0
84  hasOpaqueSPAdjustment: false
85  hasVAStart:      false
86  hasMustTailInVarArgFunc: false
87  hasTailCall:     false
88  localFrameSize:  0
89  savePoint:       ''
90  restorePoint:    ''
91fixedStack:      []
92stack:           []
93callSites:       []
94debugValueSubstitutions: []
95constants:       []
96machineFunctionInfo: {}
97body:             |
98  bb.0:
99    liveins: $x0
100
101    ; CHECK-LABEL: name: test_simple_4xs16
102    ; CHECK: liveins: $x0
103    ; CHECK-NEXT: {{  $}}
104    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0, debug-location !11
105    ; CHECK-NEXT: DBG_VALUE [[COPY]](p0), $noreg, !9, !DIExpression(), debug-location !11
106    ; CHECK-NEXT: DBG_VALUE %1:_(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !5)
107    ; CHECK-NEXT: DBG_VALUE %4:_(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !5)
108    ; CHECK-NEXT: DBG_VALUE %7:_(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !5)
109    ; CHECK-NEXT: DBG_VALUE %10:_(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !5)
110    ; CHECK-NEXT: DBG_VALUE 0, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 6, column: 1, scope: !5)
111    ; CHECK-NEXT: DBG_VALUE %2:_(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 7, column: 1, scope: !5)
112    ; CHECK-NEXT: DBG_VALUE %3:_(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 8, column: 1, scope: !5)
113    ; CHECK-NEXT: DBG_VALUE 1, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 9, column: 1, scope: !5)
114    ; CHECK-NEXT: DBG_VALUE %5:_(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 10, column: 1, scope: !5)
115    ; CHECK-NEXT: DBG_VALUE %6:_(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 11, column: 1, scope: !5)
116    ; CHECK-NEXT: DBG_VALUE 2, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 12, column: 1, scope: !5)
117    ; CHECK-NEXT: DBG_VALUE %8:_(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 13, column: 1, scope: !5)
118    ; CHECK-NEXT: DBG_VALUE %9:_(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 14, column: 1, scope: !5)
119    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3940688328982532
120    ; CHECK-NEXT: G_STORE [[C]](s64), [[COPY]](p0), debug-location !DILocation(line: 9, scope: !5) :: (store (s64), align 2)
121    ; CHECK-NEXT: DBG_VALUE 3, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 15, column: 1, scope: !5)
122    ; CHECK-NEXT: RET_ReallyLR debug-location !DILocation(line: 16, column: 1, scope: !5)
123    %0:_(p0) = COPY $x0, debug-location !11
124    DBG_VALUE %0(p0), $noreg, !9, !DIExpression(), debug-location !11
125    %1:_(s16) = G_CONSTANT i16 4, debug-location !DILocation(line: 2, column: 1, scope: !5)
126    DBG_VALUE %1(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !5)
127    %4:_(s16) = G_CONSTANT i16 5, debug-location !DILocation(line: 3, column: 1, scope: !5)
128    DBG_VALUE %4(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !5)
129    %7:_(s16) = G_CONSTANT i16 9, debug-location !DILocation(line: 4, column: 1, scope: !5)
130    DBG_VALUE %7(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !5)
131    %10:_(s16) = G_CONSTANT i16 14, debug-location !DILocation(line: 5, column: 1, scope: !5)
132    DBG_VALUE %10(s16), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !5)
133    G_STORE %1(s16), %0(p0), debug-location !DILocation(line: 9, column: 1, scope: !5) :: (store (s16))
134    DBG_VALUE 0, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 6, column: 1, scope: !5)
135    %2:_(s64) = G_CONSTANT i64 2, debug-location !DILocation(line: 7, column: 1, scope: !5)
136    DBG_VALUE %2(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 7, column: 1, scope: !5)
137    %3:_(p0) = G_PTR_ADD %0, %2(s64), debug-location !DILocation(line: 8, column: 1, scope: !5)
138    DBG_VALUE %3(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 8, column: 1, scope: !5)
139    G_STORE %4(s16), %3(p0), debug-location !DILocation(line: 9, column: 1, scope: !5) :: (store (s16))
140    DBG_VALUE 1, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 9, column: 1, scope: !5)
141    %5:_(s64) = G_CONSTANT i64 4, debug-location !DILocation(line: 10, column: 1, scope: !5)
142    DBG_VALUE %5(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 10, column: 1, scope: !5)
143    %6:_(p0) = G_PTR_ADD %0, %5(s64), debug-location !DILocation(line: 11, column: 1, scope: !5)
144    DBG_VALUE %6(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 11, column: 1, scope: !5)
145    G_STORE %7(s16), %6(p0), debug-location !DILocation(line: 9, column: 4, scope: !5) :: (store (s16))
146    DBG_VALUE 2, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 12, column: 1, scope: !5)
147    %8:_(s64) = G_CONSTANT i64 6, debug-location !DILocation(line: 13, column: 1, scope: !5)
148    DBG_VALUE %8(s64), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 13, column: 1, scope: !5)
149    %9:_(p0) = G_PTR_ADD %0, %8(s64), debug-location !DILocation(line: 14, column: 1, scope: !5)
150    DBG_VALUE %9(p0), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 14, column: 1, scope: !5)
151    G_STORE %10(s16), %9(p0), debug-location !DILocation(line: 9, column: 4, scope: !5) :: (store (s16))
152    DBG_VALUE 3, $noreg, !9, !DIExpression(), debug-location !DILocation(line: 15, column: 1, scope: !5)
153    RET_ReallyLR debug-location !DILocation(line: 16, column: 1, scope: !5)
154
155...
156