-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
eeGetMethodName is only expected to be used for diagnostics.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailseeGetMethodName is only expected to be used for diagnostics.
|
If I am reading the code correctly, we are always going to ask for |
If it is too complex refactoring, we should add
and flip the same check in |
It's a good point. The refactoring does look a little complicated to do, but |
@jkotas I started with a larger refactoring but as you mentioned it does end up being a more major operation, so for this PR I went with your second suggestion instead. |
{ | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This logic seems a bit odd to me in terms of the namespaceResult
, IIUC it will work only for one level of nesting.
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.
This is designed to handle just enough for the JIT to identify intrinsics. We only need one level of nesting for that.
src/coreclr/jit/importer.cpp
Outdated
{ | ||
bIntrinsicImported = true; | ||
goto DONE_CALL; | ||
call = impSIMDIntrinsic(opcode, newobjThis, clsHnd, methHnd, sig, mflags, pResolvedToken->token); |
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.
Failure is known according to build analysis. |
eeGetMethodName is only expected to be used for diagnostics.
In practice this does not cause issues, but some odd situations could occur in the cases where
eeGetMethodName
returns a placeholder name during SPMI replay.Also avoid unnecessary EE call in
impSIMDIntrinsic
in the common case of no SIMD intrinsic.