Skip to content

JIT: Assertion failed 'isValidSimm<9>(imm)' during 'Generate code' #119489

Closed

Description

@jakobbotsch
// Generated by Fuzzlyn v3.3 on 2025-09-07 15:20:59
// Run on Arm64 Linux
// Seed: 15956452263296455423-async,runtimeasync,vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armcrc32,armcrc32arm64,armdp,armrdm,armrdmarm64,armsha1,armsha256,armsve,armsve2
// Reduced from 127.1 KiB to 1.6 KiB in 00:03:52
// Hits JIT assert for Release with Runtime Async:
// Assertion failed 'isValidSimm<9>(imm)' in 'Program:M0()' during 'Generate code' (IL size 203; hash 0xaf50ff37; FullOpts)
// 
//     File: /__w/1/s/src/coreclr/jit/emitarm64sve.cpp Line: 2704
// 
using System.Numerics;
using System.Threading.Tasks;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;

public struct S0
{
    public long F0;
    public byte F1;
    public ulong F2;
    public Vector128<long> F3;
    public ushort F6;
    public Vector<int> F7;
    public bool M4(long[] arg0)
    {
        return default(bool);
    }

    public long[] M10(short arg0)
    {
        for (int lvar0 = 2147483549; lvar0 > 2147483547; lvar0--)
        {
        }

        return new long[]
        {
            1
        };
    }
}

public class Program
{
    public static S0 s_4;
    public static void Main()
    {
        M0().GetAwaiter().GetResult();
    }

    public static async Task M0()
    {
        short var22 = default(short);
        for (short lvar0 = 2; lvar0 > 0; lvar0--)
        {
            await Task.Yield();
            M1(s_4);
            var vr12 = (sbyte)-1;
            var vr11 = Vector128.CreateScalar(vr12).AsVector();
            var vr10 = Sve.CompareLessThanOrEqual(vr11, Vector.Create<sbyte>(0));
            var vr9 = Sve.AddAcross(vr10);
            var vr14 = new S0();
            ushort vr19 = vr14.F6;
            var vr17 = new S0();
            var vr16 = M1(vr17);
            var vr15 = (Vector<long>)Vector128.CreateScalar(vr16).AsVector();
            long var8 = Sve.ConditionalExtractAfterLastActiveElement(vr9, vr19, vr15);
            System.Console.WriteLine(var8);
        }

        bool vr0 = (new S0()).M4((new S0()).M10(var22));
    }

    public static ushort M1(S0 argThis)
    {
        S0 vr22 = s_4;
        return argThis.F6;
    }
}

Activity

  1. added
    untriaged
    on Sep 9, 2025
  2. added and removed
    untriaged
    on Sep 9, 2025
  3. added
    area-CodeGen-coreclr
    on Sep 9, 2025
  4. added this to the 11.0.0 milestone on Sep 9, 2025
  5. dotnet-policy-service commented on Sep 9, 2025

    @dotnet-policy-service
    Contributor

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

  6. jakobbotsch commented on Sep 9, 2025

    @jakobbotsch
    MemberAuthor

    Attached SPMI collection with assertion failure.

    4AE38D13.zip

    cc @a74nh, before #119326 this one asserts with "isScalableVectorSize(size)", so likely some missing handling for the mask load/saves. Can you take a look?

  7. a74nh commented on Sep 9, 2025

    @a74nh
    Contributor

    Attached SPMI collection with assertion failure.

    4AE38D13.zip

    cc @a74nh, before #119326 this one asserts with "isScalableVectorSize(size)", so likely some missing handling for the mask load/saves. Can you take a look?

    I'll take a look. Sounds like the mask load/stores checks aren't quite right when calculating the immediate

  8. added 2 commits that reference this issue on Sep 10, 2025
    a66bca9
    11a40a7
  9. added a commit that references this issue on Sep 10, 2025
    c89e300
  10. locked and limited conversation to collaborators on Oct 11, 2025
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

    area-CodeGen-coreclrruntime-async

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions