-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Only add GVMDependencies for types with used GVMs #118704
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
Conversation
Ever since GVM support was added to native AOT, we were generating the GVM resolution metadata for every type considered allocated. This included GVMs that were never even called: see `TypeGVMEntriesNode` that simply goes over everything on the type - we were adding a `TypeGVMEntriesNode` for all allocated types that have something to do with GVMs. This PR changes it so that we only generate `TypeGVMEntries` for types that have at least one used GVM. This is a scoped down version of dotnet#118632 (that tries to track things per-method) with a lot less risk.
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.
Pull Request Overview
This PR optimizes Generic Virtual Method (GVM) dependency generation in the native AOT compiler by only creating GVM resolution metadata for types that actually have used GVMs, rather than for all allocated types that could potentially have GVMs.
Key changes:
- Remove eager GVM metadata generation from type allocation
- Add conditional GVM metadata generation based on actual method usage
- Track implementation discovery to determine when GVM metadata is needed
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
GVMDependenciesNode.cs | Adds conditional TypeGVMEntries dependency generation based on found implementations and tracks inheritance hierarchy |
EETypeNode.cs | Removes automatic TypeGVMEntries dependency for types with GVM flags |
ConstructedEETypeNode.cs | Removes automatic TypeGVMEntries dependency for canonical subtypes with GVM flags |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/ba-g arm32 failures are dotnet/dnceng#6034 but infra doesn't pair it |
Ever since GVM support was added to native AOT, we were generating the GVM resolution metadata for every type considered allocated. This included GVMs that were never even called: see
TypeGVMEntriesNode
that simply goes over everything on the type - we were adding aTypeGVMEntriesNode
for all allocated types that have something to do with GVMs.This PR changes it so that we only generate
TypeGVMEntries
for types that have at least one used GVM. This is a scoped down version of #118632 (that tries to track things per-method) with a lot less risk.Cc @dotnet/ilc-contrib