-
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
[arm64] JIT assertion failures for valid C# code #73804
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsIn #73768 I've wrote quite complex, but valid (it defnitely works fine on x64) C# code that produces JIT assertion failures on arm64: Sample run: https://github.com/dotnet/runtime/pull/73768/checks?check_run_id=7793120898
It would be great if someone from the @dotnet/jit-contrib Team could take a look and let me know whether I've hit a bug in JIT or my code is invalid. Thanks!
|
@BruceForstall, PTAL. |
You should never hit a JIT assert under any circumstance. cc @tannergooding in case I'm wrong w.r.t. hw intrinsics |
The issue here is that for some scalar intrinsics (here it is Simple reproduction: private static int Problem(short* s)
{
return ArmBase.LeadingZeroCount(*s);
} Edit: the presumable fix would be to use |
This is correct, assertions shouldn't be hit ever. For recursive intrinsics we should be at worst bailing out in import and causing it to throw a |
What should be the IR behavior for short types in indirections? The incoming IL is:
So the If we don't recognize the intrinsic, we have:
and generate a call like:
The When we recognize the intrinsic, we have:
and generate the same:
before hitting the assert.
Or do we need to insert a cast during importation? |
They are zero/sign-extended to TYP_INT as part of the indirection.
That cast would just be removed by morph. Using I've said this a few times, but I really wish |
The code already uses `emitActualTypeSize` in the scalar case; this also uses `genActualType` to get the "actual" type of small types when deciding the intrinsic base type, used in codegen. Fixes dotnet#73804
The code already uses `emitActualTypeSize` in the scalar case; this also uses `genActualType` to get the "actual" type of small types when deciding the intrinsic base type, used in codegen. Fixes #73804
In #73768 I've wrote quite complex, but valid (it defnitely works fine on x64) C# code that produces JIT assertion failures on arm64:
Sample run: https://github.com/dotnet/runtime/pull/73768/checks?check_run_id=7793120898
Sample log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-73768-merge-b3d703c3580445e6b2/JIT.1.Attempt.3/1/console.32c25b20.log?helixlogtype=result
It would be great if someone from the @dotnet/jit-contrib Team could take a look and let me know whether I've hit a bug in JIT or my code is invalid. Thanks!
The text was updated successfully, but these errors were encountered: