Repository navigation
Compile managed JIT helpers in partial no-JIT ReadyToRun compilations - #138188
Merged
lewing merged 4 commits intoNov 24, 2026
Merged
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change preserving required managed JIT helpers in partial ReadyToRun compilations.
No open issues 🎉
What changed in this PR
This PR keeps managed JIT helpers in partial ReadyToRun compilations on targets without runtime code generation, preventing required helpers from being dropped when absent from the profile. It builds on the vector-acceleration changes in #138183.
Changes:
- Shares managed-helper discovery between rooting and compilation filtering, preserving existing platform exclusions.
- Exempts managed helpers from partial-profile filtering when runtime code generation is unavailable and the version bubble includes CoreLib.
- Adds regression coverage for unprofiled helpers while checking that ordinary unprofiled methods remain excluded.
| File | Description |
|---|---|
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunSingleAssemblyCompilationModuleGroup.cs |
Adds guarded helper exemption with a lazily cached helper set. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunJitHelperRootProvider.cs |
Extracts shared discovery of distinct managed helpers. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs |
Contains vector-query rooting inherited from #138183, outside this PR’s requested scope. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ReadyToRunLibraryRootProviderTests.cs |
Adds managed-helper regression coverage and shared partial-compilation setup. |
Review effort: Balanced
lewing
marked this pull request as ready for review
November 24, 2026 05:01
3 tasks
Exempt the managed JIT helpers rooted by ReadyToRunJitHelperRootProvider from the partial-profile restriction on targets without runtime codegen, so CoreLib's R2R image always contains code for every JIT helper. Fixes dotnet#138187 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lewing
force-pushed
the
lewing-partial-r2r-managed-jit-helpers
branch
from
November 24, 2026 17:15
f5c7d9d to
bf3dd61
Compare
jkotas
reviewed
Nov 24, 2026
jkotas
reviewed
Nov 24, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
jkotas
reviewed
Nov 24, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
jkotas
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under
--partial,ReadyToRunSingleAssemblyCompilationModuleGroup.ContainsMethodBodyCorerejects every method missing from the profile.ReadyToRunJitHelperRootProviderroots the managed JIT helpers throughAddCompilationRoot, which only keeps a root that passesContainsMethodBody, so on browser composites all 70 helpers were silently dropped. That breaks the rule that the CoreLib R2R image must contain code for all JIT helpers (comment). Unprofiled helper calls then resolve to interpreter entry points with no code and trap withRuntimeError: null function.Changes:
ReadyToRunJitHelperRootProvider.GetManagedHelpersbuilds the helper set once. It keeps the existing ARM/ARM64 and single-threaded thread-statics exclusions, and both rooting and the new check use it.IsHardwareAcceleratedgetters. The exemption only applies when the version bubble includes CoreLib.PartialNoJitCompilationContainsManagedJitHelpers.Validation (browser-wasm, Release):
ILCompiler.ReadyToRun.Tests: 440 total, 397 passed, 0 failed, 43 skipped. The new test fails (70/70 helpers rejected) without the fix.System.Runtime.Intrinsics.Testswith a profile containing onlyPackedSimdTests.PackedSimdIsSupportedplus--partial: crashes withRuntimeError: null functionbefore the fix and passes after.System.Runtime.Intrinsics.Testswith the default profile, run before the CoreLib-bubble guard was added: 13346 passed, 0 failed, 1 skipped. All 70 helpers appear in the--mapoutput.Resolves #138187