Skip to content

Use CORJIT_PREJIT_UNSUPPORTED instead of CORJIT_LIMITATION for BlockNonDeterministicIntrinsics - #123716

Merged
EgorBo merged 6 commits into
dotnet:mainfrom
EgorBo:fix-implLimitation-spmi
Jan 29, 2026
Merged

Use CORJIT_PREJIT_UNSUPPORTED instead of CORJIT_LIMITATION for BlockNonDeterministicIntrinsics#123716
EgorBo merged 6 commits into
dotnet:mainfrom
EgorBo:fix-implLimitation-spmi

Conversation

@EgorBo

Copy link
Copy Markdown
Member

Apply @jakobbotsch's suggestion to unblock failing SPMI (x86-crossgen)

@github-actionsgithub-actionsBot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 28, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Comment threadsrc/coreclr/jit/compiler.h Outdated
EgorBoand others added 2 commits January 28, 2026 15:57
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@EgorBo
EgorBoforce-pushed the fix-implLimitation-spmi branch from 4554074 to acd3f38CompareJanuary 28, 2026 15:00
@jkotas

Copy link
Copy Markdown
Member

Needs to be handled in AOT compilers too (src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs/CorInfoTypes.cs)

@EgorBo
EgorBo marked this pull request as ready for review January 29, 2026 00:41
CopilotAI review requested due to automatic review settings January 29, 2026 00:41

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 introduces a distinct JIT failure code for ReadyToRun/prejit-unsupported scenarios (instead of using CORJIT_IMPLLIMITATION) to address failing SPMI runs during x86 crossgen.

Changes:

  • Add a new CorJitResult value (CORJIT_R2R_UNSUPPORTED) to represent R2R/prejit unsupported failures.
  • Update JIT + VM + tooling (SuperPMI, managed JitInterface) to propagate and handle the new result code.
  • Switch BlockNonDeterministicIntrinsics to report the new result instead of CORJIT_IMPLLIMITATION.

Reviewed changes

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

Show a summary per file
FileDescription
src/coreclr/vm/jitinterface.cppTreat CORJIT_R2R_UNSUPPORTED similarly to other invalid-program JIT results when throwing.
src/coreclr/tools/superpmi/superpmi/jitinstance.cppAllow SuperPMI to record CORJIT_R2R_UNSUPPORTED as a non-error compile outcome.
src/coreclr/tools/Common/JitInterface/CorInfoTypes.csAdd managed enum value for CORJIT_R2R_UNSUPPORTED.
src/coreclr/tools/Common/JitInterface/CorInfoImpl.csMap CORJIT_R2R_UNSUPPORTED to the same handling as impl limitations (R2R: RequiresRuntimeJitException).
src/coreclr/jit/error.hAdd a new fatal helper declaration for R2R unsupported failures.
src/coreclr/jit/error.cppImplement the new fatal helper to return CORJIT_R2R_UNSUPPORTED.
src/coreclr/jit/compiler.hChange BlockNonDeterministicIntrinsics to use the new R2R unsupported fatal helper.
src/coreclr/jit/compiler.cppInclude CORJIT_R2R_UNSUPPORTED in the “retry with minopts” failure list.
src/coreclr/inc/corjit.hAdd the new CorJitResult enum value.

Comment threadsrc/coreclr/inc/corjit.h
Comment threadsrc/coreclr/tools/superpmi/superpmi/jitinstance.cpp
Comment threadsrc/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Comment threadsrc/coreclr/jit/compiler.cpp
Comment threadsrc/coreclr/inc/corjit.h
@EgorBo

Copy link
Copy Markdown
MemberAuthor

PTAL @jkotas@jakobbotsch

@jkotas

Copy link
Copy Markdown
Member

The delta looks fine to me, but I do not know any details about the issue you are trying to fix.

@EgorBo

Copy link
Copy Markdown
MemberAuthor

The delta looks fine to me, but I do not know any details about the issue you are trying to fix.

CORJIT_IMPLLIMITATION is returned from many places in JIT (see IMPL_LIMITATION), but today all of them except for this BlockNonDeterministicIntrinsics have a debug-time Assert - we don't want to hit them on our CI, e.g. 'too many exception clauses' and if we do - we want to know why and where it failed.

This specific one is not rare and it's completely fine to hit it (e.g. some SIMD API that may return different results on JIT and R2R) - so instead of ignoring all CORJIT_IMPLLIMITATION in SPMI and possibly missing real issues, we special-case this one to be ignored.

@EgorBo
EgorBo enabled auto-merge (squash) January 29, 2026 23:07
@EgorBo

Copy link
Copy Markdown
MemberAuthor

/ba-g deadletter

@EgorBo
EgorBo merged commit 062177e into dotnet:mainJan 29, 2026
110 of 114 checks passed
@EgorBo
EgorBo deleted the fix-implLimitation-spmi branch January 29, 2026 23:07
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Mar 1, 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.

4 participants

@EgorBo@jkotas@jakobbotsch