Shaders: add DXIL CFG, PHI, DCE, compaction, and feature-sync passes #1535
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1545"
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 ivall/xcl. Originally posted by Roroca-1 on 2026-11-24T17:28:50Z.
Retired 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.Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:42:52Z.
Review: COMMENTED
The targeted DXIL tests are helpful, and leaving the optimizer unwired avoids enabling it prematurely. CONTRIBUTING.md still requires the full workspace suite on Windows; the current report says that was not run natively. It also requires a paired real-title smoke run for changes under
crates/xcl/src, even when the title does not reach the new path. Please add those results before merge, documenting the path coverage. AI-assisted review; I checked the applicable requirements against the guide.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:19:10Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Pull request closed