51 lines · plain
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -enable-ipra=0 < %s | FileCheck -enable-var-scope --check-prefix=GCN %s2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -enable-ipra=0 < %s | FileCheck -enable-var-scope --check-prefix=GCN %s3 4%struct.ByValStruct = type { [4 x i32] }5; Make sure the offset is folded and function's frame register is used6; rather than the global scratch wave offset.7; GCN-LABEL: {{^}}void_func_byval_struct_use_outside_entry_block:8; GCN-NOT: v_lshrrev_b329; GCN-NOT: s_sub_u3210 11; GCN: s_and_saveexec_b6412; GCN: s_cbranch_execz [[BB1:.LBB[0-9]+_[0-9]+]]13 14; GCN: buffer_load_dword [[LOAD0:v[0-9]+]], off, s[0:3], s32 glc{{$}}15; GCN-NOT: s3216; GCN: buffer_store_dword [[LOAD0]], off, s[0:3], s32{{$}}17; GCN-NOT: s3218 19; GCN: buffer_load_dword [[LOAD1:v[0-9]+]], off, s[0:3], s32 offset:16 glc{{$}}20; GCN-NOT: s3221; GCN: buffer_store_dword [[LOAD1]], off, s[0:3], s32 offset:16{{$}}22; GCN-NOT: s3223 24; GCN: [[BB1]]25; GCN: s_or_b64 exec, exec26define hidden void @void_func_byval_struct_use_outside_entry_block(ptr addrspace(5) byval(%struct.ByValStruct) noalias nocapture align 4 %arg0, ptr addrspace(5) byval(%struct.ByValStruct) noalias nocapture align 4 %arg1, i1 %cond) #1 {27entry:28 br i1 %cond, label %bb0, label %bb129 30bb0:31 %tmp = load volatile i32, ptr addrspace(5) %arg0, align 432 %add = add nsw i32 %tmp, 133 store volatile i32 %add, ptr addrspace(5) %arg0, align 434 %tmp1 = load volatile i32, ptr addrspace(5) %arg1, align 435 %add3 = add nsw i32 %tmp1, 236 store volatile i32 %add3, ptr addrspace(5) %arg1, align 437 store volatile i32 9, ptr addrspace(1) null, align 438 br label %bb139 40bb1:41 ret void42}43declare hidden void @external_void_func_void() #044 45declare void @llvm.lifetime.start.p5(i64, ptr addrspace(5) nocapture) #346declare void @llvm.lifetime.end.p5(i64, ptr addrspace(5) nocapture) #347 48attributes #0 = { nounwind }49attributes #1 = { noinline norecurse nounwind }50attributes #2 = { nounwind norecurse "frame-pointer"="all" }51