[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / hsa-metadata-hidden-args-v3.ll
blob1105caf980ef4c5526506e5dd40423ab8b434a7c
1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
5 ; CHECK:              ---
6 ; CHECK:      amdhsa.kernels:
8 ; CHECK:        - .args:
9 ; CHECK-NEXT:       - .address_space:  global
10 ; CHECK-NEXT:         .name:           r
11 ; CHECK-NEXT:         .offset:         0
12 ; CHECK-NEXT:         .size:           8
13 ; CHECK-NEXT:         .value_kind:     global_buffer
14 ; CHECK-NEXT:       - .address_space:  global
15 ; CHECK-NEXT:         .name:           a
16 ; CHECK-NEXT:         .offset:         8
17 ; CHECK-NEXT:         .size:           8
18 ; CHECK-NEXT:         .value_kind:     global_buffer
19 ; CHECK-NEXT:       - .address_space:  global
20 ; CHECK-NEXT:         .name:           b
21 ; CHECK-NEXT:         .offset:         16
22 ; CHECK-NEXT:         .size:           8
23 ; CHECK-NEXT:         .value_kind:     global_buffer
24 ; CHECK:          .name:           test0
25 ; CHECK:          .symbol:         test0.kd
26 define amdgpu_kernel void @test0(
27     half addrspace(1)* %r,
28     half addrspace(1)* %a,
29     half addrspace(1)* %b) {
30 entry:
31   %a.val = load half, half addrspace(1)* %a
32   %b.val = load half, half addrspace(1)* %b
33   %r.val = fadd half %a.val, %b.val
34   store half %r.val, half addrspace(1)* %r
35   ret void
38 ; CHECK:        - .args:
39 ; CHECK-NEXT:       - .address_space:  global
40 ; CHECK-NEXT:         .name:           r
41 ; CHECK-NEXT:         .offset:         0
42 ; CHECK-NEXT:         .size:           8
43 ; CHECK-NEXT:         .value_kind:     global_buffer
44 ; CHECK-NEXT:       - .address_space:  global
45 ; CHECK-NEXT:         .name:           a
46 ; CHECK-NEXT:         .offset:         8
47 ; CHECK-NEXT:         .size:           8
48 ; CHECK-NEXT:         .value_kind:     global_buffer
49 ; CHECK-NEXT:       - .address_space:  global
50 ; CHECK-NEXT:         .name:           b
51 ; CHECK-NEXT:         .offset:         16
52 ; CHECK-NEXT:         .size:           8
53 ; CHECK-NEXT:         .value_kind:     global_buffer
54 ; CHECK-NEXT:       - .offset:         24
55 ; CHECK-NEXT:         .size:           8
56 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
57 ; CHECK:          .name:           test8
58 ; CHECK:          .symbol:         test8.kd
59 define amdgpu_kernel void @test8(
60     half addrspace(1)* %r,
61     half addrspace(1)* %a,
62     half addrspace(1)* %b) #0 {
63 entry:
64   %a.val = load half, half addrspace(1)* %a
65   %b.val = load half, half addrspace(1)* %b
66   %r.val = fadd half %a.val, %b.val
67   store half %r.val, half addrspace(1)* %r
68   ret void
71 ; CHECK:        - .args:
72 ; CHECK-NEXT:       - .address_space:  global
73 ; CHECK-NEXT:         .name:           r
74 ; CHECK-NEXT:         .offset:         0
75 ; CHECK-NEXT:         .size:           8
76 ; CHECK-NEXT:         .value_kind:     global_buffer
77 ; CHECK-NEXT:       - .address_space:  global
78 ; CHECK-NEXT:         .name:           a
79 ; CHECK-NEXT:         .offset:         8
80 ; CHECK-NEXT:         .size:           8
81 ; CHECK-NEXT:         .value_kind:     global_buffer
82 ; CHECK-NEXT:       - .address_space:  global
83 ; CHECK-NEXT:         .name:           b
84 ; CHECK-NEXT:         .offset:         16
85 ; CHECK-NEXT:         .size:           8
86 ; CHECK-NEXT:         .value_kind:     global_buffer
87 ; CHECK-NEXT:       - .offset:         24
88 ; CHECK-NEXT:         .size:           8
89 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
90 ; CHECK-NEXT:       - .offset:         32
91 ; CHECK-NEXT:         .size:           8
92 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_y
93 ; CHECK:          .name:           test16
94 ; CHECK:          .symbol:         test16.kd
95 define amdgpu_kernel void @test16(
96     half addrspace(1)* %r,
97     half addrspace(1)* %a,
98     half addrspace(1)* %b) #1 {
99 entry:
100   %a.val = load half, half addrspace(1)* %a
101   %b.val = load half, half addrspace(1)* %b
102   %r.val = fadd half %a.val, %b.val
103   store half %r.val, half addrspace(1)* %r
104   ret void
107 ; CHECK:        - .args:
108 ; CHECK-NEXT:       - .address_space:  global
109 ; CHECK-NEXT:         .name:           r
110 ; CHECK-NEXT:         .offset:         0
111 ; CHECK-NEXT:         .size:           8
112 ; CHECK-NEXT:         .value_kind:     global_buffer
113 ; CHECK-NEXT:       - .address_space:  global
114 ; CHECK-NEXT:         .name:           a
115 ; CHECK-NEXT:         .offset:         8
116 ; CHECK-NEXT:         .size:           8
117 ; CHECK-NEXT:         .value_kind:     global_buffer
118 ; CHECK-NEXT:       - .address_space:  global
119 ; CHECK-NEXT:         .name:           b
120 ; CHECK-NEXT:         .offset:         16
121 ; CHECK-NEXT:         .size:           8
122 ; CHECK-NEXT:         .value_kind:     global_buffer
123 ; CHECK-NEXT:       - .offset:         24
124 ; CHECK-NEXT:         .size:           8
125 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
126 ; CHECK-NEXT:       - .offset:         32
127 ; CHECK-NEXT:         .size:           8
128 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_y
129 ; CHECK-NEXT:       - .offset:         40
130 ; CHECK-NEXT:         .size:           8
131 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_z
132 ; CHECK:          .name:           test24
133 ; CHECK:          .symbol:         test24.kd
134 define amdgpu_kernel void @test24(
135     half addrspace(1)* %r,
136     half addrspace(1)* %a,
137     half addrspace(1)* %b) #2 {
138 entry:
139   %a.val = load half, half addrspace(1)* %a
140   %b.val = load half, half addrspace(1)* %b
141   %r.val = fadd half %a.val, %b.val
142   store half %r.val, half addrspace(1)* %r
143   ret void
146 ; CHECK:        - .args:
147 ; CHECK-NEXT:       - .address_space:  global
148 ; CHECK-NEXT:         .name:           r
149 ; CHECK-NEXT:         .offset:         0
150 ; CHECK-NEXT:         .size:           8
151 ; CHECK-NEXT:         .value_kind:     global_buffer
152 ; CHECK-NEXT:       - .address_space:  global
153 ; CHECK-NEXT:         .name:           a
154 ; CHECK-NEXT:         .offset:         8
155 ; CHECK-NEXT:         .size:           8
156 ; CHECK-NEXT:         .value_kind:     global_buffer
157 ; CHECK-NEXT:       - .address_space:  global
158 ; CHECK-NEXT:         .name:           b
159 ; CHECK-NEXT:         .offset:         16
160 ; CHECK-NEXT:         .size:           8
161 ; CHECK-NEXT:         .value_kind:     global_buffer
162 ; CHECK-NEXT:       - .offset:         24
163 ; CHECK-NEXT:         .size:           8
164 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
165 ; CHECK-NEXT:       - .offset:         32
166 ; CHECK-NEXT:         .size:           8
167 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_y
168 ; CHECK-NEXT:       - .offset:         40
169 ; CHECK-NEXT:         .size:           8
170 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_z
171 ; CHECK-NEXT:       - .address_space:  global
172 ; CHECK-NEXT:         .offset:         48
173 ; CHECK-NEXT:         .size:           8
174 ; CHECK-NEXT:         .value_kind:     hidden_none
175 ; CHECK:          .name:           test32
176 ; CHECK:          .symbol:         test32.kd
177 define amdgpu_kernel void @test32(
178     half addrspace(1)* %r,
179     half addrspace(1)* %a,
180     half addrspace(1)* %b) #3 {
181 entry:
182   %a.val = load half, half addrspace(1)* %a
183   %b.val = load half, half addrspace(1)* %b
184   %r.val = fadd half %a.val, %b.val
185   store half %r.val, half addrspace(1)* %r
186   ret void
189 ; CHECK:        - .args:
190 ; CHECK-NEXT:       - .address_space:  global
191 ; CHECK-NEXT:         .name:           r
192 ; CHECK-NEXT:         .offset:         0
193 ; CHECK-NEXT:         .size:           8
194 ; CHECK-NEXT:         .value_kind:     global_buffer
195 ; CHECK-NEXT:       - .address_space:  global
196 ; CHECK-NEXT:         .name:           a
197 ; CHECK-NEXT:         .offset:         8
198 ; CHECK-NEXT:         .size:           8
199 ; CHECK-NEXT:         .value_kind:     global_buffer
200 ; CHECK-NEXT:       - .address_space:  global
201 ; CHECK-NEXT:         .name:           b
202 ; CHECK-NEXT:         .offset:         16
203 ; CHECK-NEXT:         .size:           8
204 ; CHECK-NEXT:         .value_kind:     global_buffer
205 ; CHECK-NEXT:       - .offset:         24
206 ; CHECK-NEXT:         .size:           8
207 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
208 ; CHECK-NEXT:       - .offset:         32
209 ; CHECK-NEXT:         .size:           8
210 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_y
211 ; CHECK-NEXT:       - .offset:         40
212 ; CHECK-NEXT:         .size:           8
213 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_z
214 ; CHECK-NEXT:       - .address_space:  global
215 ; CHECK-NEXT:         .offset:         48
216 ; CHECK-NEXT:         .size:           8
217 ; CHECK-NEXT:         .value_kind:     hidden_none
218 ; CHECK-NEXT:       - .address_space:  global
219 ; CHECK-NEXT:         .offset:         56
220 ; CHECK-NEXT:         .size:           8
221 ; CHECK-NEXT:         .value_kind:     hidden_none
222 ; CHECK-NEXT:       - .address_space:  global
223 ; CHECK-NEXT:         .offset:         64
224 ; CHECK-NEXT:         .size:           8
225 ; CHECK-NEXT:         .value_kind:     hidden_none
226 ; CHECK:          .name:           test48
227 ; CHECK:          .symbol:         test48.kd
228 define amdgpu_kernel void @test48(
229     half addrspace(1)* %r,
230     half addrspace(1)* %a,
231     half addrspace(1)* %b) #4 {
232 entry:
233   %a.val = load half, half addrspace(1)* %a
234   %b.val = load half, half addrspace(1)* %b
235   %r.val = fadd half %a.val, %b.val
236   store half %r.val, half addrspace(1)* %r
237   ret void
240 ; CHECK:        - .args:
241 ; CHECK-NEXT:       - .address_space:  global
242 ; CHECK-NEXT:         .name:           r
243 ; CHECK-NEXT:         .offset:         0
244 ; CHECK-NEXT:         .size:           8
245 ; CHECK-NEXT:         .value_kind:     global_buffer
246 ; CHECK-NEXT:       - .address_space:  global
247 ; CHECK-NEXT:         .name:           a
248 ; CHECK-NEXT:         .offset:         8
249 ; CHECK-NEXT:         .size:           8
250 ; CHECK-NEXT:         .value_kind:     global_buffer
251 ; CHECK-NEXT:       - .address_space:  global
252 ; CHECK-NEXT:         .name:           b
253 ; CHECK-NEXT:         .offset:         16
254 ; CHECK-NEXT:         .size:           8
255 ; CHECK-NEXT:         .value_kind:     global_buffer
256 ; CHECK-NEXT:       - .offset:         24
257 ; CHECK-NEXT:         .size:           8
258 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_x
259 ; CHECK-NEXT:       - .offset:         32
260 ; CHECK-NEXT:         .size:           8
261 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_y
262 ; CHECK-NEXT:       - .offset:         40
263 ; CHECK-NEXT:         .size:           8
264 ; CHECK-NEXT:         .value_kind:     hidden_global_offset_z
265 ; CHECK-NEXT:       - .address_space:  global
266 ; CHECK-NEXT:         .offset:         48
267 ; CHECK-NEXT:         .size:           8
268 ; CHECK-NEXT:         .value_kind:     hidden_none
269 ; CHECK-NEXT:       - .address_space:  global
270 ; CHECK-NEXT:         .offset:         56
271 ; CHECK-NEXT:         .size:           8
272 ; CHECK-NEXT:         .value_kind:     hidden_none
273 ; CHECK-NEXT:       - .address_space:  global
274 ; CHECK-NEXT:         .offset:         64
275 ; CHECK-NEXT:         .size:           8
276 ; CHECK-NEXT:         .value_kind:     hidden_none
277 ; CHECK-NEXT:       - .address_space:  global
278 ; CHECK-NEXT:         .offset:         72
279 ; CHECK-NEXT:         .size:           8
280 ; CHECK-NEXT:         .value_kind:     hidden_multigrid_sync_arg
281 ; CHECK:          .name:           test56
282 ; CHECK:          .symbol:         test56.kd
283 define amdgpu_kernel void @test56(
284     half addrspace(1)* %r,
285     half addrspace(1)* %a,
286     half addrspace(1)* %b) #5 {
287 entry:
288   %a.val = load half, half addrspace(1)* %a
289   %b.val = load half, half addrspace(1)* %b
290   %r.val = fadd half %a.val, %b.val
291   store half %r.val, half addrspace(1)* %r
292   ret void
295 ; CHECK:  amdhsa.version:
296 ; CHECK-NEXT: - 1
297 ; CHECK-NEXT: - 0
299 attributes #0 = { "amdgpu-implicitarg-num-bytes"="8" }
300 attributes #1 = { "amdgpu-implicitarg-num-bytes"="16" }
301 attributes #2 = { "amdgpu-implicitarg-num-bytes"="24" }
302 attributes #3 = { "amdgpu-implicitarg-num-bytes"="32" }
303 attributes #4 = { "amdgpu-implicitarg-num-bytes"="48" }
304 attributes #5 = { "amdgpu-implicitarg-num-bytes"="56" }