Skip to content

Rewrite inlining pass #1935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Rewrite inlining pass #1935

wants to merge 7 commits into from

Conversation

vouillon
Copy link
Member

No description provided.

@vouillon vouillon force-pushed the inlining branch 3 times, most recently from 840420d to 7b64a79 Compare April 14, 2025 23:08
@vouillon vouillon force-pushed the inlining branch 3 times, most recently from 79446f9 to ba1a622 Compare April 16, 2025 15:48
@vouillon vouillon force-pushed the inlining branch 4 times, most recently from b62b39e to 5cb6652 Compare April 24, 2025 17:49
@vouillon vouillon marked this pull request as ready for review April 24, 2025 17:50
; body_size : int cache
; full_size : int cache
; closure_count : int cache
; init_code : int cache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment to some of these fields explain what there are for ?
At least for init_code, interesting_params, full_size

&& (not (contains_loop ~context info))
&& returns_a_block ~context info
&& count_init_code ~context info * 2 > body_size ~context info
&& full_size ~context info - body_size ~context info <= 20 * closure_count ~context info
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a small comment explaining the two heuristics above , init_code * 2 > body_size and full_size <= 20 * closure_count

- We are a lot more aggressive at inlining functor-like functions, since
this may enable further optimizations.
- We are more cautious at inlining nested functions, since this can result
in memory leaks.
- We inline a larger class of small functions
@hhugo
Copy link
Member

hhugo commented Apr 25, 2025

I've pushed a fixup to the testsuite.
We should check how this PR affects functor heavy programs (something using core maybe).
@TyOverby could you tests this PR on your side ?

@hhugo
Copy link
Member

hhugo commented Apr 25, 2025

We need a changelog entry

@hhugo
Copy link
Member

hhugo commented Apr 25, 2025

I'm not certain I read the benchmark correctly.
It seems that partial render table sees a code size increase of 10%, memory increase of ~50%, compilation time increase of 30% for not runtime improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants