-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Only root supported hwintrinsic methods for interpreter-based platforms #123043
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
Only root supported hwintrinsic methods for interpreter-based platforms #123043
Conversation
We don't need to root the IsSupported getters as the interpreter already handles those as `return false;`. Add a new helper in InstructionSetParser to do the "instruction set -> types that provide hardware intrinsic methods for said instruction set" mapping so we don't need to search every type in the system module now that we only need to go through the explicitly supported instruction sets.
Document definearch command in instructionsetdesc.txt Drive the "intrinsic namespace" logic for `LookupPlatformIntrinsicInstructionSet` from the newly added field in definearch. Fix the ARM64 intrinsics namespace.
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 optimizes the hardware intrinsic rooting logic for interpreter-based platforms by only rooting methods from supported instruction sets rather than all hardware intrinsic types in the system module.
Key changes:
- Added managed namespace parameter to architecture definitions in InstructionSetDesc.txt
- Created new
LookupPlatformIntrinsicTypeshelper method to map instruction sets to their managed types - Updated ReadyToRunHardwareIntrinsicRootProvider to iterate only supported instruction sets
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt | Added 6th parameter for managed namespace to definearch commands; fixed alignment and removed managed names for internal-only instruction sets like VectorT128 and RiscV64 ISAs |
| src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs | Added _architectureManagedNamespace dictionary; updated definearch parsing to expect 6 parameters; generated new LookupPlatformIntrinsicTypes method with proper handling of nested types and 64-bit variants |
| src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs | Generated code: added using System; updated ArchitectureToValidInstructionSets to remove incorrect R2R names; added X64 case to LookupPlatformIntrinsicInstructionSet; implemented new LookupPlatformIntrinsicTypes method |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs | Replaced iteration over all system module types with efficient iteration over supported instruction sets using the new LookupPlatformIntrinsicTypes helper |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs
Show resolved
Hide resolved
|
/ba-g macos machines disconnected during CI run |
We don't need to root the
IsSupportedgetters for unsupported intrinsic types as the interpreter already handles those asreturn false;.Add a new helper in
InstructionSetParserto do the "instruction set -> types that provide hardware intrinsic methods for said instruction set" mapping so we don't need to search every type in the system module now that we only need to go through the explicitly supported instruction sets.Adjust InstructionSetDesc.txt to support specifying the managed namespace for intrinsic instruction sets so we can better filter ISAs with no managed types (ie RiscV) and avoid hard-coding namespaces in
LookupPlatformIntrinsicInstructionSet.