Skip to content

JIT: Assertion failed 'isContainable || supportsRegOptional' #114570

Closed

Description

@BruceForstall
// Generated by Fuzzlyn v2.5 on 2025-04-11 19:36:22
// Run on X86 Windows
// Seed: 2880609996874211534-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86bmi1,x86bmi2,x86fma,x86lzcnt,x86pclmulqdq,x86popcnt,x86sse,x86sse2,x86sse3,x86sse41,x86sse42,x86ssse3,x86x86base
// Reduced from 130.6 KiB to 0.9 KiB in 00:04:12
// Hits JIT assert in Release:
// Assertion failed 'isContainable || supportsRegOptional' in 'Program:M8():System.Runtime.Intrinsics.Vector128`1[ulong]' during 'Generate code' (IL size 39; hash 0x72979674; FullOpts)
// 
//     File: D:\a\_work\1\s\src\coreclr\jit\hwintrinsiccodegenxarch.cpp Line: 61
// 
using System;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static IRuntime s_rt;
    public static byte s_1;
    public static Vector128<sbyte> s_17;
    public static uint s_22;
    public static void Main()
    {
        var vr17 = M8();
    }

    public static Vector128<ulong> M8()
    {
        var vr6 = Vector128.Create(0, 0, s_22, 0);
        var vr3 = (ulong)Bmi1.AndNot(0, M23(vr6, ref s_17));
        return Vector128.CreateScalar(vr3);
    }

    public static ref byte M23(Vector128<uint> arg0, ref Vector128<sbyte> arg1)
    {
        s_rt.WriteLine(arg0);
        return ref s_1;
    }
}

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

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

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1013771&view=ms.vss-build-web.run-extensions-tab

@dotnet/jit-contrib @dotnet/intel @saucecontrol

Activity

  1. added
    area-CodeGen-coreclr
    on Apr 11, 2025
  2. added this to the 10.0.0 milestone on Apr 11, 2025
  3. dotnet-policy-service commented on Apr 11, 2025

    @dotnet-policy-service
    Contributor

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

  4. saucecontrol commented on Apr 11, 2025

    @saucecontrol
    Member

    This one doesn't repro for me locally -- just runs through and ends in the expected NRE:

    Looking at the JitDump, everything that's marked contained appears to be valid:

    ------------ BB01 [0000] [000..027) (return), preds={} succs={}
    N003 (???,???) [000028] -----------                            IL_OFFSET void   INLRT @ 0x00E[E-] REG NA
    N005 (???,???) [000031] -----------                   t31 =    CNS_VEC   simd16<0x00000000, 0x00000000, 0x00000000, 0x00000000> REG mm0
    N007 (  1,  1) [000001] -----+-----                    t1 =    CNS_INT   int    0 REG ecx $40
    N009 (???,???) [000032] -c---------                   t32 =    CNS_INT   int    1 REG NA
                                                                /--*  t31    simd16 
                                                                +--*  t1     int    
                                                                +--*  t32    int    
    N011 (???,???) [000033] -----------                   t33 = *  HWINTRINSIC simd16 uint Insert REG mm0
    N013 (  1,  4) [000002] Hc---+-----                    t2 =    CNS_INT(h) int    0xCEEFB218 static Fseq[s_22] REG NA $100
                                                                /--*  t2     int    
    N015 (  3,  6) [000003] nc--G+-----                    t3 = *  IND       int    REG NA <l:$140, c:$81>
    N017 (???,???) [000034] -c---------                   t34 =    CNS_INT   int    2 REG NA
                                                                /--*  t33    simd16 
                                                                +--*  t3     int    
                                                                +--*  t34    int    
    N019 (???,???) [000035] ----G------                   t35 = *  HWINTRINSIC simd16 uint Insert REG mm0
    N021 (  1,  1) [000004] -----+-----                    t4 =    CNS_INT   int    0 reuse reg val REG ecx $40
    N023 (???,???) [000036] -c---------                   t36 =    CNS_INT   int    3 REG NA
                                                                /--*  t35    simd16 
                                                                +--*  t4     int    
                                                                +--*  t36    int    
    N025 (  7, 10) [000005] ----G+-----                    t5 = *  HWINTRINSIC simd16 uint Insert REG mm0 $180
                                                                /--*  t5     simd16 
    N027 (???,???) [000037] ----G------                         *  PUTARG_STK [+0x10] void   (16 stackByteSize), (16 byteOffset) REG NA
    N029 (  1,  4) [000009] H----+-----                    t9 =    CNS_INT(h) int    0x802055A0 static Fseq[s_17] REG ecx $102
                                                                /--*  t9     int    
    N031 (???,???) [000038] -----------                   t38 = *  PUTARG_REG int    REG ecx
    N033 (  1,  4) [000039] Hc---------                   t39 =    CNS_INT(h) int    0xCF64D890 ftn REG NA
                                                                /--*  t39    int    
    N035 (  3,  6) [000040] nc--G------                   t40 = *  IND       int    REG NA
                                                                /--*  t38    int    arg1 ecx
                                                                +--*  t40    int    control expr
    N037 ( 25, 20) [000010] --CXG+-----                   t10 = *  CALL      byref  Runtime_114570:M23(System.Runtime.Intrinsics.Vector128`1[uint],byref):byref REG eax $1c0
                                                                /--*  t10    byref  
    N039 ( 29, 23) [000012] --CXG+-----                   t12 = *  IND       ubyte  REG eax <l:$301, c:$300>
                                                                /--*  t12    ubyte  
    N041 ( 29, 23) [000023] DACXG------                         *  STORE_LCL_VAR int    V02 loc1         d:1 eax REG eax $2c2
    N043 (  1,  1) [000026] -----------                   t26 =    LCL_VAR   int    V02 loc1         u:1 eax (last use) REG eax <l:$200, c:$240>
    N045 (???,???) [000029] -----------                   t29 =    CNS_INT   int    0 REG edx
                                                                /--*  t26    int    
                                                                +--*  t29    int    
    N047 (???,???) [000030] -c---------                   t30 = *  LONG      long   REG NA
                                                                /--*  t30    long   
    N049 ( 32, 27) [000016] -ACXG+-----                   t16 = *  HWINTRINSIC simd16 ulong CreateScalar REG mm0 <l:$383, c:$382>
    N051 (  1,  1) [000017] -----+-----                   t17 =    LCL_VAR   int    V00 RetBuf       u:1 esi (last use) REG esi $80
                                                                /--*  t17    int    
                                                                +--*  t16    simd16 
    N053 ( 36, 30) [000018] sACXG+-----                         *  STOREIND  simd16 (copy) REG NA $2c5
    N055 (  0,  0) [000019] -----+-----                            RETURN    void   REG NA $VN.Void
    

    Codegen looks right, too

    *************** After end code gen, before unwindEmit()
    G_M7098_IG01:        ; func=00, offs=0x000000, size=0x0006, bbWeight=1, PerfScore 2.50, gcrefRegs=00000000 {}, byrefRegs=00000000 {}, byref, nogc <-- Prolog IG
    
    IN000f: 000000 push     ebp
    IN0010: 000001 mov      ebp, esp
    IN0011: 000003 push     esi
    IN0012: 000004 mov      esi, ecx
    
    G_M7098_IG02:        ; offs=0x000006, size=0x0016, bbWeight=1, PerfScore 8.58, gcrefRegs=00000000 {}, byrefRegs=00000000 {}, BB01 [0000], byref
    
    IN0001: 000006 vxorps   xmm0, xmm0, xmm0
    IN0002: 00000A xor      ecx, ecx
    IN0003: 00000C vpinsrd  xmm0, xmm0, ecx, 1
    IN0004: 000012 vpinsrd  xmm0, xmm0, dword ptr [0xCEEFB218], 2      ; data for Runtime_114570:s_22
    
    G_M7098_IG03:        ; offs=0x00001C, size=0x002C, bbWeight=1, PerfScore 17.75, gcrefRegs=00000000 {}, byrefRegs=00000000 {}, BB01 [0000], byref
    
    IN0005: 00001C vpinsrd  xmm0, xmm0, ecx, 3
    IN0006: 000022 sub      esp, 16
    IN0007: 000025 vmovups  xmmword ptr [esp], xmm0
    IN0008: 00002A mov      ecx, 0x210802055A0      ; data for Runtime_114570:s_17
    IN0009: 00002F call     [Runtime_114570:M23(System.Runtime.Intrinsics.Vector128`1[uint],byref):byref]
    IN000a: 000035 movzx    eax, byte  ptr [eax]
    IN000b: 000038 xor      edx, edx
    IN000c: 00003A vmovd    xmm0, eax
    IN000d: 00003E vpinsrd  xmm0, xmm0, edx, 1
    IN000e: 000044 vmovups  xmmword ptr [esi], xmm0
    
    G_M7098_IG04:        ; offs=0x000048, size=0x0003, bbWeight=1, PerfScore 2.00, epilog, nogc, extend
    
    IN0013: 000048 pop      esi
    IN0014: 000049 pop      ebp
    IN0015: 00004A ret      
    

    Is there any environment setup I might be missing?

  5. BruceForstall commented on Apr 11, 2025

    @BruceForstall
    ContributorAuthor

    Is there any environment setup I might be missing?

    I see Hits JIT assert in Release. @jakobbotsch what does this mean? Any suggestions? I also couldn't repro it with a few different configuration attempts.

  6. jakobbotsch commented on Apr 14, 2025

    @jakobbotsch
    Member

    It means Fuzzlyn hit a JIT assert when the example was compiled in release mode and run without tiered compilation.

    Fuzzlyn records SPMI collections for asserts automatically. You can find it in the "Issues_windows_x86_checked" artifact. I've attached the most reduced failing context below. It reproduces on 159f40e.

    col.zip

  7. added
    blocking-clean-ci-optional
    on Apr 14, 2025
  8. saucecontrol commented on Apr 14, 2025

    @saucecontrol
    Member

    Thanks @jakobbotsch, I see the problem now. Fix incoming...

  9. locked and limited conversation to collaborators on May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrblocking-clean-ci-optional

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions