Skip to content

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

Closed

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

Activity

  1. added
    arm-sve
    on Jul 25, 2024
  2. ghost added
    area-CodeGen-coreclr
    on Jul 25, 2024
  3. added
    untriaged
    on Jul 25, 2024
  4. dotnet-policy-service commented on Jul 25, 2024

    @dotnet-policy-service
    Contributor

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

  5. self-assigned this
    on Jul 25, 2024
  6. removed
    untriaged
    on Jul 25, 2024
  7. added this to the 9.0.0 milestone on Jul 25, 2024
  8. removed their assignment
    on Jul 25, 2024
  9. TIHan commented on Jul 25, 2024

    @TIHan
    Contributor
  10. kunalspathak commented on Jul 25, 2024

    @kunalspathak
    Contributor

    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.

  11. kunalspathak commented on Jul 26, 2024

    @kunalspathak
    Contributor

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

  12. locked and limited conversation to collaborators on Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm64area-CodeGen-coreclrarm-sve

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions