JIT: constrain max IL size for OSR inlining#117816
Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom Jul 18, 2025
Merged
Conversation
If we inline too aggressively at intermediate tiers, we can lose profile data that would be beneficial at the final tier. Extend the recent fixes made for limiting max IL size at Tier1+Instr to include OSR as well. This one is a arguably bit more delicate as OSR may well be the final tier, but there is no way to know that. We are just returning to the .NET 9 behavior here. Fixes dotnet#117717. May also fix some of the other regressions that have not yet been analyzed in depth.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR constrains the maximum IL size for OSR (On-Stack Replacement) inlining to prevent overly aggressive inlining that could result in loss of valuable profile data for final tier compilation. The change extends existing Tier1+Instrumented compilation limits to also apply to OSR scenarios, reverting to .NET 9 behavior.
Key changes:
- Extends IL size constraints from Tier1+Instrumented scenarios to also include OSR compilation
- Updates logging messages to reflect the new OSR consideration
- Adds explicit logging for both constrained and boosted scenarios
Member
Author
|
@EgorBo PTAL |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
|
SPMI won't give us the whole picture here, but clearly we're doing quite a bit less inlining in OSR methods. |
This was referenced Jul 25, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If we inline too aggressively at intermediate tiers, we can lose profile data that would be beneficial at the final tier.
Extend the recent fixes made for limiting max IL size at Tier1+Instr to include OSR as well. This one is a arguably bit more delicate as OSR may well be the final tier, but there is no way to know that.
We are just returning to the .NET 9 behavior here.
Fixes #117717. May also fix some of the other regressions that have not yet been analyzed in depth.