gfx2hlsl: allow structured wave-level if/else branches inside s_cbranch_execz blocks #3800
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3800
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3798"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Holastor on GitHub · 2026-12-01 23:18 UTC · original
Holastor:dxil/per-lane-execz-else-branch→main· +106 −1 · 2 files · 3 commits · merged 2026-12-02 02:15 UTCSummary
Adds
Stage.execz_else_branchintools/startup/gfx2hlsl.pyto accept structured wave-levelif / elsecontrol flow insides_cbranch_execzblocks instead of rejecting the trailings_branch L_joinat the end of thethenarm with"branch out of the block".Supported structured shapes (with
guardpreceded bys_and_saveexec_b32 sN, .../s_and_saveexec_b64,s_branch L_joinatelse_idx - 1withL_join > L_else, no external entries into thethenarm(guard, L_else), no exits out of[L_else, L_join], and no clobber ofsNinthenother thans_andn2_b32/b64 sN, sN, exec):EXECrestore atL_else:s_mov_b32 exec_lo, sN(ors_mov_b64 exec, ...) atL_else.elsewithEXECrestore atL_join: pure scalar instructions in[L_else, L_join)withoutEXECwrites or branches, followed bys_mov_b32 exec_lo, sNatL_join.else(76130159):s_cbranch_scc0/s_cbranch_scc1from< guardjumping into(L_else, L_join), providedsNis not read in[target, L_join)andL_joinrestores/overwritesEXEC(effects[join_idx][2] & EXEC_KEYS).Verification
python -B tests/startup_gfx2hlsl_compute_check.py(pass; retains the negative control for unstructuredbranch out of the block, adds positive tests forEXEC-restoringelse, scalarelse, andhlsl_ext_else, plus negative controls for clobbered save registers and external jumps intothen)python -B tests/docs_links_check.py(147 Markdown files, 671 links — pass)python -B tests/bidi_controls_check.py(2502 tracked files — pass)