Recompiler: direct DXIL drops phi groups that pass one value around #1928
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1938"
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 mastrr9 on 2026-11-24T23:43:51Z.
Module::optimizeonly removes a phi that is trivial on its own, so loops leave cycles of phis that name each other plus one value. This removes such groups with Tarjan SCCs over the phi operand graph (Braun et al., CC 2013).XCL_DXIL_NO_OPT=sccskips the step.No
TRANSLATOR_VERSIONchange: #1947 hashes thegpu/dxilsources into the translation cache's identity.Draft: the head commit
0fda14f(rebased onto main568e7db) has only been type-checked; Windows tests, GPU verification and the regression run are still to do.What is in it
gpu/dxil/module/opt.rs: the pass, run after trivial phis and again after CSE, with four tests on hand-built IRTested
These runs are from before the final rebase, on a combined branch (
01db80a, based on maine9e94ce; it holds this change plus four other changes), not on this PR's head commit. On the head commit,cargo check --locked --workspace --all-targets --target x86_64-pc-windows-msvcon macOS (Rust 1.100.0, the C compiler for one dependency stubbed out) finished with no errors; nothing was run.cargo testdebug build. Driver, CPU and Rust versions were not recorded.cargo test -p xcl --lib gpu::dxil::module::opt -- --test-threads=1: 4 passed, 0 failed.direct_dxil_size_report(a synthetic size report that is on that branch, not in this PR), pass off (XCL_DXIL_NO_OPT=scc) → on, totals: phis 194 → 173, instructions 4027 → 4000, selects 191 → 185, bytecode 120800 B → 120640 B. The tree also had a lane-bit folding change, on in both runs.gpu/dxil/module/is unchanged betweene9e94ceandf5136a6. The rebase onto568e7dbleaves the pass and its tests as they were; the tests now share onemod testswith a test thatmainadded toopt.rs.Regression run
Not run: there are no
xcl-smokeblocks for this change.Not tested
cargo test --workspacewas not run for this change on its own.opt.rsare expected with #1818, #1906 and #1930; whichever lands later needs a rebase.AI use
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:08:26Z.
Diff audit on draft
47170bf(redundant_phi_sccsTarjan SCC removal before and after CSE, plus sub-SCC handling and tests) looks clean.When ready to undraft: rebase onto
main(dropping the manualTRANSLATOR_VERSION = 8bump inkernel.rs, as#1947now auto-hashesgpu/dxilsources), add thexcl-smokeblock forPR description, and add AMD + NVIDIA verification.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:41:09Z.
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-25 04:08:41 +00:00
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:42:53Z.
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:31Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:07:53Z.
Triage (#1607) – head
0fda14fNo open or merged PR removes redundant phi SCCs in
gpu/dxil/module/opt.rs. Main's #3269 (fixed-point optimizer) and #2194 (CFG merges) add other passes. Main still only removes single trivial phis (simplify_phis).To keep after the rebase: main's
5a984e02(keep backedge values behind loop phis) refuses to replace a phi with a value serialized after it (inst_at[j] < inst_at[i]).redundant_phi_sccsalso handles single-phi components:iv = phi [iv, entry], [next, latch]forms the SCC{iv}with one outside valuenext. Without the same availability check, it would put back exactly the replacement that main's fix took out (testtrivial_loop_phi_keeps_backedge_definition_after_header_uses).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.