Skip to content

JIT: Use matched inline args for inliner argument observations - #137630

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:inliner-arg-observations
Nov 19, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:inliner-arg-observations

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

impMakeDiscretionaryInlineObservations walked the callee signature and the call's argument list in lockstep, skipping only the this pointer. Any other non-IL argument (generic context, async continuation, async context and so on) shifted the pairing, so observations such as "arg is a constant" were made against the wrong call argument.

When inlining, use the argument pairing and signature types already computed by impInlineInitVars. When not inlining, only look at the signature.

This was causing some spurious diffs in #137548 after I reordered some async arguments.

impMakeDiscretionaryInlineObservations walked the callee signature and the
call's argument list in lockstep, skipping only the this pointer. Any other
non-IL argument (generic context, async continuation, async context and so
on) shifted the pairing, so observations such as "arg is a constant" were
made against the wrong call argument.

When inlining, use the argument pairing and signature types already computed
by impInlineInitVars. When not inlining, only look at the signature.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: de29f758-df50-40a9-bf70-a3978983794f
@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 Nov 16, 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.

@azure-pipelines

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

@jakobbotsch

Copy link
Copy Markdown
Member Author

@MihuBot

@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo @AndyAyersMS

Some substantial diffs now that we are basing the heuristics off of the right argument nodes. There's a lot of misses too in the cases where we may be doing more inlining.
This will probably have impact on micro benchmarks, but seems like something we should take on principle.

Comment thread src/coreclr/jit/importer.cpp Resolved
@EgorBo

EgorBo commented Nov 17, 2026

Copy link
Copy Markdown
Member

I wonder while we're at it, we should also fix #69280

And maybe improve the prescan analysis to be precise, not some double-slot heuristic.

@EgorBo EgorBo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess it makes sense, since we're early in .NET 12.0 stage.

Comment thread src/coreclr/jit/importer.cpp Resolved
@jakobbotsch

jakobbotsch commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

I wonder while we're at it, we should also fix #69280

Makes sense, I can submit a follow-up PR to fix that as well. I think we should space these changes a bit to give the perf lab a chance to attribute the regressions.

@jakobbotsch

Copy link
Copy Markdown
Member Author

/ba-g Failure looks like RemoteExecutor timeout #136624/#137423

@jakobbotsch
jakobbotsch merged commit ca40a18 into dotnet:main Nov 19, 2026
128 of 131 checks passed
@jakobbotsch
jakobbotsch deleted the inliner-arg-observations branch November 19, 2026 11:40
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 23, 2026
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.

3 participants