-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Assertion failed '!(checkUnusedValues && def->IsUnusedValue()) && "operands should never be marked as unused values"' during 'Lowering nodeinfo' #106480
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
I'll take a look. |
I'm not able to repro this -- @amanasifkhalid which hash did this run against? |
@AndyAyersMS It's from this run; hash is 03969786. |
Antigen hit it again with this repro: // Found by Antigen
// Reduced from 121.36 KB to 3.38 KB.
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using System.Numerics;
public class TestClass
{
public struct S1
{
}
public struct S2
{
}
static int s_int_10 = 0;
static uint s_uint_16 = 0;
static Vector512<ushort> s_v512_ushort_42 = Vector512<ushort>.AllBitsSet;
static Vector512<float> s_v512_float_47 = Vector512<float>.AllBitsSet;
bool bool_64 = true;
Vector512<ushort> v512_ushort_102 = Vector512.Create((ushort)0, 0, 2, 0, 2, 0, 0, 2, 2, 1, 5, 99, 2, 99, 5, 5, 5, 2, 2, 99, 5, 32767, 2, 2, 5, 2, 32767, 1, 99, 32766, 5, 2);
Vector512<float> v512_float_107 = Vector512<float>.Zero;
static int s_loopInvariant = 2;
private static List<string> toPrint = new List<string>();
public double Method1(out Vector512<float> p_v512_float_124)
{
unchecked
{
bool bool_125 = true;
byte byte_126 = 5;
ushort ushort_136 = 0;
p_v512_float_124 = s_v512_float_47 *= Vector512.Max(v512_float_107 ^ s_v512_float_47, s_v512_float_47);
try
{
if ((bool_64 = ((((s_uint_16 = ((15-4)))) > ((s_int_10 / ((15|4))))))))
{} else
{
if (((((s_uint_16 = ((15-4)))) > ((s_int_10 / ((15|4)))))))
{
}
else
{
try
{
if (bool_125)
{
}
else
{
}
}
catch (System.MissingMethodException)
{
for (int __loopvar9 = 15+4; s_int_10 < (((15/4))); s_int_10++)
{
if (15<4)
break;
int __loopvar5 = s_loopInvariant;
do
{
Avx512F.TernaryLogic(((((Avx512F.TernaryLogic(v512_ushort_102, v512_ushort_102, v512_ushort_102, byte_126) | ((v512_ushort_102 | v512_ushort_102)))) + ((v512_ushort_102 | v512_ushort_102)))), ((v512_ushort_102 += ((s_v512_ushort_42 *= ((v512_ushort_102 *= v512_ushort_102)))))), ((((v512_ushort_102 * ((15|4)))) ^ ((v512_ushort_102 *= v512_ushort_102)))), byte_126);
}
while ((((15!=4))) && ((15<4)));
;
}
}
finally
{
}
}
}
}
finally
{
}
return ((15/4));
}
}
public void Method0()
{
unchecked
{
double double_175 = 99.08695652173913;
double_175 = Method1(out s_v512_float_47);
return;
}
}
public static void Main(string[] args)
{
}
public static int Antigen()
{
new TestClass().Method0();
return string.Join(Environment.NewLine, toPrint).GetHashCode();
}
}
/*
Environment:
set DOTNET_JitRLCSEGreedy=1
set DOTNET_TailcallStress=1
set DOTNET_JitForceControlFlowGuard=1
set DOTNET_HeapVerify=1
set DOTNET_ReadyToRun=1
set DOTNET_JitRandomOnStackReplacement=5
set DOTNET_TieredCompilation=0
set DOTNET_PreferredVectorBitWidth=512
set DOTNET_EnableHWIntrinsic=1
set DOTNET_JitStress=2
set DOTNET_JitStressRegs=3
set DOTNET_JitThrowOnAssertionFailure=1
set DOTNET_LegacyExceptionHandling=1
Debug: -1650517093
Release: 0
JIT assert failed:
Assertion failed '!(checkUnusedValues && def->IsUnusedValue()) && "operands should never be marked as unused values"' in 'TestClass:Method1(byref):double:this' during 'Lowering nodeinfo' (IL size 345; hash 0x05298471; FullOpts)
File: D:\a\_work\1\s\src\coreclr\jit\lir.cpp Line: 1649
*/ You might have more luck with that one. |
Ah, keep forgetting the reduced repros don't actually call the failing methods... eg public static void Main(string[] args)
{
} When I fix that I can repro. |
Second repro only needs |
Simplified repro using System;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
public class TestClass
{
Vector512<ushort> v512_ushort_102 = Vector512<ushort>.AllBitsSet;
public void Method0()
{
byte byte_126 = 5;
Avx512F.TernaryLogic(v512_ushort_102, v512_ushort_102, v512_ushort_102, byte_126);
}
public static void Main(string[] args)
{
new TestClass().Method0();
}
} In |
In `LowerHWIntrinsicTernaryLogic` we do some operand swapping and replacing, and were not accounting for this when marking operands as unused. Fixes dotnet#106480.
In `LowerHWIntrinsicTernaryLogic` we do some operand swapping and replacing, and were not accounting for this when marking operands as unused. Fixes #106480.
…TernaryLogic (#106574) * JIT: fix unused operand marking in LowerHWIntrinsicTernaryLogic In `LowerHWIntrinsicTernaryLogic` we do some operand swapping and replacing, and were not accounting for this when marking operands as unused. Fixes #106480. * review feedback --------- Co-authored-by: Andy Ayers <andya@microsoft.com>
…et#106555) In `LowerHWIntrinsicTernaryLogic` we do some operand swapping and replacing, and were not accounting for this when marking operands as unused. Fixes dotnet#106480.
On windows x64:
Also hit on Windows x86. cc @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: