brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · 1e3678d Raw
137 lines · plain
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -enable-ipra < %s | FileCheck -check-prefix=GCN %s2; RUN: llc -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefix=GCN %s3 4; Kernels are not called, so there is no call preserved mask.5; GCN-LABEL: {{^}}kernel:6; GCN: flat_store_dword7define amdgpu_kernel void @kernel(ptr addrspace(1) %out) #0 {8entry:9  store i32 0, ptr addrspace(1) %out10  ret void11}12 13; GCN-LABEL: {{^}}func:14; GCN: ; NumVgprs: 815define hidden void @func() #1 {16  call void asm sideeffect "", "~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7}"() #017  ret void18}19 20; GCN-LABEL: {{^}}kernel_call:21; GCN-NOT: buffer_store22; GCN-NOT: buffer_load23; GCN-NOT: readlane24; GCN-NOT: writelane25; GCN: flat_load_dword v826; GCN: s_swappc_b6427; GCN-NOT: buffer_store28; GCN-NOT: buffer_load29; GCN-NOT: readlane30; GCN-NOT: writelane31; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v832 33; GCN: ; TotalNumSgprs: 3734; GCN: ; NumVgprs: 935define amdgpu_kernel void @kernel_call() #0 {36  %vgpr = load volatile i32, ptr addrspace(1) poison37  tail call void @func()38  store volatile i32 %vgpr, ptr addrspace(1) poison39  ret void40}41 42; GCN-LABEL: {{^}}func_regular_call:43; GCN-NOT: buffer_load44; GCN-NOT: readlane45; GCN: flat_load_dword v846; GCN: s_swappc_b6447; GCN-NOT: buffer_load48; GCN-NOT: readlane49; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v850 51; GCN: ; TotalNumSgprs: 3452; GCN: ; NumVgprs: 1053define void @func_regular_call() #1 {54  %vgpr = load volatile i32, ptr addrspace(1) poison55  tail call void @func()56  store volatile i32 %vgpr, ptr addrspace(1) poison57  ret void58}59 60; GCN-LABEL: {{^}}func_tail_call:61; GCN: s_waitcnt62; GCN-NEXT: s_getpc_b64 s[16:17]63; GCN-NEXT: s_add_u32 s16,64; GCN-NEXT: s_addc_u32 s17,65; GCN-NEXT: s_setpc_b64 s[16:17]66 67; GCN: ; TotalNumSgprs: 3268; GCN: ; NumVgprs: 869define void @func_tail_call() #1 {70  tail call void @func()71  ret void72}73 74; GCN-LABEL: {{^}}func_call_tail_call:75; GCN: flat_load_dword v876; GCN: s_swappc_b6477; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, v878; GCN: s_setpc_b6479 80; GCN: ; TotalNumSgprs: 3481; GCN: ; NumVgprs: 1082define void @func_call_tail_call() #1 {83  %vgpr = load volatile i32, ptr addrspace(1) poison84  tail call void @func()85  store volatile i32 %vgpr, ptr addrspace(1) poison86  tail call void @func()87  ret void88}89 90; GCN-LABEL: {{^}}void_func_void:91define void @void_func_void() noinline {92  ret void93}94 95; Make sure we don't get save/restore of FP between calls.96; GCN-LABEL: {{^}}test_funcx2:97; GCN: s_getpc_b6498; GCN-NOT: s3299; GCN: s_swappc_b64100; GCN-NOT: s32101; GCN: s_swappc_b64102define void @test_funcx2() #0 {103  call void @void_func_void()104  call void @void_func_void()105  ret void106}107 108; Make sure we save/restore the return address around the call.109; Function Attrs: norecurse110define internal void @hoge() #2 {111bb:112; GCN-LABEL: {{^}}hoge:113; GCN-DAG: v_writelane_b32 [[CSR_VGPR:v[0-9]+]], s30,114; GCN-DAG: v_writelane_b32 [[CSR_VGPR]], s31,115; GCN: s_swappc_b64 s[30:31]116; GCN-DAG: v_readlane_b32 s30, [[CSR_VGPR]],117; GCN-DAG: v_readlane_b32 s31, [[CSR_VGPR]],118; GCN: s_waitcnt vmcnt(0)119; GCN: s_setpc_b64 s[30:31]120  call void @eggs()121  ret void122}123 124; GCN-LABEL: {{^}}wombat:125define weak amdgpu_kernel void @wombat(ptr %arg, ptr %arg2) {126bb:127  call void @hoge() #0128  ret void129}130 131declare dso_local void @eggs()132 133 134attributes #0 = { nounwind }135attributes #1 = { nounwind noinline "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }136attributes #2 = { norecurse }137