1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -global-isel -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s
5 declare { i32, i32 } @llvm.amdgcn.ds.bvh.stack.rtn(i32, i32, <4 x i32>, i32 immarg)
7 define amdgpu_gs void @test_ds_bvh_stack(i32 %addr, i32 %data0, <4 x i32> %data1, ptr addrspace(1) %out) {
8 ; CHECK-LABEL: test_ds_bvh_stack:
10 ; CHECK-NEXT: ds_bvh_stack_rtn_b32 v1, v0, v1, v[2:5]
11 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
12 ; CHECK-NEXT: v_add_nc_u32_e32 v0, v1, v0
13 ; CHECK-NEXT: global_store_b32 v[6:7], v0, off
15 ; CHECK-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
16 ; CHECK-NEXT: s_endpgm
17 %pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.rtn(i32 %addr, i32 %data0, <4 x i32> %data1, i32 0)
18 %vdst = extractvalue { i32, i32 } %pair, 0
19 %newaddr = extractvalue { i32, i32 } %pair, 1
20 %res = add i32 %vdst, %newaddr
21 store i32 %res, ptr addrspace(1) %out, align 4
25 define amdgpu_gs void @test_ds_bvh_stack_1(i32 %addr, i32 %data0, <4 x i32> %data1, ptr addrspace(1) %out) {
26 ; CHECK-LABEL: test_ds_bvh_stack_1:
28 ; CHECK-NEXT: ds_bvh_stack_rtn_b32 v1, v0, v1, v[2:5] offset:1
29 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
30 ; CHECK-NEXT: v_add_nc_u32_e32 v0, v1, v0
31 ; CHECK-NEXT: global_store_b32 v[6:7], v0, off
33 ; CHECK-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
34 ; CHECK-NEXT: s_endpgm
35 %pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.rtn(i32 %addr, i32 %data0, <4 x i32> %data1, i32 1)
36 %vdst = extractvalue { i32, i32 } %pair, 0
37 %newaddr = extractvalue { i32, i32 } %pair, 1
38 %res = add i32 %vdst, %newaddr
39 store i32 %res, ptr addrspace(1) %out, align 4