-
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: assert compiling System.Runtime.Intrinsics.X86.Avx:TestC via PMI #10774
JIT: assert compiling System.Runtime.Intrinsics.X86.Avx:TestC via PMI #10774
Comments
@AndyAyersMS, how is PMI instantiating the generic types? The HWIntrinsics have JIT constraints that aren't expressed in the metadata type system. |
It uses reflection, so anything the runtime allows is fair game.... I can track down the exact instantiation if you like. |
That will cause problems for the HWIntrinsic types/methods. They are constrained in metadata to |
Ok. Looks like we are trying to instantiate with a What is the process for ultimately rejecting this kind of instantation? Is it left to the jit? If so, we should make sure when the type is invalid that the jit does not hit asserts first. |
The logic starts here: https://github.com/dotnet/coreclr/blob/master/src/jit/hwintrinsicxarch.cpp#L636 The assert (L728) comes just before the first |
So presumably we can just remove the asserts above ... (for TYP_UNKNOWN and TYP_STRUCT)? |
Not quite sufficient... need something a bit more robust. |
Yes, I believe so. The only time it should fail is:
|
(with asserts removed) - still see a TYP_UNKNOWN getting through:
|
Hmmm... It seems to be missing out on the PNSE exception and is getting down to Let me build locally and try to step through here |
I had coded up this but perhaps it is too strong. Anyways I'll let you sort it out. Basic point is that we should not assert if we're going to throw later, and we should always throw for the invalid cases. @@ -721,11 +721,18 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
if (baseType == TYP_UNKNOWN) // the second argument is not a vector
{
baseType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, secondArg, &secondArgClass)));
- assert(baseType != TYP_STRUCT);
+
+ if (baseType == TYP_STRUCT)
+ {
+ return impUnsupportedHWIntrinsic(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, method, sig, mustExpand);
+ }
}
}
+ }
- assert(baseType != TYP_UNKNOWN);
+ if (baseType == TYP_UNKNOWN)
+ {
+ return impUnsupportedHWIntrinsic(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, method, sig, mustExpand);
}
if ((HWIntrinsicInfo::IsOneTypeGeneric(intrinsic) || HWIntrinsicInfo::IsTwoTypeGeneric(intrinsic)) && |
@AndyAyersMS, was the second assert happening for |
No, it was for |
Seeing a similar kind of failure here:
Would be great if we can PMI system.private.corelib cleanly with a checked jit.... Should I open a new issue? |
@AndyAyersMS, a new issue would be great. I'll start working on this now, however. |
I made a couple of improvements to the generic expansions in PMI and am now seeing an assert when running PMI on system.private.corelib:
To repro, build x64 checked, sync to latest jitutils and build, then run the above.
The text was updated successfully, but these errors were encountered: