-
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: Handle GT_RETFILT in fgInsertStmtNearEnd (#85420)
Also add some logging for read backs in physical promotion. Fix #85088
- Loading branch information
1 parent
64bd3b1
commit a08818e
Showing
4 changed files
with
77 additions
and
12 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
50 changes: 50 additions & 0 deletions
50
src/tests/JIT/Regression/JitBlue/Runtime_85088/Runtime_85088.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,50 @@ | ||
// 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; | ||
using Xunit; | ||
|
||
public class Runtime_85088 | ||
{ | ||
[Fact] | ||
public static int Test() | ||
{ | ||
Foo f = new(); | ||
try | ||
{ | ||
try | ||
{ | ||
throw new Exception(); | ||
} | ||
finally | ||
{ | ||
f.X = 15; | ||
f.Y = 20; | ||
f.X += f.Y; | ||
f.Y *= f.X; | ||
|
||
// f will be physically promoted and will require a read back after this call. | ||
// Since this is a finally, some platforms will have a GT_RETFILT that we were | ||
// inserting IR after instead of before. | ||
f = Call(f); | ||
} | ||
} | ||
catch | ||
{ | ||
} | ||
|
||
return f.X + f.Y; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static Foo Call(Foo f) | ||
{ | ||
return new Foo { X = 75, Y = 25 }; | ||
} | ||
|
||
private struct Foo | ||
{ | ||
public short X, Y; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_85088/Runtime_85088.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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
<CLRTestEnvironmentVariable Include="DOTNET_JitStressModeNames" Value="STRESS_PHYSICAL_PROMOTION STRESS_PHYSICAL_PROMOTION_COST STRESS_NO_OLD_PROMOTION" /> | ||
</ItemGroup> | ||
</Project> |