Repository navigation
Claude/vc6 passes - #6
Merged
Merged
Conversation
Rewrites that produced gta2_re matches by hand: - bool_assign: 'x = a < b;' <-> 'if (a < b) x = 1; else x = 0;' (and 'x = 0; if (c) x = 1;'): VC6 if-converts a flag set differently. - reuse_local / split_local: one local for two values or two locals: which register holds the array base and which the walking pointer. - inline_use: read a local's initializer again at one use: whether VC6 keeps the value in a register across calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
swap_logical swaps the operands of && and || (which test VC6 lays out first), do_while turns a while loop into a guarded do-while and back, and noop_node adds or drops redundant parentheses and f32 casts of f32 values, which move the x87 scheduler's 81-node window breaks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goto_exit turns a loop's breaks into a goto to a label after the loop (all of them or one) and back: a break's exit is a jump-only block whose jumps VC6 retargets. tail_return copies the return after an if into one branch, or drops such a copy, which decides the tail VC6's cross-jumping keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…her calling convention Each declaration line of the function and of the functions it calls (in the source and its headers) becomes a region holding the text between the return type and the name; all the declarations of one function get the same choice of none, __cdecl, __stdcall or __fastcall. In a __cdecl function VC6 gives the instructions after a call no call-clobber latency, so the convention changes the schedule even without parameters: gta2_re's GetLayout_4D6000 is found again in two compiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
switch_dup runs the statement after a switch in each case before its break (adding a default for it) or hoists a statement every break shares out of the switch. --op-alias now also takes a method name (Normalize=Normalize_406C20 renames the call), and --auto-method-aliases finds the pairs of an inline method and its named out-of-line copy in the included headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) / if (1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
No description provided.