Skip to content

JIT: Assertion failed 'isContainable || supportsRegOptional' during 'Generate code' #111613

Closed

Description

@jakobbotsch
// Generated by Fuzzlyn v2.4 on 2025-01-19 15:15:14
// Run on X64 Windows
// Seed: 9992515068480039116-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 86.1 KiB to 0.3 KiB in 00:02:16
// Hits JIT assert in Release:
// Assertion failed 'isContainable || supportsRegOptional' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Generate code' (IL size 30; 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 void Main()
    {
        var vr3 = Vector256.Create<long>(1);
        Vector128<float> vr4 = Avx512DQ.VL.ConvertToVector128Single(vr3);
        System.Console.WriteLine(vr4.AsUInt32());
    }
}

Bisected to #110736, cc @saucecontrol

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Jan 20, 2025
  2. added
    untriaged
    on Jan 20, 2025
  3. dotnet-policy-service commented on Jan 20, 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. added this to the 10.0.0 milestone on Jan 20, 2025
  5. EgorBo commented on Jan 20, 2025

    @EgorBo
    Member

    cc @tannergooding @saucecontrol could be some recent PRs?

  6. jakobbotsch commented on Jan 20, 2025

    @jakobbotsch
    MemberAuthor

    cc @tannergooding @saucecontrol could be some recent PRs?

    Yep, you probably missed that I bisected it to #110736 above

  7. EgorBo commented on Jan 20, 2025

    @EgorBo
    Member

    Yep, you probably missed that I bisected it to #110736 above

    oops, didn't see it indeed 😆

  8. saucecontrol commented on Jan 20, 2025

    @saucecontrol
    Member

    Codegen is actually fine, so it's kind of a bogus assert. Before and after #110763

     G_M000_IG02:                ;; offset=0x0000
    -       vcvtqq2ps ymm0, ymmword ptr [reloc @RWD00]
    +       vcvtqq2ps ymm0, qword ptr [reloc @RWD00] {1to4}
            vmovups  xmmword ptr [rcx], xmm0
            mov      rax, rcx
      
     G_M000_IG03:                ;; offset=0x0011
            vzeroupper 
            ret      
      
    -RWD00  	dq	0000000000000001h, 0000000000000001h, 0000000000000001h, 0000000000000001h
    +RWD00  	dq	0000000000000001h

    Actual cause is a pre-existing bug in TryFoldCnsVecForEmbeddedBroadcast, where it uses parent SimdSize to determine the size of the broadcast node. Since the parent intrinsic here narrows, its SimdSize is half that of the child.

    So the containment check before conversion to broadcast succeeds and we contain the node, but then the validity check at codegen fails because the child is too small (even though only a scalar is used from it anyway).

    I'll put up a fix in a bit.

  9. added
    in-pr
    on Jan 20, 2025
  10. removed
    untriaged
    on Jan 21, 2025
  11. locked and limited conversation to collaborators on Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-CodeGen-coreclrin-pr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions