Skip to content

JIT: Centralize WellKnownArg definitions - #130252

Merged
jakobbotsch merged 4 commits into
dotnet:mainfrom
jakobbotsch:fix-130227
Jul 7, 2026
Merged

JIT: Centralize WellKnownArg definitions#130252
jakobbotsch merged 4 commits into
dotnet:mainfrom
jakobbotsch:fix-130227

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

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

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.
CopilotAI review requested due to automatic review settings July 6, 2026 14:41
@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Comment threadsrc/coreclr/jit/compiler.hpp Outdated
Comment threadsrc/coreclr/jit/importercalls.cpp
Comment threadsrc/coreclr/jit/wellknownargs.h

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 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.h as the single source of truth for WellKnownArg entries and their metadata.
  • Rewrites WellKnownArg-related helpers (getWellKnownArgName, CallArg::IsUserArg, CallArg::IsArgAddedLate, arg dump short names) to be table-driven from wellknownargs.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
FileDescription
src/coreclr/jit/wellknownargs.hNew centralized table defining well-known args and their metadata.
src/coreclr/jit/morph.cppConverts getWellKnownArgName to use the centralized table.
src/coreclr/jit/importercalls.cppUpdates GDV arg filtering logic; also includes a small indentation-only change.
src/coreclr/jit/importer.cppRefactors inline arg init to use IsUserArg/InstParam instead of a well-known switch.
src/coreclr/jit/gentree.hGenerates WellKnownArg enum members from the centralized table.
src/coreclr/jit/gentree.cppTable-driven IsArgAddedLate, IsUserArg, and short-name lookup for arg messages.
src/coreclr/jit/fginline.cppRefactors inline argument setup logic to use IsUserArg/InstParam.
src/coreclr/jit/compiler.hppStops tagging the helper “method handle” arg as a well-known arg.
src/coreclr/jit/CMakeLists.txtAdds 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);

Comment threadsrc/coreclr/jit/wellknownargs.h
CopilotAI review requested due to automatic review settings July 6, 2026 14:50

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment threadsrc/coreclr/jit/wellknownargs.h
Comment threadsrc/coreclr/jit/fginline.cpp
CopilotAI review requested due to automatic review settings July 6, 2026 22:58
Comment threadsrc/coreclr/jit/fginline.cpp

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

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.

@jakobbotsch
jakobbotsch merged commit 0884fe1 into dotnet:mainJul 7, 2026
133 of 138 checks passed
@jakobbotsch
jakobbotsch deleted the fix-130227 branch July 7, 2026 14:01
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-preview7 milestone Jul 8, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
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.
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Aug 7, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failed '!"Unexpected well known arg to method GDV candidate"'

4 participants

@jakobbotsch@AndyAyersMS@hez2010