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.
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: Always track the context for late devirt #112396
JIT: Always track the context for late devirt #112396
Changes from 14 commits
8563a18
3678070
1173d97
dc917f2
57427a4
e0e7344
4b30625
d01f255
d746d95
6a2dcd6
125600a
1c711a3
7f7c0f4
55585bd
4fa6b92
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Have you checked whether this can be merged with some other information of
GenTreeCall
to avoid growing the size of all large nodes?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.
Late devirtualization can happen even without generic context, so we need to always track the
InlineContext
now regardless of whether it has a generic context or not.We used to union the
gtLateDevirtualizationInfo
withgtHandleHistogramProfileCandidateInfo
together because we didn't save generic context for methods that have class probe, but now we will have to save anInlineContext
for them anyway so we can also save the generic context for those methods as well.This happens to enable late devirtualization for tier-1 methods under PGO and this is why it has diffs for PGO cases only.
I was trying to merge it into the union but it would require class probing to "overwite" the gtLateDevirtualizationInfo and unset the flag for it else where, which may be hard to get right... see https://github.com/dotnet/runtime/runs/37064711496, we have cases where late devit inlining happens while we have class probing.
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.
Instead we can remove the member
class InlineContext* gtInlineContext
fromGenTreeCall
now, though it's debug only.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.
Or alternatively, we will have to block all inlining for devirted methods that don't have a generic context in late devirt.
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.
For debug it's ok to use extra memory, we are more concerned with release. I suppose we cannot move this into the union above this one because of
gtStubCallStubAddr
?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.
Yeah, unfortunately. Maybe we can merge it with
gtControlExpr
, do we ever morph a call before inlining?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.
I think it's ok to leave it as a separate field for now. Maybe we should consider some better approaches in the future to reducing the size of
GenTreeCall
(e.g. storing all rarely used fields in a separate object that gets allocated on demand).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.
Okay. I just pushed a commit to remove the redundant flag.