Shaders: add DXIL CFG, PHI, DCE, compaction, and feature-sync passes #1545
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1545
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1545/head"
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?
@Roroca-1 on GitHub · 2026-11-24 17:28 UTC · original
Roroca-1:dxil-opt-2-cfg-dce→main· +21233 −30 · 74 files · 24 commits · closed without mergingRetired after #1426 merged. Main now handles unreachable blocks, trivial PHIs, dominator CSE and dead instructions during shader finalization. The additional CFG rewrites, compaction and feature synchronization in this draft have no isolated result here against the merged optimizer. The original branch is preserved for follow-up measurements.
Core DXIL SSA IR optimization and compaction passes (
Shader::optimize/opt::optimize_module), left unwired from kernel translation until the stacked InstCombine/CSE and enablement PRs land.Part of #1269.
Stacked on #1544; only the top commit belongs here.
This PR adds ~1,230 non-test lines (~256 test lines) because the iterative CFG/PHI/DCE fixpoint loop,
compact_module, andsync_featuresshare operand-rewriting and dominator helpers and together keepShader::featuresconsistent after dead code removal; InstCombine/CSE andkernel.rswiring are split into the follow-up PRs.The merged #1426 already performs unreachable-block cleanup, trivial PHI elimination and DCE in
module/opt.rs. This branch predates that implementation and conflicts withmain.What is in it
crates/xcl/src/gpu/dxil/opt.rs: addStats,module_stats,optimize,optimize_module, iterativesimplify_cfg(terminator folding, iterative RPO traversal, PHI edge trimming, empty jump-block bypass, single-predecessor merging, dense RPO re-indexing), dominance-checkedsimplify_phis(via iterative Cooper-Harvey-Kennedycompute_idom), iterative mark-and-sweepdce(dead PHI cycles, unusedreadnone/readonlyand pure wave/quad calls), densecompact_module, andsync_featuresplus 5 unit/GPU tests.crates/xcl/src/gpu/dxil/mod.rs,crates/xcl/src/gpu/dxil/shader.rs: exportpub mod optand addShader::optimize(&mut self).Tested
proton-cachyos-slr) + DXVK, cross-built from Linux tox86_64-pc-windows-msvcviacargo-xwin, debug, commit32facfe36b73:TARGET_CFLAGS="/FIstring.h" cargo xwin build --tests -p xcl --target x86_64-pc-windows-msvc: 0 errors, 0 warningswine xcl.exe gpu::dxil::opt --nocapture --test-threads=1: 5 passed, 0 failed, 0 ignored (809 filtered out; 0SKIPPED, includes GPU execution on RX 9070 XT)Regression run
Pending native Windows GPU workspace tests and paired
scripts/smoke.ps1runs on the same retail title and duration at cleanmainand PR head. Path coverage must be recorded with the results. The new pass is unwired on this branch.Not tested
.\scripts\test.ps1workspace test suitedxcompiler.dllDXIL validation and disassembly (unavailable locally under Wine)scripts/smoke.ps1regression run on retail game titlesAI use
opt.rspasses and tests, wiredShader::optimize, drafted this description, and ran thecargo-xwin/ Wine + RX 9070 XT tests.@DavidM1911 on GitHub · 2026-11-24 19:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Pull request closed