未验证 提交 1d3e4eef 编写于 作者: S SingleAccretion 提交者: GitHub

Spill non-morphable split args on non-ARM targets (#71380)

* Spill split args on non-ARM targets

* Add a test

* Work around vectors in varargs being broken
上级 cd553b72
......@@ -991,16 +991,9 @@ void CallArgs::ArgsComplete(Compiler* comp, GenTreeCall* call)
// For RyuJIT backend we will expand a Multireg arg into a GT_FIELD_LIST
// with multiple indirections, so here we consider spilling it into a tmp LclVar.
//
CLANG_FORMAT_COMMENT_ANCHOR;
#ifdef TARGET_ARM
bool isMultiRegArg = (arg.AbiInfo.NumRegs > 0) && (arg.AbiInfo.NumRegs + arg.AbiInfo.GetStackSlotsNumber() > 1);
#else
bool isMultiRegArg = (arg.AbiInfo.NumRegs > 1);
#endif
if (varTypeIsStruct(argx) && !arg.m_needTmp)
{
if (isMultiRegArg)
if ((arg.AbiInfo.NumRegs > 0) && ((arg.AbiInfo.NumRegs + arg.AbiInfo.GetStackSlotsNumber()) > 1))
{
if ((argx->gtFlags & GTF_PERSISTENT_SIDE_EFFECTS) != 0)
{
......
// 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.Intrinsics;
using System.Runtime.CompilerServices;
public class Runtime_71375
{
public static int Main()
{
// At the time of writing this test, the calling convention for incoming vector parameters on
// Windows ARM64 was broken, so only the fact that "Problem" compiled without asserts was
// checked. If/once the above is fixed, this test should be changed to actually call "Problem".
RuntimeHelpers.PrepareMethod(typeof(Runtime_71375).GetMethod("Problem").MethodHandle);
return 100;
}
[MethodImpl(MethodImplOptions.NoInlining)]
static int VarArgs(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, Vector128<int> splitArg, __arglist) => splitArg.GetElement(0);
[MethodImpl(MethodImplOptions.NoInlining)]
public static bool Problem()
{
return VarArgs(0, 0, 0, 0, 0, 0, Vector128<int>.AllBitsSet, __arglist()) != -1;
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- The test tests Windows ARM64 Varargs (managed) calling convention -->
<CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'arm64'">true</CLRTestTargetUnsupported>
<OutputType>Exe</OutputType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -1259,6 +1259,9 @@
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/GitHub_4044/GitHub_4044/*">
<Issue>https://github.com/dotnet/runtimelab/issues/188</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/Runtime_71375/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: Varargs</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/superpmi/superpmicollect/**">
<Issue>CoreCLR test</Issue>
</ExcludeList>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册