-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: remove inlining restriction for some methods that throw #2232
Conversation
We were blocking inlines for methods that throw with more than one thing on the evaluation stack. There was already logic for the non-inlining case to flush the stack and preserve pending side effects. So we can simply remove the inlining restriction. Fixes dotnet#2156.
cc @dotnet/jit-contrib PMI diffs shows a few cases where inlining is unblocked; all cause code size increases.
SPMI shows one beneficial inline:
|
If you gather PerfScore diffs on this chnage there shouldn't be much of a regression, as the block is marked as RarelyRun (with a weight of zero). The remaining diffs will be based upon codesize and will be greatly reduced:
However sometimes extra code in the Cold region can cause changes in register usage (extra callee saves, extra spills , etc..) in the hot regions and looking into those can often reveal area that we can improve upon. |
This change allows inlining of some methods with conditional throws. The throw block will be rarely run, but the rest of the inlined method won't be. So perf scores end up higher too.
|
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.
LGTM
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.
LGTM
We were blocking inlines for methods that throw with more than one thing on the
evaluation stack. There was already logic for the non-inlining case to flush
the stack and preserve pending side effects. So we can simply remove the
inlining restriction.
Fixes #2156.