1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -enable-ipra=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CIVI %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -enable-ipra=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s
4 ; GCN-LABEL: {{^}}use_dispatch_ptr:
5 ; GCN: s_load_dword s{{[0-9]+}}, s[6:7], 0x0
6 define void @use_dispatch_ptr() #1 {
7 %dispatch_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
8 %header_ptr = bitcast i8 addrspace(2)* %dispatch_ptr to i32 addrspace(2)*
9 %value = load volatile i32, i32 addrspace(2)* %header_ptr
13 ; GCN-LABEL: {{^}}kern_indirect_use_dispatch_ptr:
14 ; GCN: enable_sgpr_dispatch_ptr = 1
15 ; GCN: s_mov_b64 s[6:7], s[4:5]
16 define amdgpu_kernel void @kern_indirect_use_dispatch_ptr(i32) #1 {
17 call void @use_dispatch_ptr()
21 ; GCN-LABEL: {{^}}use_queue_ptr:
22 ; GCN: s_load_dword s{{[0-9]+}}, s[6:7], 0x0
23 define void @use_queue_ptr() #1 {
24 %queue_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
25 %header_ptr = bitcast i8 addrspace(2)* %queue_ptr to i32 addrspace(2)*
26 %value = load volatile i32, i32 addrspace(2)* %header_ptr
30 ; GCN-LABEL: {{^}}kern_indirect_use_queue_ptr:
31 ; GCN: enable_sgpr_queue_ptr = 1
32 ; GCN: s_mov_b64 s[6:7], s[4:5]
34 define amdgpu_kernel void @kern_indirect_use_queue_ptr(i32) #1 {
35 call void @use_queue_ptr()
39 ; GCN-LABEL: {{^}}use_queue_ptr_addrspacecast:
40 ; CIVI: s_load_dword [[APERTURE_LOAD:s[0-9]+]], s[6:7], 0x10
41 ; GFX9: s_getreg_b32 [[APERTURE_LOAD:s[0-9]+]]
43 ; GCN: v_mov_b32_e32 v[[HI:[0-9]+]], [[APERTURE_LOAD]]
44 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+}}:[[HI]]{{\]}}
45 define void @use_queue_ptr_addrspacecast() #1 {
46 %asc = addrspacecast i32 addrspace(3)* inttoptr (i32 16 to i32 addrspace(3)*) to i32 addrspace(4)*
47 store volatile i32 0, i32 addrspace(4)* %asc
51 ; GCN-LABEL: {{^}}kern_indirect_use_queue_ptr_addrspacecast:
52 ; CIVI: enable_sgpr_queue_ptr = 1
54 ; CIVI: s_mov_b64 s[6:7], s[4:5]
57 define amdgpu_kernel void @kern_indirect_use_queue_ptr_addrspacecast(i32) #1 {
58 call void @use_queue_ptr_addrspacecast()
62 ; GCN-LABEL: {{^}}use_kernarg_segment_ptr:
63 ; GCN: s_load_dword s{{[0-9]+}}, s[6:7], 0x0
64 define void @use_kernarg_segment_ptr() #1 {
65 %kernarg_segment_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
66 %header_ptr = bitcast i8 addrspace(2)* %kernarg_segment_ptr to i32 addrspace(2)*
67 %value = load volatile i32, i32 addrspace(2)* %header_ptr
71 ; GCN-LABEL: {{^}}kern_indirect_use_kernarg_segment_ptr:
72 ; GCN: enable_sgpr_kernarg_segment_ptr = 1
73 ; GCN: s_mov_b64 s[6:7], s[4:5]
75 define amdgpu_kernel void @kern_indirect_use_kernarg_segment_ptr(i32) #1 {
76 call void @use_kernarg_segment_ptr()
80 ; GCN-LABEL: {{^}}use_dispatch_id:
82 define void @use_dispatch_id() #1 {
83 %id = call i64 @llvm.amdgcn.dispatch.id()
84 call void asm sideeffect "; use $0", "s"(i64 %id)
88 ; No kernarg segment so that there is a mov to check. With kernarg
89 ; pointer enabled, it happens to end up in the right place anyway.
91 ; GCN-LABEL: {{^}}kern_indirect_use_dispatch_id:
92 ; GCN: enable_sgpr_dispatch_id = 1
94 ; GCN: s_mov_b64 s[6:7], s[4:5]
95 define amdgpu_kernel void @kern_indirect_use_dispatch_id() #1 {
96 call void @use_dispatch_id()
100 ; GCN-LABEL: {{^}}use_workgroup_id_x:
103 define void @use_workgroup_id_x() #1 {
104 %val = call i32 @llvm.amdgcn.workgroup.id.x()
105 call void asm sideeffect "; use $0", "s"(i32 %val)
109 ; GCN-LABEL: {{^}}use_stack_workgroup_id_x:
111 ; GCN: s_mov_b32 s5, s32
112 ; GCN: buffer_store_dword v0, off, s[0:3], s5 offset:4
115 define void @use_stack_workgroup_id_x() #1 {
117 store volatile i32 0, i32* %alloca
118 %val = call i32 @llvm.amdgcn.workgroup.id.x()
119 call void asm sideeffect "; use $0", "s"(i32 %val)
123 ; GCN-LABEL: {{^}}use_workgroup_id_y:
126 define void @use_workgroup_id_y() #1 {
127 %val = call i32 @llvm.amdgcn.workgroup.id.y()
128 call void asm sideeffect "; use $0", "s"(i32 %val)
132 ; GCN-LABEL: {{^}}use_workgroup_id_z:
135 define void @use_workgroup_id_z() #1 {
136 %val = call i32 @llvm.amdgcn.workgroup.id.z()
137 call void asm sideeffect "; use $0", "s"(i32 %val)
141 ; GCN-LABEL: {{^}}use_workgroup_id_xy:
144 define void @use_workgroup_id_xy() #1 {
145 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
146 %val1 = call i32 @llvm.amdgcn.workgroup.id.y()
147 call void asm sideeffect "; use $0", "s"(i32 %val0)
148 call void asm sideeffect "; use $0", "s"(i32 %val1)
152 ; GCN-LABEL: {{^}}use_workgroup_id_xyz:
156 define void @use_workgroup_id_xyz() #1 {
157 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
158 %val1 = call i32 @llvm.amdgcn.workgroup.id.y()
159 %val2 = call i32 @llvm.amdgcn.workgroup.id.z()
160 call void asm sideeffect "; use $0", "s"(i32 %val0)
161 call void asm sideeffect "; use $0", "s"(i32 %val1)
162 call void asm sideeffect "; use $0", "s"(i32 %val2)
166 ; GCN-LABEL: {{^}}use_workgroup_id_xz:
169 define void @use_workgroup_id_xz() #1 {
170 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
171 %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
172 call void asm sideeffect "; use $0", "s"(i32 %val0)
173 call void asm sideeffect "; use $0", "s"(i32 %val1)
177 ; GCN-LABEL: {{^}}use_workgroup_id_yz:
180 define void @use_workgroup_id_yz() #1 {
181 %val0 = call i32 @llvm.amdgcn.workgroup.id.y()
182 %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
183 call void asm sideeffect "; use $0", "s"(i32 %val0)
184 call void asm sideeffect "; use $0", "s"(i32 %val1)
188 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_x:
189 ; GCN: enable_sgpr_workgroup_id_x = 1
190 ; GCN: enable_sgpr_workgroup_id_y = 0
191 ; GCN: enable_sgpr_workgroup_id_z = 0
194 ; GCN: s_mov_b32 s33, s7
196 ; GCN: s_mov_b32 s4, s33
198 ; GCN: s_mov_b32 s32, s33
200 define amdgpu_kernel void @kern_indirect_use_workgroup_id_x() #1 {
201 call void @use_workgroup_id_x()
205 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_y:
206 ; GCN: enable_sgpr_workgroup_id_x = 1
207 ; GCN: enable_sgpr_workgroup_id_y = 1
208 ; GCN: enable_sgpr_workgroup_id_z = 0
210 ; GCN: s_mov_b32 s33, s8
211 ; GCN: s_mov_b32 s4, s33
212 ; GCN: s_mov_b32 s6, s7
213 ; GCN: s_mov_b32 s32, s33
215 define amdgpu_kernel void @kern_indirect_use_workgroup_id_y() #1 {
216 call void @use_workgroup_id_y()
220 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_z:
221 ; GCN: enable_sgpr_workgroup_id_x = 1
222 ; GCN: enable_sgpr_workgroup_id_y = 0
223 ; GCN: enable_sgpr_workgroup_id_z = 1
225 ; GCN: s_mov_b32 s33, s8
226 ; GCN: s_mov_b32 s4, s33
227 ; GCN: s_mov_b32 s6, s7
229 define amdgpu_kernel void @kern_indirect_use_workgroup_id_z() #1 {
230 call void @use_workgroup_id_z()
234 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_xy:
235 ; GCN: enable_sgpr_workgroup_id_x = 1
236 ; GCN: enable_sgpr_workgroup_id_y = 1
237 ; GCN: enable_sgpr_workgroup_id_z = 0
239 ; GCN: s_mov_b32 s33, s8
242 ; GCN: s_mov_b32 s4, s33
245 ; GCN: s_mov_b32 s32, s33
249 define amdgpu_kernel void @kern_indirect_use_workgroup_id_xy() #1 {
250 call void @use_workgroup_id_xy()
254 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_xyz:
255 ; GCN: enable_sgpr_workgroup_id_x = 1
256 ; GCN: enable_sgpr_workgroup_id_y = 1
257 ; GCN: enable_sgpr_workgroup_id_z = 1
259 ; GCN: s_mov_b32 s33, s9
265 ; GCN: s_mov_b32 s4, s33
271 ; GCN: s_mov_b32 s32, s33
278 define amdgpu_kernel void @kern_indirect_use_workgroup_id_xyz() #1 {
279 call void @use_workgroup_id_xyz()
283 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_xz:
284 ; GCN: enable_sgpr_workgroup_id_x = 1
285 ; GCN: enable_sgpr_workgroup_id_y = 0
286 ; GCN: enable_sgpr_workgroup_id_z = 1
288 ; GCN: s_mov_b32 s33, s8
292 ; GCN: s_mov_b32 s4, s33
296 ; GCN: s_mov_b32 s32, s33
301 define amdgpu_kernel void @kern_indirect_use_workgroup_id_xz() #1 {
302 call void @use_workgroup_id_xz()
306 ; GCN-LABEL: {{^}}kern_indirect_use_workgroup_id_yz:
307 ; GCN: enable_sgpr_workgroup_id_x = 1
308 ; GCN: enable_sgpr_workgroup_id_y = 1
309 ; GCN: enable_sgpr_workgroup_id_z = 1
311 ; GCN: s_mov_b32 s33, s9
312 ; GCN: s_mov_b32 s6, s7
313 ; GCN: s_mov_b32 s4, s33
314 ; GCN: s_mov_b32 s7, s8
315 ; GCN: s_mov_b32 s32, s33
317 define amdgpu_kernel void @kern_indirect_use_workgroup_id_yz() #1 {
318 call void @use_workgroup_id_yz()
322 ; Argument is in right place already
323 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_x:
325 define void @func_indirect_use_workgroup_id_x() #1 {
326 call void @use_workgroup_id_x()
330 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_y:
332 define void @func_indirect_use_workgroup_id_y() #1 {
333 call void @use_workgroup_id_y()
337 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_z:
339 define void @func_indirect_use_workgroup_id_z() #1 {
340 call void @use_workgroup_id_z()
344 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_x:
345 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
347 define void @other_arg_use_workgroup_id_x(i32 %arg0) #1 {
348 %val = call i32 @llvm.amdgcn.workgroup.id.x()
349 store volatile i32 %arg0, i32 addrspace(1)* undef
350 call void asm sideeffect "; use $0", "s"(i32 %val)
354 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_y:
355 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
357 define void @other_arg_use_workgroup_id_y(i32 %arg0) #1 {
358 %val = call i32 @llvm.amdgcn.workgroup.id.y()
359 store volatile i32 %arg0, i32 addrspace(1)* undef
360 call void asm sideeffect "; use $0", "s"(i32 %val)
364 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_z:
365 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
367 define void @other_arg_use_workgroup_id_z(i32 %arg0) #1 {
368 %val = call i32 @llvm.amdgcn.workgroup.id.z()
369 store volatile i32 %arg0, i32 addrspace(1)* undef
370 call void asm sideeffect "; use $0", "s"(i32 %val)
374 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workgroup_id_x:
375 ; GCN: enable_sgpr_workgroup_id_x = 1
376 ; GCN: enable_sgpr_workgroup_id_y = 0
377 ; GCN: enable_sgpr_workgroup_id_z = 0
379 ; GCN-DAG: s_mov_b32 s33, s7
380 ; GCN-DAG: v_mov_b32_e32 v0, 0x22b
383 ; GCN: s_mov_b32 s4, s33
385 ; GCN-DAG: s_mov_b32 s32, s33
387 define amdgpu_kernel void @kern_indirect_other_arg_use_workgroup_id_x() #1 {
388 call void @other_arg_use_workgroup_id_x(i32 555)
392 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workgroup_id_y:
393 ; GCN: enable_sgpr_workgroup_id_x = 1
394 ; GCN: enable_sgpr_workgroup_id_y = 1
395 ; GCN: enable_sgpr_workgroup_id_z = 0
397 ; GCN-DAG: s_mov_b32 s33, s8
398 ; GCN-DAG: v_mov_b32_e32 v0, 0x22b
399 ; GCN: s_mov_b32 s4, s33
400 ; GCN-DAG: s_mov_b32 s6, s7
401 ; GCN-DAG: s_mov_b32 s32, s33
403 define amdgpu_kernel void @kern_indirect_other_arg_use_workgroup_id_y() #1 {
404 call void @other_arg_use_workgroup_id_y(i32 555)
408 ; GCN-LABEL: {{^}}kern_indirect_other_arg_use_workgroup_id_z:
409 ; GCN: enable_sgpr_workgroup_id_x = 1
410 ; GCN: enable_sgpr_workgroup_id_y = 0
411 ; GCN: enable_sgpr_workgroup_id_z = 1
413 ; GCN: s_mov_b32 s33, s8
414 ; GCN-DAG: v_mov_b32_e32 v0, 0x22b
415 ; GCN: s_mov_b32 s4, s33
416 ; GCN-DAG: s_mov_b32 s6, s7
418 ; GCN: s_mov_b32 s32, s33
420 define amdgpu_kernel void @kern_indirect_other_arg_use_workgroup_id_z() #1 {
421 call void @other_arg_use_workgroup_id_z(i32 555)
425 ; GCN-LABEL: {{^}}use_every_sgpr_input:
426 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s5 offset:4
427 ; GCN: s_load_dword s{{[0-9]+}}, s[6:7], 0x0
428 ; GCN: s_load_dword s{{[0-9]+}}, s[8:9], 0x0
429 ; GCN: s_load_dword s{{[0-9]+}}, s[10:11], 0x0
430 ; GCN: ; use s[12:13]
434 define void @use_every_sgpr_input() #1 {
435 %alloca = alloca i32, align 4
436 store volatile i32 0, i32* %alloca
438 %dispatch_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
439 %dispatch_ptr.bc = bitcast i8 addrspace(2)* %dispatch_ptr to i32 addrspace(2)*
440 %val0 = load volatile i32, i32 addrspace(2)* %dispatch_ptr.bc
442 %queue_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
443 %queue_ptr.bc = bitcast i8 addrspace(2)* %queue_ptr to i32 addrspace(2)*
444 %val1 = load volatile i32, i32 addrspace(2)* %queue_ptr.bc
446 %kernarg_segment_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
447 %kernarg_segment_ptr.bc = bitcast i8 addrspace(2)* %kernarg_segment_ptr to i32 addrspace(2)*
448 %val2 = load volatile i32, i32 addrspace(2)* %kernarg_segment_ptr.bc
450 %val3 = call i64 @llvm.amdgcn.dispatch.id()
451 call void asm sideeffect "; use $0", "s"(i64 %val3)
453 %val4 = call i32 @llvm.amdgcn.workgroup.id.x()
454 call void asm sideeffect "; use $0", "s"(i32 %val4)
456 %val5 = call i32 @llvm.amdgcn.workgroup.id.y()
457 call void asm sideeffect "; use $0", "s"(i32 %val5)
459 %val6 = call i32 @llvm.amdgcn.workgroup.id.z()
460 call void asm sideeffect "; use $0", "s"(i32 %val6)
465 ; GCN-LABEL: {{^}}kern_indirect_use_every_sgpr_input:
466 ; GCN: enable_sgpr_workgroup_id_x = 1
467 ; GCN: enable_sgpr_workgroup_id_y = 1
468 ; GCN: enable_sgpr_workgroup_id_z = 1
469 ; GCN: enable_sgpr_workgroup_info = 0
471 ; GCN: enable_sgpr_private_segment_buffer = 1
472 ; GCN: enable_sgpr_dispatch_ptr = 1
473 ; GCN: enable_sgpr_queue_ptr = 1
474 ; GCN: enable_sgpr_kernarg_segment_ptr = 1
475 ; GCN: enable_sgpr_dispatch_id = 1
476 ; GCN: enable_sgpr_flat_scratch_init = 1
478 ; GCN: s_mov_b32 s33, s17
479 ; GCN: s_mov_b64 s[12:13], s[10:11]
480 ; GCN: s_mov_b64 s[10:11], s[8:9]
481 ; GCN: s_mov_b64 s[8:9], s[6:7]
482 ; GCN: s_mov_b64 s[6:7], s[4:5]
483 ; GCN: s_mov_b32 s4, s33
484 ; GCN: s_mov_b32 s32, s33
486 define amdgpu_kernel void @kern_indirect_use_every_sgpr_input() #1 {
487 call void @use_every_sgpr_input()
491 ; GCN-LABEL: {{^}}func_indirect_use_every_sgpr_input:
504 define void @func_indirect_use_every_sgpr_input() #1 {
505 call void @use_every_sgpr_input()
509 ; GCN-LABEL: {{^}}func_use_every_sgpr_input_call_use_workgroup_id_xyz:
510 ; GCN-DAG: s_mov_b32 s6, s14
511 ; GCN-DAG: s_mov_b32 s7, s15
512 ; GCN-DAG: s_mov_b32 s8, s16
514 define void @func_use_every_sgpr_input_call_use_workgroup_id_xyz() #1 {
515 %alloca = alloca i32, align 4
516 store volatile i32 0, i32* %alloca
518 %dispatch_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
519 %dispatch_ptr.bc = bitcast i8 addrspace(2)* %dispatch_ptr to i32 addrspace(2)*
520 %val0 = load volatile i32, i32 addrspace(2)* %dispatch_ptr.bc
522 %queue_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
523 %queue_ptr.bc = bitcast i8 addrspace(2)* %queue_ptr to i32 addrspace(2)*
524 %val1 = load volatile i32, i32 addrspace(2)* %queue_ptr.bc
526 %kernarg_segment_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
527 %kernarg_segment_ptr.bc = bitcast i8 addrspace(2)* %kernarg_segment_ptr to i32 addrspace(2)*
528 %val2 = load volatile i32, i32 addrspace(2)* %kernarg_segment_ptr.bc
530 %val3 = call i64 @llvm.amdgcn.dispatch.id()
531 call void asm sideeffect "; use $0", "s"(i64 %val3)
533 %val4 = call i32 @llvm.amdgcn.workgroup.id.x()
534 call void asm sideeffect "; use $0", "s"(i32 %val4)
536 %val5 = call i32 @llvm.amdgcn.workgroup.id.y()
537 call void asm sideeffect "; use $0", "s"(i32 %val5)
539 %val6 = call i32 @llvm.amdgcn.workgroup.id.z()
540 call void asm sideeffect "; use $0", "s"(i32 %val6)
542 call void @use_workgroup_id_xyz()
546 ; GCN-LABEL: {{^}}func_use_every_sgpr_input_call_use_workgroup_id_xyz_spill:
547 ; GCN: s_mov_b32 s5, s32
548 ; GCN: s_add_u32 s32, s32, 0x300
550 ; GCN-DAG: s_mov_b32 [[SAVE_X:s[0-9]+]], s14
551 ; GCN-DAG: s_mov_b32 [[SAVE_Y:s[0-9]+]], s15
552 ; GCN-DAG: s_mov_b32 [[SAVE_Z:s[0-9]+]], s16
553 ; GCN-DAG: s_mov_b64 {{s\[[0-9]+:[0-9]+\]}}, s[6:7]
554 ; GCN-DAG: s_mov_b64 {{s\[[0-9]+:[0-9]+\]}}, s[8:9]
555 ; GCN-DAG: s_mov_b64 {{s\[[0-9]+:[0-9]+\]}}, s[10:11]
557 ; GCN-DAG: s_mov_b32 s6, [[SAVE_X]]
558 ; GCN-DAG: s_mov_b32 s7, [[SAVE_Y]]
559 ; GCN-DAG: s_mov_b32 s8, [[SAVE_Z]]
562 ; GCN: buffer_store_dword v{{[0-9]+}}, off, s[0:3], s5 offset:4
563 ; GCN: s_load_dword s{{[0-9]+}},
564 ; GCN: s_load_dword s{{[0-9]+}},
565 ; GCN: s_load_dword s{{[0-9]+}},
567 ; GCN: ; use [[SAVE_X]]
568 ; GCN: ; use [[SAVE_Y]]
569 ; GCN: ; use [[SAVE_Z]]
570 define void @func_use_every_sgpr_input_call_use_workgroup_id_xyz_spill() #1 {
571 %alloca = alloca i32, align 4
572 call void @use_workgroup_id_xyz()
574 store volatile i32 0, i32* %alloca
576 %dispatch_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
577 %dispatch_ptr.bc = bitcast i8 addrspace(2)* %dispatch_ptr to i32 addrspace(2)*
578 %val0 = load volatile i32, i32 addrspace(2)* %dispatch_ptr.bc
580 %queue_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
581 %queue_ptr.bc = bitcast i8 addrspace(2)* %queue_ptr to i32 addrspace(2)*
582 %val1 = load volatile i32, i32 addrspace(2)* %queue_ptr.bc
584 %kernarg_segment_ptr = call noalias i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
585 %kernarg_segment_ptr.bc = bitcast i8 addrspace(2)* %kernarg_segment_ptr to i32 addrspace(2)*
586 %val2 = load volatile i32, i32 addrspace(2)* %kernarg_segment_ptr.bc
588 %val3 = call i64 @llvm.amdgcn.dispatch.id()
589 call void asm sideeffect "; use $0", "s"(i64 %val3)
591 %val4 = call i32 @llvm.amdgcn.workgroup.id.x()
592 call void asm sideeffect "; use $0", "s"(i32 %val4)
594 %val5 = call i32 @llvm.amdgcn.workgroup.id.y()
595 call void asm sideeffect "; use $0", "s"(i32 %val5)
597 %val6 = call i32 @llvm.amdgcn.workgroup.id.z()
598 call void asm sideeffect "; use $0", "s"(i32 %val6)
603 declare i32 @llvm.amdgcn.workgroup.id.x() #0
604 declare i32 @llvm.amdgcn.workgroup.id.y() #0
605 declare i32 @llvm.amdgcn.workgroup.id.z() #0
606 declare noalias i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
607 declare noalias i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
608 declare i64 @llvm.amdgcn.dispatch.id() #0
609 declare noalias i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
611 attributes #0 = { nounwind readnone speculatable }
612 attributes #1 = { nounwind noinline }