Skip to content

JIT: Attribute GDV inline failures to candidate - #133993

Open
AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-133974-gdv-inline-callee
Open

AndyAyersMS wants to merge 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-133974-gdv-inline-callee

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

GDV inline checks evaluated the guarded target but reported failures against
the original virtual method. For permanent failures this could mark the wrong
method as not inlineable for the lifetime of the process.

Pass the actual GDV candidate to InlineResult so reporting and
CORINFO_FLG_BAD_INLINEE propagation use the guarded target. Add a regression
test that tiers the poisoning call before checking allocation elimination in
an unrelated exact call.

Fixes #133974

Validation:

  • Regression test allocated 24,000 bytes before the fix and zero after it
  • Poisoned Test codegen improved from 34 bytes to 6 bytes
  • Windows x64 Release and Checked CoreCLR builds
  • Windows x64 Checked targeted regression test
  • JIT formatting

Note

This pull request description was generated with GitHub Copilot.

GDV inline checks reported failures against the original virtual method,
permanently marking the wrong method as not inlineable. Record the guarded
candidate as the callee and add regression coverage.

Fixes dotnet#133974

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cc9ff2b1-3240-4db8-85b3-8e42b2a0f2ec
Copilot AI lite review requested due to automatic review settings September 15, 2026 21:29
@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 Sep 15, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@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.

@AndyAyersMS
AndyAyersMS requested a review from EgorBo September 15, 2026 21:32
@AndyAyersMS

Copy link
Copy Markdown
Member Author

@EgorBo PTAL
fyi @dotnet/jit-contrib

Can't really assess this via SPMI or PMI. It's probably not going to change much in practice, so I don't plan to do any bespoke SPMI.

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.

🟡 Changes recommended

Centralize or pass through the guarded-target selection to avoid duplicated logic and future misattribution.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes GDV inline-failure attribution so permanent no-inline marking targets the guarded method.

Changes:

  • Adds explicit callee support to InlineResult.
  • Uses the GDV candidate for reporting and propagation.
  • Adds tiered-PGO regression coverage.
File summaries
File Summary
src/tests/JIT/opt/GuardedDevirtualization/badinlinee.csproj Configures isolated tiered-PGO testing.
src/tests/JIT/opt/GuardedDevirtualization/badinlinee.cs Adds allocation-elimination regression coverage.
src/coreclr/jit/inline.h Extends InlineResult with an explicit callee.
src/coreclr/jit/inline.cpp Uses the supplied callee for reporting.
src/coreclr/jit/importercalls.cpp Passes the GDV target during candidate evaluation.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +9228 to +9232
CORINFO_METHOD_HANDLE callee = gdvCandidate->guardedMethodUnboxedResolvedToken.hMethod;
if (callee == nullptr)
{
callee = gdvCandidate->guardedMethodHandle;
}
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.

JIT (bug): Rejecting a GDV candidate permanently marks the base virtual method as NOINLINE process-wide

2 participants