JIT: Use fgCalledCount in inlinee weight computation#112499
Merged
amanasifkhalid merged 1 commit intodotnet:mainfrom Feb 18, 2025
Merged
JIT: Use fgCalledCount in inlinee weight computation#112499amanasifkhalid merged 1 commit intodotnet:mainfrom
fgCalledCount in inlinee weight computation#112499amanasifkhalid merged 1 commit intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
Author
|
@dotnet/jit-contrib PTAL. Diffs seem to be only in OSR methods. In the cases where we're now doing less inlining, the OSR loop's execution count is less than 100x the method call count; the opposite is true for cases where we're doing more inlining. With this change, we're doing fewer inlines overall. Thanks! |
Contributor
Author
|
@AndyAyersMS could you PTAL? Thanks! |
Contributor
Author
|
ping @AndyAyersMS |
AndyAyersMS
approved these changes
Feb 18, 2025
This was referenced Feb 25, 2025
Closed
[Perf] Windows/x64: 1 Improvement on 2/18/2025 9:18:32 PM +00:00
dotnet/perf-autofiling-issues#50841
Closed
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.
I noticed that tweaking the computation of the entry weight for OSR methods (in service of #111915) incurred large inlining diffs. This is due to the fact that we use the entry block's weight to compute the normalized weight of a call site. This means we will get the wrong normalized weight for call sites when the entry block's weight diverges from the method's call count. This is currently possible only when the entry block is part of a loop, or when we compute a weight for the OSR entry fixup block that differs from
fgCalledCount(which we almost always do). The correct thing to do is to use the root method's call count to normalize the call site's weight.