-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
JIT: Use metadata names for SIMD intrinsic method recognition #76786
Changes from 4 commits
40426f0
9f302cb
b21c7c8
c208cfa
cd9bb9a
7b08520
36bf9f2
b15106c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6248,12 +6248,24 @@ const char* CEEInfo::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftnHnd, con | |
} CONTRACTL_END; | ||
|
||
const char* result = NULL; | ||
const char* classResult = NULL; | ||
const char* namespaceResult = NULL; | ||
const char* enclosingResult = NULL; | ||
|
||
JIT_TO_EE_TRANSITION(); | ||
|
||
if (className != NULL) | ||
{ | ||
*className = NULL; | ||
} | ||
|
||
if (namespaceName != NULL) | ||
{ | ||
*namespaceName = NULL; | ||
} | ||
|
||
if (enclosingClassName != NULL) | ||
{ | ||
*enclosingClassName = NULL; | ||
} | ||
|
||
MethodDesc *ftn = GetMethod(ftnHnd); | ||
mdMethodDef token = ftn->GetMemberDef(); | ||
|
||
|
@@ -6263,30 +6275,18 @@ const char* CEEInfo::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftnHnd, con | |
IMDInternalImport* pMDImport = pMT->GetMDImport(); | ||
|
||
IfFailThrow(pMDImport->GetNameOfMethodDef(token, &result)); | ||
IfFailThrow(pMDImport->GetNameOfTypeDef(pMT->GetCl(), &classResult, &namespaceResult)); | ||
if (className != NULL || namespaceName != NULL) | ||
{ | ||
IfFailThrow(pMDImport->GetNameOfTypeDef(pMT->GetCl(), className, namespaceName)); | ||
} | ||
// Query enclosingClassName when the method is in a nested class | ||
// and get the namespace of enclosing classes (nested class's namespace is empty) | ||
if (pMT->GetClass()->IsNested()) | ||
if (enclosingClassName != NULL && pMT->GetClass()->IsNested()) | ||
{ | ||
IfFailThrow(pMDImport->GetNameOfTypeDef(pMT->GetEnclosingCl(), &enclosingResult, &namespaceResult)); | ||
IfFailThrow(pMDImport->GetNameOfTypeDef(pMT->GetEnclosingCl(), enclosingClassName, namespaceName)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic seems a bit odd to me in terms of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is designed to handle just enough for the JIT to identify intrinsics. We only need one level of nesting for that. |
||
} | ||
} | ||
|
||
if (className != NULL) | ||
{ | ||
*className = classResult; | ||
} | ||
|
||
if (namespaceName != NULL) | ||
{ | ||
*namespaceName = namespaceResult; | ||
} | ||
|
||
if (enclosingClassName != NULL) | ||
{ | ||
*enclosingClassName = enclosingResult; | ||
} | ||
|
||
EE_TO_JIT_TRANSITION(); | ||
|
||
return result; | ||
|
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.
Should this just be part of the slightly higher check that already exists?
There isn't any real reason it should be separate or not handled in
impIntrinsic
...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.
I initially tried refactoring this and moving it in to be part of
impIntrinsic
, but it turned out to be a bit more work than I wanted here. Also wasn't totally sure with the alt-jit check if I could just move it under the existing if.I am planning to do some more refactoring for this (starting with #76792) so I think I will leave the further clean up to a future PR.