-
Notifications
You must be signed in to change notification settings - Fork 10
Fix return type and argument types for AMD intrinsics #246
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
+53
−15
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3e9277d
fix return type
idubinov ae16879
Merge remote-tracking branch 'origin/amd-staging' into idu/blas
idubinov 49ac52f
remove llvm.* check
idubinov ddf233d
revert unnecessary changes
idubinov 158eb54
Merge branch 'amd-staging' into idu/blas
lamb-j bc647d0
improve return type and argument types
idubinov 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
30 changes: 30 additions & 0 deletions
30
test/llvm-intrinsics/amdgcn-intrinsic-ptr-arg-addrspace.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,30 @@ | ||
| ; Test that non-overloaded AMDGCN intrinsics taking pointer *parameters* with a | ||
| ; specific address space are correctly round-tripped through SPIR-V. The writer | ||
| ; recovers the canonical parameter address space from LLVM's intrinsic | ||
| ; declaration (rather than a hardcoded per-name list), so the flat/generic | ||
| ; pointer parameter of is.shared / is.private must be preserved. | ||
|
|
||
| ; RUN: llvm-spirv -spirv-allow-unknown-intrinsics=llvm.amdgcn %s -o %t.spv | ||
| ; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s | ||
|
|
||
| target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9" | ||
| target triple = "spirv64-amd-amdhsa" | ||
|
|
||
| ; CHECK-DAG: declare i1 @llvm.amdgcn.is.shared(ptr) | ||
| ; CHECK-DAG: declare i1 @llvm.amdgcn.is.private(ptr) | ||
|
|
||
| define void @test_amdgcn_ptr_arg_intrinsics(ptr addrspace(4) %generic, ptr addrspace(1) %out) { | ||
| entry: | ||
| %flat = addrspacecast ptr addrspace(4) %generic to ptr | ||
| ; CHECK: call i1 @llvm.amdgcn.is.shared(ptr %{{[0-9a-zA-Z._]+}}) | ||
| %shared = call i1 @llvm.amdgcn.is.shared(ptr %flat) | ||
| ; CHECK: call i1 @llvm.amdgcn.is.private(ptr %{{[0-9a-zA-Z._]+}}) | ||
| %private = call i1 @llvm.amdgcn.is.private(ptr %flat) | ||
| %r = or i1 %shared, %private | ||
| %z = zext i1 %r to i32 | ||
| store i32 %z, ptr addrspace(1) %out | ||
| ret void | ||
| } | ||
|
|
||
| declare i1 @llvm.amdgcn.is.shared(ptr) | ||
| declare i1 @llvm.amdgcn.is.private(ptr) |
Oops, something went wrong.
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.