-
Notifications
You must be signed in to change notification settings - Fork 17k
[SPIR-V] Fix environment resolution causing legalization crash #179052
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
Show all changes
11 commits
Select commit
Hold shift + click to select a range
602a287
[SPIR-V] Fix environment resolution causing legalization crash
MrSidims bf7bc9d
format
MrSidims 54d67d9
change way to check for hlsl attr
MrSidims 6cc7d39
Merge branch 'main' into is-shader-spirv
MrSidims 881c120
fix line comment
MrSidims 048775b
Merge remote-tracking branch 'origin/main' into is-shader-spirv
MrSidims 222c6ac
remove comment
MrSidims ec15a9e
rewrite setEnv and fix test
MrSidims a245a7b
Merge remote-tracking branch 'origin/main' into is-shader-spirv
MrSidims 8e21f07
fix assert
MrSidims 7f5d49c
remove change
MrSidims 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s | ||
| ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val --target-env vulkan1.3 %} | ||
|
|
||
| ; Regression test for https://github.com/llvm/llvm-project/issues/171898 | ||
| ; When triple is spirv-unknown-unknown and a non-entry-point function using | ||
| ; wide vectors (e.g. <8 x i32>) appears before the entry point with | ||
| ; hlsl.shader attribute, the environment must be resolved early enough that | ||
| ; legalization uses the correct vector size limits. | ||
|
|
||
| ; CHECK-DAG: OpCapability Shader | ||
| ; CHECK-DAG: OpEntryPoint GLCompute %[[#entry:]] "main" | ||
|
MrSidims marked this conversation as resolved.
|
||
| ; CHECK-NOT: OpTypeVector %{{.*}} 8 | ||
|
|
||
| @GVec4 = internal addrspace(10) global <4 x double> zeroinitializer | ||
| @Lows = internal addrspace(10) global <4 x i32> zeroinitializer | ||
| @Highs = internal addrspace(10) global <4 x i32> zeroinitializer | ||
|
|
||
| define internal void @test_split() { | ||
| entry: | ||
| %0 = load <8 x i32>, ptr addrspace(10) @GVec4, align 32 | ||
| %1 = shufflevector <8 x i32> %0, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> | ||
| %2 = shufflevector <8 x i32> %0, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> | ||
| store <4 x i32> %1, ptr addrspace(10) @Lows, align 16 | ||
| store <4 x i32> %2, ptr addrspace(10) @Highs, align 16 | ||
| ret void | ||
| } | ||
|
|
||
| define void @main() local_unnamed_addr #0 { | ||
| entry: | ||
| call void @test_split() | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" } | ||
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.
Where is the use of the wide vector?
@helperuses on 4xi32.Uh oh!
There was an error while loading. Please reload this page.
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.
Ehhh, how I ended up with this test? Some odd script put in llvm-reduce script may be? Thanks for spotting!