-
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.
Make
gtHasRef
pay attention to LCL_FLD nodes (#62568)
* Add a test * Make "gtHasRef" pay attention to LCL_FLD nodes Fixes the interference checks in the forward substitution of relops optimization.
- Loading branch information
1 parent
cc5a650
commit 666e9c7
Showing
3 changed files
with
54 additions
and
4 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
31 changes: 31 additions & 0 deletions
31
src/tests/JIT/Regression/JitBlue/Runtime_62524/Runtime_62524.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,31 @@ | ||
// 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; | ||
|
||
public class Runtime_62524 | ||
{ | ||
public static int Main() | ||
{ | ||
return Problem(new() { Value = 1 }) == 1 ? 100 : 101; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static int Problem(StructWithIndex a) | ||
{ | ||
bool k = a.Value == 1; | ||
a = default; | ||
if (k) | ||
{ | ||
return 1; | ||
} | ||
|
||
return a.Index; | ||
} | ||
} | ||
|
||
public struct StructWithIndex | ||
{ | ||
public int Index; | ||
public int Value; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/tests/JIT/Regression/JitBlue/Runtime_62524/Runtime_62524.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,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<CLRTestBatchPreCommands><![CDATA[ | ||
$(CLRTestBatchPreCommands) | ||
set DOTNET_JitNoStructPromotion=1 | ||
set DOTNET_JitNoCSE=1 | ||
]]></CLRTestBatchPreCommands> | ||
<BashCLRTestPreCommands><![CDATA[ | ||
$(BashCLRTestPreCommands) | ||
export DOTNET_JitNoStructPromotion=1 | ||
export DOTNET_JitNoCSE=1 | ||
]]></BashCLRTestPreCommands> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |