-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: more fixes for VN loop dependence tracking (#56184)
Specify `Overwrite` when setting loop dependence map entries, as we may refine the initial result. Fixes #56174. Extract loop dependence of `VNF_PhiMemoryDef`. Fixes new case noted in #55936, and 13/16 or so other cases Jakob sent me privately. Also update a comment and fix tests to work better with jitstress per other notes on that PR.
- Loading branch information
1 parent
eaaf43f
commit b18ff29
Showing
5 changed files
with
110 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/tests/JIT/Regression/JitBlue/Runtime_54118/Runtime_54118_1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Generated by Fuzzlyn v1.2 on 2021-07-22 13:37:14 | ||
// Seed: 14815563263006255362 | ||
// Reduced from 12.9 KiB to 0.4 KiB in 00:00:17 | ||
// Debug: Outputs 1 | ||
// Release: Outputs 0 | ||
|
||
// VN must properly report loop dependence of a PhiMemoryDef | ||
// or the jit will hoist the load of vr7[0] past the store. | ||
|
||
public class Runtime_54118 | ||
{ | ||
static short[] s_2; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static bool Eval(byte b) => b == 100; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static int Bound() => 2; | ||
|
||
public static int Main() | ||
{ | ||
byte[] vr7 = new byte[]{0}; | ||
bool vr11 = default(bool); | ||
bool ok = false; | ||
int k = Bound(); | ||
for (int vr9 = 0; vr9 < k; vr9++) | ||
{ | ||
if (vr11) | ||
{ | ||
s_2[0] = 0; | ||
} | ||
|
||
vr7[0] = 100; | ||
byte vr10 = vr7[0]; | ||
ok = Eval(vr10); | ||
} | ||
|
||
return ok ? 100 : -1; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/tests/JIT/Regression/JitBlue/Runtime_54118/Runtime_54118_1.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |