Repository navigation
shader: count a 32-bit SALU write in a mesh SAVEEXEC arm as one SGPR (Part of #3703) - #3785
Merged
Merged
Conversation
The then-arm scan recorded every scalar destination as a register pair, so a 32-bit write such as s_lshl_b32 s7 also marked s8 as written. At the join s8 was clobbered, and a lane mask kept there was lost; the else arm also could not read the neighbour. Record the pair only for 64-bit SALU forms and for non-SALU writes (compare masks, readlane), as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3703. Fixes the 13 programs that stop at
unproven mesh mask operandon the current stack.Problem
validate_saveexecrecords every scalar destination written in a SAVEEXEC then arm as a register pair. That covers lane masks, but a 32-bit SALU write also marked its neighbour. Those writes become the arm'sscalar_clobbers, which are cleared at the join.In all 13 programs, a lane mask lives in
s[8:9](s_cselect_b64 s[8:9], exec, 0) across a nested SAVEEXEC whose then arm runss_lshl_b32 s7, .... The join cleareds8, and the laters_and_b64 s[2:3], vcc, s[8:9]was refused as an unproven mask.The same over-count made an else arm that reads such a neighbour refuse as
else arm reads a scalar the then arm writes.Change (
gfx1013_direct_mesh.inl)In the then-arm scan, a SOP1/SOP2/SOPK result marks
dst+1only when the opcode name has64(the_b64/_u64/_i64forms, plus*_b64sources such ass_bcnt1_i32_b64, kept as before). VOP results with an SGPR destination (compare masks,v_readfirstlane) and scalar loads are unchanged.Tests (
tests/native_direct_mesh_check.py)saveexec-then-b32-neighbour: the then arm writess29withs_mov_b32, and the else arm readss30. It lowers tophi [ 7, then ], [ 3, else ].saveexec-then-b64-pair:s_mov_b64 s[30:31]in the then arm still keeps the else arm's read ofs31refused.Validation (Windows 11, MSVC, Windows SDK 10.0.26100)
ctest --test-dir out/build/dev -R "native_direct_mesh|mesh": 210/210 (the twomesh_two_exitshardware tests skip as usual).s_bitset1_b32, then stop at a scalar loop #3703) onmain+ shader: lower s_not_b32, s_brev_b32 and s_bfe_i32 in the mesh frontend #3708 + shader: lower v_rcp_iflag_f32 and v_ashrrev_i32 in the mesh frontend #3709 + shader: keep a mesh lane limit across a nested CMPX skip that closes at the same restore (Part of #3703) #3710 + shader: lower v_cmpx_lg_f32, v_cmpx_gt_f32 and per-lane v_cmpx_gt_u32 in the mesh frontend (Part of #3703) #3729 + shader: carry exact mesh lanes through nested CMPX skips to an EXEC restore (Part of #3703) #3760 + shader: merge mesh writes under one CMPX inside a lane skip and restore the guard (Part of #3703) #3765 + shader, runtime: lower and bind mesh format loads from a descriptor-table V# (Part of #3703) #3770 + shader: lower a mesh CMPX region inside a SAVEEXEC then arm (Part of #3703) #3782 + this: 988 of 1,569 translate, up from 975. 13 gained, none lost. Onmainalone these programs stop at earlier walls. Counts only; request bytes stay local.Independent of #3782; the two touch different lines.
AI-assisted.
🤖 Generated with Claude Code