29 lines · plain
1; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri < %s | FileCheck -enable-var-scope -check-prefix=GCN %s2; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -mattr=-flat-for-global < %s | FileCheck -enable-var-scope -check-prefix=GCN %s3; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=gfx900 < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s4 5; If flat_store_dword and flat_load_dword use different registers for the data6; operand, this test is not broken. It just means it is no longer testing7; for the original bug.8 9; GCN: {{^}}test:10; XGCN: flat_store_dword v[{{[0-9]+:[0-9]+}}], [[DATA:v[0-9]+]]11; XGCN: s_waitcnt vmcnt(0) lgkmcnt(0)12; XGCN: flat_load_dword [[DATA]], v[{{[0-9]+:[0-9]+}}]13define amdgpu_kernel void @test(ptr %out, i32 %in) {14 store volatile i32 0, ptr %out15 %val = load volatile i32, ptr %out16 ret void17}18 19; Make sure lgkmcnt isn't used for global_ addrspace(5)* instructions20; GCN-LABEL: {{^}}test_waitcnt_type_flat_global:21; GFX9: global_load_dword [[LD:v[0-9]+]]22; GFX9-NEXT: s_waitcnt vmcnt(0){{$}}23; GFX9-NEXT: ds_write_b32 [[LD]]24define amdgpu_kernel void @test_waitcnt_type_flat_global(ptr addrspace(1) %in) {25 %val = load volatile i32, ptr addrspace(1) %in26 store volatile i32 %val, ptr addrspace(3) poison27 ret void28}29