Skip to content

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

Closed
@jakobbotsch

Description

@jakobbotsch
// 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIarm-sveWork related to arm64 SVE/SVE2 support

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions