-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Configure HardwareIntrinsic support for Apple Mobile platforms #122249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Configure HardwareIntrinsic support for Apple Mobile platforms #122249
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.
There was a problem hiding this comment.
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 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
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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