Skip to content

Conversation

@s-perron
Copy link
Contributor

@s-perron s-perron commented Jun 6, 2025

SPIR-V has the concept of a specialization constant. See the SPIR-V spec
for details.

This commit adds the ability for the SPIR-V backend to generate the base
specialization constants (OpSpecConstant, OpSpecConstantFalse, and
OpSpecConstantTrue).

This will be used by HLSL.

Fixes #142991

SPIR-V has the concept of a specialization constant. See the [SPIR-V spec](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_specialization_2)
for details.

This commit adds the ability for the SPIR-V backend to generate the base
specialization constants (OpSpecConstant, OpSpecConstantFalse, and
OpSpecConstantTrue).

This will be used by HLSL.
@s-perron
Copy link
Contributor Author

s-perron commented Jun 9, 2025

It look like a builtin already exists for this. I should use the one that already exists. I did not see it earlier.

https://github.com/s-perron/llvm-project/blob/fadeeac5a79cbae0edffbabbe383d7451c254afb/llvm/test/CodeGen/SPIRV/transcoding/spec_const.ll

@s-perron s-perron closed this Jun 10, 2025
@s-perron s-perron deleted the spec-const-intrinsic branch June 10, 2025 14:46
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.

[SPIRV] Implement the llvm.spv.get.specialization.constant intrinsic

1 participant