Repository navigation
[AUTOMATED] Speed up structuring: identify only the loops the region structurer reads, and do not repeat known structurings - #1986
Merged
Merged
Conversation
[AUTOMATED] Keep the first loop-condition collapse instead of a third run, skip a region structuring already known to fail within one apply, and run only the cyclic phase of the region identifier the region structurer reads. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] Spec prose for chapters 07 and 08, and a unit test that the cyclic-only identification yields the same loops as the full analysis. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] chainfold.c gains commit(), appended after main so no existing function moves: `order = 1` sits between two put() calls whose failures share one ordinary block. condfold auto prints it as a comma operand of the condition, noreturn as nested ifs; the round trip runs it too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] 5518 -> 5520 assertions (kuna-chainfold #5, #6; #3 renamed). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
[AUTOMATED] New SHA-256 sums and the commit() function. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU
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.
Recent structuring options (
condfold auto/noreturn,loopcondhoist,dedupitetail latch,returndup auto) madedecompile-allup to 7.6% slower on large binaries. Most of the structuring time goes into work whose result is discarded or recomputed: the region identifier's acyclic regions, which nothing reads, and second and third structurings of a graph whose outcome is already known. This change removes that work; the output does not change.cyclic_loops). It now runs only the identifier's preprocessing and cyclic phase (KunaRegionIdentifier::compute_cyclic), and builds no identifier whenregionlooprefineis off. The acyclic phase only wraps existing nodes in new regions, so every loop keeps its head, blocks and exits. It took about 60% of the identifier's time.o0jumpsgate. Within oneActionBlockStructurerun, a structuring of the same graph after such a failure goes straight toCollapseStructure: thecondfoldstructuring without the relaxation, and theloopcontinue autostructuring with the record back on.loopcondhoistrule wins over the rule-free structuring, the first collapse is saved aside and put back. It is no longer collapsed a third time. A check that both seedings map every block to the same copy guards this.decompile-all --jobs 1, user+sys CPU, minimum of 4 interleaved runs:Tests: a unit test checks that
compute_cyclicfinds the same loops ascomputeon three graphs with nested and multi-exit loops. The decbench corpus (35,197 O2 and 34,473 O0 functions) prints byte-identical C before and after.tests/stages/kuna-chainfold.xmlalso pins the comma-operand form of a chain with a store between its calls:if ((!v1) && (order = 1, v1 = put(..), !v1))undercondfold auto, nested ifs undernoreturn. The chain-fold round trip runs that function too.Model:
anthropic/claude-opus-5-5🤖 Generated with Claude Code
https://claude.ai/code/session_013BBaWVABMswm9QwjnywGWU