1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri --amdhsa-code-object-version=2 -enable-ipra=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VARABI %s
2 ; RUN: llc -amdgpu-fixed-function-abi -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri --amdhsa-code-object-version=2 -enable-ipra=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,FIXEDABI %s
4 ; GCN-LABEL: {{^}}use_workitem_id_x:
6 ; VARABI: v_and_b32_e32 [[ID:v[0-9]+]], 0x3ff, v0
7 ; FIXEDABI: v_and_b32_e32 [[ID:v[0-9]+]], 0x3ff, v31
8 ; GCN-NEXT: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[ID]]
10 ; GCN-NEXT: s_setpc_b64
11 define void @use_workitem_id_x() #1 {
12 %val = call i32 @llvm.amdgcn.workitem.id.x()
13 store volatile i32 %val, i32 addrspace(1)* undef
17 ; GCN-LABEL: {{^}}use_workitem_id_y:
19 ; VARABI: v_bfe_u32 [[ID:v[0-9]+]], v0, 10, 10
20 ; FIXEDABI: v_bfe_u32 [[ID:v[0-9]+]], v31, 10, 10
21 ; GCN-NEXT: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[ID]]
23 ; GCN-NEXT: s_setpc_b64
24 define void @use_workitem_id_y() #1 {
25 %val = call i32 @llvm.amdgcn.workitem.id.y()
26 store volatile i32 %val, i32 addrspace(1)* undef
30 ; GCN-LABEL: {{^}}use_workitem_id_z:
32 ; VARABI: v_bfe_u32 [[ID:v[0-9]+]], v0, 20, 10
33 ; FIXEDABI: v_bfe_u32 [[ID:v[0-9]+]], v31, 20, 10
34 ; GCN-NEXT: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[ID]]
36 ; GCN-NEXT: s_setpc_b64
37 define void @use_workitem_id_z() #1 {
38 %val = call i32 @llvm.amdgcn.workitem.id.z()
39 store volatile i32 %val, i32 addrspace(1)* undef
43 ; GCN-LABEL: {{^}}use_workitem_id_xy:
45 ; VARABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v0
46 ; VARABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v0, 10, 10
48 ; FIXEDABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v31
49 ; FIXEDABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v31, 10, 10
51 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDX]]
52 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDY]]
54 ; GCN-NEXT: s_setpc_b64
55 define void @use_workitem_id_xy() #1 {
56 %val0 = call i32 @llvm.amdgcn.workitem.id.x()
57 %val1 = call i32 @llvm.amdgcn.workitem.id.y()
58 store volatile i32 %val0, i32 addrspace(1)* undef
59 store volatile i32 %val1, i32 addrspace(1)* undef
63 ; GCN-LABEL: {{^}}use_workitem_id_xyz:
66 ; VARABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v0
67 ; VARABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v0, 10, 10
68 ; VARABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v0, 20, 10
70 ; FIXEDABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v31
71 ; FIXEDABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v31, 10, 10
72 ; FIXEDABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v31, 20, 10
75 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDX]]
76 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDY]]
77 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDZ]]
79 ; GCN-NEXT: s_setpc_b64
80 define void @use_workitem_id_xyz() #1 {
81 %val0 = call i32 @llvm.amdgcn.workitem.id.x()
82 %val1 = call i32 @llvm.amdgcn.workitem.id.y()
83 %val2 = call i32 @llvm.amdgcn.workitem.id.z()
84 store volatile i32 %val0, i32 addrspace(1)* undef
85 store volatile i32 %val1, i32 addrspace(1)* undef
86 store volatile i32 %val2, i32 addrspace(1)* undef
90 ; GCN-LABEL: {{^}}use_workitem_id_xz:
92 ; VARABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v0
93 ; VARABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v0, 20, 10
95 ; FIXEDABI-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v31
96 ; FIXEDABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v31, 20, 10
98 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDX]]
99 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDZ]]
100 ; GCN-NEXT: s_waitcnt
101 ; GCN-NEXT: s_setpc_b64
102 define void @use_workitem_id_xz() #1 {
103 %val0 = call i32 @llvm.amdgcn.workitem.id.x()
104 %val1 = call i32 @llvm.amdgcn.workitem.id.z()
105 store volatile i32 %val0, i32 addrspace(1)* undef
106 store volatile i32 %val1, i32 addrspace(1)* undef
110 ; GCN-LABEL: {{^}}use_workitem_id_yz:
112 ; VARABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v0, 10, 10
113 ; VARABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v0, 20, 10
115 ; FIXEDABI-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v31, 10, 10
116 ; FIXEDABI-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v31, 20, 10
118 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDY]]
119 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]:[0-9]+\]}}, [[IDZ]]
120 ; GCN-NEXT: s_waitcnt
121 ; GCN-NEXT: s_setpc_b64
122 define void @use_workitem_id_yz() #1 {
123 %val0 = call i32 @llvm.amdgcn.workitem.id.y()
124 %val1 = call i32 @llvm.amdgcn.workitem.id.z()
125 store volatile i32 %val0, i32 addrspace(1)* undef
126 store volatile i32 %val1, i32 addrspace(1)* undef
130 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_x:
131 ; VARABI: enable_vgpr_workitem_id = 0
132 ; FIXEDABI: enable_vgpr_workitem_id = 2
139 define amdgpu_kernel void @kern_indirect_use_workitem_id_x() #1 {
140 call void @use_workitem_id_x()
144 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_y:
145 ; VARABI: enable_vgpr_workitem_id = 1
146 ; FIXEDABI: enable_vgpr_workitem_id = 2
152 ; VARABI: v_lshlrev_b32_e32 v0, 10, v1
155 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
156 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
157 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
158 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
165 define amdgpu_kernel void @kern_indirect_use_workitem_id_y() #1 {
166 call void @use_workitem_id_y()
170 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_z:
171 ; GCN: enable_vgpr_workitem_id = 2
175 ; VARABI: v_lshlrev_b32_e32 v0, 20, v2
179 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
180 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
181 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
182 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
185 define amdgpu_kernel void @kern_indirect_use_workitem_id_z() #1 {
186 call void @use_workitem_id_z()
190 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_xy:
193 ; VARABI: v_lshlrev_b32_e32 [[IDY:v[0-9]+]], 10, v1
194 ; VARABI: v_or_b32_e32 v0, v0, [[IDY]]
198 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
199 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
200 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
201 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
204 define amdgpu_kernel void @kern_indirect_use_workitem_id_xy() #1 {
205 call void @use_workitem_id_xy()
209 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_xz:
212 ; VARABI: v_lshlrev_b32_e32 [[IDZ:v[0-9]+]], 20, v2
213 ; VARABI: v_or_b32_e32 v0, v0, [[IDZ]]
218 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
219 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
220 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
221 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
224 define amdgpu_kernel void @kern_indirect_use_workitem_id_xz() #1 {
225 call void @use_workitem_id_xz()
229 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_yz:
232 ; VARABI-DAG: v_lshlrev_b32_e32 [[IDY:v[0-9]+]], 10, v1
233 ; VARABI-DAG: v_lshlrev_b32_e32 [[IDZ:v[0-9]+]], 20, v2
234 ; VARABI: v_or_b32_e32 v0, [[IDY]], [[IDZ]]
239 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
240 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
241 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
242 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
245 define amdgpu_kernel void @kern_indirect_use_workitem_id_yz() #1 {
246 call void @use_workitem_id_yz()
250 ; GCN-LABEL: {{^}}kern_indirect_use_workitem_id_xyz:
254 ; VARABI-DAG: v_lshlrev_b32_e32 [[IDY:v[0-9]+]], 10, v1
255 ; VARABI-DAG: v_lshlrev_b32_e32 [[IDZ:v[0-9]+]], 20, v2
256 ; VARABI-DAG: v_or_b32_e32 v0, v0, [[IDY]]
257 ; VARABI-DAG: v_or_b32_e32 v0, v0, [[IDZ]]
262 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
263 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
264 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
265 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
268 define amdgpu_kernel void @kern_indirect_use_workitem_id_xyz() #1 {
269 call void @use_workitem_id_xyz()
273 ; GCN-LABEL: {{^}}func_indirect_use_workitem_id_x:
277 define void @func_indirect_use_workitem_id_x() #1 {
278 call void @use_workitem_id_x()
282 ; GCN-LABEL: {{^}}func_indirect_use_workitem_id_y:
286 define void @func_indirect_use_workitem_id_y() #1 {
287 call void @use_workitem_id_y()
291 ; GCN-LABEL: {{^}}func_indirect_use_workitem_id_z:
295 define void @func_indirect_use_workitem_id_z() #1 {
296 call void @use_workitem_id_z()
300 ; GCN-LABEL: {{^}}other_arg_use_workitem_id_x:
302 ; VARABI-DAG: v_and_b32_e32 [[ID:v[0-9]+]], 0x3ff, v1
303 ; FIXEDABI-DAG: v_and_b32_e32 [[ID:v[0-9]+]], 0x3ff, v31
305 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
306 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[ID]]
307 define void @other_arg_use_workitem_id_x(i32 %arg0) #1 {
308 %val = call i32 @llvm.amdgcn.workitem.id.x()
309 store volatile i32 %arg0, i32 addrspace(1)* undef
310 store volatile i32 %val, i32 addrspace(1)* undef
314 ; GCN-LABEL: {{^}}other_arg_use_workitem_id_y:
316 ; VARABI-DAG: v_bfe_u32 [[ID:v[0-9]+]], v1, 10, 10
317 ; FIXEDABI-DAG: v_bfe_u32 [[ID:v[0-9]+]], v31, 10, 10
318 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
319 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[ID]]
320 define void @other_arg_use_workitem_id_y(i32 %arg0) #1 {
321 %val = call i32 @llvm.amdgcn.workitem.id.y()
322 store volatile i32 %arg0, i32 addrspace(1)* undef
323 store volatile i32 %val, i32 addrspace(1)* undef
327 ; GCN-LABEL: {{^}}other_arg_use_workitem_id_z:
329 ; VARABI-DAG: v_bfe_u32 [[ID:v[0-9]+]], v1, 20, 10
330 ; FIXEDABI-DAG: v_bfe_u32 [[ID:v[0-9]+]], v31, 20, 10
331 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
332 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[ID]]
333 define void @other_arg_use_workitem_id_z(i32 %arg0) #1 {
334 %val = call i32 @llvm.amdgcn.workitem.id.z()
335 store volatile i32 %arg0, i32 addrspace(1)* undef
336 store volatile i32 %val, i32 addrspace(1)* undef
341 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workitem_id_x:
342 ; VARABI: enable_vgpr_workitem_id = 0
343 ; FIXEDABI: enable_vgpr_workitem_id = 2
345 ; VARABI: v_mov_b32_e32 v1, v0
346 ; VARABI: v_mov_b32_e32 v0, 0x22b
348 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
349 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
350 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
351 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
354 define amdgpu_kernel void @kern_indirect_other_arg_use_workitem_id_x() #1 {
355 call void @other_arg_use_workitem_id_x(i32 555)
360 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workitem_id_y:
361 ; VARABI: enable_vgpr_workitem_id = 1
363 ; VARABI: v_lshlrev_b32_e32 v1, 10, v1
365 ; VARABI: v_mov_b32_e32 v0, 0x22b
367 ; VARABI: s_swappc_b64
370 ; FIXEDABI: enable_vgpr_workitem_id = 2
371 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
372 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
373 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
374 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
375 define amdgpu_kernel void @kern_indirect_other_arg_use_workitem_id_y() #1 {
376 call void @other_arg_use_workitem_id_y(i32 555)
380 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workitem_id_z:
381 ; GCN: enable_vgpr_workitem_id = 2
383 ; VARABI-DAG: v_mov_b32_e32 v0, 0x22b
384 ; VARABI-DAG: v_lshlrev_b32_e32 v1, 20, v2
385 ; VARABI: s_swappc_b64
389 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
390 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
391 ; FIXEDABI: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
392 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
393 define amdgpu_kernel void @kern_indirect_other_arg_use_workitem_id_z() #1 {
394 call void @other_arg_use_workitem_id_z(i32 555)
398 ; GCN-LABEL: {{^}}too_many_args_use_workitem_id_x:
399 ; VARABI: buffer_load_dword v32, off, s[0:3], s32{{$}}
400 ; VARABI: v_and_b32_e32 v32, 0x3ff, v32
401 ; VARABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, v32
402 ; VARABI: s_setpc_b64
404 ; FIXEDABI: v_and_b32_e32 v31, 0x3ff, v31
405 ; FIXEDABI: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32{{$}}
406 define void @too_many_args_use_workitem_id_x(
407 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
408 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
409 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
410 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30, i32 %arg31) #1 {
411 %val = call i32 @llvm.amdgcn.workitem.id.x()
412 store volatile i32 %val, i32 addrspace(1)* undef
414 store volatile i32 %arg0, i32 addrspace(1)* undef
415 store volatile i32 %arg1, i32 addrspace(1)* undef
416 store volatile i32 %arg2, i32 addrspace(1)* undef
417 store volatile i32 %arg3, i32 addrspace(1)* undef
418 store volatile i32 %arg4, i32 addrspace(1)* undef
419 store volatile i32 %arg5, i32 addrspace(1)* undef
420 store volatile i32 %arg6, i32 addrspace(1)* undef
421 store volatile i32 %arg7, i32 addrspace(1)* undef
423 store volatile i32 %arg8, i32 addrspace(1)* undef
424 store volatile i32 %arg9, i32 addrspace(1)* undef
425 store volatile i32 %arg10, i32 addrspace(1)* undef
426 store volatile i32 %arg11, i32 addrspace(1)* undef
427 store volatile i32 %arg12, i32 addrspace(1)* undef
428 store volatile i32 %arg13, i32 addrspace(1)* undef
429 store volatile i32 %arg14, i32 addrspace(1)* undef
430 store volatile i32 %arg15, i32 addrspace(1)* undef
432 store volatile i32 %arg16, i32 addrspace(1)* undef
433 store volatile i32 %arg17, i32 addrspace(1)* undef
434 store volatile i32 %arg18, i32 addrspace(1)* undef
435 store volatile i32 %arg19, i32 addrspace(1)* undef
436 store volatile i32 %arg20, i32 addrspace(1)* undef
437 store volatile i32 %arg21, i32 addrspace(1)* undef
438 store volatile i32 %arg22, i32 addrspace(1)* undef
439 store volatile i32 %arg23, i32 addrspace(1)* undef
441 store volatile i32 %arg24, i32 addrspace(1)* undef
442 store volatile i32 %arg25, i32 addrspace(1)* undef
443 store volatile i32 %arg26, i32 addrspace(1)* undef
444 store volatile i32 %arg27, i32 addrspace(1)* undef
445 store volatile i32 %arg28, i32 addrspace(1)* undef
446 store volatile i32 %arg29, i32 addrspace(1)* undef
447 store volatile i32 %arg30, i32 addrspace(1)* undef
448 store volatile i32 %arg31, i32 addrspace(1)* undef
453 ; GCN-LABEL: {{^}}kern_call_too_many_args_use_workitem_id_x:
454 ; VARABI: enable_vgpr_workitem_id = 0
456 ; VARABI: s_mov_b32 s32, 0
457 ; VARABI: buffer_store_dword v0, off, s[0:3], s32{{$}}
458 ; VARABI: s_swappc_b64
461 ; FIXEDABI: enable_vgpr_workitem_id = 2
462 ; FIXEDABI-DAG: s_mov_b32 s32, 0
463 ; FIXEDABI-DAG: v_mov_b32_e32 [[K:v[0-9]+]], 0x140{{$}}
464 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
465 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
466 ; FIXEDABI-DAG: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
467 ; FIXEDABI-DAG: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
468 ; FIXEDABI: buffer_store_dword [[K]], off, s[0:3], s32{{$}}
470 ; FIXEDABI: s_swappc_b64
471 define amdgpu_kernel void @kern_call_too_many_args_use_workitem_id_x() #1 {
472 call void @too_many_args_use_workitem_id_x(
473 i32 10, i32 20, i32 30, i32 40,
474 i32 50, i32 60, i32 70, i32 80,
475 i32 90, i32 100, i32 110, i32 120,
476 i32 130, i32 140, i32 150, i32 160,
477 i32 170, i32 180, i32 190, i32 200,
478 i32 210, i32 220, i32 230, i32 240,
479 i32 250, i32 260, i32 270, i32 280,
480 i32 290, i32 300, i32 310, i32 320)
484 ; GCN-LABEL: {{^}}func_call_too_many_args_use_workitem_id_x:
485 ; VARABI: s_mov_b32 s33, s32
486 ; VARABI: buffer_store_dword v1, off, s[0:3], s32{{$}}
488 ; Touching the workitem id register is not necessary.
490 ; FIXEDABI: v_mov_b32_e32 [[K:v[0-9]+]], 0x140{{$}}
492 ; FIXEDABI: buffer_store_dword [[K]], off, s[0:3], s32{{$}}
496 define void @func_call_too_many_args_use_workitem_id_x(i32 %arg0) #1 {
497 store volatile i32 %arg0, i32 addrspace(1)* undef
498 call void @too_many_args_use_workitem_id_x(
499 i32 10, i32 20, i32 30, i32 40,
500 i32 50, i32 60, i32 70, i32 80,
501 i32 90, i32 100, i32 110, i32 120,
502 i32 130, i32 140, i32 150, i32 160,
503 i32 170, i32 180, i32 190, i32 200,
504 i32 210, i32 220, i32 230, i32 240,
505 i32 250, i32 260, i32 270, i32 280,
506 i32 290, i32 300, i32 310, i32 320)
510 ; Requires loading and storing to stack slot.
511 ; GCN-LABEL: {{^}}too_many_args_call_too_many_args_use_workitem_id_x:
512 ; GCN-DAG: s_addk_i32 s32, 0x400{{$}}
513 ; GCN-DAG: buffer_store_dword v40, off, s[0:3], s32 offset:4 ; 4-byte Folded Spill
514 ; GCN-DAG: buffer_load_dword v32, off, s[0:3], s33{{$}}
516 ; GCN: buffer_store_dword v32, off, s[0:3], s32{{$}}
520 ; GCN: s_addk_i32 s32, 0xfc00{{$}}
521 ; GCN: buffer_load_dword v40, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload
523 define void @too_many_args_call_too_many_args_use_workitem_id_x(
524 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
525 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
526 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
527 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30, i32 %arg31) #1 {
528 call void @too_many_args_use_workitem_id_x(
529 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
530 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
531 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
532 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30, i32 %arg31)
536 ; var abi stack layout:
537 ; frame[0] = byval arg32
538 ; frame[1] = stack passed workitem ID x
539 ; frame[2] = VGPR spill slot
541 ; GCN-LABEL: {{^}}too_many_args_use_workitem_id_x_byval:
542 ; VARABI: buffer_load_dword v32, off, s[0:3], s32 offset:4
543 ; VARABI-NEXT: s_waitcnt
544 ; VARABI-NEXT: v_and_b32_e32 v32, 0x3ff, v32
545 ; VARABI-NEXT: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v32
546 ; VARABI: buffer_load_dword v0, off, s[0:3], s32 glc{{$}}
547 ; VARABI: s_setpc_b64
550 ; FIXEDABI: v_and_b32_e32 v31, 0x3ff, v31
551 ; FIXEDABI-NEXT: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v31
553 ; FIXEDABI: buffer_load_dword v0, off, s[0:3], s32{{$}}
554 ; FIXEDABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
555 ; FIXEDABI: buffer_load_dword v0, off, s[0:3], s32 offset:4 glc{{$}}
556 ; FIXEDABI: s_setpc_b64
557 define void @too_many_args_use_workitem_id_x_byval(
558 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
559 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
560 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
561 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30, i32 %arg31, i32 addrspace(5)* byval(i32) %arg32) #1 {
562 %val = call i32 @llvm.amdgcn.workitem.id.x()
563 store volatile i32 %val, i32 addrspace(1)* undef
565 store volatile i32 %arg0, i32 addrspace(1)* undef
566 store volatile i32 %arg1, i32 addrspace(1)* undef
567 store volatile i32 %arg2, i32 addrspace(1)* undef
568 store volatile i32 %arg3, i32 addrspace(1)* undef
569 store volatile i32 %arg4, i32 addrspace(1)* undef
570 store volatile i32 %arg5, i32 addrspace(1)* undef
571 store volatile i32 %arg6, i32 addrspace(1)* undef
572 store volatile i32 %arg7, i32 addrspace(1)* undef
574 store volatile i32 %arg8, i32 addrspace(1)* undef
575 store volatile i32 %arg9, i32 addrspace(1)* undef
576 store volatile i32 %arg10, i32 addrspace(1)* undef
577 store volatile i32 %arg11, i32 addrspace(1)* undef
578 store volatile i32 %arg12, i32 addrspace(1)* undef
579 store volatile i32 %arg13, i32 addrspace(1)* undef
580 store volatile i32 %arg14, i32 addrspace(1)* undef
581 store volatile i32 %arg15, i32 addrspace(1)* undef
583 store volatile i32 %arg16, i32 addrspace(1)* undef
584 store volatile i32 %arg17, i32 addrspace(1)* undef
585 store volatile i32 %arg18, i32 addrspace(1)* undef
586 store volatile i32 %arg19, i32 addrspace(1)* undef
587 store volatile i32 %arg20, i32 addrspace(1)* undef
588 store volatile i32 %arg21, i32 addrspace(1)* undef
589 store volatile i32 %arg22, i32 addrspace(1)* undef
590 store volatile i32 %arg23, i32 addrspace(1)* undef
592 store volatile i32 %arg24, i32 addrspace(1)* undef
593 store volatile i32 %arg25, i32 addrspace(1)* undef
594 store volatile i32 %arg26, i32 addrspace(1)* undef
595 store volatile i32 %arg27, i32 addrspace(1)* undef
596 store volatile i32 %arg28, i32 addrspace(1)* undef
597 store volatile i32 %arg29, i32 addrspace(1)* undef
598 store volatile i32 %arg30, i32 addrspace(1)* undef
599 store volatile i32 %arg31, i32 addrspace(1)* undef
600 %private = load volatile i32, i32 addrspace(5)* %arg32
604 ; var abi stack layout:
607 ; sp[2] = stack passed workitem ID x
609 ; GCN-LABEL: {{^}}kern_call_too_many_args_use_workitem_id_x_byval:
610 ; VARABI: enable_vgpr_workitem_id = 0
611 ; VARABI: v_mov_b32_e32 [[K:v[0-9]+]], 0x3e7{{$}}
612 ; VARABI: buffer_store_dword [[K]], off, s[0:3], 0 offset:4
613 ; VARABI: buffer_load_dword [[RELOAD_BYVAL:v[0-9]+]], off, s[0:3], 0 offset:4
614 ; VARABI: s_movk_i32 s32, 0x400{{$}}
615 ; VARABI: buffer_store_dword v0, off, s[0:3], s32 offset:4
617 ; VARABI: buffer_store_dword [[RELOAD_BYVAL]], off, s[0:3], s32{{$}}
618 ; VARABI: v_mov_b32_e32 [[RELOAD_BYVAL]],
619 ; VARABI: s_swappc_b64
622 ; FIXEDABI: v_mov_b32_e32 [[K0:v[0-9]+]], 0x3e7
623 ; FIXEDABI: buffer_store_dword [[K0]], off, s[0:3], 0 offset:4{{$}}
624 ; FIXEDABI: s_movk_i32 s32, 0x400{{$}}
625 ; FIXEDABI: v_mov_b32_e32 [[K1:v[0-9]+]], 0x140
627 ; FIXEDABI: buffer_store_dword [[K1]], off, s[0:3], s32{{$}}
629 ; FIXME: Why this reload?
630 ; FIXEDABI: buffer_load_dword [[RELOAD:v[0-9]+]], off, s[0:3], 0 offset:4{{$}}
632 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
633 ; FIXEDABI-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
634 ; FIXEDABI-DAG: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
635 ; FIXEDABI: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
638 ; FIXEDABI: buffer_store_dword [[RELOAD]], off, s[0:3], s32 offset:4
639 ; FIXEDABI: s_swappc_b64
640 define amdgpu_kernel void @kern_call_too_many_args_use_workitem_id_x_byval() #1 {
641 %alloca = alloca i32, align 4, addrspace(5)
642 store volatile i32 999, i32 addrspace(5)* %alloca
643 call void @too_many_args_use_workitem_id_x_byval(
644 i32 10, i32 20, i32 30, i32 40,
645 i32 50, i32 60, i32 70, i32 80,
646 i32 90, i32 100, i32 110, i32 120,
647 i32 130, i32 140, i32 150, i32 160,
648 i32 170, i32 180, i32 190, i32 200,
649 i32 210, i32 220, i32 230, i32 240,
650 i32 250, i32 260, i32 270, i32 280,
651 i32 290, i32 300, i32 310, i32 320,
652 i32 addrspace(5)* byval(i32) %alloca)
656 ; GCN-LABEL: {{^}}func_call_too_many_args_use_workitem_id_x_byval:
657 ; VARABI: v_mov_b32_e32 [[K:v[0-9]+]], 0x3e7{{$}}
658 ; VARABI: buffer_store_dword [[K]], off, s[0:3], s33{{$}}
659 ; VARABI: buffer_load_dword [[RELOAD_BYVAL:v[0-9]+]], off, s[0:3], s33{{$}}
660 ; VARABI: buffer_store_dword v0, off, s[0:3], s32 offset:4
661 ; VARABI: buffer_store_dword [[RELOAD_BYVAL]], off, s[0:3], s32{{$}}
662 ; VARABI: v_mov_b32_e32 [[RELOAD_BYVAL]],
663 ; VARABI: s_swappc_b64
667 ; FIXEDABI: v_mov_b32_e32 [[K0:v[0-9]+]], 0x3e7{{$}}
668 ; FIXEDABI: buffer_store_dword [[K0]], off, s[0:3], s33{{$}}
669 ; FIXEDABI: v_mov_b32_e32 [[K1:v[0-9]+]], 0x140{{$}}
670 ; FIXEDABI: buffer_store_dword [[K1]], off, s[0:3], s32{{$}}
671 ; FIXEDABI: buffer_load_dword [[RELOAD_BYVAL:v[0-9]+]], off, s[0:3], s33{{$}}
674 ; FIXEDABI: buffer_store_dword [[RELOAD_BYVAL]], off, s[0:3], s32 offset:4{{$}}
676 ; FIXEDABI: s_swappc_b64
677 define void @func_call_too_many_args_use_workitem_id_x_byval() #1 {
678 %alloca = alloca i32, align 4, addrspace(5)
679 store volatile i32 999, i32 addrspace(5)* %alloca
680 call void @too_many_args_use_workitem_id_x_byval(
681 i32 10, i32 20, i32 30, i32 40,
682 i32 50, i32 60, i32 70, i32 80,
683 i32 90, i32 100, i32 110, i32 120,
684 i32 130, i32 140, i32 150, i32 160,
685 i32 170, i32 180, i32 190, i32 200,
686 i32 210, i32 220, i32 230, i32 240,
687 i32 250, i32 260, i32 270, i32 280,
688 i32 290, i32 300, i32 310, i32 320,
689 i32 addrspace(5)* byval(i32) %alloca)
693 ; GCN-LABEL: {{^}}too_many_args_use_workitem_id_xyz:
694 ; VARABI-NOT: buffer_load_dword v{{[0-9]+}}, off, s[0:3], s32{{$}}
695 ; VARABI: buffer_load_dword v32, off, s[0:3], s32{{$}}
696 ; VARABI-NOT: buffer_load_dword
698 ; VARABI: v_and_b32_e32 [[AND_X:v[0-9]+]], 0x3ff, v32
699 ; VARABI-NOT: buffer_load_dword
700 ; VARABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[AND_X]]
701 ; VARABI-NOT: buffer_load_dword
702 ; VARABI: v_bfe_u32 [[BFE_Y:v[0-9]+]], v32, 10, 10
703 ; VARABI-NEXT: v_bfe_u32 [[BFE_Z:v[0-9]+]], v32, 20, 10
704 ; VARABI-NEXT: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[BFE_Y]]
705 ; VARABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[BFE_Z]]
706 ; VARABI: s_setpc_b64
709 ; FIXEDABI: v_and_b32_e32 [[AND_X:v[0-9]+]], 0x3ff, v31
710 ; FIXEDABI-NOT: buffer_load_dword
711 ; FIXEDABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[AND_X]]
712 ; FIXEDABI-NOT: buffer_load_dword
713 ; FIXEDABI: v_bfe_u32 [[BFE_Y:v[0-9]+]], v31, 10, 10
714 ; FIXEDABI-NEXT: v_bfe_u32 [[BFE_Z:v[0-9]+]], v31, 20, 10
715 ; FIXEDABI-NEXT: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[BFE_Y]]
716 ; FIXEDABI: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[BFE_Z]]
718 define void @too_many_args_use_workitem_id_xyz(
719 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
720 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
721 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
722 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30, i32 %arg31) #1 {
723 %val0 = call i32 @llvm.amdgcn.workitem.id.x()
724 store volatile i32 %val0, i32 addrspace(1)* undef
725 %val1 = call i32 @llvm.amdgcn.workitem.id.y()
726 store volatile i32 %val1, i32 addrspace(1)* undef
727 %val2 = call i32 @llvm.amdgcn.workitem.id.z()
728 store volatile i32 %val2, i32 addrspace(1)* undef
730 store volatile i32 %arg0, i32 addrspace(1)* undef
731 store volatile i32 %arg1, i32 addrspace(1)* undef
732 store volatile i32 %arg2, i32 addrspace(1)* undef
733 store volatile i32 %arg3, i32 addrspace(1)* undef
734 store volatile i32 %arg4, i32 addrspace(1)* undef
735 store volatile i32 %arg5, i32 addrspace(1)* undef
736 store volatile i32 %arg6, i32 addrspace(1)* undef
737 store volatile i32 %arg7, i32 addrspace(1)* undef
739 store volatile i32 %arg8, i32 addrspace(1)* undef
740 store volatile i32 %arg9, i32 addrspace(1)* undef
741 store volatile i32 %arg10, i32 addrspace(1)* undef
742 store volatile i32 %arg11, i32 addrspace(1)* undef
743 store volatile i32 %arg12, i32 addrspace(1)* undef
744 store volatile i32 %arg13, i32 addrspace(1)* undef
745 store volatile i32 %arg14, i32 addrspace(1)* undef
746 store volatile i32 %arg15, i32 addrspace(1)* undef
748 store volatile i32 %arg16, i32 addrspace(1)* undef
749 store volatile i32 %arg17, i32 addrspace(1)* undef
750 store volatile i32 %arg18, i32 addrspace(1)* undef
751 store volatile i32 %arg19, i32 addrspace(1)* undef
752 store volatile i32 %arg20, i32 addrspace(1)* undef
753 store volatile i32 %arg21, i32 addrspace(1)* undef
754 store volatile i32 %arg22, i32 addrspace(1)* undef
755 store volatile i32 %arg23, i32 addrspace(1)* undef
757 store volatile i32 %arg24, i32 addrspace(1)* undef
758 store volatile i32 %arg25, i32 addrspace(1)* undef
759 store volatile i32 %arg26, i32 addrspace(1)* undef
760 store volatile i32 %arg27, i32 addrspace(1)* undef
761 store volatile i32 %arg28, i32 addrspace(1)* undef
762 store volatile i32 %arg29, i32 addrspace(1)* undef
763 store volatile i32 %arg30, i32 addrspace(1)* undef
764 store volatile i32 %arg31, i32 addrspace(1)* undef
769 ; GCN-LABEL: {{^}}kern_call_too_many_args_use_workitem_id_xyz:
770 ; GCN: enable_vgpr_workitem_id = 2
772 ; GCN-DAG: s_mov_b32 s32, 0
774 ; GCN-DAG: v_lshlrev_b32_e32 [[TMP1:v[0-9]+]], 10, v1
775 ; GCN-DAG: v_lshlrev_b32_e32 [[TMP0:v[0-9]+]], 20, v2
776 ; GCN-DAG: v_or_b32_e32 [[TMP2:v[0-9]+]], v0, [[TMP1]]
777 ; VARABI-DAG: v_or_b32_e32 [[PACKEDID:v[0-9]+]], [[TMP2]], [[TMP0]]
778 ; VARABI: buffer_store_dword [[PACKEDID]], off, s[0:3], s32{{$}}
780 ; FIXEDABI-DAG: v_or_b32_e32 v31, [[TMP2]], [[TMP0]]
781 ; FIXEDABI-DAG: v_mov_b32_e32 [[K:v[0-9]+]], 0x140
782 ; FIXEDABI: buffer_store_dword [[K]], off, s[0:3], s32{{$}}
785 define amdgpu_kernel void @kern_call_too_many_args_use_workitem_id_xyz() #1 {
786 call void @too_many_args_use_workitem_id_xyz(
787 i32 10, i32 20, i32 30, i32 40,
788 i32 50, i32 60, i32 70, i32 80,
789 i32 90, i32 100, i32 110, i32 120,
790 i32 130, i32 140, i32 150, i32 160,
791 i32 170, i32 180, i32 190, i32 200,
792 i32 210, i32 220, i32 230, i32 240,
793 i32 250, i32 260, i32 270, i32 280,
794 i32 290, i32 300, i32 310, i32 320)
798 ; Var abi: workitem ID X in register, yz on stack
799 ; v31 = workitem ID X
800 ; frame[0] = workitem { Z, Y, X }
802 ; GCN-LABEL: {{^}}too_many_args_use_workitem_id_x_stack_yz:
803 ; GCN-DAG: v_and_b32_e32 [[IDX:v[0-9]+]], 0x3ff, v31
804 ; GCN-DAG: {{flat|global}}_store_dword v[0:1], [[IDX]]
805 ; GCN-DAG: v_bfe_u32 [[IDY:v[0-9]+]], v31, 10, 10
806 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[IDY]]
807 ; GCN-DAG: v_bfe_u32 [[IDZ:v[0-9]+]], v31, 20, 10
808 ; GCN-DAG: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+]}}, [[IDZ]]
810 ; GCN: ScratchSize: 0
811 define void @too_many_args_use_workitem_id_x_stack_yz(
812 i32 %arg0, i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg5, i32 %arg6, i32 %arg7,
813 i32 %arg8, i32 %arg9, i32 %arg10, i32 %arg11, i32 %arg12, i32 %arg13, i32 %arg14, i32 %arg15,
814 i32 %arg16, i32 %arg17, i32 %arg18, i32 %arg19, i32 %arg20, i32 %arg21, i32 %arg22, i32 %arg23,
815 i32 %arg24, i32 %arg25, i32 %arg26, i32 %arg27, i32 %arg28, i32 %arg29, i32 %arg30) #1 {
816 %val0 = call i32 @llvm.amdgcn.workitem.id.x()
817 store volatile i32 %val0, i32 addrspace(1)* undef
818 %val1 = call i32 @llvm.amdgcn.workitem.id.y()
819 store volatile i32 %val1, i32 addrspace(1)* undef
820 %val2 = call i32 @llvm.amdgcn.workitem.id.z()
821 store volatile i32 %val2, i32 addrspace(1)* undef
823 store volatile i32 %arg0, i32 addrspace(1)* undef
824 store volatile i32 %arg1, i32 addrspace(1)* undef
825 store volatile i32 %arg2, i32 addrspace(1)* undef
826 store volatile i32 %arg3, i32 addrspace(1)* undef
827 store volatile i32 %arg4, i32 addrspace(1)* undef
828 store volatile i32 %arg5, i32 addrspace(1)* undef
829 store volatile i32 %arg6, i32 addrspace(1)* undef
830 store volatile i32 %arg7, i32 addrspace(1)* undef
832 store volatile i32 %arg8, i32 addrspace(1)* undef
833 store volatile i32 %arg9, i32 addrspace(1)* undef
834 store volatile i32 %arg10, i32 addrspace(1)* undef
835 store volatile i32 %arg11, i32 addrspace(1)* undef
836 store volatile i32 %arg12, i32 addrspace(1)* undef
837 store volatile i32 %arg13, i32 addrspace(1)* undef
838 store volatile i32 %arg14, i32 addrspace(1)* undef
839 store volatile i32 %arg15, i32 addrspace(1)* undef
841 store volatile i32 %arg16, i32 addrspace(1)* undef
842 store volatile i32 %arg17, i32 addrspace(1)* undef
843 store volatile i32 %arg18, i32 addrspace(1)* undef
844 store volatile i32 %arg19, i32 addrspace(1)* undef
845 store volatile i32 %arg20, i32 addrspace(1)* undef
846 store volatile i32 %arg21, i32 addrspace(1)* undef
847 store volatile i32 %arg22, i32 addrspace(1)* undef
848 store volatile i32 %arg23, i32 addrspace(1)* undef
850 store volatile i32 %arg24, i32 addrspace(1)* undef
851 store volatile i32 %arg25, i32 addrspace(1)* undef
852 store volatile i32 %arg26, i32 addrspace(1)* undef
853 store volatile i32 %arg27, i32 addrspace(1)* undef
854 store volatile i32 %arg28, i32 addrspace(1)* undef
855 store volatile i32 %arg29, i32 addrspace(1)* undef
856 store volatile i32 %arg30, i32 addrspace(1)* undef
861 ; GCN-LABEL: {{^}}kern_call_too_many_args_use_workitem_id_x_stack_yz:
862 ; GCN: enable_vgpr_workitem_id = 2
865 ; GCN-DAG: v_lshlrev_b32_e32 v1, 10, v1
866 ; GCN-DAG: v_or_b32_e32 v0, v0, v1
867 ; GCN-DAG: v_lshlrev_b32_e32 v2, 20, v2
868 ; GCN-DAG: v_or_b32_e32 v31, v0, v2
870 ; GCN: s_mov_b32 s32, 0
872 define amdgpu_kernel void @kern_call_too_many_args_use_workitem_id_x_stack_yz() #1 {
873 call void @too_many_args_use_workitem_id_x_stack_yz(
874 i32 10, i32 20, i32 30, i32 40,
875 i32 50, i32 60, i32 70, i32 80,
876 i32 90, i32 100, i32 110, i32 120,
877 i32 130, i32 140, i32 150, i32 160,
878 i32 170, i32 180, i32 190, i32 200,
879 i32 210, i32 220, i32 230, i32 240,
880 i32 250, i32 260, i32 270, i32 280,
881 i32 290, i32 300, i32 310)
885 declare i32 @llvm.amdgcn.workitem.id.x() #0
886 declare i32 @llvm.amdgcn.workitem.id.y() #0
887 declare i32 @llvm.amdgcn.workitem.id.z() #0
889 attributes #0 = { nounwind readnone speculatable }
890 attributes #1 = { nounwind noinline }