Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / annotate-kernel-features-hsa-call.ll
blob3d4ae84d9c698e44ed088ed5799f28e4f3b8d569
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2 ; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-annotate-kernel-features < %s | FileCheck -check-prefixes=AKF_HSA %s
3 ; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=ATTRIBUTOR_HSA %s
5 ; TODO: The test contains UB which is refined by the Attributor and should be removed.
7 declare i32 @llvm.amdgcn.workgroup.id.x() #0
8 declare i32 @llvm.amdgcn.workgroup.id.y() #0
9 declare i32 @llvm.amdgcn.workgroup.id.z() #0
11 declare i32 @llvm.amdgcn.workitem.id.x() #0
12 declare i32 @llvm.amdgcn.workitem.id.y() #0
13 declare i32 @llvm.amdgcn.workitem.id.z() #0
15 declare ptr addrspace(4) @llvm.amdgcn.dispatch.ptr() #0
16 declare ptr addrspace(4) @llvm.amdgcn.queue.ptr() #0
17 declare ptr addrspace(4) @llvm.amdgcn.kernarg.segment.ptr() #0
18 declare ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #0
19 declare i64 @llvm.amdgcn.dispatch.id() #0
21 define void @use_workitem_id_x() #1 {
22 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workitem_id_x
23 ; AKF_HSA-SAME: () #[[ATTR1:[0-9]+]] {
24 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.x()
25 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
26 ; AKF_HSA-NEXT:    ret void
28 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workitem_id_x
29 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR1:[0-9]+]] {
30 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.x()
31 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
32 ; ATTRIBUTOR_HSA-NEXT:    ret void
34   %val = call i32 @llvm.amdgcn.workitem.id.x()
35   store volatile i32 %val, ptr addrspace(1) undef
36   ret void
39 define void @use_workitem_id_y() #1 {
40 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workitem_id_y
41 ; AKF_HSA-SAME: () #[[ATTR1]] {
42 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.y()
43 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
44 ; AKF_HSA-NEXT:    ret void
46 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workitem_id_y
47 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR2:[0-9]+]] {
48 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.y()
49 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
50 ; ATTRIBUTOR_HSA-NEXT:    ret void
52   %val = call i32 @llvm.amdgcn.workitem.id.y()
53   store volatile i32 %val, ptr addrspace(1) undef
54   ret void
57 define void @use_workitem_id_z() #1 {
58 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workitem_id_z
59 ; AKF_HSA-SAME: () #[[ATTR1]] {
60 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.z()
61 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
62 ; AKF_HSA-NEXT:    ret void
64 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workitem_id_z
65 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR3:[0-9]+]] {
66 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.z()
67 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
68 ; ATTRIBUTOR_HSA-NEXT:    ret void
70   %val = call i32 @llvm.amdgcn.workitem.id.z()
71   store volatile i32 %val, ptr addrspace(1) undef
72   ret void
75 define void @use_workgroup_id_x() #1 {
76 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_x
77 ; AKF_HSA-SAME: () #[[ATTR1]] {
78 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.x()
79 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
80 ; AKF_HSA-NEXT:    ret void
82 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_x
83 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR4:[0-9]+]] {
84 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.x()
85 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
86 ; ATTRIBUTOR_HSA-NEXT:    ret void
88   %val = call i32 @llvm.amdgcn.workgroup.id.x()
89   store volatile i32 %val, ptr addrspace(1) undef
90   ret void
93 define void @use_workgroup_id_y() #1 {
94 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_y
95 ; AKF_HSA-SAME: () #[[ATTR1]] {
96 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.y()
97 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
98 ; AKF_HSA-NEXT:    ret void
100 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_y
101 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR5:[0-9]+]] {
102 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.y()
103 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
104 ; ATTRIBUTOR_HSA-NEXT:    ret void
106   %val = call i32 @llvm.amdgcn.workgroup.id.y()
107   store volatile i32 %val, ptr addrspace(1) undef
108   ret void
111 define void @use_workgroup_id_z() #1 {
112 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_z
113 ; AKF_HSA-SAME: () #[[ATTR1]] {
114 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.z()
115 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
116 ; AKF_HSA-NEXT:    ret void
118 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_z
119 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR6:[0-9]+]] {
120 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workgroup.id.z()
121 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
122 ; ATTRIBUTOR_HSA-NEXT:    ret void
124   %val = call i32 @llvm.amdgcn.workgroup.id.z()
125   store volatile i32 %val, ptr addrspace(1) undef
126   ret void
129 define void @use_dispatch_ptr() #1 {
130 ; AKF_HSA-LABEL: define {{[^@]+}}@use_dispatch_ptr
131 ; AKF_HSA-SAME: () #[[ATTR1]] {
132 ; AKF_HSA-NEXT:    [[DISPATCH_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
133 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[DISPATCH_PTR]], ptr addrspace(1) undef, align 8
134 ; AKF_HSA-NEXT:    ret void
136 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_dispatch_ptr
137 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR7:[0-9]+]] {
138 ; ATTRIBUTOR_HSA-NEXT:    [[DISPATCH_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
139 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[DISPATCH_PTR]], ptr addrspace(1) undef, align 8
140 ; ATTRIBUTOR_HSA-NEXT:    ret void
142   %dispatch.ptr = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
143   store volatile ptr addrspace(4) %dispatch.ptr, ptr addrspace(1) undef
144   ret void
147 define void @use_queue_ptr() #1 {
148 ; AKF_HSA-LABEL: define {{[^@]+}}@use_queue_ptr
149 ; AKF_HSA-SAME: () #[[ATTR1]] {
150 ; AKF_HSA-NEXT:    [[QUEUE_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()
151 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[QUEUE_PTR]], ptr addrspace(1) undef, align 8
152 ; AKF_HSA-NEXT:    ret void
154 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_queue_ptr
155 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR8:[0-9]+]] {
156 ; ATTRIBUTOR_HSA-NEXT:    [[QUEUE_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()
157 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[QUEUE_PTR]], ptr addrspace(1) undef, align 8
158 ; ATTRIBUTOR_HSA-NEXT:    ret void
160   %queue.ptr = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()
161   store volatile ptr addrspace(4) %queue.ptr, ptr addrspace(1) undef
162   ret void
165 define void @use_dispatch_id() #1 {
166 ; AKF_HSA-LABEL: define {{[^@]+}}@use_dispatch_id
167 ; AKF_HSA-SAME: () #[[ATTR1]] {
168 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i64 @llvm.amdgcn.dispatch.id()
169 ; AKF_HSA-NEXT:    store volatile i64 [[VAL]], ptr addrspace(1) undef, align 8
170 ; AKF_HSA-NEXT:    ret void
172 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_dispatch_id
173 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR9:[0-9]+]] {
174 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i64 @llvm.amdgcn.dispatch.id()
175 ; ATTRIBUTOR_HSA-NEXT:    store volatile i64 [[VAL]], ptr addrspace(1) undef, align 8
176 ; ATTRIBUTOR_HSA-NEXT:    ret void
178   %val = call i64 @llvm.amdgcn.dispatch.id()
179   store volatile i64 %val, ptr addrspace(1) undef
180   ret void
183 define void @use_workgroup_id_y_workgroup_id_z() #1 {
184 ; AKF_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_y_workgroup_id_z
185 ; AKF_HSA-SAME: () #[[ATTR1]] {
186 ; AKF_HSA-NEXT:    [[VAL0:%.*]] = call i32 @llvm.amdgcn.workgroup.id.y()
187 ; AKF_HSA-NEXT:    [[VAL1:%.*]] = call i32 @llvm.amdgcn.workgroup.id.z()
188 ; AKF_HSA-NEXT:    store volatile i32 [[VAL0]], ptr addrspace(1) undef, align 4
189 ; AKF_HSA-NEXT:    store volatile i32 [[VAL1]], ptr addrspace(1) undef, align 4
190 ; AKF_HSA-NEXT:    ret void
192 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_workgroup_id_y_workgroup_id_z
193 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR10:[0-9]+]] {
194 ; ATTRIBUTOR_HSA-NEXT:    [[VAL0:%.*]] = call i32 @llvm.amdgcn.workgroup.id.y()
195 ; ATTRIBUTOR_HSA-NEXT:    [[VAL1:%.*]] = call i32 @llvm.amdgcn.workgroup.id.z()
196 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL0]], ptr addrspace(1) undef, align 4
197 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL1]], ptr addrspace(1) undef, align 4
198 ; ATTRIBUTOR_HSA-NEXT:    ret void
200   %val0 = call i32 @llvm.amdgcn.workgroup.id.y()
201   %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
202   store volatile i32 %val0, ptr addrspace(1) undef
203   store volatile i32 %val1, ptr addrspace(1) undef
204   ret void
207 define void @func_indirect_use_workitem_id_x() #1 {
208 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_x
209 ; AKF_HSA-SAME: () #[[ATTR1]] {
210 ; AKF_HSA-NEXT:    call void @use_workitem_id_x()
211 ; AKF_HSA-NEXT:    ret void
213 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_x
214 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR1]] {
215 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workitem_id_x()
216 ; ATTRIBUTOR_HSA-NEXT:    ret void
218   call void @use_workitem_id_x()
219   ret void
222 define void @kernel_indirect_use_workitem_id_x() #1 {
223 ; AKF_HSA-LABEL: define {{[^@]+}}@kernel_indirect_use_workitem_id_x
224 ; AKF_HSA-SAME: () #[[ATTR1]] {
225 ; AKF_HSA-NEXT:    call void @use_workitem_id_x()
226 ; AKF_HSA-NEXT:    ret void
228 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kernel_indirect_use_workitem_id_x
229 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR1]] {
230 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workitem_id_x()
231 ; ATTRIBUTOR_HSA-NEXT:    ret void
233   call void @use_workitem_id_x()
234   ret void
237 define void @func_indirect_use_workitem_id_y() #1 {
238 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_y
239 ; AKF_HSA-SAME: () #[[ATTR1]] {
240 ; AKF_HSA-NEXT:    call void @use_workitem_id_y()
241 ; AKF_HSA-NEXT:    ret void
243 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_y
244 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR2]] {
245 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workitem_id_y()
246 ; ATTRIBUTOR_HSA-NEXT:    ret void
248   call void @use_workitem_id_y()
249   ret void
252 define void @func_indirect_use_workitem_id_z() #1 {
253 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_z
254 ; AKF_HSA-SAME: () #[[ATTR1]] {
255 ; AKF_HSA-NEXT:    call void @use_workitem_id_z()
256 ; AKF_HSA-NEXT:    ret void
258 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workitem_id_z
259 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR3]] {
260 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workitem_id_z()
261 ; ATTRIBUTOR_HSA-NEXT:    ret void
263   call void @use_workitem_id_z()
264   ret void
267 define void @func_indirect_use_workgroup_id_x() #1 {
268 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_x
269 ; AKF_HSA-SAME: () #[[ATTR1]] {
270 ; AKF_HSA-NEXT:    call void @use_workgroup_id_x()
271 ; AKF_HSA-NEXT:    ret void
273 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_x
274 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR4]] {
275 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workgroup_id_x()
276 ; ATTRIBUTOR_HSA-NEXT:    ret void
278   call void @use_workgroup_id_x()
279   ret void
282 define void @kernel_indirect_use_workgroup_id_x() #1 {
283 ; AKF_HSA-LABEL: define {{[^@]+}}@kernel_indirect_use_workgroup_id_x
284 ; AKF_HSA-SAME: () #[[ATTR1]] {
285 ; AKF_HSA-NEXT:    call void @use_workgroup_id_x()
286 ; AKF_HSA-NEXT:    ret void
288 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kernel_indirect_use_workgroup_id_x
289 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR4]] {
290 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workgroup_id_x()
291 ; ATTRIBUTOR_HSA-NEXT:    ret void
293   call void @use_workgroup_id_x()
294   ret void
297 define void @func_indirect_use_workgroup_id_y() #1 {
298 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_y
299 ; AKF_HSA-SAME: () #[[ATTR1]] {
300 ; AKF_HSA-NEXT:    call void @use_workgroup_id_y()
301 ; AKF_HSA-NEXT:    ret void
303 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_y
304 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR5]] {
305 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workgroup_id_y()
306 ; ATTRIBUTOR_HSA-NEXT:    ret void
308   call void @use_workgroup_id_y()
309   ret void
312 define void @func_indirect_use_workgroup_id_z() #1 {
313 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_z
314 ; AKF_HSA-SAME: () #[[ATTR1]] {
315 ; AKF_HSA-NEXT:    call void @use_workgroup_id_z()
316 ; AKF_HSA-NEXT:    ret void
318 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_z
319 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR6]] {
320 ; ATTRIBUTOR_HSA-NEXT:    call void @use_workgroup_id_z()
321 ; ATTRIBUTOR_HSA-NEXT:    ret void
323   call void @use_workgroup_id_z()
324   ret void
327 define void @func_indirect_indirect_use_workgroup_id_y() #1 {
328 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_indirect_use_workgroup_id_y
329 ; AKF_HSA-SAME: () #[[ATTR1]] {
330 ; AKF_HSA-NEXT:    call void @func_indirect_use_workgroup_id_y()
331 ; AKF_HSA-NEXT:    ret void
333 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_indirect_use_workgroup_id_y
334 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR5]] {
335 ; ATTRIBUTOR_HSA-NEXT:    call void @func_indirect_use_workgroup_id_y()
336 ; ATTRIBUTOR_HSA-NEXT:    ret void
338   call void @func_indirect_use_workgroup_id_y()
339   ret void
342 define void @indirect_x2_use_workgroup_id_y() #1 {
343 ; AKF_HSA-LABEL: define {{[^@]+}}@indirect_x2_use_workgroup_id_y
344 ; AKF_HSA-SAME: () #[[ATTR1]] {
345 ; AKF_HSA-NEXT:    call void @func_indirect_indirect_use_workgroup_id_y()
346 ; AKF_HSA-NEXT:    ret void
348 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@indirect_x2_use_workgroup_id_y
349 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR5]] {
350 ; ATTRIBUTOR_HSA-NEXT:    call void @func_indirect_indirect_use_workgroup_id_y()
351 ; ATTRIBUTOR_HSA-NEXT:    ret void
353   call void @func_indirect_indirect_use_workgroup_id_y()
354   ret void
357 define void @func_indirect_use_dispatch_ptr() #1 {
358 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_ptr
359 ; AKF_HSA-SAME: () #[[ATTR1]] {
360 ; AKF_HSA-NEXT:    call void @use_dispatch_ptr()
361 ; AKF_HSA-NEXT:    ret void
363 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_ptr
364 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR7]] {
365 ; ATTRIBUTOR_HSA-NEXT:    call void @use_dispatch_ptr()
366 ; ATTRIBUTOR_HSA-NEXT:    ret void
368   call void @use_dispatch_ptr()
369   ret void
372 define void @func_indirect_use_queue_ptr() #1 {
373 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_queue_ptr
374 ; AKF_HSA-SAME: () #[[ATTR1]] {
375 ; AKF_HSA-NEXT:    call void @use_queue_ptr()
376 ; AKF_HSA-NEXT:    ret void
378 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_queue_ptr
379 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR8]] {
380 ; ATTRIBUTOR_HSA-NEXT:    call void @use_queue_ptr()
381 ; ATTRIBUTOR_HSA-NEXT:    ret void
383   call void @use_queue_ptr()
384   ret void
387 define void @func_indirect_use_dispatch_id() #1 {
388 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_id
389 ; AKF_HSA-SAME: () #[[ATTR1]] {
390 ; AKF_HSA-NEXT:    call void @use_dispatch_id()
391 ; AKF_HSA-NEXT:    ret void
393 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_id
394 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR9]] {
395 ; ATTRIBUTOR_HSA-NEXT:    call void @use_dispatch_id()
396 ; ATTRIBUTOR_HSA-NEXT:    ret void
398   call void @use_dispatch_id()
399   ret void
402 define void @func_indirect_use_workgroup_id_y_workgroup_id_z() #1 {
403 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_y_workgroup_id_z
404 ; AKF_HSA-SAME: () #[[ATTR1]] {
405 ; AKF_HSA-NEXT:    call void @func_indirect_use_workgroup_id_y_workgroup_id_z()
406 ; AKF_HSA-NEXT:    ret void
408 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_workgroup_id_y_workgroup_id_z
409 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR11:[0-9]+]] {
410 ; ATTRIBUTOR_HSA-NEXT:    call void @func_indirect_use_workgroup_id_y_workgroup_id_z()
411 ; ATTRIBUTOR_HSA-NEXT:    ret void
413   call void @func_indirect_use_workgroup_id_y_workgroup_id_z()
414   ret void
417 define void @recursive_use_workitem_id_y() #1 {
418 ; AKF_HSA-LABEL: define {{[^@]+}}@recursive_use_workitem_id_y
419 ; AKF_HSA-SAME: () #[[ATTR1]] {
420 ; AKF_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.y()
421 ; AKF_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
422 ; AKF_HSA-NEXT:    call void @recursive_use_workitem_id_y()
423 ; AKF_HSA-NEXT:    ret void
425 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@recursive_use_workitem_id_y
426 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR2]] {
427 ; ATTRIBUTOR_HSA-NEXT:    [[VAL:%.*]] = call i32 @llvm.amdgcn.workitem.id.y()
428 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 [[VAL]], ptr addrspace(1) undef, align 4
429 ; ATTRIBUTOR_HSA-NEXT:    call void @recursive_use_workitem_id_y()
430 ; ATTRIBUTOR_HSA-NEXT:    ret void
432   %val = call i32 @llvm.amdgcn.workitem.id.y()
433   store volatile i32 %val, ptr addrspace(1) undef
434   call void @recursive_use_workitem_id_y()
435   ret void
438 define void @call_recursive_use_workitem_id_y() #1 {
439 ; AKF_HSA-LABEL: define {{[^@]+}}@call_recursive_use_workitem_id_y
440 ; AKF_HSA-SAME: () #[[ATTR1]] {
441 ; AKF_HSA-NEXT:    call void @recursive_use_workitem_id_y()
442 ; AKF_HSA-NEXT:    ret void
444 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@call_recursive_use_workitem_id_y
445 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR2]] {
446 ; ATTRIBUTOR_HSA-NEXT:    call void @recursive_use_workitem_id_y()
447 ; ATTRIBUTOR_HSA-NEXT:    ret void
449   call void @recursive_use_workitem_id_y()
450   ret void
453 define void @use_group_to_flat_addrspacecast(ptr addrspace(3) %ptr) #1 {
454 ; AKF_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast
455 ; AKF_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR1]] {
456 ; AKF_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
457 ; AKF_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
458 ; AKF_HSA-NEXT:    ret void
460 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast
461 ; ATTRIBUTOR_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR12:[0-9]+]] {
462 ; ATTRIBUTOR_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
463 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
464 ; ATTRIBUTOR_HSA-NEXT:    ret void
466   %stof = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(4)
467   store volatile i32 0, ptr addrspace(4) %stof
468   ret void
472 define void @use_group_to_flat_addrspacecast_gfx9(ptr addrspace(3) %ptr) #2 {
473 ; AKF_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast_gfx9
474 ; AKF_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR2:[0-9]+]] {
475 ; AKF_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
476 ; AKF_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
477 ; AKF_HSA-NEXT:    ret void
479 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast_gfx9
480 ; ATTRIBUTOR_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR13:[0-9]+]] {
481 ; ATTRIBUTOR_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
482 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
483 ; ATTRIBUTOR_HSA-NEXT:    ret void
485   %stof = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(4)
486   store volatile i32 0, ptr addrspace(4) %stof
487   ret void
490 define void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(ptr addrspace(3) %ptr) #2 {
491 ; AKF_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast_queue_ptr_gfx9
492 ; AKF_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR2]] {
493 ; AKF_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
494 ; AKF_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
495 ; AKF_HSA-NEXT:    call void @func_indirect_use_queue_ptr()
496 ; AKF_HSA-NEXT:    ret void
498 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_group_to_flat_addrspacecast_queue_ptr_gfx9
499 ; ATTRIBUTOR_HSA-SAME: (ptr addrspace(3) [[PTR:%.*]]) #[[ATTR14:[0-9]+]] {
500 ; ATTRIBUTOR_HSA-NEXT:    [[STOF:%.*]] = addrspacecast ptr addrspace(3) [[PTR]] to ptr addrspace(4)
501 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 0, ptr addrspace(4) [[STOF]], align 4
502 ; ATTRIBUTOR_HSA-NEXT:    call void @func_indirect_use_queue_ptr()
503 ; ATTRIBUTOR_HSA-NEXT:    ret void
505   %stof = addrspacecast ptr addrspace(3) %ptr to ptr addrspace(4)
506   store volatile i32 0, ptr addrspace(4) %stof
507   call void @func_indirect_use_queue_ptr()
508   ret void
511 define void @indirect_use_group_to_flat_addrspacecast() #1 {
512 ; AKF_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast
513 ; AKF_HSA-SAME: () #[[ATTR1]] {
514 ; AKF_HSA-NEXT:    call void @use_group_to_flat_addrspacecast(ptr addrspace(3) null)
515 ; AKF_HSA-NEXT:    ret void
517 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast
518 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR12]] {
519 ; ATTRIBUTOR_HSA-NEXT:    call void @use_group_to_flat_addrspacecast(ptr addrspace(3) null)
520 ; ATTRIBUTOR_HSA-NEXT:    ret void
522   call void @use_group_to_flat_addrspacecast(ptr addrspace(3) null)
523   ret void
526 define void @indirect_use_group_to_flat_addrspacecast_gfx9() #1 {
527 ; AKF_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast_gfx9
528 ; AKF_HSA-SAME: () #[[ATTR1]] {
529 ; AKF_HSA-NEXT:    call void @use_group_to_flat_addrspacecast_gfx9(ptr addrspace(3) null)
530 ; AKF_HSA-NEXT:    ret void
532 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast_gfx9
533 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR11]] {
534 ; ATTRIBUTOR_HSA-NEXT:    call void @use_group_to_flat_addrspacecast_gfx9(ptr addrspace(3) null)
535 ; ATTRIBUTOR_HSA-NEXT:    ret void
537   call void @use_group_to_flat_addrspacecast_gfx9(ptr addrspace(3) null)
538   ret void
541 define void @indirect_use_group_to_flat_addrspacecast_queue_ptr_gfx9() #1 {
542 ; AKF_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast_queue_ptr_gfx9
543 ; AKF_HSA-SAME: () #[[ATTR1]] {
544 ; AKF_HSA-NEXT:    call void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(ptr addrspace(3) null)
545 ; AKF_HSA-NEXT:    ret void
547 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@indirect_use_group_to_flat_addrspacecast_queue_ptr_gfx9
548 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR8]] {
549 ; ATTRIBUTOR_HSA-NEXT:    call void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(ptr addrspace(3) null)
550 ; ATTRIBUTOR_HSA-NEXT:    ret void
552   call void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(ptr addrspace(3) null)
553   ret void
556 define void @use_kernarg_segment_ptr() #1 {
557 ; AKF_HSA-LABEL: define {{[^@]+}}@use_kernarg_segment_ptr
558 ; AKF_HSA-SAME: () #[[ATTR1]] {
559 ; AKF_HSA-NEXT:    [[KERNARG_SEGMENT_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.kernarg.segment.ptr()
560 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[KERNARG_SEGMENT_PTR]], ptr addrspace(1) undef, align 8
561 ; AKF_HSA-NEXT:    ret void
563 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_kernarg_segment_ptr
564 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR11]] {
565 ; ATTRIBUTOR_HSA-NEXT:    [[KERNARG_SEGMENT_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.kernarg.segment.ptr()
566 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[KERNARG_SEGMENT_PTR]], ptr addrspace(1) undef, align 8
567 ; ATTRIBUTOR_HSA-NEXT:    ret void
569   %kernarg.segment.ptr = call ptr addrspace(4) @llvm.amdgcn.kernarg.segment.ptr()
570   store volatile ptr addrspace(4) %kernarg.segment.ptr, ptr addrspace(1) undef
571   ret void
573 define void @func_indirect_use_kernarg_segment_ptr() #1 {
574 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_kernarg_segment_ptr
575 ; AKF_HSA-SAME: () #[[ATTR1]] {
576 ; AKF_HSA-NEXT:    call void @use_kernarg_segment_ptr()
577 ; AKF_HSA-NEXT:    ret void
579 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_kernarg_segment_ptr
580 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR11]] {
581 ; ATTRIBUTOR_HSA-NEXT:    call void @use_kernarg_segment_ptr()
582 ; ATTRIBUTOR_HSA-NEXT:    ret void
584   call void @use_kernarg_segment_ptr()
585   ret void
588 define amdgpu_kernel void @kern_use_implicitarg_ptr() #1 {
589 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_use_implicitarg_ptr
590 ; AKF_HSA-SAME: () #[[ATTR1]] {
591 ; AKF_HSA-NEXT:    [[IMPLICITARG_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
592 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[IMPLICITARG_PTR]], ptr addrspace(1) undef, align 8
593 ; AKF_HSA-NEXT:    ret void
595 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_use_implicitarg_ptr
596 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR15:[0-9]+]] {
597 ; ATTRIBUTOR_HSA-NEXT:    [[IMPLICITARG_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
598 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[IMPLICITARG_PTR]], ptr addrspace(1) undef, align 8
599 ; ATTRIBUTOR_HSA-NEXT:    ret void
601   %implicitarg.ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
602   store volatile ptr addrspace(4) %implicitarg.ptr, ptr addrspace(1) undef
603   ret void
606 define void @use_implicitarg_ptr() #1 {
607 ; AKF_HSA-LABEL: define {{[^@]+}}@use_implicitarg_ptr
608 ; AKF_HSA-SAME: () #[[ATTR1]] {
609 ; AKF_HSA-NEXT:    [[IMPLICITARG_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
610 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[IMPLICITARG_PTR]], ptr addrspace(1) undef, align 8
611 ; AKF_HSA-NEXT:    ret void
613 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_implicitarg_ptr
614 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR12]] {
615 ; ATTRIBUTOR_HSA-NEXT:    [[IMPLICITARG_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
616 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[IMPLICITARG_PTR]], ptr addrspace(1) undef, align 8
617 ; ATTRIBUTOR_HSA-NEXT:    ret void
619   %implicitarg.ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
620   store volatile ptr addrspace(4) %implicitarg.ptr, ptr addrspace(1) undef
621   ret void
624 define void @func_indirect_use_implicitarg_ptr() #1 {
625 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_implicitarg_ptr
626 ; AKF_HSA-SAME: () #[[ATTR1]] {
627 ; AKF_HSA-NEXT:    call void @use_implicitarg_ptr()
628 ; AKF_HSA-NEXT:    ret void
630 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_implicitarg_ptr
631 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR12]] {
632 ; ATTRIBUTOR_HSA-NEXT:    call void @use_implicitarg_ptr()
633 ; ATTRIBUTOR_HSA-NEXT:    ret void
635   call void @use_implicitarg_ptr()
636   ret void
639 declare void @external.func() #3
641 ; This function gets deleted.
642 define internal void @defined.func() #3 {
643 ; AKF_HSA-LABEL: define {{[^@]+}}@defined.func
644 ; AKF_HSA-SAME: () #[[ATTR3:[0-9]+]] {
645 ; AKF_HSA-NEXT:    ret void
647 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@defined.func
648 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR17:[0-9]+]] {
649 ; ATTRIBUTOR_HSA-NEXT:    ret void
651   ret void
654 define void @func_call_external() #3 {
655 ; AKF_HSA-LABEL: define {{[^@]+}}@func_call_external
656 ; AKF_HSA-SAME: () #[[ATTR3]] {
657 ; AKF_HSA-NEXT:    call void @external.func()
658 ; AKF_HSA-NEXT:    ret void
660 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_call_external
661 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR16:[0-9]+]] {
662 ; ATTRIBUTOR_HSA-NEXT:    call void @external.func()
663 ; ATTRIBUTOR_HSA-NEXT:    ret void
665   call void @external.func()
666   ret void
669 define void @func_call_defined() #3 {
670 ; AKF_HSA-LABEL: define {{[^@]+}}@func_call_defined
671 ; AKF_HSA-SAME: () #[[ATTR3]] {
672 ; AKF_HSA-NEXT:    call void @defined.func()
673 ; AKF_HSA-NEXT:    ret void
675 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_call_defined
676 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR17]] {
677 ; ATTRIBUTOR_HSA-NEXT:    call void @defined.func()
678 ; ATTRIBUTOR_HSA-NEXT:    ret void
680   call void @defined.func()
681   ret void
683 define void @func_call_asm() #3 {
684 ; AKF_HSA-LABEL: define {{[^@]+}}@func_call_asm
685 ; AKF_HSA-SAME: () #[[ATTR3]] {
686 ; AKF_HSA-NEXT:    call void asm sideeffect "", ""() #[[ATTR3]]
687 ; AKF_HSA-NEXT:    ret void
689 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_call_asm
690 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR17]] {
691 ; ATTRIBUTOR_HSA-NEXT:    call void asm sideeffect "", ""() #[[ATTR28:[0-9]+]]
692 ; ATTRIBUTOR_HSA-NEXT:    ret void
694   call void asm sideeffect "", ""() #3
695   ret void
698 define amdgpu_kernel void @kern_call_external() #3 {
699 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_call_external
700 ; AKF_HSA-SAME: () #[[ATTR4:[0-9]+]] {
701 ; AKF_HSA-NEXT:    call void @external.func()
702 ; AKF_HSA-NEXT:    ret void
704 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_call_external
705 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR18:[0-9]+]] {
706 ; ATTRIBUTOR_HSA-NEXT:    call void @external.func()
707 ; ATTRIBUTOR_HSA-NEXT:    ret void
709   call void @external.func()
710   ret void
713 define amdgpu_kernel void @func_kern_defined() #3 {
714 ; AKF_HSA-LABEL: define {{[^@]+}}@func_kern_defined
715 ; AKF_HSA-SAME: () #[[ATTR4]] {
716 ; AKF_HSA-NEXT:    call void @defined.func()
717 ; AKF_HSA-NEXT:    ret void
719 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_kern_defined
720 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR17]] {
721 ; ATTRIBUTOR_HSA-NEXT:    call void @defined.func()
722 ; ATTRIBUTOR_HSA-NEXT:    ret void
724   call void @defined.func()
725   ret void
728 define i32 @use_dispatch_ptr_ret_type() #1 {
729 ; AKF_HSA-LABEL: define {{[^@]+}}@use_dispatch_ptr_ret_type
730 ; AKF_HSA-SAME: () #[[ATTR1]] {
731 ; AKF_HSA-NEXT:    [[DISPATCH_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
732 ; AKF_HSA-NEXT:    store volatile ptr addrspace(4) [[DISPATCH_PTR]], ptr addrspace(1) undef, align 8
733 ; AKF_HSA-NEXT:    ret i32 0
735 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@use_dispatch_ptr_ret_type
736 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR7]] {
737 ; ATTRIBUTOR_HSA-NEXT:    [[DISPATCH_PTR:%.*]] = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
738 ; ATTRIBUTOR_HSA-NEXT:    store volatile ptr addrspace(4) [[DISPATCH_PTR]], ptr addrspace(1) undef, align 8
739 ; ATTRIBUTOR_HSA-NEXT:    ret i32 0
741   %dispatch.ptr = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()
742   store volatile ptr addrspace(4) %dispatch.ptr, ptr addrspace(1) undef
743   ret i32 0
746 define float @func_indirect_use_dispatch_ptr_constexpr_cast_func() #1 {
747 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_ptr_constexpr_cast_func
748 ; AKF_HSA-SAME: () #[[ATTR1]] {
749 ; AKF_HSA-NEXT:    [[F:%.*]] = call float @use_dispatch_ptr_ret_type()
750 ; AKF_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
751 ; AKF_HSA-NEXT:    ret float [[FADD]]
753 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_use_dispatch_ptr_constexpr_cast_func
754 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR7]] {
755 ; ATTRIBUTOR_HSA-NEXT:    [[F:%.*]] = call float @use_dispatch_ptr_ret_type()
756 ; ATTRIBUTOR_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
757 ; ATTRIBUTOR_HSA-NEXT:    ret float [[FADD]]
759   %f = call float @use_dispatch_ptr_ret_type()
760   %fadd = fadd float %f, 1.0
761   ret float %fadd
764 define float @func_indirect_call(ptr %fptr) #3 {
765 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_call
766 ; AKF_HSA-SAME: (ptr [[FPTR:%.*]]) #[[ATTR3]] {
767 ; AKF_HSA-NEXT:    [[F:%.*]] = call float [[FPTR]]()
768 ; AKF_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
769 ; AKF_HSA-NEXT:    ret float [[FADD]]
771 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_call
772 ; ATTRIBUTOR_HSA-SAME: (ptr [[FPTR:%.*]]) #[[ATTR16]] {
773 ; ATTRIBUTOR_HSA-NEXT:    [[F:%.*]] = call float [[FPTR]]()
774 ; ATTRIBUTOR_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
775 ; ATTRIBUTOR_HSA-NEXT:    ret float [[FADD]]
777   %f = call float %fptr()
778   %fadd = fadd float %f, 1.0
779   ret float %fadd
782 declare float @extern() #3
783 define float @func_extern_call() #3 {
784 ; AKF_HSA-LABEL: define {{[^@]+}}@func_extern_call
785 ; AKF_HSA-SAME: () #[[ATTR3]] {
786 ; AKF_HSA-NEXT:    [[F:%.*]] = call float @extern()
787 ; AKF_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
788 ; AKF_HSA-NEXT:    ret float [[FADD]]
790 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_extern_call
791 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR16]] {
792 ; ATTRIBUTOR_HSA-NEXT:    [[F:%.*]] = call float @extern()
793 ; ATTRIBUTOR_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
794 ; ATTRIBUTOR_HSA-NEXT:    ret float [[FADD]]
796   %f = call float @extern()
797   %fadd = fadd float %f, 1.0
798   ret float %fadd
801 define float @func_null_call(ptr %fptr) #3 {
802 ; AKF_HSA-LABEL: define {{[^@]+}}@func_null_call
803 ; AKF_HSA-SAME: (ptr [[FPTR:%.*]]) #[[ATTR3]] {
804 ; AKF_HSA-NEXT:    [[F:%.*]] = call float null()
805 ; AKF_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
806 ; AKF_HSA-NEXT:    ret float [[FADD]]
808 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_null_call
809 ; ATTRIBUTOR_HSA-SAME: (ptr [[FPTR:%.*]]) #[[ATTR16]] {
810 ; ATTRIBUTOR_HSA-NEXT:    [[F:%.*]] = call float null()
811 ; ATTRIBUTOR_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
812 ; ATTRIBUTOR_HSA-NEXT:    ret float [[FADD]]
814   %f = call float null()
815   %fadd = fadd float %f, 1.0
816   ret float %fadd
819 declare float @llvm.amdgcn.rcp.f32(float) #0
821 ; Calls some other recognized intrinsic
822 define float @func_other_intrinsic_call(float %arg) #3 {
823 ; AKF_HSA-LABEL: define {{[^@]+}}@func_other_intrinsic_call
824 ; AKF_HSA-SAME: (float [[ARG:%.*]]) #[[ATTR3]] {
825 ; AKF_HSA-NEXT:    [[F:%.*]] = call float @llvm.amdgcn.rcp.f32(float [[ARG]])
826 ; AKF_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
827 ; AKF_HSA-NEXT:    ret float [[FADD]]
829 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_other_intrinsic_call
830 ; ATTRIBUTOR_HSA-SAME: (float [[ARG:%.*]]) #[[ATTR17]] {
831 ; ATTRIBUTOR_HSA-NEXT:    [[F:%.*]] = call float @llvm.amdgcn.rcp.f32(float [[ARG]])
832 ; ATTRIBUTOR_HSA-NEXT:    [[FADD:%.*]] = fadd float [[F]], 1.000000e+00
833 ; ATTRIBUTOR_HSA-NEXT:    ret float [[FADD]]
835   %f = call float @llvm.amdgcn.rcp.f32(float %arg)
836   %fadd = fadd float %f, 1.0
837   ret float %fadd
840 ; Hostcall needs to be enabled for sanitizers
841 define amdgpu_kernel void @kern_sanitize_address() #4 {
842 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_sanitize_address
843 ; AKF_HSA-SAME: () #[[ATTR5:[0-9]+]] {
844 ; AKF_HSA-NEXT:    store volatile i32 0, ptr addrspace(1) null, align 4
845 ; AKF_HSA-NEXT:    ret void
847 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_sanitize_address
848 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR19:[0-9]+]] {
849 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 0, ptr addrspace(1) null, align 4
850 ; ATTRIBUTOR_HSA-NEXT:    ret void
852   store volatile i32 0, ptr addrspace(1) null
853   ret void
856 ; Hostcall needs to be enabled for sanitizers
857 define void @func_sanitize_address() #4 {
858 ; AKF_HSA-LABEL: define {{[^@]+}}@func_sanitize_address
859 ; AKF_HSA-SAME: () #[[ATTR5]] {
860 ; AKF_HSA-NEXT:    store volatile i32 0, ptr addrspace(1) null, align 4
861 ; AKF_HSA-NEXT:    ret void
863 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_sanitize_address
864 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR20:[0-9]+]] {
865 ; ATTRIBUTOR_HSA-NEXT:    store volatile i32 0, ptr addrspace(1) null, align 4
866 ; ATTRIBUTOR_HSA-NEXT:    ret void
868   store volatile i32 0, ptr addrspace(1) null
869   ret void
872 ; Hostcall needs to be enabled for sanitizers
873 define void @func_indirect_sanitize_address() #3 {
874 ; AKF_HSA-LABEL: define {{[^@]+}}@func_indirect_sanitize_address
875 ; AKF_HSA-SAME: () #[[ATTR3]] {
876 ; AKF_HSA-NEXT:    call void @func_sanitize_address()
877 ; AKF_HSA-NEXT:    ret void
879 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@func_indirect_sanitize_address
880 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR21:[0-9]+]] {
881 ; ATTRIBUTOR_HSA-NEXT:    call void @func_sanitize_address()
882 ; ATTRIBUTOR_HSA-NEXT:    ret void
884   call void @func_sanitize_address()
885   ret void
888 ; Hostcall needs to be enabled for sanitizers
889 define amdgpu_kernel void @kern_indirect_sanitize_address() #3 {
890 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_indirect_sanitize_address
891 ; AKF_HSA-SAME: () #[[ATTR4]] {
892 ; AKF_HSA-NEXT:    call void @func_sanitize_address()
893 ; AKF_HSA-NEXT:    ret void
895 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_indirect_sanitize_address
896 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR22:[0-9]+]] {
897 ; ATTRIBUTOR_HSA-NEXT:    call void @func_sanitize_address()
898 ; ATTRIBUTOR_HSA-NEXT:    ret void
900   call void @func_sanitize_address()
901   ret void
904 ; Marked with amdgpu-no-implicitarg-ptr, and
905 ; sanitize_address. sanitize_address wins and requires the pointer.
906 declare void @extern_func_sanitize_address() #5
908 define amdgpu_kernel void @kern_decl_sanitize_address() #3 {
909 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_decl_sanitize_address
910 ; AKF_HSA-SAME: () #[[ATTR4]] {
911 ; AKF_HSA-NEXT:    call void @extern_func_sanitize_address()
912 ; AKF_HSA-NEXT:    ret void
914 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_decl_sanitize_address
915 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR18]] {
916 ; ATTRIBUTOR_HSA-NEXT:    call void @extern_func_sanitize_address()
917 ; ATTRIBUTOR_HSA-NEXT:    ret void
919   call void @extern_func_sanitize_address()
920   ret void
923 declare void @enqueue_block_decl() #6
925 define internal void @enqueue_block_def() #6 {
926 ; AKF_HSA-LABEL: define {{[^@]+}}@enqueue_block_def
927 ; AKF_HSA-SAME: () #[[ATTR7:[0-9]+]] {
928 ; AKF_HSA-NEXT:    ret void
930 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@enqueue_block_def
931 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR25:[0-9]+]] {
932 ; ATTRIBUTOR_HSA-NEXT:    ret void
934   ret void
937 define amdgpu_kernel void @kern_call_enqueued_block_decl() {
938 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_call_enqueued_block_decl
939 ; AKF_HSA-SAME: () #[[ATTR8:[0-9]+]] {
940 ; AKF_HSA-NEXT:    call void @enqueue_block_decl()
941 ; AKF_HSA-NEXT:    ret void
943 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_call_enqueued_block_decl
944 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR26:[0-9]+]] {
945 ; ATTRIBUTOR_HSA-NEXT:    call void @enqueue_block_decl()
946 ; ATTRIBUTOR_HSA-NEXT:    ret void
948   call void @enqueue_block_decl()
949   ret void
952 define amdgpu_kernel void @kern_call_enqueued_block_def() {
953 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_call_enqueued_block_def
954 ; AKF_HSA-SAME: () #[[ATTR8]] {
955 ; AKF_HSA-NEXT:    call void @enqueue_block_def()
956 ; AKF_HSA-NEXT:    ret void
958 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_call_enqueued_block_def
959 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR27:[0-9]+]] {
960 ; ATTRIBUTOR_HSA-NEXT:    call void @enqueue_block_def()
961 ; ATTRIBUTOR_HSA-NEXT:    ret void
963   call void @enqueue_block_def()
964   ret void
967 define void @unused_enqueue_block() {
968 ; AKF_HSA-LABEL: define {{[^@]+}}@unused_enqueue_block() {
969 ; AKF_HSA-NEXT:    ret void
971 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@unused_enqueue_block
972 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR27]] {
973 ; ATTRIBUTOR_HSA-NEXT:    ret void
975   ret void
978 define internal void @known_func() {
979 ; AKF_HSA-LABEL: define {{[^@]+}}@known_func() {
980 ; AKF_HSA-NEXT:    ret void
982 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@known_func
983 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR27]] {
984 ; ATTRIBUTOR_HSA-NEXT:    ret void
986   ret void
989 ; Should never happen
990 define amdgpu_kernel void @kern_callsite_enqueue_block() {
991 ; AKF_HSA-LABEL: define {{[^@]+}}@kern_callsite_enqueue_block
992 ; AKF_HSA-SAME: () #[[ATTR8]] {
993 ; AKF_HSA-NEXT:    call void @known_func() #[[ATTR7]]
994 ; AKF_HSA-NEXT:    ret void
996 ; ATTRIBUTOR_HSA-LABEL: define {{[^@]+}}@kern_callsite_enqueue_block
997 ; ATTRIBUTOR_HSA-SAME: () #[[ATTR27]] {
998 ; ATTRIBUTOR_HSA-NEXT:    call void @known_func() #[[ATTR29:[0-9]+]]
999 ; ATTRIBUTOR_HSA-NEXT:    ret void
1001   call void @known_func() #6
1002   ret void
1005 attributes #0 = { nounwind readnone speculatable }
1006 attributes #1 = { nounwind "target-cpu"="fiji" }
1007 attributes #2 = { nounwind "target-cpu"="gfx900" }
1008 attributes #3 = { nounwind }
1009 attributes #4 = { nounwind sanitize_address }
1010 attributes #5 = { nounwind sanitize_address "amdgpu-no-implicitarg-ptr" }
1011 attributes #6 = { "enqueued-block" }
1014 !llvm.module.flags = !{!0}
1015 !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
1017 ; AKF_HSA: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
1018 ; AKF_HSA: attributes #[[ATTR1]] = { nounwind "target-cpu"="fiji" }
1019 ; AKF_HSA: attributes #[[ATTR2]] = { nounwind "target-cpu"="gfx900" }
1020 ; AKF_HSA: attributes #[[ATTR3]] = { nounwind }
1021 ; AKF_HSA: attributes #[[ATTR4]] = { nounwind "amdgpu-calls" }
1022 ; AKF_HSA: attributes #[[ATTR5]] = { nounwind sanitize_address }
1023 ; AKF_HSA: attributes #[[ATTR6:[0-9]+]] = { nounwind sanitize_address "amdgpu-no-implicitarg-ptr" }
1024 ; AKF_HSA: attributes #[[ATTR7]] = { "enqueued-block" }
1025 ; AKF_HSA: attributes #[[ATTR8]] = { "amdgpu-calls" }
1027 ; ATTRIBUTOR_HSA: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
1028 ; ATTRIBUTOR_HSA: attributes #[[ATTR1]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1029 ; ATTRIBUTOR_HSA: attributes #[[ATTR2]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1030 ; ATTRIBUTOR_HSA: attributes #[[ATTR3]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1031 ; ATTRIBUTOR_HSA: attributes #[[ATTR4]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1032 ; ATTRIBUTOR_HSA: attributes #[[ATTR5]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1033 ; ATTRIBUTOR_HSA: attributes #[[ATTR6]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1034 ; ATTRIBUTOR_HSA: attributes #[[ATTR7]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1035 ; ATTRIBUTOR_HSA: attributes #[[ATTR8]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1036 ; ATTRIBUTOR_HSA: attributes #[[ATTR9]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1037 ; ATTRIBUTOR_HSA: attributes #[[ATTR10]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1038 ; ATTRIBUTOR_HSA: attributes #[[ATTR11]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1039 ; ATTRIBUTOR_HSA: attributes #[[ATTR12]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1040 ; ATTRIBUTOR_HSA: attributes #[[ATTR13]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="gfx900" "uniform-work-group-size"="false" }
1041 ; ATTRIBUTOR_HSA: attributes #[[ATTR14]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "target-cpu"="gfx900" "uniform-work-group-size"="false" }
1042 ; ATTRIBUTOR_HSA: attributes #[[ATTR15]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "target-cpu"="fiji" "uniform-work-group-size"="false" }
1043 ; ATTRIBUTOR_HSA: attributes #[[ATTR16]] = { nounwind "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1044 ; ATTRIBUTOR_HSA: attributes #[[ATTR17]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1045 ; ATTRIBUTOR_HSA: attributes #[[ATTR18]] = { nounwind "uniform-work-group-size"="false" }
1046 ; ATTRIBUTOR_HSA: attributes #[[ATTR19]] = { nounwind sanitize_address "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "uniform-work-group-size"="false" }
1047 ; ATTRIBUTOR_HSA: attributes #[[ATTR20]] = { nounwind sanitize_address "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1048 ; ATTRIBUTOR_HSA: attributes #[[ATTR21]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1049 ; ATTRIBUTOR_HSA: attributes #[[ATTR22]] = { nounwind "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "uniform-work-group-size"="false" }
1050 ; ATTRIBUTOR_HSA: attributes #[[ATTR23:[0-9]+]] = { nounwind sanitize_address "amdgpu-no-implicitarg-ptr" "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1051 ; ATTRIBUTOR_HSA: attributes #[[ATTR24:[0-9]+]] = { "amdgpu-waves-per-eu"="4,10" "enqueued-block" "uniform-work-group-size"="false" }
1052 ; ATTRIBUTOR_HSA: attributes #[[ATTR25]] = { "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "enqueued-block" "uniform-work-group-size"="false" }
1053 ; ATTRIBUTOR_HSA: attributes #[[ATTR26]] = { "uniform-work-group-size"="false" }
1054 ; ATTRIBUTOR_HSA: attributes #[[ATTR27]] = { "amdgpu-no-agpr" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "amdgpu-waves-per-eu"="4,10" "uniform-work-group-size"="false" }
1055 ; ATTRIBUTOR_HSA: attributes #[[ATTR28]] = { nounwind }
1056 ; ATTRIBUTOR_HSA: attributes #[[ATTR29]] = { "enqueued-block" }
1058 ; AKF_HSA: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
1060 ; ATTRIBUTOR_HSA: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}