-
Notifications
You must be signed in to change notification settings - Fork 2.7k
JIT: refine types when creating arg temps to improve devirtualization #13530
Conversation
The jit will refine the types of temps used to pass arguments to inlinees when it creates the assignments to these temps. Unfortunately this is too late to drive devirtualization in the body of the inlinee, as thes assignments are created after the inlinee body is imported. So, add similar refinement logic to the place where the temps are first created. Closes #13520.
@JosephTremoulet PTAL Leads to around 50 more devirtualizations in corelib + fx per jit diffs:
Also fixes the case in #13520; inline + devirt trace now shows:
|
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. Does this mean we don't need the code to improve the type when generating the assign anymore, or does that help in more situations than this does?
With current jit logic, it should no longer be needed. Think I should remove it or turn it into some kind of insertion? |
I'd be inclined to just remove it; my hunch about making it an assertion would be that it would never trip or else it would trip in some esoteric cases that aren't really that interesting and could end up needing excessive bookkeeping to keep the assertion happy. But, that's just my guess, I'd be fine with whichever way you want to go. |
Yeah, an assertion could be a bit tricky, because we currently know less when creating the assignment than we do when we create the temp (no stack entry to consult). Let me remove the downstream update and verify there are no diffs. |
No diffs, so have removed the update-during-assign code. |
The jit will refine the types of temps used to pass arguments to inlinees
when it creates the assignments to these temps.
Unfortunately this is too late to drive devirtualization in the body of
the inlinee, as thes assignments are created after the inlinee body is
imported.
So, add similar refinement logic to the place where the temps are first
created.
Closes #13520.