-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SPIRV] Addition of test files for @llvm.tan and zero_length_array.ll #142097
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s | ||
| ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %} | ||
|
|
||
| ; CHECK-DAG: %[[#ext:]] = OpExtInstImport "OpenCL.std" | ||
| ; CHECK-DAG: %[[#type_f32:]] = OpTypeFloat 32 | ||
| ; CHECK-DAG: %[[#type_f64:]] = OpTypeFloat 64 | ||
| ; CHECK: %[[#extinst_f32:]] = OpExtInst %[[#type_f32]] %[[#ext]] tan %[[#]] | ||
| ; CHECK: %[[#extinst_f64:]] = OpExtInst %[[#type_f64]] %[[#ext]] tan %[[#]] | ||
|
|
||
| define float @test_tan_f32(float %x) { | ||
| %res = call float @llvm.tan.f32(float %x) | ||
| ret float %res | ||
| } | ||
|
|
||
| define double @test_tan_f64(double %x) { | ||
| %res = call double @llvm.tan.f64(double %x) | ||
| ret double %res | ||
| } | ||
|
|
||
| declare float @llvm.tan.f32(float) | ||
| declare double @llvm.tan.f64(double) |
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,12 @@ | ||
| ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s | ||
| ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} | ||
|
|
||
| ; CHECK: %[[#type:]] = OpTypeInt 32 0 | ||
| ; CHECK: %[[#ext:]] = OpTypeRuntimeArray %[[#type]] | ||
| ; CHECK: %[[#]] = OpTypePointer Function %[[#ext]] | ||
|
|
||
| define spir_func void @_Z3foov() { | ||
| entry: | ||
| %i = alloca [0 x i32], align 4 | ||
| ret void | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is wrong:
OpTypeRuntimeArrayrequiresShadercapability, but the triple makes this run forKernel. @aadeshps-mcw can you please help me understand what are you trying to test here? If we change the triple tospirv-unknown-vulkan-compute, which would run forShader, there is noOpTypeRuntimeArray, instead there is anOpConstant, which I assume comes from some optimization/pass. @Keenuts can you confirm?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked, mem2reg is getting rid of the alloca, so no array after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize the mistake was on my part due to a misunderstanding of the test. I’ll address it and submit a new PR at the earliest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it in #149522. Let me know if that works for you, otherwise I can just mark it as
XFAILin the PR, so you can address it later in a different PR.