Skip to content

NFC: Make hlsl::IntrinsicOp enum values stable #7231

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 2 commits into from
Mar 20, 2025

Conversation

tex3d
Copy link
Contributor

@tex3d tex3d commented Mar 20, 2025

This change makes hlsl::IntrinsicOp enum values stable by:

  • adding hlsl_intrinsic_opcodes.json to capture assigned indices
  • adds this to the files generated by hctgen
  • generation assigns new indices after the last index
  • hlsl::IntrinsicOp enum values have explicit assignments
  • removes ENABLE_SPIRV_CODEGEN ifdefs around opcode definitions and lowering table entries to keep these stable whether or not the spirv build setting is enabled.

Fixes #7230

This change makes hlsl::IntrinsicOp enum values stable by:
- adding hlsl_intrinsic_opcodes.json to capture assigned indices
- adds this to the files generated by hctgen
- generation assigns new indices after the last index
- hlsl::IntrinsicOp enum values have explicit assignments

Fixes microsoft#7230
@tex3d tex3d requested a review from a team as a code owner March 20, 2025 07:41
Copy link
Contributor

github-actions bot commented Mar 20, 2025

✅ With the latest revision this PR passed the Python code formatter.

Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

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

This is across the board a huge win. Thank you @tex3d!

@tex3d tex3d merged commit eb02343 into microsoft:main Mar 20, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Mar 20, 2025
@tex3d tex3d deleted the stable-hl-opcodes branch March 20, 2025 16:12
@pow2clk pow2clk mentioned this pull request Mar 24, 2025
pow2clk pushed a commit to pow2clk/DirectXShaderCompiler that referenced this pull request Mar 26, 2025
This change makes hlsl::IntrinsicOp enum values stable by:
- adding hlsl_intrinsic_opcodes.json to capture assigned indices
- adds this to the files generated by hctgen
- generation assigns new indices after the last index
- hlsl::IntrinsicOp enum values have explicit assignments
- removes ENABLE_SPIRV_CODEGEN ifdefs around opcode definitions and
lowering table entries to keep these stable whether or not the spirv
build setting is enabled.

Fixes microsoft#7230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request] Make hlsl::IntrinsicOp enum values stable
3 participants