Skip to content

Recompiler: keep backedge values behind loop phis - #251

Draft
bmjask wants to merge 1 commit into
stack/247-unsafe-barriers-hlslfrom
stack/248-backedge-loop-phis
Draft

bmjask wants to merge 1 commit into
stack/247-unsafe-barriers-hlslfrom
stack/248-backedge-loop-phis

Conversation

@bmjask

@bmjask bmjask commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Stacked on #250.

This is an internal draft stack in bmjask/xcl; it is not an upstream merge request.

What and why

This unit isolates recompiler: keep backedge values behind loop phis as one reviewable step in the redesign.

What is in it

  • 5af32806 is part of this logical unit.

Tested

The complete rewritten tail was verified tree-identical to integrated commit 963dcdca. Tests were not rerun during stack packaging.

Regression run

Not run during stack packaging.

Not tested

  • Windows MSVC build and test suite
  • D3D12 GPU execution
  • scripts/smoke.ps1 main/head comparison

AI use

Codex, GPT-5.6-sol, rebased the existing logical change onto the cleaned stack, verified final tree identity, created the stack branch, and drafted this description.

@bmjask
bmjask force-pushed the stack/247-unsafe-barriers-hlsl branch from c9b0645 to d422089 Compare November 27, 2026 00:45
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch from 5af3280 to 5e40d06 Compare November 27, 2026 00:46
@bmjask
bmjask force-pushed the stack/247-unsafe-barriers-hlsl branch from d422089 to e6c8b11 Compare November 27, 2026 01:00
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch 2 times, most recently from c0b0932 to efc8341 Compare November 27, 2026 05:14
@bmjask
bmjask force-pushed the stack/247-unsafe-barriers-hlsl branch from 6a61328 to d9ba111 Compare November 27, 2026 12:35
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch from efc8341 to 7a65879 Compare November 27, 2026 12:35
@bmjask
bmjask force-pushed the stack/247-unsafe-barriers-hlsl branch from d9ba111 to d5c1218 Compare November 27, 2026 12:44
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch from 7a65879 to 399f5d9 Compare November 27, 2026 12:44
@bmjask
bmjask force-pushed the stack/247-unsafe-barriers-hlsl branch from d5c1218 to a0c31c8 Compare November 27, 2026 12:52
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch from 399f5d9 to 8787bf4 Compare November 27, 2026 12:52
Trivial-phi elimination could replace a loop-header phi with its sole distinct backedge value. That rewrote header uses to an instruction serialized later in the loop and tripped the direct-DXIL well-formed-use invariant after CFG simplification.

Only eliminate a phi when its replacement is already available before it in function order. Cover the self/backedge loop form that the branchy compute translation exposes.

Assisted-by: Codex (GPT-5.6-sol)
@bmjask
bmjask force-pushed the stack/248-backedge-loop-phis branch from 8787bf4 to 5a984e0 Compare November 28, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant