Configure HardwareIntrinsic support for Apple Mobile platforms#122249
Merged
jkoritzinsky merged 6 commits intodotnet:mainfrom Dec 9, 2025
Merged
Configure HardwareIntrinsic support for Apple Mobile platforms#122249jkoritzinsky merged 6 commits intodotnet:mainfrom
jkoritzinsky merged 6 commits intodotnet:mainfrom
Conversation
… by default for Apple Mobile
…s in case someone decides to use one that we don't generate R2R code for.
…o ensure we don't need to opportunistically jit all fallback implementations for every ISA.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR configures hardware intrinsic support for Apple Mobile platforms (iOS, tvOS, and their simulators) by adjusting instruction set baselines and handling platforms that cannot JIT. The changes ensure optimal ReadyToRun performance on these platforms while preventing fallback to the interpreter.
- Sets the baseline ISA to
armv8-afor iOS/tvOS platforms (down fromarmv8-a + lse) - Disables optimistic instruction sets by default for non-JIT platforms (iOS, tvOS, MacCatalyst simulators, and WebAssembly)
- Roots hardware intrinsic methods and their
IsSupportedgetters to ensure fallback implementations are available for the interpreter
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/aot/crossgen2/Program.cs | Adds logic to disable optimistic instruction sets for Apple Mobile platforms and conditionally roots hardware intrinsic methods when CoreLib is in the version bubble |
| src/coreclr/tools/aot/ILCompiler/Program.cs | Updates parameter name from optimizingForSize to allowOptimistic for clarity |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj | Registers the new ReadyToRunHardwareIntrinsicRootProvider compilation root provider |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs | New root provider that roots all methods on supported hardware intrinsic types and IsSupported getters for unsupported types |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs | Adds BubbleIncludesCoreModule property and TargetAllowsRuntimeCodeGeneration property to identify platforms that don't support JIT |
| src/coreclr/tools/Common/InstructionSetHelpers.cs | Sets baseline ISA to armv8-a for iOS/tvOS, corrects x86-64 logic for OSX/MacCatalyst, and renames parameter to allowOptimistic |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs
Outdated
Show resolved
Hide resolved
am11
reviewed
Dec 5, 2025
Co-authored-by: Copilot <[email protected]>
This was referenced Dec 6, 2025
Open
kotlarmilos
approved these changes
Dec 8, 2025
elinor-fung
approved these changes
Dec 8, 2025
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs
Show resolved
Hide resolved
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs
Show resolved
Hide resolved
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
For Apple Mobile platforms, we need to slightly modify our policies for HW intrinsic support to provide the best user experience.
armv8-a(notarmv8-a + lseas is currently specified)mustExpand) will be rooted when CoreLib is in the R2R version bubble. This ensures that the JIT's fallback implementation will be available for the interpreter to use.get_IsSupportedmethod will be rooted so an explicitIsSupported => falseimplementation will be pregenerated. This ensures that we don't end up in a situation where any ISAs that are supported on the device but don't have any pre-jitted implementation for the given ISA are called by the interpreter.To support newer intrinsics when targeting newer devices, the .NET Mac/iOS SDK should explicitly specify the new minimum instruction sets for the user's targeted OS version.
Fixes #122190
Contributes to #120047
Contributes to #120048