1 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s -check-prefix=CHECK
3 ; Test that buffer_load_format with VGPR resource descriptor is properly
6 ; CHECK-LABEL: {{^}}test_none:
7 ; CHECK: buffer_load_format_x v0, off, {{s\[[0-9]+:[0-9]+\]}}, 0{{$}}
8 define amdgpu_vs float @test_none(ptr addrspace(4) inreg %base, i32 %i) {
10 %ptr = getelementptr ptr addrspace(8), ptr addrspace(4) %base, i32 %i
11 %tmp2 = load ptr addrspace(8), ptr addrspace(4) %ptr, align 32
12 %tmp7 = call float @llvm.amdgcn.raw.ptr.buffer.load.format.f32(ptr addrspace(8) %tmp2, i32 0, i32 0, i32 0)
16 ; CHECK-LABEL: {{^}}test_idxen:
17 ; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen{{$}}
18 define amdgpu_vs float @test_idxen(ptr addrspace(4) inreg %base, i32 %i) {
20 %ptr = getelementptr ptr addrspace(8), ptr addrspace(4) %base, i32 %i
21 %tmp2 = load ptr addrspace(8), ptr addrspace(4) %ptr, align 32
22 %tmp7 = call float @llvm.amdgcn.struct.ptr.buffer.load.format.f32(ptr addrspace(8) %tmp2, i32 undef, i32 0, i32 0, i32 0)
26 ; CHECK-LABEL: {{^}}test_offen:
27 ; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 offen{{$}}
28 define amdgpu_vs float @test_offen(ptr addrspace(4) inreg %base, i32 %i) {
30 %ptr = getelementptr ptr addrspace(8), ptr addrspace(4) %base, i32 %i
31 %tmp2 = load ptr addrspace(8), ptr addrspace(4) %ptr, align 32
32 %tmp7 = call float @llvm.amdgcn.raw.ptr.buffer.load.format.f32(ptr addrspace(8) %tmp2, i32 undef, i32 0, i32 0)
36 ; CHECK-LABEL: {{^}}test_both:
37 ; CHECK: buffer_load_format_x v0, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen offen{{$}}
38 define amdgpu_vs float @test_both(ptr addrspace(4) inreg %base, i32 %i) {
40 %ptr = getelementptr ptr addrspace(8), ptr addrspace(4) %base, i32 %i
41 %tmp2 = load ptr addrspace(8), ptr addrspace(4) %ptr, align 32
42 %tmp7 = call float @llvm.amdgcn.struct.ptr.buffer.load.format.f32(ptr addrspace(8) %tmp2, i32 undef, i32 undef, i32 0, i32 0)
46 declare float @llvm.amdgcn.struct.ptr.buffer.load.format.f32(ptr addrspace(8), i32, i32, i32, i32 immarg) #1
47 declare float @llvm.amdgcn.raw.ptr.buffer.load.format.f32(ptr addrspace(8), i32, i32, i32 immarg) #1
49 attributes #0 = { nounwind readnone }
50 attributes #1 = { nounwind readonly }