Uh oh!
There was an error while loading. Please reload this page.
JIT: Centralize WellKnownArg definitions - #130252
Conversation
Use a single wellknownargs.h that is included multiple times to build various pieces of information we query about arguments. Rewrite users in terms of columns defined in that file.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
This PR centralizes WellKnownArg metadata into a single wellknownargs.h “X-macro” list that is included multiple times to generate the enum and related query helpers, and it adjusts GDV candidate argument handling to avoid asserting on unexpected well-known args.
Changes:
- Introduces
src/coreclr/jit/wellknownargs.has the single source of truth forWellKnownArgentries and their metadata. - Rewrites
WellKnownArg-related helpers (getWellKnownArgName,CallArg::IsUserArg,CallArg::IsArgAddedLate, arg dump short names) to be table-driven fromwellknownargs.h. - Updates GDV compatibility checking to skip non-signature arguments via
CallArg::IsUserArg()instead of asserting on “unexpected” well-known args.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/wellknownargs.h | New centralized table defining well-known args and their metadata. |
| src/coreclr/jit/morph.cpp | Converts getWellKnownArgName to use the centralized table. |
| src/coreclr/jit/importercalls.cpp | Updates GDV arg filtering logic; also includes a small indentation-only change. |
| src/coreclr/jit/importer.cpp | Refactors inline arg init to use IsUserArg/InstParam instead of a well-known switch. |
| src/coreclr/jit/gentree.h | Generates WellKnownArg enum members from the centralized table. |
| src/coreclr/jit/gentree.cpp | Table-driven IsArgAddedLate, IsUserArg, and short-name lookup for arg messages. |
| src/coreclr/jit/fginline.cpp | Refactors inline argument setup logic to use IsUserArg/InstParam. |
| src/coreclr/jit/compiler.hpp | Stops tagging the helper “method handle” arg as a well-known arg. |
| src/coreclr/jit/CMakeLists.txt | Adds wellknownargs.h to the JIT header list. |
Comments suppressed due to low confidence (1)
src/coreclr/jit/importercalls.cpp:7648
- Extra leading spaces were introduced on this loop and its body, making indentation inconsistent with the surrounding block and adding whitespace-only noise.
for (UINT32 i = 0; i < numberOfMethods; i++)
{
CORINFO_CONST_LOOKUP lookup = {};
info.compCompHnd->getFunctionFixedEntryPoint((CORINFO_METHOD_HANDLE)likelyMethods[i].handle, false,
&lookup);
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jakobbotsch
commented
Jul 7, 2026
cc @dotnet/jit-contrib PTAL @AndyAyersMS Think this was exposed by recent devirtualization work, we started seeing calls with async context arguments for method-based GDVs and it did not expect to see those arguments. |
Uh oh!
There was an error while loading. Please reload this page.
Use a single wellknownargs.h that is included multiple times to build various pieces of information we query about arguments. Rewrite users in terms of columns defined in that file.
Use a single wellknownargs.h that is included multiple times to build various pieces of information we query about arguments. Rewrite users in terms of columns defined in that file.
Fix#130227