Repository navigation
shader: lower remaining SOP1 *_saveexec_* and *_wrexec_* ops in direct Compute DXIL - #3297
Conversation
…t Compute DXIL Generalizes the direct Compute DXIL scalar mask combiner and SCC liveness/provenance tracking to lower all remaining 9 wave32 (*_saveexec_b32, s_andn1_wrexec_b32) and 3 wave64 (s_andn1_saveexec_b64, s_orn1_saveexec_b64, s_andn1_wrexec_b64) SOP1 EXEC-mask instructions. Fixes R0Y00#3296. Refs R0Y00#2935. AI-assisted.
|
Independent Windows verification at Debug and Release each passed 11/11. The RTX 4070 matched all 2,064 words per case across 19 wave32 and 9 wave64 replays, including aliasing, the high-word SCC cases, and the 128-thread dispatch. Both configurations passed the eight compiler refusals. I also ran the 28 cases via I separately checked the SCC liveness change in Release. A symbolic stride extraction from a UAV slot precedes each of the nine new wave32 forms, whose result is immediately observed by |
|
I reviewed the diff (not run). The new lowerings look right: operand order for the n1/n2 forms, saveexec versus wrexec, SCC from the new mask, and both EXEC words in wave64. The widened wave32 branch in One soundness gap in the static analysis, which this PR inherits rather than introduces:
AI-assisted. |
|
Thanks @RonLogic for running the independent Debug/Release verification on RTX 4070 + WARP (and confirming the symbolic SCC liveness test!), and @Leyukaka for the thorough diff review and noting the inherited 64-bit AI-assisted. |
|
Thank you for this PR. I reviewed Could you remove one fixture dependency before merge? The 8-thread
Could you add that line at the start of This comment was AI-assisted. |
Lowers the remaining 12 SOP1 EXEC-mask instructions (
*_saveexec_*and*_wrexec_*) in the direct Compute DXIL translator, alongside consistentuses_scc_after()andtransfer()tracking.Fixes #3296. Refs #2935.
Changes
src/gfx1013_compute_native.cpp(transfer()): Generalize the wave32 compute!graphics && !wave64EXEC-mask transfer rule to cover all*_saveexec_b32ands_andn1_wrexec_b32/s_andn2_wrexec_b32instructions, clearing symbolic provenance on bothi.dstand126(EXEC_LO).src/gfx1013_direct_compute.inl(uses_scc_after()): Adds_orn2_b64,s_nand_b64,s_nor_b64,s_xnor_b64,s_andn1_saveexec_b64,s_orn1_saveexec_b64, ands_andn1_wrexec_b64tomask_scc, and add all 9 newly lowered wave32 ops (s_xor_saveexec_b32,s_andn2_saveexec_b32,s_orn2_saveexec_b32,s_nand_saveexec_b32,s_nor_saveexec_b32,s_xnor_saveexec_b32,s_andn1_saveexec_b32,s_orn1_saveexec_b32,s_andn1_wrexec_b32) tooverwrites.src/gfx1013_direct_compute.inl(emit()):combine_scalar_maskhelper coveringand/or/xor,andn2/orn2(a op ~b),andn1/orn1(~a op b), andnand/nor/xnor(~(a op b)).s_andn1_saveexec_b64(0x37),s_orn1_saveexec_b64(0x38), ands_andn1_wrexec_b64(0x39) in the 64-bit mask path (s_andn1_wrexec_b64gated tocompute && wave64with even SGPR pair operands<= 104, matchings_andn2_wrexec_b64).*_saveexec_b32(0x3e..0x45) ands_andn1_wrexec_b32(0x46) undercompute && !wave64(dst <= 107, refusingdst > 107withunsupported wave32 SAVEEXEC destination), updatingdst(oldfor saveexec,maskfor wrexec),EXEC_LO, andSCC = (mask != 0).tests/native_saveexec_wrexec_check.py,tests/cmake/native_saveexec_wrexec.cmake,docs/experiments/native-saveexec-wrexec.md: Addir,controls, andhardwarechecks covering 19 wave32 cases, 9 wave64 cases (includingSCC=0,SCC=1, high-word-only non-zeroEXEC_HI,dst == srcaliasing,vcc_lo/exec_lo/inline/literal sources, partial waves), and 8 negative operand/mode refusals.Verification
All tests ran after the final edit on both
devandreleasepresets:ctest --preset dev --no-tests=error --output-on-failure -j 1 -V -R '^native_saveexec_wrexec_':native_saveexec_wrexec_ir: Passed (0.84s, evaluated IR for19wave32 +9wave64 cases +8refusals)native_saveexec_wrexec_controls: Passed (3.62s, compiled28wave32/wave64 cases +8refusals)native_saveexec_wrexec_hardware: Skipped (77) on localIntel(R) HD Graphics 530(driver=31.0.101.2111,requires shader model 6.6 with wave32; hardware execution unmeasured locally)ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_direct_container$'&-R '^(native_or_saveexec|native_wrexec64|native_salu_cmp64|native_s_not_b64_exec)_':native_direct_container(24.99s),native_s_not_b64_exec_controls,native_salu_cmp64_ir, andnative_salu_cmp64_controlsPassed;4hardware tests Skipped (77).ctest --preset release --no-tests=error --output-on-failure -j 1 -R '^(native_saveexec_wrexec_|native_or_saveexec_|native_wrexec64_|native_salu_cmp64_|native_s_not_b64_exec_|native_direct_container$)':6non-hardware tests Passed (31.88s),5hardware tests Skipped (77).python -B tests/docs_links_check.py: Passed (145Markdown files,663links).dev(native_saveexec_wrexec_ir):andn1/orn1operand swap (~rightinstead of~left): killed atw32_andn1_nznand/nor/xnor: killed atw32_nand_nzoldinstead ofmaskforwrexec: killed atw32_wr1_nz(
src/gfx1013_direct_compute.inlrestored cleanly andnative_saveexec_wrexec_irre-passed.)AI-assisted.