diff options
author | Carol Eidt <carol.eidt@microsoft.com> | 2018-12-20 15:40:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 15:40:55 -0800 |
commit | b0996f3c12faf1d1b5d965087cfa62fc8c84a75b (patch) | |
tree | 678a023479c3ce0a96d5bb360bc3ff05dcac0766 | |
parent | 04c4df8c9ecf53499838945197af70f11ddf840a (diff) | |
parent | ba3b4025a6974e5266181760003cf7552f8ae199 (diff) | |
download | coreclr-b0996f3c12faf1d1b5d965087cfa62fc8c84a75b.tar.gz coreclr-b0996f3c12faf1d1b5d965087cfa62fc8c84a75b.tar.bz2 coreclr-b0996f3c12faf1d1b5d965087cfa62fc8c84a75b.zip |
Merge pull request #21589 from CarolEidt/Fix21546
Transform SIMD8 to FIELD_LIST if promoted
-rw-r--r-- | src/jit/morph.cpp | 2 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs | 78 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj | 33 |
3 files changed, 112 insertions, 1 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index 0a6a6fc0b1..ebe41052b2 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -4174,7 +4174,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) #if defined(_TARGET_X86_) if (isStructArg) { - GenTree* lclNode = fgIsIndirOfAddrOfLocal(argx); + GenTree* lclNode = argx->OperIs(GT_LCL_VAR) ? argx : fgIsIndirOfAddrOfLocal(argx); if ((lclNode != nullptr) && (lvaGetPromotionType(lclNode->AsLclVarCommon()->gtLclNum) == Compiler::PROMOTION_TYPE_INDEPENDENT)) { diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs new file mode 100644 index 0000000000..1d94212921 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs @@ -0,0 +1,78 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; + +using Point = System.Numerics.Vector2; + +namespace GitHub_21546 +{ + public class test + { + static Point checkA; + static Point checkB; + static Point checkC; + static int returnVal; + + [MethodImpl(MethodImplOptions.NoInlining)] + static void check(Point a, Point b, Point c) + { + if (a != checkA) + { + Console.WriteLine($"A doesn't match. Should be {checkA} but is {a}"); + returnVal = -1; + } + if (b != checkB) + { + Console.WriteLine($"B doesn't match. Should be {checkB} but is {b}"); + returnVal = -1; + } + if (c != checkC) + { + Console.WriteLine($"C doesn't match. Should be {checkC} but is {c}"); + returnVal = -1; + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void FailureCase(List<Point> p) + { + Point p1 = p[0]; + Point p2 = p.Last(); + + check(p1, p[1], p2); + check(p1, p[1], p2); + check(p1, p[1], p2); + } + + static Point NextPoint(Random random) + { + return new Point( + (float)random.NextDouble(), + (float)random.NextDouble() + ); + } + + static int Main() + { + returnVal = 100; + Random random = new Random(13); + List<Point> p = new List<Point>(); + + checkA = NextPoint(random); + p.Add(checkA); + checkB = NextPoint(random); + p.Add(checkB); + checkC = NextPoint(random); + p.Add(checkC); + + FailureCase(p); + + return returnVal; + } + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj new file mode 100644 index 0000000000..42f8a01f39 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{2649FAFE-07BF-4F93-8120-BA9A69285ABB}</ProjectGuid> + <OutputType>Exe</OutputType> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + </PropertyGroup> + <!-- Default configurations to help VS understand the configurations --> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup> + <PropertyGroup> + <DebugType>None</DebugType> + <Optimize>True</Optimize> + </PropertyGroup> + <ItemGroup> + <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> + <Visible>False</Visible> + </CodeAnalysisDependentAssemblyPaths> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="$(MSBuildProjectName).cs" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup> +</Project>
\ No newline at end of file |