Skip to content
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

Add support for doubly nested intrinsic classes #105761

Merged
merged 10 commits into from
Aug 10, 2024

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jul 31, 2024

System.Runtime.Intrinsics.X86.Avx10v1+V512+X64.IsSupported currently results in an infinite loop. This PR fixes the problem by adding support in various places for hardware intrinsic classes nested more than once.

  • Expand getMethodNameFromMetadata to allow returning names of multiple enclosing classes
  • Expand the type loader to recognize intrinsics in up to 2x nested classes
  • Fix the JIT recognition to handle potentially multi-nested intrinsic classes
  • Fix NAOT support for opportunistically querying for Avx10v1 support

Fix #105402

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 31, 2024
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @tannergooding @MichalStrehovsky @jkotas

@@ -22,7 +22,9 @@ public static bool IsHardwareIntrinsic(MethodDesc method)
if (owningType.IsIntrinsic && !owningType.HasInstantiation)
{
var owningMdType = (MetadataType)owningType;
string ns = owningMdType.ContainingType?.Namespace ?? owningMdType.Namespace;
string ns = owningMdType.ContainingType?.ContainingType?.Namespace ??
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It would be nice to avoid calling the virtual ContainingType property multiple times.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

src/coreclr/inc/corinfo.h Show resolved Hide resolved
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jakobbotsch jakobbotsch merged commit 8fee24f into dotnet:main Aug 10, 2024
102 of 106 checks passed
@jakobbotsch jakobbotsch deleted the fix-105402 branch August 10, 2024 16:00
@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Runtime.Intrinsics.X86.Avx10v1+V512+X64.IsSupported is not expanded and results in an infinite loop
3 participants