dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

Fuzzlyn: Assertion failed 'isContainable || supportsRegOptional' during 'Generate code' #109973

Open amanasifkhalid opened 2 days ago

amanasifkhalid commented 2 days ago

Hitting on multiple platforms. Example on win-x64:

// Generated by Fuzzlyn v2.4 on 2024-11-17 15:21:48
// Run on X64 Windows
// Seed: 17131692735478985344-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86avx512fx64,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 254.9 KiB to 0.6 KiB in 00:05:52
// Hits JIT assert in Release:
// Assertion failed 'isContainable || supportsRegOptional' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Generate code' (IL size 38; hash 0xade6b36b; 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 double s_8;
    public static void Main()
    {
        var vr13 = Vector128.Create<double>(0);
        var vr14 = Vector128.Create<uint>(1);
        var vr15 = Avx512F.VL.ConvertToVector128Double(vr14);
        var vr16 = Sse2.CompareScalarOrderedLessThanOrEqual(vr13, vr15);
        M31(vr16);
    }

    public static void M31(bool arg0)
    {
        var vr2 = Vector128.Create<double>(0);
        var vr6 = (double)s_8;
        var vr5 = Vector128.CreateScalar(vr6);
    }
}

cc @dotnet/jit-contrib

dotnet-policy-service[bot] commented 2 days ago

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

JulieLeeMSFT commented 2 days ago

@amanasifkhalid, PTAL. Tanner said that it looks related to lowering and containment check issue, not specific to AVX512.