1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 --amdhsa-code-object-version=2 -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=2 -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=2 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %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: AddrSpaceQual: Global
17 ; CHECK-NEXT: - Name: a
19 ; CHECK-NEXT: Align: 8
20 ; CHECK-NEXT: ValueKind: GlobalBuffer
21 ; CHECK-NEXT: AddrSpaceQual: Global
22 ; CHECK-NEXT: - Name: b
24 ; CHECK-NEXT: Align: 8
25 ; CHECK-NEXT: ValueKind: GlobalBuffer
26 ; CHECK-NEXT: AddrSpaceQual: Global
27 ; CHECK-NEXT: CodeProps:
28 define amdgpu_kernel void @test0(
29 half addrspace(1)* %r,
30 half addrspace(1)* %a,
31 half addrspace(1)* %b) {
33 %a.val = load half, half addrspace(1)* %a
34 %b.val = load half, half addrspace(1)* %b
35 %r.val = fadd half %a.val, %b.val
36 store half %r.val, half addrspace(1)* %r
40 ; CHECK: - Name: test8
41 ; CHECK: SymbolName: 'test8@kd'
43 ; CHECK-NEXT: - Name: r
45 ; CHECK-NEXT: Align: 8
46 ; CHECK-NEXT: ValueKind: GlobalBuffer
47 ; CHECK-NEXT: AddrSpaceQual: Global
48 ; CHECK-NEXT: - Name: a
50 ; CHECK-NEXT: Align: 8
51 ; CHECK-NEXT: ValueKind: GlobalBuffer
52 ; CHECK-NEXT: AddrSpaceQual: Global
53 ; CHECK-NEXT: - Name: b
55 ; CHECK-NEXT: Align: 8
56 ; CHECK-NEXT: ValueKind: GlobalBuffer
57 ; CHECK-NEXT: AddrSpaceQual: Global
58 ; CHECK-NEXT: - Size: 8
59 ; CHECK-NEXT: Align: 8
60 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
61 ; CHECK-NEXT: CodeProps:
62 define amdgpu_kernel void @test8(
63 half addrspace(1)* %r,
64 half addrspace(1)* %a,
65 half addrspace(1)* %b) #0 {
67 %a.val = load half, half addrspace(1)* %a
68 %b.val = load half, half addrspace(1)* %b
69 %r.val = fadd half %a.val, %b.val
70 store half %r.val, half addrspace(1)* %r
74 ; CHECK: - Name: test16
75 ; CHECK: SymbolName: 'test16@kd'
77 ; CHECK-NEXT: - Name: r
79 ; CHECK-NEXT: Align: 8
80 ; CHECK-NEXT: ValueKind: GlobalBuffer
81 ; CHECK-NEXT: AddrSpaceQual: Global
82 ; CHECK-NEXT: - Name: a
84 ; CHECK-NEXT: Align: 8
85 ; CHECK-NEXT: ValueKind: GlobalBuffer
86 ; CHECK-NEXT: AddrSpaceQual: Global
87 ; CHECK-NEXT: - Name: b
89 ; CHECK-NEXT: Align: 8
90 ; CHECK-NEXT: ValueKind: GlobalBuffer
91 ; CHECK-NEXT: AddrSpaceQual: Global
92 ; CHECK-NEXT: - Size: 8
93 ; CHECK-NEXT: Align: 8
94 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
95 ; CHECK-NEXT: - Size: 8
96 ; CHECK-NEXT: Align: 8
97 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
98 ; CHECK-NEXT: CodeProps:
99 define amdgpu_kernel void @test16(
100 half addrspace(1)* %r,
101 half addrspace(1)* %a,
102 half addrspace(1)* %b) #1 {
104 %a.val = load half, half addrspace(1)* %a
105 %b.val = load half, half addrspace(1)* %b
106 %r.val = fadd half %a.val, %b.val
107 store half %r.val, half addrspace(1)* %r
111 ; CHECK: - Name: test24
112 ; CHECK: SymbolName: 'test24@kd'
114 ; CHECK-NEXT: - Name: r
115 ; CHECK-NEXT: Size: 8
116 ; CHECK-NEXT: Align: 8
117 ; CHECK-NEXT: ValueKind: GlobalBuffer
118 ; CHECK-NEXT: AddrSpaceQual: Global
119 ; CHECK-NEXT: - Name: a
120 ; CHECK-NEXT: Size: 8
121 ; CHECK-NEXT: Align: 8
122 ; CHECK-NEXT: ValueKind: GlobalBuffer
123 ; CHECK-NEXT: AddrSpaceQual: Global
124 ; CHECK-NEXT: - Name: b
125 ; CHECK-NEXT: Size: 8
126 ; CHECK-NEXT: Align: 8
127 ; CHECK-NEXT: ValueKind: GlobalBuffer
128 ; CHECK-NEXT: AddrSpaceQual: Global
129 ; CHECK-NEXT: - Size: 8
130 ; CHECK-NEXT: Align: 8
131 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
132 ; CHECK-NEXT: - Size: 8
133 ; CHECK-NEXT: Align: 8
134 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
135 ; CHECK-NEXT: - Size: 8
136 ; CHECK-NEXT: Align: 8
137 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
138 ; CHECK-NEXT: CodeProps:
139 define amdgpu_kernel void @test24(
140 half addrspace(1)* %r,
141 half addrspace(1)* %a,
142 half addrspace(1)* %b) #2 {
144 %a.val = load half, half addrspace(1)* %a
145 %b.val = load half, half addrspace(1)* %b
146 %r.val = fadd half %a.val, %b.val
147 store half %r.val, half addrspace(1)* %r
151 ; CHECK: - Name: test32
152 ; CHECK: SymbolName: 'test32@kd'
154 ; CHECK-NEXT: - Name: r
155 ; CHECK-NEXT: Size: 8
156 ; CHECK-NEXT: Align: 8
157 ; CHECK-NEXT: ValueKind: GlobalBuffer
158 ; CHECK-NEXT: AddrSpaceQual: Global
159 ; CHECK-NEXT: - Name: a
160 ; CHECK-NEXT: Size: 8
161 ; CHECK-NEXT: Align: 8
162 ; CHECK-NEXT: ValueKind: GlobalBuffer
163 ; CHECK-NEXT: AddrSpaceQual: Global
164 ; CHECK-NEXT: - Name: b
165 ; CHECK-NEXT: Size: 8
166 ; CHECK-NEXT: Align: 8
167 ; CHECK-NEXT: ValueKind: GlobalBuffer
168 ; CHECK-NEXT: AddrSpaceQual: Global
169 ; CHECK-NEXT: - Size: 8
170 ; CHECK-NEXT: Align: 8
171 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
172 ; CHECK-NEXT: - Size: 8
173 ; CHECK-NEXT: Align: 8
174 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
175 ; CHECK-NEXT: - Size: 8
176 ; CHECK-NEXT: Align: 8
177 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
178 ; CHECK-NEXT: - Size: 8
179 ; CHECK-NEXT: Align: 8
180 ; CHECK-NEXT: ValueKind: HiddenNone
181 ; CHECK-NEXT: AddrSpaceQual: Global
182 ; CHECK-NEXT: CodeProps:
183 define amdgpu_kernel void @test32(
184 half addrspace(1)* %r,
185 half addrspace(1)* %a,
186 half addrspace(1)* %b) #3 {
188 %a.val = load half, half addrspace(1)* %a
189 %b.val = load half, half addrspace(1)* %b
190 %r.val = fadd half %a.val, %b.val
191 store half %r.val, half addrspace(1)* %r
195 ; CHECK: - Name: test48
196 ; CHECK: SymbolName: 'test48@kd'
198 ; CHECK-NEXT: - Name: r
199 ; CHECK-NEXT: Size: 8
200 ; CHECK-NEXT: Align: 8
201 ; CHECK-NEXT: ValueKind: GlobalBuffer
202 ; CHECK-NEXT: AddrSpaceQual: Global
203 ; CHECK-NEXT: - Name: a
204 ; CHECK-NEXT: Size: 8
205 ; CHECK-NEXT: Align: 8
206 ; CHECK-NEXT: ValueKind: GlobalBuffer
207 ; CHECK-NEXT: AddrSpaceQual: Global
208 ; CHECK-NEXT: - Name: b
209 ; CHECK-NEXT: Size: 8
210 ; CHECK-NEXT: Align: 8
211 ; CHECK-NEXT: ValueKind: GlobalBuffer
212 ; CHECK-NEXT: AddrSpaceQual: Global
213 ; CHECK-NEXT: - Size: 8
214 ; CHECK-NEXT: Align: 8
215 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
216 ; CHECK-NEXT: - Size: 8
217 ; CHECK-NEXT: Align: 8
218 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
219 ; CHECK-NEXT: - Size: 8
220 ; CHECK-NEXT: Align: 8
221 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
222 ; CHECK-NEXT: - Size: 8
223 ; CHECK-NEXT: Align: 8
224 ; CHECK-NEXT: ValueKind: HiddenNone
225 ; CHECK-NEXT: AddrSpaceQual: Global
226 ; CHECK-NEXT: - Size: 8
227 ; CHECK-NEXT: Align: 8
228 ; CHECK-NEXT: ValueKind: HiddenNone
229 ; CHECK-NEXT: AddrSpaceQual: Global
230 ; CHECK-NEXT: - Size: 8
231 ; CHECK-NEXT: Align: 8
232 ; CHECK-NEXT: ValueKind: HiddenNone
233 ; CHECK-NEXT: AddrSpaceQual: Global
234 ; CHECK-NEXT: CodeProps:
235 define amdgpu_kernel void @test48(
236 half addrspace(1)* %r,
237 half addrspace(1)* %a,
238 half addrspace(1)* %b) #4 {
240 %a.val = load half, half addrspace(1)* %a
241 %b.val = load half, half addrspace(1)* %b
242 %r.val = fadd half %a.val, %b.val
243 store half %r.val, half addrspace(1)* %r
247 ; CHECK: - Name: test56
248 ; CHECK: SymbolName: 'test56@kd'
250 ; CHECK-NEXT: - Name: r
251 ; CHECK-NEXT: Size: 8
252 ; CHECK-NEXT: Align: 8
253 ; CHECK-NEXT: ValueKind: GlobalBuffer
254 ; CHECK-NEXT: AddrSpaceQual: Global
255 ; CHECK-NEXT: - Name: a
256 ; CHECK-NEXT: Size: 8
257 ; CHECK-NEXT: Align: 8
258 ; CHECK-NEXT: ValueKind: GlobalBuffer
259 ; CHECK-NEXT: AddrSpaceQual: Global
260 ; CHECK-NEXT: - Name: b
261 ; CHECK-NEXT: Size: 8
262 ; CHECK-NEXT: Align: 8
263 ; CHECK-NEXT: ValueKind: GlobalBuffer
264 ; CHECK-NEXT: AddrSpaceQual: Global
265 ; CHECK-NEXT: - Size: 8
266 ; CHECK-NEXT: Align: 8
267 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
268 ; CHECK-NEXT: - Size: 8
269 ; CHECK-NEXT: Align: 8
270 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetY
271 ; CHECK-NEXT: - Size: 8
272 ; CHECK-NEXT: Align: 8
273 ; CHECK-NEXT: ValueKind: HiddenGlobalOffsetZ
274 ; CHECK-NEXT: - Size: 8
275 ; CHECK-NEXT: Align: 8
276 ; CHECK-NEXT: ValueKind: HiddenNone
277 ; CHECK-NEXT: AddrSpaceQual: Global
278 ; CHECK-NEXT: - Size: 8
279 ; CHECK-NEXT: Align: 8
280 ; CHECK-NEXT: ValueKind: HiddenNone
281 ; CHECK-NEXT: AddrSpaceQual: Global
282 ; CHECK-NEXT: - Size: 8
283 ; CHECK-NEXT: Align: 8
284 ; CHECK-NEXT: ValueKind: HiddenNone
285 ; CHECK-NEXT: AddrSpaceQual: Global
286 ; CHECK-NEXT: - Size: 8
287 ; CHECK-NEXT: Align: 8
288 ; CHECK-NEXT: ValueKind: HiddenMultiGridSyncArg
289 ; CHECK-NEXT: AddrSpaceQual: Global
290 ; CHECK-NEXT: CodeProps:
291 define amdgpu_kernel void @test56(
292 half addrspace(1)* %r,
293 half addrspace(1)* %a,
294 half addrspace(1)* %b) #5 {
296 %a.val = load half, half addrspace(1)* %a
297 %b.val = load half, half addrspace(1)* %b
298 %r.val = fadd half %a.val, %b.val
299 store half %r.val, half addrspace(1)* %r
303 attributes #0 = { "amdgpu-implicitarg-num-bytes"="8" }
304 attributes #1 = { "amdgpu-implicitarg-num-bytes"="16" }
305 attributes #2 = { "amdgpu-implicitarg-num-bytes"="24" }
306 attributes #3 = { "amdgpu-implicitarg-num-bytes"="32" }
307 attributes #4 = { "amdgpu-implicitarg-num-bytes"="48" }
308 attributes #5 = { "amdgpu-implicitarg-num-bytes"="56" }