-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SPIR-V] Consistent handling of TargetExtTypes in emit-intrinsics #135682
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
5 commits
Select commit
Hold shift + click to select a range
e5b9e1d
[SPIR-V] Consistent handling of TargetExtTypes in emit-intrinsics
cassiebeckley 50c254c
Merge remote-tracking branch 'upstream/main' into spirv-type-undef
cassiebeckley ef15dff
Add comments
cassiebeckley 737c66f
Fix format
s-perron 341da6b
Merge branch 'main' into spirv-type-undef
s-perron 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; RUN: llc -verify-machineinstrs -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 %} | ||
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - | spirv-as - -o - | spirv-val %} | ||
|
||
%literal_32 = type target("spirv.Literal", 32) | ||
%literal_true = type target("spirv.Literal", 1) | ||
|
||
; CHECK-DAG: OpUnknown(21, 4) [[int_t:%[0-9]+]] 32 1 | ||
%int_t = type target("spirv.Type", %literal_32, %literal_true, 21, 4, 32) | ||
|
||
; CHECK-DAG: {{%[0-9]+}} = OpTypeFunction [[int_t]] | ||
define %int_t @foo() { | ||
entry: | ||
%v = alloca %int_t | ||
%i = load %int_t, ptr %v | ||
|
||
; CHECK-DAG: [[i:%[0-9]+]] = OpUndef [[int_t]] | ||
; CHECK-DAG: OpReturnValue [[i]] | ||
ret %int_t %i | ||
} |
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.
Let's please document this explicitly in comments.
A wider context is that in #130605 we have started elimination of spv_track_constant intrinsics, and this is a work in progress. I understand this change and its need to resolve the issue, however, it introduces a hidden relations between this point in the code and SPIRVEmitIntrinsics::processInstrAfterVisit() where
Intrinsic::spv_track_constant
is inserted. This create a pitfall for anyone who will try to untangle type inference logic from emit-intrinsic logic.I think it's ok to introduce this change, but please add a longer comment here and in SPIRVEmitIntrinsics::processInstrAfterVisit(), referencing another occurrence of the spv_track_constant/spv_assign_type pair implicitly linked by
isTargetExtTy()
, so that we do not forget to address this after the prospective rework of type inference vs. emit-intrinsic starts.