Skip to content

Conversation

@jkoritzinsky
Copy link
Member

We don't need to root the IsSupported getters for unsupported intrinsic types 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.

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.

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.
Copy link
Contributor

Copilot AI left a 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 LookupPlatformIntrinsicTypes helper 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant