-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
windows/x64: Assertion failed 'unreached' during 'Physical promotion' #110326
Comments
@dotnet/jit-contrib |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
A similar |
Simplified repro is: sing System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
public class TestClass
{
public struct S1
{
public bool bool_2;
public Vector512<short> v512_short_3;
public Vector512<float> v512_float_4;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static ulong Method1()
{
S1 s1_s1_d1_f3_160 = new S1();
return Vector512.ExtractMostSignificantBits(s1_s1_d1_f3_160.v512_short_3);
}
public static void Main(string[] args)
{
TestClass.Method1();
}
} @jakobbotsch the tree shape we have is roughly:
My guess is that it isn't "safe" for us to be retyping the promoted field that exists as -- The failure here is because |
Right, the optimization needs to skip promoted fields ( The original assertion failure seems to be during physical promotion, though, and old promotion should not be involved there. Can you share a jitdump or SPMI collection? Curious to see what physical promotion is seeing. |
Here is the dump: The repro is just the simplified repro above (#110326 (comment)) being run with |
This dump seems to make it past physical promotion, into morph, so it's not quite the same failure mode as the assert from the OP.
When I try the original repro with AltJit, after adding a call to
|
I'll try and take a look at this and see if I can root cause it as well. I missed that |
I have a guess as to what might be happening -- if you have assignments between physically promoted structs and regularly/old promoted structs, then physical promotion will sometimes promote fields based on that assignment. |
can you retry with |
The original repro fails in the same place, with the following callstack:
JitStress=2 and TieredCompilation=0 are required; with changing using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Numerics;
public class TestClass
{
public struct S2_D1_F2
{
public struct S2_D2_F2
{
public Vector<double> v_double_0;
}
public struct S2_D2_F3
{
public Vector3 v3_10;
}
}
public struct S2_D1_F3
{
public struct S2_D2_F3
{
public Vector256<int> v256_int_14;
}
public Vector128<long> v128_long_13;
public Vector512<uint> v512_uint_16;
}
public void Method0()
{
unchecked
{
S2_D1_F2.S2_D2_F2 s2_s2_d1_f2_s2_d2_f2_262 = new S2_D1_F2.S2_D2_F2();
S2_D1_F2.S2_D2_F2 s2_s2_d1_f2_s2_d2_f2_263 = s2_s2_d1_f2_s2_d2_f2_262;
S2_D1_F2.S2_D2_F3 s2_s2_d1_f2_s2_d2_f3_264 = new S2_D1_F2.S2_D2_F3();
S2_D1_F2.S2_D2_F3 s2_s2_d1_f2_s2_d2_f3_265 = s2_s2_d1_f2_s2_d2_f3_264;
S2_D1_F2 s2_s2_d1_f2_266 = new S2_D1_F2();
S2_D1_F3.S2_D2_F3 s2_s2_d1_f3_s2_d2_f3_268 = new S2_D1_F3.S2_D2_F3();
S2_D1_F3 s2_s2_d1_f3_269 = new S2_D1_F3();
S2_D1_F3 s2_s2_d1_f3_270 = s2_s2_d1_f3_269;
s2_s2_d1_f3_270.v512_uint_16 = Vector512.IsZero(Vector512<uint>.AllBitsSet);
Log("s2_s2_d1_f", s2_s2_d1_f2_s2_d2_f2_262.v_double_0);
Log("s2_s2_d1_f", s2_s2_d1_f2_s2_d2_f2_263.v_double_0);
Log("s2_s2_d1_f", s2_s2_d1_f2_s2_d2_f3_264);
Log("s2_s2_d1_f", s2_s2_d1_f2_s2_d2_f3_265.v3_10);
Log("s2_s2_d1_f", s2_s2_d1_f2_266);
Log("s2_s2_d1_f", s2_s2_d1_f3_s2_d2_f3_268.v256_int_14);
Log("s2_s2_d1_f", s2_s2_d1_f3_269.v128_long_13);
Log("s2_s2_d1_f", s2_s2_d1_f3_270.v128_long_13);
return;
}
}
public static void Main(string[] args)
{
new TestClass().Method0();
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static void Log(string varName, object varValue)
{
}
} CC. @jakobbotsch -- I know where/how to disable the promoted field support from the new mask optimization, but I'm not quite sure the best place to disable |
Disabling it in the new mask optimization should be enough -- old promotion promotes based on metadata, and no metadata field will be of type |
The text was updated successfully, but these errors were encountered: