perf(recompiler): preserve sorted dominance sets during insertion #2521
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2521"
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 Celegans12 on 2026-10-10T00:47:20Z.
What
Both dominance analyses sort a whole set after inserting one block ID. The sets already start sorted and unique, and intersections preserve that order. Insert at
lower_boundonly when the ID is absent.This changes the two insertion sites in
computeDominatorTreeandcomputePostDominators. Visitation order, convergence and graph rewriting stay unchanged. Six differential fixtures compare complete dominance vectors with the original algorithms across diamonds, loops, non-exiting SCCs, unreachable blocks and permuted IDs.#2105 changes post-dominator visitation order; #2276 changes dominance queries and region traversal; #1493 extracts shared helpers. None implements these two insertion changes.
Synthetic whole-
Structurizemedians were 7.5108 to 3.4704 ms for 50 diamonds and 2.3872 to 2.0880 ms for 20 shared-merge branches: three samples after warm-up, alternating order, graph construction excluded. Initial/finalGraphToStringbytes matched. These two cases do not establish startup or FPS gains.Tested
Windows 11, MinGW-w64 GCC 15.2.0: configure
-DBUILD_TESTING=ON, full build, libs and registration passed. Tested treee14758cbecexactly equals main1f0c9fef56plus this feature; #2473 is merged.CTest: 556 executed passes, three skips, no failures. Two VideoOut modes skipped because main forces SDL's offscreen driver; both exact built modes passed separately with native Windows SDL. The remaining skip is the deliberate missing-Vulkan negative test. Raw upstream/local skip gates remain failed; native passes are supplemental evidence.
Focused
agc_structurizerandagc_shader_control_flowtests passed.Linux/lavapipe: full build, libs and registration passed on the same tree. CTest recorded 539 executed passes, 29 skips out of 568 cases, no failures; executed cases each passed three repetitions. Skips comprise 27 unchanged platform/device cases and two newly registered VideoOut modes consistent with main's offscreen/display skip path. Individual skip output was not captured. The helper predates the JUnit skip checker; exit 0 does not establish a current skip-policy pass.
Not tested: standalone title run or console behavior.
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 adriadam10 on 2026-10-10T07:32:00Z.
Rebased onto current
main: the only conflict was intests/Structurizer.cpp, next to the post-dominator check and case added by #2105; kept both sides, no change toStructurizer.cpp. AGC/AgcDriver ctest passes on Linux (agc_structurizerincluded). The sets start sorted/unique andintersectSortedpreserves order, so inserting atlower_boundmatchesaddUnique+sortUnique. Merging on green CI.