shader: coalesce single-pred blocks and fold dead diamonds in DXIL opt #2623
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2623"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-29T15:04:32Z.
Summary
Adds
simplify_cfg()to the DXIL module optimizer (crates/victory-shader/src/emit/bitcode/opt.rs, gated underFOLDalongsideprune()and mid-loopdrop_dead_insts()whenDEADis enabled):CondBr(_, t, t) -> Br(t)whenever all phis intagree for that predecessor.a -> Br(b)chains whenbhas only predecessora(resolving single-entry phis with a degenerate phi-cycle guard and remapping successor phi incoming block IDs).e: Br(t)) into phi-free targetst, collapsing deadif/elsediamonds into straight-line blocks and unlocking cross-blockLOADSreuse/DSE andBARRIERScoalescing on subsequent rounds.Verification
cargo test -p victory-shader --lib: 462 passed, 0 failed (27/27opt::tests::, including randomized differential oracle, RTX 3060 Ti DXIL parity, and new CFG coalescing / diamond / phi-remap tests).cargo clippy -p victory-shader --tests: 0 warnings inopt.rs.cargo xtask policy --staged: passed.