llvm.org GIT mirror llvm / 6943079
AMDGPU: Make test functions hidden Reduces amount of code in the function from eliminating the GOT load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363940 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault a month ago
1 changed file(s) with 23 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
44 ; GCN: v_mov_b32_e32 v[[LO:[0-9]+]], s6
55 ; GCN: v_mov_b32_e32 v[[HI:[0-9]+]], s7
66 ; GCN: {{flat|global}}_load_dword v{{[0-9]+}}, v{{\[}}[[LO]]:[[HI]]{{\]}}
7 define void @use_dispatch_ptr() #1 {
7 define hidden void @use_dispatch_ptr() #1 {
88 %dispatch_ptr = call noalias i8 addrspace(4)* @llvm.amdgcn.dispatch.ptr() #0
99 %header_ptr = bitcast i8 addrspace(4)* %dispatch_ptr to i32 addrspace(4)*
1010 %value = load volatile i32, i32 addrspace(4)* %header_ptr
2323 ; GCN: v_mov_b32_e32 v[[LO:[0-9]+]], s6
2424 ; GCN: v_mov_b32_e32 v[[HI:[0-9]+]], s7
2525 ; GCN: {{flat|global}}_load_dword v{{[0-9]+}}, v{{\[}}[[LO]]:[[HI]]{{\]}}
26 define void @use_queue_ptr() #1 {
26 define hidden void @use_queue_ptr() #1 {
2727 %queue_ptr = call noalias i8 addrspace(4)* @llvm.amdgcn.queue.ptr() #0
2828 %header_ptr = bitcast i8 addrspace(4)* %queue_ptr to i32 addrspace(4)*
2929 %value = load volatile i32, i32 addrspace(4)* %header_ptr
4646 ; GFX9: v_mov_b32_e32 v[[HI:[0-9]+]], [[APERTURE_LOAD]]
4747 ; GFX9: {{flat|global}}_store_dword v{{\[[0-9]+}}:[[HI]]{{\]}}
4848 ; CIVI: {{flat|global}}_store_dword v{{\[}}[[LO]]:[[HI]]{{\]}}
49 define void @use_queue_ptr_addrspacecast() #1 {
49 define hidden void @use_queue_ptr_addrspacecast() #1 {
5050 %asc = addrspacecast i32 addrspace(3)* inttoptr (i32 16 to i32 addrspace(3)*) to i32*
5151 store volatile i32 0, i32* %asc
5252 ret void
6767 ; GCN: v_mov_b32_e32 v[[LO:[0-9]+]], s6
6868 ; GCN: v_mov_b32_e32 v[[HI:[0-9]+]], s7
6969 ; GCN: {{flat|global}}_load_dword v{{[0-9]+}}, v{{\[}}[[LO]]:[[HI]]{{\]}}
70 define void @use_kernarg_segment_ptr() #1 {
70 define hidden void @use_kernarg_segment_ptr() #1 {
7171 %kernarg_segment_ptr = call noalias i8 addrspace(4)* @llvm.amdgcn.kernarg.segment.ptr() #0
7272 %header_ptr = bitcast i8 addrspace(4)* %kernarg_segment_ptr to i32 addrspace(4)*
7373 %value = load volatile i32, i32 addrspace(4)* %header_ptr
8585
8686 ; GCN-LABEL: {{^}}use_dispatch_id:
8787 ; GCN: ; use s[6:7]
88 define void @use_dispatch_id() #1 {
88 define hidden void @use_dispatch_id() #1 {
8989 %id = call i64 @llvm.amdgcn.dispatch.id()
9090 call void asm sideeffect "; use $0", "s"(i64 %id)
9191 ret void
106106 ; GCN-LABEL: {{^}}use_workgroup_id_x:
107107 ; GCN: s_waitcnt
108108 ; GCN: ; use s6
109 define void @use_workgroup_id_x() #1 {
109 define hidden void @use_workgroup_id_x() #1 {
110110 %val = call i32 @llvm.amdgcn.workgroup.id.x()
111111 call void asm sideeffect "; use $0", "s"(i32 %val)
112112 ret void
118118 ; GCN: buffer_store_dword v0, off, s[0:3], s32{{$}}
119119 ; GCN: ; use s6
120120 ; GCN: s_setpc_b64
121 define void @use_stack_workgroup_id_x() #1 {
121 define hidden void @use_stack_workgroup_id_x() #1 {
122122 %alloca = alloca i32, addrspace(5)
123123 store volatile i32 0, i32 addrspace(5)* %alloca
124124 %val = call i32 @llvm.amdgcn.workgroup.id.x()
129129 ; GCN-LABEL: {{^}}use_workgroup_id_y:
130130 ; GCN: s_waitcnt
131131 ; GCN: ; use s6
132 define void @use_workgroup_id_y() #1 {
132 define hidden void @use_workgroup_id_y() #1 {
133133 %val = call i32 @llvm.amdgcn.workgroup.id.y()
134134 call void asm sideeffect "; use $0", "s"(i32 %val)
135135 ret void
138138 ; GCN-LABEL: {{^}}use_workgroup_id_z:
139139 ; GCN: s_waitcnt
140140 ; GCN: ; use s6
141 define void @use_workgroup_id_z() #1 {
141 define hidden void @use_workgroup_id_z() #1 {
142142 %val = call i32 @llvm.amdgcn.workgroup.id.z()
143143 call void asm sideeffect "; use $0", "s"(i32 %val)
144144 ret void
147147 ; GCN-LABEL: {{^}}use_workgroup_id_xy:
148148 ; GCN: ; use s6
149149 ; GCN: ; use s7
150 define void @use_workgroup_id_xy() #1 {
150 define hidden void @use_workgroup_id_xy() #1 {
151151 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
152152 %val1 = call i32 @llvm.amdgcn.workgroup.id.y()
153153 call void asm sideeffect "; use $0", "s"(i32 %val0)
159159 ; GCN: ; use s6
160160 ; GCN: ; use s7
161161 ; GCN: ; use s8
162 define void @use_workgroup_id_xyz() #1 {
162 define hidden void @use_workgroup_id_xyz() #1 {
163163 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
164164 %val1 = call i32 @llvm.amdgcn.workgroup.id.y()
165165 %val2 = call i32 @llvm.amdgcn.workgroup.id.z()
172172 ; GCN-LABEL: {{^}}use_workgroup_id_xz:
173173 ; GCN: ; use s6
174174 ; GCN: ; use s7
175 define void @use_workgroup_id_xz() #1 {
175 define hidden void @use_workgroup_id_xz() #1 {
176176 %val0 = call i32 @llvm.amdgcn.workgroup.id.x()
177177 %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
178178 call void asm sideeffect "; use $0", "s"(i32 %val0)
183183 ; GCN-LABEL: {{^}}use_workgroup_id_yz:
184184 ; GCN: ; use s6
185185 ; GCN: ; use s7
186 define void @use_workgroup_id_yz() #1 {
186 define hidden void @use_workgroup_id_yz() #1 {
187187 %val0 = call i32 @llvm.amdgcn.workgroup.id.y()
188188 %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
189189 call void asm sideeffect "; use $0", "s"(i32 %val0)
328328 ; Argument is in right place already
329329 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_x:
330330 ; GCN-NOT: s6
331 define void @func_indirect_use_workgroup_id_x() #1 {
331 define hidden void @func_indirect_use_workgroup_id_x() #1 {
332332 call void @use_workgroup_id_x()
333333 ret void
334334 }
335335
336336 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_y:
337337 ; GCN-NOT: s6
338 define void @func_indirect_use_workgroup_id_y() #1 {
338 define hidden void @func_indirect_use_workgroup_id_y() #1 {
339339 call void @use_workgroup_id_y()
340340 ret void
341341 }
342342
343343 ; GCN-LABEL: {{^}}func_indirect_use_workgroup_id_z:
344344 ; GCN-NOT: s6
345 define void @func_indirect_use_workgroup_id_z() #1 {
345 define hidden void @func_indirect_use_workgroup_id_z() #1 {
346346 call void @use_workgroup_id_z()
347347 ret void
348348 }
350350 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_x:
351351 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
352352 ; GCN: ; use s6
353 define void @other_arg_use_workgroup_id_x(i32 %arg0) #1 {
353 define hidden void @other_arg_use_workgroup_id_x(i32 %arg0) #1 {
354354 %val = call i32 @llvm.amdgcn.workgroup.id.x()
355355 store volatile i32 %arg0, i32 addrspace(1)* undef
356356 call void asm sideeffect "; use $0", "s"(i32 %val)
360360 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_y:
361361 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
362362 ; GCN: ; use s6
363 define void @other_arg_use_workgroup_id_y(i32 %arg0) #1 {
363 define hidden void @other_arg_use_workgroup_id_y(i32 %arg0) #1 {
364364 %val = call i32 @llvm.amdgcn.workgroup.id.y()
365365 store volatile i32 %arg0, i32 addrspace(1)* undef
366366 call void asm sideeffect "; use $0", "s"(i32 %val)
370370 ; GCN-LABEL: {{^}}other_arg_use_workgroup_id_z:
371371 ; GCN: {{flat|global}}_store_dword v{{\[[0-9]+:[0-9]+\]}}, v0
372372 ; GCN: ; use s6
373 define void @other_arg_use_workgroup_id_z(i32 %arg0) #1 {
373 define hidden void @other_arg_use_workgroup_id_z(i32 %arg0) #1 {
374374 %val = call i32 @llvm.amdgcn.workgroup.id.z()
375375 store volatile i32 %arg0, i32 addrspace(1)* undef
376376 call void asm sideeffect "; use $0", "s"(i32 %val)
442442 ; GCN: ; use s14
443443 ; GCN: ; use s15
444444 ; GCN: ; use s16
445 define void @use_every_sgpr_input() #1 {
445 define hidden void @use_every_sgpr_input() #1 {
446446 %alloca = alloca i32, align 4, addrspace(5)
447447 store volatile i32 0, i32 addrspace(5)* %alloca
448448
512512 ; GCN-NOT: s[8:9]
513513 ; GCN-NOT: s[10:11]
514514 ; GCN-NOT: s[12:13]
515 define void @func_indirect_use_every_sgpr_input() #1 {
515 define hidden void @func_indirect_use_every_sgpr_input() #1 {
516516 call void @use_every_sgpr_input()
517517 ret void
518518 }
522522 ; GCN-DAG: s_mov_b32 s7, s15
523523 ; GCN-DAG: s_mov_b32 s8, s16
524524 ; GCN: s_swappc_b64
525 define void @func_use_every_sgpr_input_call_use_workgroup_id_xyz() #1 {
525 define hidden void @func_use_every_sgpr_input_call_use_workgroup_id_xyz() #1 {
526526 %alloca = alloca i32, align 4, addrspace(5)
527527 store volatile i32 0, i32 addrspace(5)* %alloca
528528
590590 ; GCN: ; use [[SAVE_X]]
591591 ; GCN: ; use [[SAVE_Y]]
592592 ; GCN: ; use [[SAVE_Z]]
593 define void @func_use_every_sgpr_input_call_use_workgroup_id_xyz_spill() #1 {
593 define hidden void @func_use_every_sgpr_input_call_use_workgroup_id_xyz_spill() #1 {
594594 %alloca = alloca i32, align 4, addrspace(5)
595595 call void @use_workgroup_id_xyz()
596596