JIT: Unify to instParamLookup and improve GVM test coverage#126947
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
Refactors CoreCLR devirtualization metadata to use a unified instParamLookup and expands JIT test coverage for generic virtual method (GVM) scenarios to support follow-on GVM devirtualization work.
Changes:
- Add a new GVM-focused runtime lookup/delegate test to broaden devirtualization coverage.
- Replace
CORINFO_DEVIRTUALIZATION_INFOad-hoc flags withinstParamLookup, and update JIT devirtualization logic to consume it. - Update SuperPMI and the managed JitInterface type definitions/serialization to match the new
CORINFO_DEVIRTUALIZATION_INFOshape (plus bump the JIT/EE versioning GUID).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/JIT/Generics/VirtualMethods/generic_virtual_methods.cs | Adds additional GVM/runtime-lookup-related test coverage. |
| src/coreclr/vm/jitinterface.cpp | Initializes/produces instParamLookup for devirtualization results (replacing older flags). |
| src/coreclr/jit/importercalls.cpp | Plumbs instParamLookup through devirtualization + guarded devirtualization candidate tracking and inserts instantiation args when required. |
| src/coreclr/jit/morph.cpp | Simplifies lookup-tree helpers to take CORINFO_LOOKUP directly. |
| src/coreclr/jit/compiler.h | Updates declarations for the new lookup-tree helper signatures and GDV candidate plumbing. |
| src/coreclr/inc/corinfo.h | Updates CORINFO_DEVIRTUALIZATION_INFO to carry instParamLookup instead of legacy flags; documents “no lookup needed” sentinel. |
| src/coreclr/inc/jiteeversionguid.h | Bumps the JIT/EE version GUID for the interface change. |
| src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs | Mirrors the CORINFO_DEVIRTUALIZATION_INFO layout change in managed definitions. |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | Updates managed resolveVirtualMethod implementation to populate instParamLookup and method-context behavior. |
| src/coreclr/tools/superpmi/superpmi-shared/agnostic.h | Updates SuperPMI record structs to include instParamLookup. |
| src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp | Records/restores/dumps instParamLookup in SuperPMI method contexts. |
|
Test failure seems unrelated. |
|
Ping @jakobbotsch This is a refactor only change which is the prerequisites of the upcoming GVM devirt work, please take a look when you get some time. |
75dec5b to
4da609f
Compare
4da609f to
42d5011
Compare
aba164b to
d02eec1
Compare
|
Now it's zero diff as expected. Also CI failures seem unrelated. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/coreclr/jit/importercalls.cpp:1
- When transforming a virtual/interface call into a direct call, clearing only
GTF_CALL_VIRT_VTABLEmay leave other virtual-kind bits set (e.g., interface/stub dispatch kinds). This can misclassify the call later in the pipeline. Prefer clearing the full virtual-kind mask (e.g.,GTF_CALL_VIRT_KIND_MASK) before setting the direct-call state.
// Licensed to the .NET Foundation under one or more agreements.
jakobbotsch
left a comment
There was a problem hiding this comment.
LGTM! Thanks for sticking with this.
Extracted from #123323. This PR is the first step in splitting the shared GVM devirtualization work. It does two things: - expands the generic virtual method test coverage so the later enablement PRs have good coverage - refactors devirtualization a bit to replace multiple ad-hoc flags in `CORINFO_DEVIRTUALIZATION_INFO` with a single `instParamLookup` Contributes to #112596
Extracted from #123323. This PR is the first step in splitting the shared GVM devirtualization work.
It does two things:
CORINFO_DEVIRTUALIZATION_INFOwith a singleinstParamLookupContributes to #112596
/cc: @jakobbotsch