-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Return false in PropagateNeverToRuntime for BBJ_THROW blocks #118280
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diffs seem pretty modest.
I think we should consider taking this for .NET 10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where callee methods in always-throw blocks were incorrectly being marked as NoInlining
when inlining failed. The fix ensures that for BBJ_THROW blocks, the system returns false from PropagateNeverToRuntime
, preventing the inappropriate marking. Additionally, the PR consolidates related logic by moving the dynamic PGO and other checks into the PropagateNeverToRuntime
method.
Key changes:
- Return false in
PropagateNeverToRuntime
for BBJ_THROW blocks to prevent incorrect NoInlining marks - Consolidate inline propagation logic by moving dynamic PGO checks from
InlineResult::Report()
toPropagateNeverToRuntime
- Simplify the reporting logic in
InlineResult::Report()
by removing duplicated conditions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/jit/inlinepolicy.cpp | Refactored PropagateNeverToRuntime to handle BBJ_THROW blocks and consolidated dynamic PGO logic |
src/coreclr/jit/inline.cpp | Simplified InlineResult::Report() by removing logic moved to PropagateNeverToRuntime |
@AndyAyersMS then this is ready for review I guess? With this commit I've checked that the diffs are triggered only by this |
Fixes #115918
Previously, in non-DynamicPGO scenarios if we fail to inline a callee in an always-throw block, we used to mark such methods as NoInlining which is not the right thing to do since due to #78386 all always-throw blocks only inline trivial (<=8 bytes of IL) calls.
Also, move existing logic to be inside PropagateNeverToRuntime (cleanup)