Skip to content

JIT: Invalid result with Avx2.BlendVariable #125431

Description

@jakobbotsch
// Generated by Fuzzlyn v3.3 on 2026-03-09 16:27:56
// Run on X64 Linux
// Seed: 14993291497765132425-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86pclmulqdqv256,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 393.1 KiB to 0.7 KiB in 00:07:29
// Debug: Prints 1 line(s)
// Release: Prints 0 line(s)
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static Vector<ulong> s_12;
    public static byte[] s_27;
    public static Vector256<byte>[, ] s_53;
    public static void Main()
    {
        Vector256<byte> vr18 = Vector256.Create<byte>(0);
        var vr19 = Vector256.Create<byte>(0);
        var vr20 = M43(vr19, ref s_27);
        var vr21 = Vector256.CreateScalar(vr20);
        Vector256<byte> vr24 = s_53[0, 0];
        vr18 = Avx2.BlendVariable(vr21, vr24, vr18);
        M43(vr18, ref s_27);
    }

    public static byte M43(Vector256<byte> arg1, ref byte[] arg2)
    {
        System.Console.WriteLine(s_12);
        return arg2[0];
    }
}

Repros on Windows too

cc @dotnet/jit-contrib

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions