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.
Copilot AI review requested due to automatic review settings July 6, 2026 14:41
@github-actions github-actions Bot 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 thread src/coreclr/jit/compiler.hpp Outdated
Comment thread src/coreclr/jit/importercalls.cpp
Comment thread src/coreclr/jit/wellknownargs.h

Copilot AI 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
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);

Comment thread src/coreclr/jit/wellknownargs.h
Copilot AI review requested due to automatic review settings July 6, 2026 14:50

Copilot AI 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 thread src/coreclr/jit/wellknownargs.h
Comment thread src/coreclr/jit/fginline.cpp
Copilot AI review requested due to automatic review settings July 6, 2026 22:58
Comment thread src/coreclr/jit/fginline.cpp

Copilot AI 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
Member Author

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 requested a review from AndyAyersMS July 7, 2026 09:34
@jakobbotsch jakobbotsch merged commit 0884fe1 into dotnet:main Jul 7, 2026
133 of 138 checks passed
@jakobbotsch jakobbotsch deleted the fix-130227 branch July 7, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR 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