Skip to content
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

[RyuJIT] Propagate gtFlags in Vector.Create #43578

Merged
merged 8 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/coreclr/src/jit/hwintrinsicarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,10 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,

for (unsigned i = 0; i < sig->numArgs; i++)
{
tmp = gtNewArgList(impPopStack().val);
tmp->gtOp2 = op1;
op1 = tmp;
tmp = gtNewListNode(impPopStack().val, tmp);
}

op1 = tmp;
retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, baseType, simdSize);
}
break;
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/src/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,10 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic,

for (unsigned i = 0; i < sig->numArgs; i++)
{
tmp = gtNewArgList(impPopStack().val);
tmp->gtOp2 = op1;
op1 = tmp;
tmp = gtNewListNode(impPopStack().val, tmp);
}

op1 = tmp;
retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, baseType, simdSize);
}
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;

namespace GitHub_43569
{
class Program
{
public static int Main()
{
if ((int)Vector64_Create_short(100) != 100)
return 1;
if ((int)Vector128_Create_float(100) != 100)
return 2;
if ((int)Vector128_Create_byte(100) != 100)
return 3;
if ((int)Vector256_Create_float(100) != 100)
return 4;
if ((int)Vector256_Create_double(100) != 100)
return 5;
return 100;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T Inline<T>(T t) => t;

[MethodImpl(MethodImplOptions.NoInlining)]
public static short Vector64_Create_short(short a)
{
Vector64<short> x = default;
for (int i = 0; i < 1; i++)
x = Vector64.Create(1, 2, 3, Inline(a));
return x.GetElement(3);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static float Vector128_Create_float(float a)
{
Vector128<float> x = default;
for (int i = 0; i < 1; i++)
x = Vector128.Create(1, 2, 3, Inline(a));
return x.GetElement(3);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static byte Vector128_Create_byte(byte a)
{
Vector128<byte> x = default;
for (int i = 0; i < 1; i++)
x = Vector128.Create(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, Inline(a));
return x.GetElement(15);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static float Vector256_Create_float(float a)
{
Vector256<float> x = default;
for (int i = 0; i < 1; i++)
x = Vector256.Create(1, 2, 3, 4, 5, 6, 7, Inline(a));
return x.GetElement(7);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static double Vector256_Create_double(double a)
{
Vector256<double> x = default;
for (int i = 0; i < 1; i++)
x = Vector256.Create(1, 2, 3, Inline(a));
return x.GetElement(3);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>Embedded</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="GitHub_43569.cs" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions src/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,9 @@

<!-- Known failures for mono runtime on *all* architectures/operating systems -->
<ItemGroup Condition="'$(RuntimeFlavor)' == 'mono'" >
<ExcludeList Include="$(XunitTestBinBase)/JIT/HardwareIntrinsics/General/Regression/GitHub_43569/**">
<Issue>https://github.com/dotnet/runtime/issues/43676</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTestWithMcj/*">
<Issue>Tests features specific to coreclr</Issue>
</ExcludeList>
Expand Down