Skip to content

Commit 592e01f

Browse files
Ensure the relevant containable nodes are handled (#91334)
Co-authored-by: Tanner Gooding <[email protected]>
1 parent a02c660 commit 592e01f

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

src/coreclr/jit/lowerxarch.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8135,7 +8135,16 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* parentNode, GenTre
81358135
case NI_Vector128_ToScalar:
81368136
case NI_Vector256_ToScalar:
81378137
case NI_Vector512_ToScalar:
8138+
case NI_SSE2_ConvertToInt32:
8139+
case NI_SSE2_ConvertToUInt32:
8140+
case NI_SSE2_X64_ConvertToInt64:
8141+
case NI_SSE2_X64_ConvertToUInt64:
8142+
case NI_SSE2_Extract:
8143+
case NI_SSE41_Extract:
8144+
case NI_SSE41_X64_Extract:
81388145
case NI_AVX_ExtractVector128:
8146+
case NI_AVX2_ConvertToInt32:
8147+
case NI_AVX2_ConvertToUInt32:
81398148
case NI_AVX2_ExtractVector128:
81408149
case NI_AVX512F_ExtractVector128:
81418150
case NI_AVX512F_ExtractVector256:
@@ -8178,6 +8187,13 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* parentNode, GenTre
81788187
return false;
81798188
}
81808189

8190+
case NI_Vector128_get_Zero:
8191+
case NI_Vector256_get_Zero:
8192+
{
8193+
// These are only containable as part of Sse41.Insert
8194+
return false;
8195+
}
8196+
81818197
case NI_SSE3_MoveAndDuplicate:
81828198
case NI_AVX2_BroadcastScalarToVector128:
81838199
case NI_AVX2_BroadcastScalarToVector256:
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.aa
3+
4+
// Found by Antigen
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Runtime.CompilerServices;
9+
using System.Runtime.Intrinsics;
10+
using System.Runtime.Intrinsics.X86;
11+
using System.Numerics;
12+
using Xunit;
13+
14+
public class TestClass
15+
{
16+
public struct S1
17+
{
18+
}
19+
20+
static short s_short_8 = 5;
21+
static int s_int_9 = -2;
22+
long long_59 = 4;
23+
uint uint_64 = 1;
24+
Vector256<int> v256_int_90 = Vector256.Create(2, -5, 4, 4, 5, 0, -1, 5);
25+
S1 s1_99 = new S1();
26+
27+
private uint Method4(out short p_short_161, S1 p_s1_162, bool p_bool_163, ref int p_int_164)
28+
{
29+
unchecked
30+
{
31+
p_short_161 = 15|4;
32+
if ((long_59 *= 15>>4)!= (long_59 |= 15^4))
33+
{
34+
}
35+
else
36+
{
37+
Vector128.CreateScalarUnsafe(Vector256.Sum(v256_int_90));
38+
}
39+
return 15|4;
40+
}
41+
}
42+
43+
private void Method0()
44+
{
45+
unchecked
46+
{
47+
uint_64 = Method4(out s_short_8, s1_99, 15<4, ref s_int_9);
48+
return;
49+
}
50+
}
51+
52+
[Fact]
53+
public static void TestEntryPoint()
54+
{
55+
new TestClass().Method0();
56+
}
57+
}
58+
/*
59+
60+
Assert failure(PID 34336 [0x00008620], Thread: 38576 [0x96b0]): Assertion failed '!childNode->isContainableHWIntrinsic()' in 'TestClass:Method4(byref,TestClass+S1,bool,byref):uint:this' during 'Lowering nodeinfo' (IL size 63; hash 0xa4e6dede; Tier0)
61+
File: D:\git\runtime\src\coreclr\jit\lowerxarch.cpp Line: 8201
62+
Image: D:\git\runtime\artifacts\tests\coreclr\windows.x64.Checked\tests\Core_Root\CoreRun.exe
63+
*/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<Optimize>True</Optimize>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<Compile Include="$(MSBuildProjectName).cs" />
7+
</ItemGroup>
8+
</Project>

0 commit comments

Comments
 (0)