-
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: more inlining with EH prep work #113023
JIT: more inlining with EH prep work #113023
Conversation
Don't try an inline managed methods with unmanaged calling conventions. This mainly copes with x86 where unmanaged calling conventions use reversed arg order, but I've disabled it in general. No diffs as these methods seem to always include EH. Remove uses of `compXcptnsCount` as this goes stale whenever we clone or remove EH, or (eventually) inline methods with EH. Instead, rely on `compHndBBtabCount`. Defer allocating x86's shadow SP var and area until later in jitting, so this reflects any changes in EH table structure. In particular we often are able to eliminate EH in part or all together and this saves a low-offset allocation and so leads to some nice code size savings on x86. Also on x86 remove the runtime-dependent catch class case from the computation for keeping this alive, as we now transform such into runtime lookups in filters (that may well keep this alive).
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.
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
x86 shows good savings, everything else unaffected. Oddly there are some minopts diffs, which I was not expecting. Going to take a look at some of those. |
I may back out the keep alive this changes, perhaps there is more going on there (edit: seems like they were related to the too small nesting level number) Seems like we're still leaving some size wins on the table, eg we needlessly set up and tear down the frame if there was EH and we eliminated it: Will hold off on further improvements in this PR and look at that as a follow-up. |
CI not triggering, let me bounce and see if that fixes it. |
Updated diffs ... still a few in minopts. |
Looks like these remaining minopts diffs are in methods with unreachable EH (not imported even in Tier0) and we now don't allocate the shadow SP slots there either. |
Don't try an inline managed methods with unmanaged calling conventions. This mainly copes with x86 where unmanaged calling conventions use reversed arg order, but I've disabled it in general. No diffs as these methods seem to always include EH.
Remove uses of
compXcptnsCount
as this goes stale whenever we clone or remove EH, or (eventually) inline methods with EH. Instead, rely oncompHndBBtabCount
.Defer allocating x86's shadow SP var and area until later in jitting, so this reflects any changes in EH table structure. In particular we often are able to eliminate EH in part or all together and this saves a low-offset allocation and so leads to some nice code size savings on x86.
Also on x86 remove the runtime-dependent catch class case from the computation for keeping this alive, as we now transform such into runtime lookups in filters (that may well keep this alive).
Contributes to #108900.