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

Fix multireg promotion on arm64 #91260

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 21 additions & 0 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7483,7 +7483,28 @@ bool Lowering::CheckMultiRegLclVar(GenTreeLclVar* lclNode, int registerCount)
{
if (registerCount == varDsc->lvFieldCnt)
{
int hfaFields = 0;
canEnregisterAsMultiReg = true;
for (unsigned i = 0; i < varDsc->lvFieldCnt; ++i)
{
LclVarDsc* fieldDesc = comp->lvaGetDesc(varDsc->lvFieldLclStart + i);
if (fieldDesc->lvIsHfa())
{
// Let's see if all fields are HFAs
hfaFields++;
}
else if (((fieldDesc->lvFldOffset % REGSIZE_BYTES) != 0) || (fieldDesc->lvSize() >= REGSIZE_BYTES))
{
// Otherwise, we expect two ints/longs
canEnregisterAsMultiReg = false;
break;
}
}
if (hfaFields != registerCount)
{
// A mix of HFAs with non-HFAs
canEnregisterAsMultiReg = false;
}
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.aa

// Found by Antigen

using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Numerics;
using Xunit;

public class Runtime_91214
{
[Fact]
public static void TestEntryPoint()
{
Method0();
}

public struct S
{
public Vector3 v3;
public bool b;
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static S Method2()
{
return default;
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static void Method0()

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build mono Common Pri0 Test Build AnyOS AnyCPU release)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release AllSubsets_Mono_RuntimeTests monointerpreter)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Interpreter_RuntimeTests monointerpreter)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/Users/runner/work/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/Users/runner/work/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 32 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L32

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(32,24): error xUnit1013: Public method 'Method0' on test class 'Runtime_91214' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]
{
S s = Method2();
Log(null, s.v3);
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static void Log(object a, object b) { }

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build mono Common Pri0 Test Build AnyOS AnyCPU release)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release AllSubsets_Mono_RuntimeTests monointerpreter)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Interpreter_RuntimeTests monointerpreter)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/Users/runner/work/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/Users/runner/work/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]

Check failure on line 39 in src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs

View check run for this annotation

Azure Pipelines / runtime

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs#L39

src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.cs(39,24): error xUnit1013: Public method 'Log' on test class 'Runtime_91214' should be marked as a Theory. Reduce the visibility of the method, or add a Theory attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013) [/__w/1/s/src/tests/JIT/Regression/JitBlue/Runtime_91214/Runtime_91214.csproj]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
Loading