summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2018-10-30 13:38:50 -0700
committerGitHub <noreply@github.com>2018-10-30 13:38:50 -0700
commit1f62917ca7c4d16cb5b4e12eaf4fd35f5cbb8715 (patch)
treeefea50ba5ff5e92bb6cab8f88dd4e070d6886d11 /tests
parent626def86af589734999a0e62d3a83c2acb9de54a (diff)
downloadcoreclr-1f62917ca7c4d16cb5b4e12eaf4fd35f5cbb8715.tar.gz
coreclr-1f62917ca7c4d16cb5b4e12eaf4fd35f5cbb8715.tar.bz2
coreclr-1f62917ca7c4d16cb5b4e12eaf4fd35f5cbb8715.zip
Fix `JitStressRegs=0x1` issue with `RefTypeUpperVectorSaveDef`. (#20623)
* Add a repro test. * Fix the issue. * Add comments
Diffstat (limited to 'tests')
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.cs62
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.csproj35
2 files changed, 97 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.cs b/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.cs
new file mode 100644
index 0000000000..23bb5e9768
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.cs
@@ -0,0 +1,62 @@
+// 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.Numerics;
+using System.Runtime.CompilerServices;
+
+// Based on DevDiv_714266, the issue reporoduced with JitStressRegs=0x1.
+// `minRegCandidateCount` for `RefTypeUpperVectorSaveDef` did not count one temporary register
+// that it used for the save. So if we had a call that did not require any registers (no defs/uses)
+// then we set `minRegCandidateCount = 0`for `RefTypeUpperVectorSaveDef` `refPosition`
+// and was not able to find a register for do the saving.
+
+class DevDiv_714266
+{
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ public static void CallWithoutUsesAndDefs()
+ {
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static void MethodWithManyLiveVectors()
+ {
+ Vector<float> v = new Vector<float>();
+
+ Vector<float> v0 = -v;
+ Vector<float> v1 = -v;
+ Vector<float> v2 = -v;
+ Vector<float> v3 = -v;
+ Vector<float> v4 = -v;
+ Vector<float> v5 = -v;
+ Vector<float> v6 = -v;
+ Vector<float> v7 = -v;
+ Vector<float> v8 = -v;
+ Vector<float> v9 = -v;
+
+ CallWithoutUsesAndDefs();
+
+ GC.KeepAlive(new object[10]
+ {
+ v1,
+ v2,
+ v3,
+ v4,
+ v5,
+ v6,
+ v7,
+ v8,
+ v9,
+ v0
+ });
+ }
+
+ static int Main()
+ {
+ MethodWithManyLiveVectors();
+ return 100;
+ }
+
+}
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.csproj b/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.csproj
new file mode 100644
index 0000000000..bcc4883f33
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_714266/DevDiv_714266.csproj
@@ -0,0 +1,35 @@
+<?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>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <CLRTestPriority>1</CLRTestPriority>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(MSBuildProjectName).cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>