-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Add intrinsics and MIs for ds_bvh_stack_* #130007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mariusz-sikora-at-amd
merged 1 commit into
main
from
users/mariusz-sikora-at-amd/ds-bvh-stack
Mar 17, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bvh.stack.push.pop.rtn.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -global-isel=0 -march=amdgcn -mcpu=gfx1200 < %s | FileCheck %s | ||
; RUN: llc -global-isel=1 -march=amdgcn -mcpu=gfx1200 < %s | FileCheck %s | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push4_pop1(i32 %addr, i32 %data0, <4 x i32> %data1) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push4_pop1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push4_pop1_rtn_b32 v1, v0, v1, v[2:5] | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.push4.pop1.rtn(i32 %addr, i32 %data0, <4 x i32> %data1, i32 0) | ||
%vdst = extractvalue { i32, i32 } %pair, 0 | ||
%newaddr = extractvalue { i32, i32 } %pair, 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst, i32 %newaddr, i32 poison, i32 poison, i1 true, i1 false) | ||
ret void | ||
} | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push4_pop1_1(i32 %addr, i32 %data0, <4 x i32> %data1) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push4_pop1_1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push4_pop1_rtn_b32 v1, v0, v1, v[2:5] offset:1 | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.push4.pop1.rtn(i32 %addr, i32 %data0, <4 x i32> %data1, i32 1) | ||
%vdst = extractvalue { i32, i32 } %pair, 0 | ||
%newaddr = extractvalue { i32, i32 } %pair, 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst, i32 %newaddr, i32 poison, i32 poison, i1 true, i1 false) | ||
ret void | ||
} | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push8_pop1(i32 %addr, i32 %data0, <8 x i32> %data1) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push8_pop1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push8_pop1_rtn_b32 v1, v0, v1, v[2:9] | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.push8.pop1.rtn(i32 %addr, i32 %data0, <8 x i32> %data1, i32 0) | ||
%vdst = extractvalue { i32, i32 } %pair, 0 | ||
%newaddr = extractvalue { i32, i32 } %pair, 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst, i32 %newaddr, i32 poison, i32 poison, i1 true, i1 false) | ||
ret void | ||
} | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push8_pop1_1(i32 %addr, i32 %data0, <8 x i32> %data1) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push8_pop1_1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push8_pop1_rtn_b32 v1, v0, v1, v[2:9] offset:1 | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i32, i32 } @llvm.amdgcn.ds.bvh.stack.push8.pop1.rtn(i32 %addr, i32 %data0, <8 x i32> %data1, i32 1) | ||
%vdst = extractvalue { i32, i32 } %pair, 0 | ||
%newaddr = extractvalue { i32, i32 } %pair, 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst, i32 %newaddr, i32 poison, i32 poison, i1 true, i1 false) | ||
ret void | ||
} | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push8_pop2(i32 %addr, i32 %data0, <8 x i32> %data1, ptr addrspace(1) %out1, ptr addrspace(1) %out2) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push8_pop2: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push8_pop2_rtn_b64 v[1:2], v0, v1, v[2:9] | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i64, i32 } @llvm.amdgcn.ds.bvh.stack.push8.pop2.rtn(i32 %addr, i32 %data0, <8 x i32> %data1, i32 0) | ||
%vdst = extractvalue { i64, i32 } %pair, 0 | ||
%newaddr = extractvalue { i64, i32 } %pair, 1 | ||
%vdst.v2i32 = bitcast i64 %vdst to <2 x i32> | ||
%vdst.lo = extractelement <2 x i32> %vdst.v2i32, i32 0 | ||
%vdst.hi = extractelement <2 x i32> %vdst.v2i32, i32 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst.lo, i32 %vdst.hi, i32 %newaddr, i32 poison, i1 true, i1 false) | ||
ret void | ||
} | ||
|
||
define amdgpu_gs void @test_ds_bvh_stack_push8_pop2_1(i32 %addr, i32 %data0, <8 x i32> %data1, ptr addrspace(1) %out1, ptr addrspace(1) %out2) { | ||
; CHECK-LABEL: test_ds_bvh_stack_push8_pop2_1: | ||
; CHECK: ; %bb.0: | ||
; CHECK-NEXT: ds_bvh_stack_push8_pop2_rtn_b64 v[1:2], v0, v1, v[2:9] offset:1 | ||
; CHECK-NEXT: s_wait_dscnt 0x0 | ||
; CHECK-NEXT: export prim v1, off, off, off done | ||
; CHECK-NEXT: s_endpgm | ||
%pair = call { i64, i32 } @llvm.amdgcn.ds.bvh.stack.push8.pop2.rtn(i32 %addr, i32 %data0, <8 x i32> %data1, i32 1) | ||
%vdst = extractvalue { i64, i32 } %pair, 0 | ||
%newaddr = extractvalue { i64, i32 } %pair, 1 | ||
%vdst.v2i32 = bitcast i64 %vdst to <2 x i32> | ||
%vdst.lo = extractelement <2 x i32> %vdst.v2i32, i32 0 | ||
%vdst.hi = extractelement <2 x i32> %vdst.v2i32, i32 1 | ||
call void @llvm.amdgcn.exp.i32(i32 20, i32 1, i32 %vdst.lo, i32 %vdst.hi, i32 %newaddr, i32 poison, i1 true, i1 false) | ||
ret void | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.