-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the register of CAST for contained index operator (#74275)
* Rename test files * Fix index scale for cast * Do not contain index if indir is not containable. * Revert "Do not contain index if indir is not containable." This reverts commit e79d17d92ceb0eed5ae1bfd03c2d1d6b171ab17f. * Instead try to contain the LEA * IsSafeToContainMem() check * Do IsSafeToContainMem() only if needed * Add test case * Fix merge error * fix the test case * review comment
- Loading branch information
1 parent
db4a954
commit fd11209
Showing
6 changed files
with
89 additions
and
24 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
27 changes: 27 additions & 0 deletions
27
src/tests/JIT/Regression/JitBlue/Runtime_74117/Runtime_74117.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,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
unsafe class Runtime_74117 | ||
{ | ||
public unsafe static int Main(string[] args) | ||
{ | ||
byte a = 5; | ||
Problem(ref a, 0); | ||
return 100; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static byte GetByte() => 1; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Problem(ref byte x, int a) | ||
{ | ||
JitUse(&a); | ||
Unsafe.Add(ref x, a) = GetByte(); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void JitUse<T>(T* arg) where T : unmanaged { } | ||
} |
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_74373/Runtime_74373.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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |