Skip to content

JIT: Make LACKS_RETURN callsite-specific - #134198

Open
AndyAyersMS wants to merge 1 commit into
mainfrom
lacks-return-callsite
Open

AndyAyersMS wants to merge 1 commit into
mainfrom
lacks-return-callsite

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Summary

The inliner records LACKS_RETURN when contextual import finds no suitable
return expression. Since this can depend on call-site specialization, classify
the observation as CALLSITE so one failed attempt does not permanently mark
the callee as uninlineable.

Callees with no return blocks are already handled by
CALLEE_DOES_NOT_RETURN.

Testing

  • build.cmd clr+libs -c Checked
  • build.cmd clr.jit -c Checked

Note

This pull request description was generated with GitHub Copilot.

The inliner records LACKS_RETURN when no suitable return expression is
found while importing an inlinee. Since importation is specialized for the
call site, this observation should be scoped to CALLSITE rather than CALLEE.

Callees with no return blocks are already handled by
CALLEE_DOES_NOT_RETURN.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0793cca8-3c8d-4f6e-9d2f-a52fe39c0784
Copilot AI lite review requested due to automatic review settings September 18, 2026 14:44
@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 18, 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

Copy link
Copy Markdown
Member Author

A small tweak to a rarely-made observation.

CALLEE noinline observations are usually propagated back to the runtime to inhibit future inline attempts, CALLSITE observations just fail the current attempt. This observation is contextual (can depend on call site), so classify it that way.

@EgorBo PTAL
fyi @dotnet/jit-contrib

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.

🟢 Approval recommended

The change is localized, references were updated consistently (no remaining CALLEE_LACKS_RETURN usages), and the new target aligns with how LegalPolicy treats CALLSITE vs CALLEE fatal observations.

Pull request overview

Updates the JIT inlining observation for “missing return expression” to be callsite-scoped rather than callee-scoped, so a failure to materialize a return value during a particular inline attempt doesn’t permanently mark the callee as never-inline.

Changes:

  • Reclassify LACKS_RETURN from CALLEE to CALLSITE and adjust its diagnostic text.
  • Update the inliner failure path to report CALLSITE_LACKS_RETURN instead of CALLEE_LACKS_RETURN.
File summaries
File Description
src/coreclr/jit/inline.def Changes LACKS_RETURN to be a callsite-targeted fatal observation with updated wording.
src/coreclr/jit/fginline.cpp Updates the inline failure recording to use InlineObservation::CALLSITE_LACKS_RETURN.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

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