[SPIR-V] Normalize inline SPIR-V for builtins #7974
+426
−17
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.
This PR requires #7967
Inline SPIR-V provides mutliple attributes with overlapping
capabilities:
The issue is that what should be syntactic sugar was not implemented as
such: ext_input_builtin should be sugar for decorate + storage_class.
This meant codegen has different paths depending on the attributes used,
even if they should in the end have the same effect.
As expected, those paths have different behaviors, and some are buggy.
This commits adds a new step in sema: attribute normalization.
The target idea is to
desugarsome attributes into a more basicformat, but it requires large changes in CG. As of now, this commits
normalizes a bit the attributes in sema, but might lift
decoration+storage into ext_input_builtin.
Properly doing de-sugar will require additional changes, especially
around parameters & builtin through decorations which works only because
codegen checks are not complete.