shader: coalesce single-pred blocks and fold dead diamonds in DXIL opt #2623
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2623
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@nidea1 on GitHub · 2026-11-29 15:04 UTC · original
nidea1:perf/dxil-opt-cfg-block-coalescing→main· +391 −7 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
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.