summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2018-02-14 15:38:58 -0800
committerGitHub <noreply@github.com>2018-02-14 15:38:58 -0800
commit94510ef330ad1ecb31540a949a68d4e09c164c64 (patch)
tree37161f66b2cf10ad90232a23c1700026b3734e27 /tests/src/JIT/Regression
parent7910a37a1cf5b963997994b6884475c224585e90 (diff)
downloadcoreclr-94510ef330ad1ecb31540a949a68d4e09c164c64.tar.gz
coreclr-94510ef330ad1ecb31540a949a68d4e09c164c64.tar.bz2
coreclr-94510ef330ad1ecb31540a949a68d4e09c164c64.zip
[RyuJit] Stack level setter (#15597)
* create a new phase: StackLevelSetter * add repro * Fix grammar mistakes * use the default hash * delete values from the map. * create gentree::OperIsPutArgStkOrSplit * fix more comments * delete an extra condition that is always true * use GTSTRUCT_2_SPECIAL for PutArgStk * extract fgUseThrowHelperBlocks * optimize memory for amd64 and additional checks for x86 * change checks The previous version was wrong, because morph can call fgAddCodeRef several times for the same instruction during different phases. * fix comments * fix genJumpToThrowHlpBlk * small ref in genJumpToThrowHlpBlk * fix rebase problems. * use fgUseThrowHelperBlocks instead of !opts.compDbgCode * add throwHelperBlocksUsed for throughput.
Diffstat (limited to 'tests/src/JIT/Regression')
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il57
-rw-r--r--tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.ilproj34
2 files changed, 91 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il b/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il
new file mode 100644
index 0000000000..1a63094f31
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il
@@ -0,0 +1,57 @@
+// 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.
+
+.assembly extern System.Runtime {auto}
+.assembly extern System.Console {auto}
+.assembly DevDiv_534476 {}
+
+// The test showed a problem with stack level calculations during morph phase
+// that did not reflect code movements in the later phases.
+
+// In this case a helper call, created for IL_002c, will create a put_arg, but it will be moved from IL_0026 to IL_0014.
+// This put_arg movement will affect throw edge at IL_0021, that will have incorrect stack level.
+
+.class private auto ansi beforefieldinit DevDiv_534476.ILGEN_CLASS
+ extends [System.Runtime]System.Object
+{
+ .method private static float32
+ ILGEN_METHOD(uint64 e) cil managed
+ {
+ .maxstack 46
+ .locals init (native unsigned int, bool)
+ IL_0000: ldarg 0x0000
+ ldc.i4.1
+ IL_0012: conv.ovf.u2.un
+ IL_0014: shr.un
+ IL_001b: ldarg 0x0000
+ IL_0021: conv.ovf.u4.un // the first throw block edge.
+ IL_0023: ldloc.s 0x01
+ IL_0025: mul // mul value is known to be null.
+ IL_0026: shl // long decomposition will replace IL_0026 with IL_0014.
+ IL_002c: conv.r4 // will be transformed into helper call, with put_arg before IL_0021.
+ IL_0009: ckfinite // to create the second throw edge.
+
+ IL_002d: ret
+ } // end of method ILGEN_CLASS::ILGEN_METHOD
+
+.method private hidebysig static int32 Main(string[] args) cil managed
+{
+ .entrypoint
+ // Code size 30 (0x1e)
+ .maxstack 6
+ .locals init (int32 V_0)
+ IL_0000: nop
+ IL_000d: ldc.i4.1
+ IL_000e: conv.i8
+ IL_0011: call float32 DevDiv_534476.ILGEN_CLASS::ILGEN_METHOD(uint64)
+ IL_0016: pop
+ IL_0017: ldc.i4.s 100
+ IL_0019: stloc.0
+ IL_001a: br.s IL_001c
+ IL_001c: ldloc.0
+ IL_001d: ret
+} // end of method ILGEN_CLASS::Main
+
+
+} // end of class DevDiv_534476.ILGEN_CLASS
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.ilproj b/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.ilproj
new file mode 100644
index 0000000000..b2754edced
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.ilproj
@@ -0,0 +1,34 @@
+<?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>
+ </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>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="DevDiv_534476.il" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>