Skip to content

shader: omit native subgroup votes for dead scalar conditions - #1272

Open
Kadamitas wants to merge 1 commit into
ProjectLeonida:mainfrom
Kadamitas:perf/native-dead-scc-votes
Open

Kadamitas wants to merge 1 commit into
ProjectLeonida:mainfrom
Kadamitas:perf/native-dead-scc-votes

Conversation

@Kadamitas

@Kadamitas Kadamitas commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: dead scalar condition votes

What and why

Use the existing scalar condition liveness analysis for native wave32 and wave64. When the shader overwrites the condition before another instruction reads it, omit the vote that would compute that condition. Preserve the mask result and keep the vote at control-flow joins where it remains live.

Tested

  • On the Nov 27 rebase onto 43a9d562d, all 62 focused SALU, wave64, WREXEC, and DPP tests passed.
  • A hand-written control reduced one subgroup vote to zero. Lane outputs matched before and after. Both votes remained in a separate live branch-join control.
  • 675 translator tests passed before the latest-main rebase. On the final branch, 135 focused semantic and SPIR-V checks passed with one platform skip.
  • The WREXEC positive control explicitly consumes SCC so that it continues to verify vote emission when the value is live.
  • The broader run on the earlier base covered 6,169 tests in 470 files. WREXEC was the only failing file. Its two vote-emission assertions used a dead result. The updated WREXEC case passed on the final branch.
  • The design contract records the rule. Verification uses synthetic inputs and SPIR-V validation.

GPUs tested: n/a (translator and semantic tests)

AI-assisted: yes

  • One topic with synthetic inputs and no game data.

@PierreEbele

Copy link
Copy Markdown
Contributor

Reviewed e7e359f: ran the touched semantic test files on the PR tree and its merge base (the new and the flipped tests fail without the fix, the rest pass) and the whole translator suite on the PR tree: 471 files, 6178 tests, 0 failures. Probed the gate with hand-built shaders: loop back-edge carries the SCC, s_cbranch_scc joins, dead+live pairs and wave64 native joins give identical values to main, with votes dropped only for provably dead SCC writes. test_translate skips on this host (llvm-mc/spirv-tools), so the WQM_MASK edit is unverified. No findings; heads-up that the docs/design.md contract row conflicts on merge with current main. AI-assisted review.

Recommendation: Merge

@Kadamitas
Kadamitas force-pushed the perf/native-dead-scc-votes branch from e7e359f to d003c34 Compare November 27, 2026 18:56
@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 27, 2026
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.

2 participants