-
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: Always track the context for late devirt #112396
Merged
+49
−46
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8563a18
Track InlinersContext in LateDevirtualizationInfo
hez2010 3678070
Rework fix
hez2010 1173d97
Update inline context for statement as well
hez2010 dc917f2
Use IL offset from call
hez2010 57427a4
Always set DebugInfo
hez2010 e0e7344
Track InlineContext
hez2010 4b30625
Cleanup
hez2010 d01f255
Always record late devirt info
hez2010 d746d95
Always record late devirt info
hez2010 6a2dcd6
Copy gtLateDevirtualizationInfo
hez2010 125600a
Refactor to take InlineContext explicitly
hez2010 1c711a3
Set inlinersContext to nullptr
hez2010 7f7c0f4
Late devirt info always available
hez2010 55585bd
Oops
hez2010 4fa6b92
Remove the reduandant flag
hez2010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.