fix(recompiler): clone small return blocks shared by early exits #2201
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2201"
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 boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:29:43Z.
What
A pixel shader of Uncharted: Legacy of Thieves Collection (PPSA05684) stops on
mainwith:Its early discards all branch to one small ending block, which then has several conditional predecessors outside any loop. When the regular pass throws, the structurizer now restarts from the original graph and first gives each such predecessor its own copy of the return block (at most
CloneWordFloorwords, a budget of four clones per block). TestsharedDiscardintests/Structurizer.cppuses the shader's block sizes and fails without the fix.Tested
Arch Linux, GCC 16.2.1, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.71.09).
main(d70b8998):tools/check_conventions.pypasses; of the 513 ctest tests all pass exceptagc_driver_dcc_keys_first_write, which fails the same way onmain(an unchanged pending image was uploaded again).agc_driver_storage_cache_budgetpasses run alone; underctest -j8a local 3 GB RSS limit stopped it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T13:07:48Z.
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
-DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build pluslibs. 49e5143c cherry-picked onto currentmaind70b8998(applies cleanly).agc_driver_dcc_keys_first_writepasses onmainand with this change, so the failure noted in the description (an unchanged pending image was uploaded again) doesn't reproduce on Windows/NVIDIA.agc_driver_storage_cache_budgetalso passes underctest -j8here (14 s).AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:49:27Z.
Rebased onto current
main(only conflict: the newsharedDiscardcase sits next to the "chain of fifty selections" case intests/Structurizer.cpp; kept both). Built and ran the AGC/AgcDriver ctest scope: 323/323 pass, includingagc_structurizer. ThesharedDiscardcase failed without the Structurizer change in the earlier check, and the Windows run by @rmz-24 passed. Merging.