Skip to content

Raise allowance size threshold along alwaysWorthInlining calls #21819

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

nbhuiyan
Copy link
Member

@nbhuiyan nbhuiyan commented May 7, 2025

In Estimate Code Size, we would terminate estimation once _analyzedSize exceeded the analyzed size threshold, which was obtained using sizeThreshold * allowanceFactor. However, not increasing the analyzed size threshold for methods that are always worth inlining - a property set through inliner policy or through the use of @ForceInline annotation, meant that those methods were not being prioritized as necessary. To overcome that issue, this commit introduces a few changes to the ECS heuristics:

  • forceInlineMultiplier - to be used to multiply the analyzed size threshold for a method that is always worth inlining.
  • Change estimateCodeSize function signature to be able to recursively pass down caller method's analyzed size threshold to callees along an always worth inlining call graph.
  • Reset _analyzedSize to pre-analysis _analyzedSize for methods always worth inlining.

@nbhuiyan
Copy link
Member Author

nbhuiyan commented May 7, 2025

@vijaysun-omr Requesting review.

@vijaysun-omr vijaysun-omr self-assigned this May 7, 2025
In Estimate Code Size, we would terminate estimation once
_analyzedSize exceeded the analyzed size threshold, which was
obtained using sizeThreshold * allowanceFactor. However, not
increasing the analyzed size threshold for methods that are always
worth inlining - a property set through inliner policy or through
the use of @ForceInline annotation, meant that those methods were
not being prioritized as necessary. To overcome that issue, this
commit introduces a few changes to the ECS heuristics:
  * forceInlineMultiplier - to be used to multiply the analyzed
    size threshold for a method that is always worth inlining.
  * Change estimateCodeSize function signature to be able to
    recursively pass down caller method's analyzed size threshold
    to callees along an always worth inlining call graph.
  * Reset _analyzedSize to pre-analysis _analyzedSize for methods
    always worth inlining.

Signed-off-by: Nazim Bhuiyan <[email protected]>
@nbhuiyan nbhuiyan force-pushed the ecs-forceinline-final branch from 8eaf301 to 5d1f26b Compare May 8, 2025 14:03
@vijaysun-omr
Copy link
Contributor

Jenkins test sanity.functional,sanity.openjdk all jdk8,jdk21

@vijaysun-omr
Copy link
Contributor

Jenkins test sanity.openjdk plinux jdk21

@vijaysun-omr
Copy link
Contributor

FYI, @mpirvu @ehsankianifar @r30shah @gita-omr since changes in this area have affected results in the past for some of your benchmarks.

@vijaysun-omr vijaysun-omr merged commit 43b64dd into eclipse-openj9:master May 10, 2025
51 checks passed
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