Skip to content

Partial Executer#346

Merged
yuri91 merged 4 commits intomasterfrom
type-optimizer-changes
Feb 3, 2026
Merged

Partial Executer#346
yuri91 merged 4 commits intomasterfrom
type-optimizer-changes

Conversation

@andmadri
Copy link

Made two new changes:

  1. Changed the previous logic for tracking the number of instructions visited for a function. Before we used to have a global tracker, that when we had reached the max number of instructions, we would skip on any future instruction for all call sites. This I think was wrong because we want to track instructions per call site and not across all of them. Now if reach the maximum number of instructions we can bail out for that call site but maybe with a different call site we can still find optimizations.

  2. Added a set that stores visited basic blocks across a function's call sites and a counter that has the total number of blocks for a function. If the size of the set ever is the same as the total number blocks, there is no point in continuing with any other call site.

@andmadri andmadri requested a review from yuri91 January 30, 2026 16:15
@yuri91 yuri91 added the hydra Run hydra on this PR label Jan 30, 2026
Changed the old logic so instead of keeping track globally of how many
instructions have been visited for a given function. We keep this counter
per function class and reset it for every new call site. If we have visited
more than the maximum number of instructions, we can decide to not continue
visiting this call site.
@andmadri andmadri force-pushed the type-optimizer-changes branch from f065a69 to c79e74d Compare February 2, 2026 17:26
@andmadri andmadri requested a review from yuri91 February 2, 2026 17:29
Andres Madrid Ucha added 3 commits February 3, 2026 11:42
During the recursive visit of a function call site, when we mark blocks
as visited, we insert them into a data structure that tracks the visited
blocks across the different call sites. If at any point, the size of the
visited blocks is the same as the size of a funciton,
that means that there is no point in trying to find unreachable blocks
in any further visit to another call site of that function.
We were previously using the limit for the maximum number of visits
per basic blocks for bailing out on to many call sites for a function
which was not clear.
Instead of a check for the maximum number of basic blocks, we
track if we have visited too many instruction for a SCC. If
that is the case we mark the basic blocks as visited, reset the
counter of instructions per SCC and continue
@andmadri andmadri force-pushed the type-optimizer-changes branch from c79e74d to db3f430 Compare February 3, 2026 11:04
@yuri91 yuri91 merged commit 5f5c3a6 into master Feb 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hydra Run hydra on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants