xref: /llvm-project/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.load-last-use.ll (revision 0bc33f41abf4174cb76b5099cffaf7820dec58e9)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2;RUN: llc < %s -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 | FileCheck %s --check-prefix=GCN
3;RUN: llc < %s -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -amdgpu-enable-delay-alu=0 | FileCheck %s --check-prefix=GCN
4
5define float @raw_buffer_load(<4 x i32> inreg) {
6; GCN-LABEL: raw_buffer_load:
7; GCN:       ; %bb.0: ; %main_body
8; GCN-NEXT:    s_wait_loadcnt_dscnt 0x0
9; GCN-NEXT:    s_wait_expcnt 0x0
10; GCN-NEXT:    s_wait_samplecnt 0x0
11; GCN-NEXT:    s_wait_bvhcnt 0x0
12; GCN-NEXT:    s_wait_kmcnt 0x0
13; GCN-NEXT:    buffer_load_b32 v0, off, s[0:3], null th:TH_LOAD_LU
14; GCN-NEXT:    s_wait_loadcnt 0x0
15; GCN-NEXT:    s_setpc_b64 s[30:31]
16main_body:
17  %data = call float @llvm.amdgcn.raw.buffer.load.f32(<4 x i32> %0, i32 0, i32 0, i32 3)
18  ret float %data
19}
20
21define float @struct_buffer_load(<4 x i32> inreg) {
22; GCN-LABEL: struct_buffer_load:
23; GCN:       ; %bb.0: ; %main_body
24; GCN-NEXT:    s_wait_loadcnt_dscnt 0x0
25; GCN-NEXT:    s_wait_expcnt 0x0
26; GCN-NEXT:    s_wait_samplecnt 0x0
27; GCN-NEXT:    s_wait_bvhcnt 0x0
28; GCN-NEXT:    s_wait_kmcnt 0x0
29; GCN-NEXT:    v_mov_b32_e32 v0, 0
30; GCN-NEXT:    buffer_load_b32 v0, v0, s[0:3], null idxen th:TH_LOAD_LU
31; GCN-NEXT:    s_wait_loadcnt 0x0
32; GCN-NEXT:    s_setpc_b64 s[30:31]
33main_body:
34  %data = call float @llvm.amdgcn.struct.buffer.load.f32(<4 x i32> %0, i32 0, i32 0, i32 0, i32 3)
35  ret float %data
36}
37
38