Skip to content

[NFC] Remove assert from SPV Work Graphs#8599

Merged
llvm-beanz merged 2 commits into
microsoft:mainfrom
llvm-beanz:nfc-no-string-matching-wg
Jul 1, 2026
Merged

[NFC] Remove assert from SPV Work Graphs#8599
llvm-beanz merged 2 commits into
microsoft:mainfrom
llvm-beanz:nfc-no-string-matching-wg

Conversation

@llvm-beanz

@llvm-beanz llvm-beanz commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

I misunderstood how this was being used, and now that I understand, the assert makes no sense.

In the SPIRV representation defined in https://github.khronos.org/SPIRV-Registry/extensions/AMD/SPV_AMDX_shader_enqueue.html, as well as in DXIL, the record objects are always arrays. At the source level we differentiate single objects from arrays but the single object is just an array of one element.

For the single object case any function that takes an index defaults to for the index.

This is true in both SPIRV and DXIL. Checking if the type name ends in s isn't a meaningful assert. The user either had a single element array, or a multi-element array, and they either didn't provide an index (so it defaults 0) or they did because they were required to at the AST level.

Either way we don't need to check any of this in an assert in the codegen layer.

This replaces string matching of WG type names with using the proper
NodeIOFlags. This avoids the compiler incorrectly treating a
user-defined type as if it is the built-in type.
@llvm-beanz llvm-beanz changed the title [NFC] Don't string match WG type names [NFC] Remove bunk assert from SPV Work Graphs Jul 1, 2026
@llvm-beanz llvm-beanz changed the title [NFC] Remove bunk assert from SPV Work Graphs [NFC] Remove assert from SPV Work Graphs Jul 1, 2026
@llvm-beanz llvm-beanz enabled auto-merge (squash) July 1, 2026 19:59
@llvm-beanz llvm-beanz merged commit 3fe4b7d into microsoft:main Jul 1, 2026
17 checks passed
@llvm-beanz llvm-beanz deleted the nfc-no-string-matching-wg branch July 1, 2026 21:17
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jul 1, 2026
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.

3 participants