Shaders: reuse the predicate when reading a zero-extended SCC #1536
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1546"
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:29:22Z.
Stacked on #1544. Only
ce8c103belongs here. Part of #1269.Direct lowering writes the scalar condition code (SCC) by zero-extending an i1 predicate to i32. Reading SCC tests that word against zero. The comparison can return the original predicate.
What is in it
module.rs, cover the comparison and two counterexamples, and bump the direct translator cache version to 6. The merged #1426 supplies CSE.Tested
ce8c103.TARGET_CFLAGS=/FIstring.h cargo xwin build --tests -p xcl --target x86_64-pc-windows-msvcsucceeded.wine xcl-67594ede252ac8b9.exe gpu::dxil::module::tests --nocaptureran 2 passed, 0 failed, 0 ignored, 0 skipped. Before the fold, the SCC test observed a new instruction instead of the original predicate and failed.wine xcl-67594ede252ac8b9.exe gpu::dxil::bitreader_tests --test-threads=4ran 3 passed, 0 failed, 0 ignored, 0 skipped.Regression run
Pending paired clean main/head retail-title runs.
Not tested
Native Windows GPU workspace suite, DXIL validation, retail shaders and performance.
AI use
T3 Code (Codex, gpt-6.2-astra) narrowed the original T3 Code (Antigravity, gemini-pro-orchestrator-neon) optimizer proposal, wrote the current patch and tests, and ran the Wine checks.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:32:54Z.
Review: COMMENTED
AI-assisted review (GPT-6): I traced the dominator traversal and CSE table lifetime in the current diff.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:32:54Z.
Code review location:
crates/xcl/src/gpu/dxil/opt.rs; line 1795Could each dominator child get its own CSE table scope? This
Exitruns only after every child has been visited, so an expression inserted in one branch remains available in its sibling even though that definition does not dominate the sibling. CSE can then replace the sibling value with a non-dominating SSA value. Please restore the table to the parent mark between child subtrees. AI-assisted review: I traced the sibling-block traversal and table lifetime.[PR #1546] Shaders: add DXIL InstCombine constant folding and dominator CSEto [PR #1546] Shaders: reuse the predicate when reading a zero-extended SCCImported from ivall/xcl. Originally posted by Roroca-1 on 2026-11-24T19:19:14Z.
Review: COMMENTED
No description provided.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:19:12Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by Roroca-1 on 2026-11-24T19:19:14Z.
Code review location:
crates/xcl/src/gpu/dxil/opt.rs; line 1795The replacement at
ce8c103removes this branch’s CSE implementation and uses the optimizer from merged #1426. I checked its sibling scoping with a diamond test under Wine. Both arms compute the same expression, one arm repeats it, and the join PHI uses the two incoming values. The same-arm duplicate folded and each PHI edge kept its own arm’s definition (1 passed). T3 Code (Codex, gpt-6.2-astra) wrote and ran the probe.upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:33:58Z.
Regression run of
ce8c1039on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:26:44Z.
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 Foniass on 2026-12-01T06:03:57Z.
Triage (#1607) – head
ce8c103Stacked on #1544; only
ce8c103belongs here. The base commit of #1544 is already on main (#3266,4a20b25), so after a rebase this PR is just the SCC fold indxil/module.rs:cmpand its test. No other open PR foldscmp(Ne, zext(i1), 0).The
TRANSLATOR_VERSIONbump to 6 is behind main (12); on rebase it needs to move past main's value.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.