forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: broaden cloning invariant checks
Streamline call effects checks. Use wider bit vectors. Closes dotnet#70100.
- Loading branch information
1 parent
1a776dc
commit 046f84c
Showing
4 changed files
with
84 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// 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; | ||
|
||
// Loops in F, G, H should all clone | ||
|
||
class CallAndIndir | ||
{ | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void S() { } | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void F(int[] a, int low, int high, ref int z) | ||
{ | ||
for (int i = low; i < high; i++) | ||
{ | ||
z += a[i]; | ||
S(); | ||
} | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void G(int[] a, int low, int high, ref int z) | ||
{ | ||
for (int i = low; i < high; i++) | ||
{ | ||
z += a[i]; | ||
} | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void H(int[] a, int low, int high, ref int z) | ||
{ | ||
int r = 0; | ||
for (int i = low; i < high; i++) | ||
{ | ||
r += a[i]; | ||
S(); | ||
} | ||
z += r; | ||
} | ||
|
||
public static int Main() | ||
{ | ||
int[] a = new int[] { 1, 2, 3, 4 }; | ||
int z = 0; | ||
F(a, 2, 4, ref z); | ||
G(a, 2, 4, ref z); | ||
H(a, 2, 4, ref z); | ||
return z + 79; | ||
} | ||
} |
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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |