Skip to content
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

spirv-val, core: add support for OpExtInstWithForwardRefs #5698

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

Keenuts
Copy link
Contributor

@Keenuts Keenuts commented Jun 3, 2024

This commit adds validation and support for
OpExtInstWithForwardRefs. This new instruction will be used for non-semantic debug info, when forward references are required.

For now, this commit only fixes the code to handle this new instruction, and adds validation rules. But it does not add the pass to generate/fix the OpExtInst instruction when forward references are in use. Such pass would be useful for DXC or other tools, but I wanted to land validation rules first.

This commit also bumps SPIRV-Headers to get this new opcode.

This commit adds validation and support for
OpExtInstWithForwardRefs. This new instruction will be used
for non-semantic debug info, when forward references are
required.

For now, this commit only fixes the code to handle this new instruction,
and adds validation rules. But it does not add the pass to generate/fix
the OpExtInst instruction when forward references are in use.
Such pass would be useful for DXC or other tools, but I wanted to land
validation rules first.

This commit also bumps SPIRV-Headers to get this new opcode.

Signed-off-by: Nathan Gauër <brioche@google.com>
@Keenuts Keenuts changed the title val, core: add support for OpExtInstWithForwardRefs spirv-val, core: add support for OpExtInstWithForwardRefs Jun 3, 2024
@Keenuts Keenuts requested a review from s-perron June 3, 2024 13:41
Copy link
Collaborator

@s-perron s-perron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the changes in the folding rules should be reverted. Some instructions like FMix and FClamp should not have forward references, so I don't think you should change checks specifically related to those, and other like them.

Alan or someone else should look at the validator code.

source/opt/folding_rules.cpp Outdated Show resolved Hide resolved
@Keenuts Keenuts requested a review from alan-baker June 3, 2024 16:04
source/val/validate_extensions.cpp Outdated Show resolved Hide resolved
source/val/validate_extensions.cpp Outdated Show resolved Hide resolved
source/val/validate_extensions.cpp Outdated Show resolved Hide resolved
source/val/validate_id.cpp Outdated Show resolved Hide resolved
source/val/validate_extensions.cpp Outdated Show resolved Hide resolved
Signed-off-by: Nathan Gauër <brioche@google.com>
Copy link
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steven to approve the optimizer changes.

@Keenuts Keenuts merged commit 6a2bdee into KhronosGroup:main Jun 4, 2024
24 checks passed
@Keenuts Keenuts deleted the validate_opextinstwithfwd branch June 4, 2024 14:18
jkwak-work added a commit to shader-slang/SPIRV-Tools that referenced this pull request Jul 2, 2024
Merging '6a2bdee' from http://github.com/KhronosGroup/SPIRV-Tools.git
This merge is required to address an issue KhronosGroup#4304.

> commit 6a2bdee
> Author: Nathan Gauër <brioche@google.com>
> Date:   Tue Jun 4 16:18:06 2024 +0200
>     spirv-val, core: add support for OpExtInstWithForwardRefs (KhronosGroup#5698)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants