1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -enable-ipra -amdgpu-sroa=0 < %s | FileCheck -check-prefix=GCN %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -amdgpu-sroa=0 < %s | FileCheck -check-prefix=GCN %s
4 ; Kernels are not called, so there is no call preserved mask.
5 ; GCN-LABEL: {{^}}kernel:
6 ; GCN: flat_store_dword
7 define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) #0 {
9 store i32 0, i32 addrspace(1)* %out
13 ; GCN-LABEL: {{^}}func:
15 define hidden void @func() #1 {
16 call void asm sideeffect "", "~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7}"() #0
20 ; GCN-LABEL: {{^}}kernel_call:
21 ; GCN-NOT: buffer_store
22 ; GCN-NOT: buffer_load
25 ; GCN: flat_load_dword v8
27 ; GCN-NOT: buffer_store
28 ; GCN-NOT: buffer_load
31 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
35 define amdgpu_kernel void @kernel_call() #0 {
36 %vgpr = load volatile i32, i32 addrspace(1)* undef
37 tail call void @func()
38 store volatile i32 %vgpr, i32 addrspace(1)* undef
42 ; GCN-LABEL: {{^}}func_regular_call:
43 ; GCN-NOT: buffer_store
44 ; GCN-NOT: buffer_load
47 ; GCN: flat_load_dword v8
49 ; GCN-NOT: buffer_store
50 ; GCN-NOT: buffer_load
53 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
57 define void @func_regular_call() #1 {
58 %vgpr = load volatile i32, i32 addrspace(1)* undef
59 tail call void @func()
60 store volatile i32 %vgpr, i32 addrspace(1)* undef
64 ; GCN-LABEL: {{^}}func_tail_call:
66 ; GCN-NEXT: s_getpc_b64 s[4:5]
67 ; GCN-NEXT: s_add_u32 s4,
68 ; GCN-NEXT: s_addc_u32 s5,
69 ; GCN-NEXT: s_setpc_b64 s[4:5]
73 define void @func_tail_call() #1 {
74 tail call void @func()
78 ; GCN-LABEL: {{^}}func_call_tail_call:
79 ; GCN: flat_load_dword v8
81 ; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v8
86 define void @func_call_tail_call() #1 {
87 %vgpr = load volatile i32, i32 addrspace(1)* undef
88 tail call void @func()
89 store volatile i32 %vgpr, i32 addrspace(1)* undef
90 tail call void @func()
94 define void @void_func_void() noinline {
98 ; Make sure we don't get save/restore of FP between calls.
99 ; GCN-LABEL: {{^}}test_funcx2:
102 define void @test_funcx2() #0 {
103 call void @void_func_void()
104 call void @void_func_void()
108 attributes #0 = { nounwind }
109 attributes #1 = { nounwind noinline }