Recompiler: use SGPR masks for scalar-load availability invalidation #2747
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#2747
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@KOLESNiii on GitHub · 2026-11-26 09:50 UTC · original
Part of #2088 and #2508. Related to #2746 and #2479. Reviewed on
mainatb49be18.reload::analyzechecks every tracked load address after an instruction changes any scalar register. For each address it tries up to 128 register numbers to test whether the instruction touched the base pair or offset register. It repeats this during the fixed-point iteration and again when recording load reuse. The ordinary direct DXIL path consumes the result. Address components · Invalidation and iteration · Ordinary emitterPrecompute one
u128dependency mask per tracked address and invalidate it when the mask intersectschanges()'s existing register mask. This gives the same test for the base, base+1, and offset, including the current handling of the offset sentinel. Keep memory clobbers, transfer order, and instruction effects as they are. This is independent of #2479's instruction-effect corrections and #2746's proposal to skip the analysis when compact emission discards it.A standalone Linux probe with Rust 1.100.0
-Oon a Ryzen AI 7 350 ran the main analyzer and a copy with only this predicate changed. Three synthetic CFGs each had 32,769 decoded instructions and 8,193 reachable blocks. The medians over five runs per variant were:Every reported slot and availability decision agreed. A separate eight-load fixture also agreed on reuse, invalidation by a base register write, a barrier, an overlapping offset register write, and an unrelated write that preserved reuse. These are analyzer timings. Windows, total translation time and retail loading remain unmeasured.
For the upstream change, keep the existing analysis tests and verify that the ordinary translator emits identical DXIL for a fixed synthetic corpus. Measure translation with cold XCL caches before extrapolating to a title.
AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static analysis, the standalone Linux probe, and drafting.