1 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX11 %s
2 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX11 %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX12 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX12 %s
6 ; GCN-LABEL: {{^}}lds_direct_load:
8 ; GFX11: lds_direct_load v{{[0-9]+}}
9 ; GFX12: ds_direct_load v{{[0-9]+}}
11 ; GFX11: lds_direct_load v{{[0-9]+}}
12 ; GFX12: ds_direct_load v{{[0-9]+}}
14 ; GFX11: lds_direct_load v{{[0-9]+}}
15 ; GFX11: s_waitcnt expcnt(2)
16 ; GFX12: ds_direct_load v{{[0-9]+}}
17 ; GFX12: s_wait_expcnt 0x2
19 ; GCN: buffer_store_b32
20 ; GFX11: s_waitcnt expcnt(1)
21 ; GFX12: s_wait_expcnt 0x1
22 ; GCN: buffer_store_b32
23 ; GFX11: s_waitcnt expcnt(0)
24 ; GFX12: s_wait_expcnt 0x0
25 ; GCN: buffer_store_b32
26 ; GCN: buffer_store_b32
27 ; GCN: buffer_store_b32
28 ; GCN: buffer_store_b32
29 define amdgpu_ps void @lds_direct_load(ptr addrspace(8) inreg %buf, i32 inreg %arg0,
30 i32 inreg %arg1, i32 inreg %arg2) #0 {
32 %p0 = call float @llvm.amdgcn.lds.direct.load(i32 %arg0)
33 ; Ensure memory clustering is occuring for lds_direct_load
34 %p5 = fadd float %p0, 1.0
35 %p1 = call float @llvm.amdgcn.lds.direct.load(i32 %arg1)
36 %p2 = call float @llvm.amdgcn.lds.direct.load(i32 %arg2)
37 %p3 = call float @llvm.amdgcn.lds.direct.load(i32 %arg1)
38 %p4 = call float @llvm.amdgcn.lds.direct.load(i32 %arg2)
39 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p5, ptr addrspace(8) %buf, i32 4, i32 0, i32 0)
40 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p1, ptr addrspace(8) %buf, i32 4, i32 1, i32 0)
41 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p2, ptr addrspace(8) %buf, i32 4, i32 2, i32 0)
42 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p3, ptr addrspace(8) %buf, i32 4, i32 3, i32 0)
43 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p4, ptr addrspace(8) %buf, i32 4, i32 4, i32 0)
44 call void @llvm.amdgcn.raw.ptr.buffer.store.f32(float %p0, ptr addrspace(8) %buf, i32 4, i32 5, i32 0)
48 declare float @llvm.amdgcn.lds.direct.load(i32) #1
49 declare void @llvm.amdgcn.raw.ptr.buffer.store.f32(float, ptr addrspace(8), i32, i32, i32)
51 attributes #0 = { nounwind }
52 attributes #1 = { nounwind readonly }