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

JIT: SVE Assertion failed 'GetEmitter()->emitInsIsStore(ins)' during 'Generate code' #105478

Closed
jakobbotsch opened this issue Jul 25, 2024 · 4 comments
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support
Milestone

Comments

@jakobbotsch
Copy link
Member

// Generated by Fuzzlyn v2.0 on 2024-07-25 13:48:58
// Run on Arm64 Windows
// Seed: 16859790955922725257-vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armcrc32,armcrc32arm64,armdp,armsha1,armsha256,armsve
// Reduced from 41.4 KiB to 1.6 KiB in 00:00:45
// Hits JIT assert in Release:
// Assertion failed 'GetEmitter()->emitInsIsStore(ins)' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Generate code' (IL size 87; hash 0xade6b36b; FullOpts)
//
//     File: C:\dev\dotnet\runtime\src\coreclr\jit\instr.cpp Line: 724
//
using System;
using System.Runtime.CompilerServices;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;

public class Program
{
    public static IRuntime s_rt;
    public static Vector64<ushort> s_1;
    public static double s_7;
    public static void Main()
    {
        CollectibleALC alc = new CollectibleALC();
        System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location);
        System.Reflection.MethodInfo mi = asm.GetType(typeof(Program).FullName).GetMethod(nameof(MainInner));
        System.Type runtimeTy = asm.GetType(typeof(Runtime).FullName);
        mi.Invoke(null, new object[] { System.Activator.CreateInstance(runtimeTy) });
    }

    public static void MainInner(IRuntime rt)
    {
        var vr3 = Vector128.CreateScalar(1UL).AsVector();
        var vr4 = (ushort)Sve.SaturatingDecrementByActiveElementCount(0, vr3);
        s_1 = Vector64.Create<ushort>(vr4);
        try
        {
            s_7 = 0;
        }
        finally
        {
            var vr5 = Vector128.CreateScalar(1UL).AsVector();
            short vr6 = (short)Sve.SaturatingDecrementByActiveElementCount(1, vr5);
            s_rt.WriteLine("c_22", vr6);
        }
    }
}

public interface IRuntime
{
    void WriteLine<T>(string site, T value);
}

public class Runtime : IRuntime
{
    public void WriteLine<T>(string site, T value) => System.Console.WriteLine(value);
}

public class CollectibleALC : System.Runtime.Loader.AssemblyLoadContext
{
    public CollectibleALC() : base(true)
    {
    }
}

cc @dotnet/jit-contrib @dotnet/arm64-contrib

@jakobbotsch jakobbotsch added arch-arm64 arm-sve Work related to arm64 SVE/SVE2 support labels Jul 25, 2024
@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 25, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 25, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@TIHan TIHan self-assigned this Jul 25, 2024
@TIHan TIHan removed the untriaged New issue has not been triaged by the area owner label Jul 25, 2024
@TIHan TIHan added this to the 9.0.0 milestone Jul 25, 2024
@TIHan TIHan removed their assignment Jul 25, 2024
@TIHan
Copy link
Contributor

TIHan commented Jul 25, 2024

cc @SwapnilGaikwad @a74nh

@kunalspathak
Copy link
Member

This is happening because load and store instructions are not marked as LD / ST. But as part of this fix, we should revisit it and tag them appropriately.

@kunalspathak
Copy link
Member

This particular issue is fixed in #105348 and I have opened #105512 to track this.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support
Projects
None yet
Development

No branches or pull requests

3 participants