1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -mattr=-code-object-v3 -filetype=obj -o - < %s | llvm-readelf --notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -mattr=-code-object-v3 -filetype=obj -o - < %s | llvm-readelf --notes | FileCheck --check-prefix=CHECK --check-prefix=GFX803 --check-prefix=NOTES %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=-code-object-v3 -filetype=obj -o - < %s | llvm-readelf --notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
6 ; CHECK: Version: [ 1, 0 ]
10 ; CHECK: SymbolName: 'test0@kd'
12 ; CHECK-NEXT: - Name: r
14 ; CHECK-NEXT: Align: 8
15 ; CHECK-NEXT: ValueKind: GlobalBuffer
16 ; CHECK-NEXT: ValueType: F16
17 ; CHECK-NEXT: AddrSpaceQual: Global
18 ; CHECK-NEXT: - Name: a
20 ; CHECK-NEXT: Align: 8
21 ; CHECK-NEXT: ValueKind: GlobalBuffer
22 ; CHECK-NEXT: ValueType: F16
23 ; CHECK-NEXT: AddrSpaceQual: Global
24 ; CHECK-NEXT: - Name: b
26 ; CHECK-NEXT: Align: 8
27 ; CHECK-NEXT: ValueKind: GlobalBuffer
28 ; CHECK-NEXT: ValueType: F16
29 ; CHECK-NEXT: AddrSpaceQual: Global
30 ; CHECK-NEXT: CodeProps:
31 define amdgpu_kernel void @test0(
32 half addrspace(1)* %r,
33 half addrspace(1)* %a,
34 half addrspace(1)* %b) {
36 %a.val = load half, half addrspace(1)* %a
37 %b.val = load half, half addrspace(1)* %b
38 %r.val = fadd half %a.val, %b.val
39 store half %r.val, half addrspace(1)* %r
43 ; CHECK: - Name: test8
44 ; CHECK: SymbolName: 'test8@kd'
46 ; CHECK-NEXT: - Name: r
48 ; CHECK-NEXT: Align: 8
49 ; CHECK-NEXT: ValueKind: GlobalBuffer
50 ; CHECK-NEXT: ValueType: F16
51 ; CHECK-NEXT: AddrSpaceQual: Global
52 ; CHECK-NEXT: - Name: a
54 ; CHECK-NEXT: Align: 8
55 ; CHECK-NEXT: ValueKind: GlobalBuffer
56 ; CHECK-NEXT: ValueType: F16
57 ; CHECK-NEXT: AddrSpaceQual: Global
58 ; CHECK-NEXT: - Name: b
60 ; CHECK-NEXT: Align: 8
61 ; CHECK-NEXT: ValueKind: GlobalBuffer
62 ; CHECK-NEXT: ValueType: F16
63 ; CHECK-NEXT: AddrSpaceQual: Global
64 ; CHECK-NEXT: - Size: 8
65 ; CHECK-NEXT: Align: 8
66 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
67 ; CHECK-NEXT: ValueType: I64
68 ; CHECK-NEXT: CodeProps:
69 define amdgpu_kernel void @test8(
70 half addrspace(1)* %r,
71 half addrspace(1)* %a,
72 half addrspace(1)* %b) #0 {
74 %a.val = load half, half addrspace(1)* %a
75 %b.val = load half, half addrspace(1)* %b
76 %r.val = fadd half %a.val, %b.val
77 store half %r.val, half addrspace(1)* %r
81 ; CHECK: - Name: test16
82 ; CHECK: SymbolName: 'test16@kd'
84 ; CHECK-NEXT: - Name: r
86 ; CHECK-NEXT: Align: 8
87 ; CHECK-NEXT: ValueKind: GlobalBuffer
88 ; CHECK-NEXT: ValueType: F16
89 ; CHECK-NEXT: AddrSpaceQual: Global
90 ; CHECK-NEXT: - Name: a
92 ; CHECK-NEXT: Align: 8
93 ; CHECK-NEXT: ValueKind: GlobalBuffer
94 ; CHECK-NEXT: ValueType: F16
95 ; CHECK-NEXT: AddrSpaceQual: Global
96 ; CHECK-NEXT: - Name: b
98 ; CHECK-NEXT: Align: 8
99 ; CHECK-NEXT: ValueKind: GlobalBuffer
100 ; CHECK-NEXT: ValueType: F16
101 ; CHECK-NEXT: AddrSpaceQual: Global
102 ; CHECK-NEXT: - Size: 8
103 ; CHECK-NEXT: Align: 8
104 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
105 ; CHECK-NEXT: ValueType: I64
106 ; CHECK-NEXT: - Size: 8
107 ; CHECK-NEXT: Align: 8
108 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
109 ; CHECK-NEXT: ValueType: I64
110 ; CHECK-NEXT: CodeProps:
111 define amdgpu_kernel void @test16(
112 half addrspace(1)* %r,
113 half addrspace(1)* %a,
114 half addrspace(1)* %b) #1 {
116 %a.val = load half, half addrspace(1)* %a
117 %b.val = load half, half addrspace(1)* %b
118 %r.val = fadd half %a.val, %b.val
119 store half %r.val, half addrspace(1)* %r
123 ; CHECK: - Name: test24
124 ; CHECK: SymbolName: 'test24@kd'
126 ; CHECK-NEXT: - Name: r
127 ; CHECK-NEXT: Size: 8
128 ; CHECK-NEXT: Align: 8
129 ; CHECK-NEXT: ValueKind: GlobalBuffer
130 ; CHECK-NEXT: ValueType: F16
131 ; CHECK-NEXT: AddrSpaceQual: Global
132 ; CHECK-NEXT: - Name: a
133 ; CHECK-NEXT: Size: 8
134 ; CHECK-NEXT: Align: 8
135 ; CHECK-NEXT: ValueKind: GlobalBuffer
136 ; CHECK-NEXT: ValueType: F16
137 ; CHECK-NEXT: AddrSpaceQual: Global
138 ; CHECK-NEXT: - Name: b
139 ; CHECK-NEXT: Size: 8
140 ; CHECK-NEXT: Align: 8
141 ; CHECK-NEXT: ValueKind: GlobalBuffer
142 ; CHECK-NEXT: ValueType: F16
143 ; CHECK-NEXT: AddrSpaceQual: Global
144 ; CHECK-NEXT: - Size: 8
145 ; CHECK-NEXT: Align: 8
146 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
147 ; CHECK-NEXT: ValueType: I64
148 ; CHECK-NEXT: - Size: 8
149 ; CHECK-NEXT: Align: 8
150 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
151 ; CHECK-NEXT: ValueType: I64
152 ; CHECK-NEXT: - Size: 8
153 ; CHECK-NEXT: Align: 8
154 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
155 ; CHECK-NEXT: ValueType: I64
156 ; CHECK-NEXT: CodeProps:
157 define amdgpu_kernel void @test24(
158 half addrspace(1)* %r,
159 half addrspace(1)* %a,
160 half addrspace(1)* %b) #2 {
162 %a.val = load half, half addrspace(1)* %a
163 %b.val = load half, half addrspace(1)* %b
164 %r.val = fadd half %a.val, %b.val
165 store half %r.val, half addrspace(1)* %r
169 ; CHECK: - Name: test32
170 ; CHECK: SymbolName: 'test32@kd'
172 ; CHECK-NEXT: - Name: r
173 ; CHECK-NEXT: Size: 8
174 ; CHECK-NEXT: Align: 8
175 ; CHECK-NEXT: ValueKind: GlobalBuffer
176 ; CHECK-NEXT: ValueType: F16
177 ; CHECK-NEXT: AddrSpaceQual: Global
178 ; CHECK-NEXT: - Name: a
179 ; CHECK-NEXT: Size: 8
180 ; CHECK-NEXT: Align: 8
181 ; CHECK-NEXT: ValueKind: GlobalBuffer
182 ; CHECK-NEXT: ValueType: F16
183 ; CHECK-NEXT: AddrSpaceQual: Global
184 ; CHECK-NEXT: - Name: b
185 ; CHECK-NEXT: Size: 8
186 ; CHECK-NEXT: Align: 8
187 ; CHECK-NEXT: ValueKind: GlobalBuffer
188 ; CHECK-NEXT: ValueType: F16
189 ; CHECK-NEXT: AddrSpaceQual: Global
190 ; CHECK-NEXT: - Size: 8
191 ; CHECK-NEXT: Align: 8
192 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
193 ; CHECK-NEXT: ValueType: I64
194 ; CHECK-NEXT: - Size: 8
195 ; CHECK-NEXT: Align: 8
196 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
197 ; CHECK-NEXT: ValueType: I64
198 ; CHECK-NEXT: - Size: 8
199 ; CHECK-NEXT: Align: 8
200 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
201 ; CHECK-NEXT: ValueType: I64
202 ; CHECK-NEXT: - Size: 8
203 ; CHECK-NEXT: Align: 8
204 ; CHECK-NEXT: ValueKind: HiddenNone
205 ; CHECK-NEXT: ValueType: I8
206 ; CHECK-NEXT: AddrSpaceQual: Global
207 ; CHECK-NEXT: CodeProps:
208 define amdgpu_kernel void @test32(
209 half addrspace(1)* %r,
210 half addrspace(1)* %a,
211 half addrspace(1)* %b) #3 {
213 %a.val = load half, half addrspace(1)* %a
214 %b.val = load half, half addrspace(1)* %b
215 %r.val = fadd half %a.val, %b.val
216 store half %r.val, half addrspace(1)* %r
220 ; CHECK: - Name: test48
221 ; CHECK: SymbolName: 'test48@kd'
223 ; CHECK-NEXT: - Name: r
224 ; CHECK-NEXT: Size: 8
225 ; CHECK-NEXT: Align: 8
226 ; CHECK-NEXT: ValueKind: GlobalBuffer
227 ; CHECK-NEXT: ValueType: F16
228 ; CHECK-NEXT: AddrSpaceQual: Global
229 ; CHECK-NEXT: - Name: a
230 ; CHECK-NEXT: Size: 8
231 ; CHECK-NEXT: Align: 8
232 ; CHECK-NEXT: ValueKind: GlobalBuffer
233 ; CHECK-NEXT: ValueType: F16
234 ; CHECK-NEXT: AddrSpaceQual: Global
235 ; CHECK-NEXT: - Name: b
236 ; CHECK-NEXT: Size: 8
237 ; CHECK-NEXT: Align: 8
238 ; CHECK-NEXT: ValueKind: GlobalBuffer
239 ; CHECK-NEXT: ValueType: F16
240 ; CHECK-NEXT: AddrSpaceQual: Global
241 ; CHECK-NEXT: - Size: 8
242 ; CHECK-NEXT: Align: 8
243 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
244 ; CHECK-NEXT: ValueType: I64
245 ; CHECK-NEXT: - Size: 8
246 ; CHECK-NEXT: Align: 8
247 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
248 ; CHECK-NEXT: ValueType: I64
249 ; CHECK-NEXT: - Size: 8
250 ; CHECK-NEXT: Align: 8
251 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
252 ; CHECK-NEXT: ValueType: I64
253 ; CHECK-NEXT: - Size: 8
254 ; CHECK-NEXT: Align: 8
255 ; CHECK-NEXT: ValueKind: HiddenNone
256 ; CHECK-NEXT: ValueType: I8
257 ; CHECK-NEXT: AddrSpaceQual: Global
258 ; CHECK-NEXT: - Size: 8
259 ; CHECK-NEXT: Align: 8
260 ; CHECK-NEXT: ValueKind: HiddenNone
261 ; CHECK-NEXT: ValueType: I8
262 ; CHECK-NEXT: AddrSpaceQual: Global
263 ; CHECK-NEXT: - Size: 8
264 ; CHECK-NEXT: Align: 8
265 ; CHECK-NEXT: ValueKind: HiddenNone
266 ; CHECK-NEXT: ValueType: I8
267 ; CHECK-NEXT: AddrSpaceQual: Global
268 ; CHECK-NEXT: CodeProps:
269 define amdgpu_kernel void @test48(
270 half addrspace(1)* %r,
271 half addrspace(1)* %a,
272 half addrspace(1)* %b) #4 {
274 %a.val = load half, half addrspace(1)* %a
275 %b.val = load half, half addrspace(1)* %b
276 %r.val = fadd half %a.val, %b.val
277 store half %r.val, half addrspace(1)* %r
281 ; CHECK: - Name: test56
282 ; CHECK: SymbolName: 'test56@kd'
284 ; CHECK-NEXT: - Name: r
285 ; CHECK-NEXT: Size: 8
286 ; CHECK-NEXT: Align: 8
287 ; CHECK-NEXT: ValueKind: GlobalBuffer
288 ; CHECK-NEXT: ValueType: F16
289 ; CHECK-NEXT: AddrSpaceQual: Global
290 ; CHECK-NEXT: - Name: a
291 ; CHECK-NEXT: Size: 8
292 ; CHECK-NEXT: Align: 8
293 ; CHECK-NEXT: ValueKind: GlobalBuffer
294 ; CHECK-NEXT: ValueType: F16
295 ; CHECK-NEXT: AddrSpaceQual: Global
296 ; CHECK-NEXT: - Name: b
297 ; CHECK-NEXT: Size: 8
298 ; CHECK-NEXT: Align: 8
299 ; CHECK-NEXT: ValueKind: GlobalBuffer
300 ; CHECK-NEXT: ValueType: F16
301 ; CHECK-NEXT: AddrSpaceQual: Global
302 ; CHECK-NEXT: - Size: 8
303 ; CHECK-NEXT: Align: 8
304 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
305 ; CHECK-NEXT: ValueType: I64
306 ; CHECK-NEXT: - Size: 8
307 ; CHECK-NEXT: Align: 8
308 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
309 ; CHECK-NEXT: ValueType: I64
310 ; CHECK-NEXT: - Size: 8
311 ; CHECK-NEXT: Align: 8
312 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
313 ; CHECK-NEXT: ValueType: I64
314 ; CHECK-NEXT: - Size: 8
315 ; CHECK-NEXT: Align: 8
316 ; CHECK-NEXT: ValueKind: HiddenNone
317 ; CHECK-NEXT: ValueType: I8
318 ; CHECK-NEXT: AddrSpaceQual: Global
319 ; CHECK-NEXT: - Size: 8
320 ; CHECK-NEXT: Align: 8
321 ; CHECK-NEXT: ValueKind: HiddenNone
322 ; CHECK-NEXT: ValueType: I8
323 ; CHECK-NEXT: AddrSpaceQual: Global
324 ; CHECK-NEXT: - Size: 8
325 ; CHECK-NEXT: Align: 8
326 ; CHECK-NEXT: ValueKind: HiddenNone
327 ; CHECK-NEXT: ValueType: I8
328 ; CHECK-NEXT: AddrSpaceQual: Global
329 ; CHECK-NEXT: - Size: 8
330 ; CHECK-NEXT: Align: 8
331 ; CHECK-NEXT: ValueKind: HiddenMultiGridSyncArg
332 ; CHECK-NEXT: ValueType: I8
333 ; CHECK-NEXT: AddrSpaceQual: Global
334 ; CHECK-NEXT: CodeProps:
335 define amdgpu_kernel void @test56(
336 half addrspace(1)* %r,
337 half addrspace(1)* %a,
338 half addrspace(1)* %b) #5 {
340 %a.val = load half, half addrspace(1)* %a
341 %b.val = load half, half addrspace(1)* %b
342 %r.val = fadd half %a.val, %b.val
343 store half %r.val, half addrspace(1)* %r
347 attributes #0 = { "amdgpu-implicitarg-num-bytes"="8" }
348 attributes #1 = { "amdgpu-implicitarg-num-bytes"="16" }
349 attributes #2 = { "amdgpu-implicitarg-num-bytes"="24" }
350 attributes #3 = { "amdgpu-implicitarg-num-bytes"="32" }
351 attributes #4 = { "amdgpu-implicitarg-num-bytes"="48" }
352 attributes #5 = { "amdgpu-implicitarg-num-bytes"="56" }