Repository navigation
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIavx512Related to the AVX-512 architecture
Milestone
Description
// Generated by Fuzzlyn v3.3 on 2026-02-22 16:38:42
// Run on X64 Windows
// Seed: 12524694341177432228-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 40.5 KiB to 0.6 KiB in 00:01:15
// Hits JIT assert for Release:
// Assertion failed '!"Write to unaliased local overlaps outstanding read"' in 'Program:M0()' during 'Rationalize IR' (IL size 61; hash 0xaf50ff37; FullOpts)
//
// File: D:\a\_work\1\s\src\coreclr\jit\lir.cpp Line: 1502
//
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
public class Program
{
public static byte[] s_2;
public static void Main()
{
M0();
}
public static void M0()
{
var vr1 = Vector256.CreateScalar(1U);
var vr3 = Vector256.Create<uint>(1);
var vr5 = Vector256.Create<uint>(0);
var vr7 = Vector256.Create<uint>(1);
var vr6 = Avx512CD.VL.LeadingZeroCount(vr7);
var vr4 = Avx2.CompareEqual(vr5, vr6);
var vr2 = Avx2.Subtract(vr3, vr4);
if (Avx.TestZ(vr1, vr2))
{
var vr0 = s_2[0];
}
}
}Output:
read: N001 ( 1, 1) [000049] ----------- t49 = LCL_VAR simd32 V05 cse0 u:1 $c0
N002 ( 3, 2) [000007] ----------- t7 = CNS_VEC simd32<0x0000000100000001, 0x0000000100000001, 0x0000000100000001, 0x0000000100000001> $c0
┌──▌ t7 simd32
write: N003 ( 3, 3) [000046] DA--------- ▌ STORE_LCL_VAR simd32 V05 cse0 d:1 $VN.Void
N004 ( 1, 2) [000052] ----------- t52 = CNS_MSK mask <0x00000000, 0x00000000> $140
┌──▌ t52 mask
N006 ( 5, 6) [000012] -A--------- t12 = ▌ HWINTRINSIC simd32 32 uint ConvertMaskToVector $180
┌──▌ t49 simd32
├──▌ t12 simd32
user: N007 ( 7, 8) [000015] -A--------- t15 = ▌ HWINTRINSIC simd32 32 uint Subtract $1c1
N008 ( 3, 2) [000001] ----------- t1 = CNS_VEC simd32<0x0000000000000001, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000> $c3
┌──▌ t1 simd32
├──▌ t15 simd32
N009 ( 11, 11) [000018] -A--------- t18 = ▌ HWINTRINSIC int 32 uint TestZ $200
N010 ( 1, 1) [000019] ----------- t19 = CNS_INT int 0 $43
┌──▌ t18 int
├──▌ t19 int
N011 ( 13, 13) [000020] JA-----N--- t20 = ▌ EQ int $240
┌──▌ t20 int
N012 ( 15, 15) [000021] -A--------- ▌ JTRUE void $VN.VoidAttached SPMI collection collected on 5302011.
col.zip
cc @dotnet/jit-contrib
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIavx512Related to the AVX-512 architecture
Activity
dotnet-policy-service commentedon Feb 23, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JulieLeeMSFT commentedon Apr 17, 2026
@Ruihan-Yin, PTAL.
cc @kg
AndyAyersMS commentedon Jun 15, 2026
Note
This comment was AI-generated.
Still reproducing on
mainas of build 1453110 (Fuzzlyn run 2026-06-07). Same hash0xaf50ff37, same methodProgram:M0(), same assertion atsrc/coreclr/jit/lir.cpp:1502. New 0.9 KiB repro (uses runtime async + an extraAvx2.SubtractSaturateindirection that causes an assertion-prop re-morph to re-trigger theAdd(Sub(0,X), Y) -> Sub(Y, X)identity after CSE has placed a COMMA def inX):Analysis of jitdump (AI generated)
The assertion fires in BB07/STMT00019 of the inlined
M2body inside theruntime-async wrapper
Program:M0().Morph (initial) rewrites
Avx2.Subtract(vr5, vr6)intoAdd(Subtract(0, vr6), vr5)via the SIMD identity(0 - b) + a == a - b.vr5andvr8both fold toCNS_VEC<0x0001...>with shared VN$281.CSE picks them as CSE WIP: repo consolidation scouting kick-off - make clr build locally on Windows #1 (
V29), wraps theleftmost-in-eval-order occurrence (inside
SubtractSaturate) inCOMMA(STORE_LCL_VAR V29 = CNS_VEC, LCL_VAR V29), and rewrites theother occurrence (the Add's right operand) as a bare
LCL_VAR V29use.Post-CSE HIR eval order is fine: COMMA def at
N002precedes bare useat
N009.Assertion prop's re-morph re-applies the same identity on the new
Add(Sub(0, X), Y)tree, producingSub(Y, X)where:Yis the bareLCL_VAR V29(now the left operand ofSub)XisSubtractSaturate(0, COMMA(STORE V29, LCL_VAR V29))(now theright operand of
Sub)In HIR exec order this places the bare
LCL_VAR V29read atN001,before the
STORE_LCL_VAR V29atN003.Rationalize linearizes faithfully;
lir.cpp:1502detects theoutstanding read of
V29whose user (Subtract) is reached onlyafter the intervening
STORE_LCL_VAR V29write, and asserts.Same root cause as the original repro — CSE plants a COMMA def in
whichever operand it picked as first-evaluated, and a subsequent morph
identity swaps the operand evaluation order without checking that the
swap reorders a read of a CSE local before its only def.
Repro
.mc+ jitdump.txt available on request.Add regression test for #124749 (#130936)