-
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.
[release/6.0] Disable folding small-typed returned indirections (#82846)
* Normalize returns after optimizing returned indirs This ensures we normalize returned indirs of locals, even when we fold it into an access of a promoted local's field. This may change a signed indir into access of an unsigned field, which may need a sign-extending cast to be inserted. It is not ideal that fgMorphRetInd can 'lose' this information, but given that it is a specialized optimization it seems the simplest solution is to just rely on the follow-up normalization. Fix #61359 * Conservative fix * Remove spurious diff --------- Co-authored-by: Jakob Botsch Nielsen <[email protected]>
- Loading branch information
1 parent
677c557
commit cbfaba5
Showing
3 changed files
with
40 additions
and
0 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
19 changes: 19 additions & 0 deletions
19
src/tests/JIT/Regression/JitBlue/Runtime_61359/Runtime_61359.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,19 @@ | ||
// 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; | ||
|
||
public unsafe class Runtime_61359 | ||
{ | ||
public static int Main() | ||
{ | ||
return HalfToInt16Bits((Half)(-1)) == -17408 ? 100 : -1; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static short HalfToInt16Bits(Half h) | ||
{ | ||
return *(short*)&h; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/tests/JIT/Regression/JitBlue/Runtime_61359/Runtime_61359.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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |