Repository navigation
perf(recompiler): preserve sorted dominance sets during insertion - #2521
Merged
adriadam10 merged 1 commit intoOct 10, 2026
Merged
Conversation
This was referenced Oct 10, 2026
9 tasks done
Celegans12
force-pushed
the
perf/shader-sorted-dominance-sets
branch
from
October 10, 2026 04:13
86c2332 to
8be3db2
Compare
Both dominance analyses start from sorted unique sets and intersect them. Insert the current block ID with lower_bound instead of sorting again. Preserve every intermediate set and the existing ID-order iteration. Keep the generic unsorted helper and all graph rewrite logic unchanged. Compare both analyses against the original algorithms on six raw CFGs. Cover finite loops, closed SCCs, unreachable islands and permuted IDs.
adriadam10
force-pushed
the
perf/shader-sorted-dominance-sets
branch
from
October 10, 2026 07:31
8be3db2 to
f6fbb48
Compare
Collaborator
|
Rebased onto current |
9 tasks done
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.
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)