-
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.
Do not fold mismatched
OBJ(ADDR(LCL_VAR))
(#69271)
* Do not fold mismatched OBJ(ADDR(LCL_VAR)) The transforms in question could fold, e. g. "OBJ<8>(ADDR(LCL_VAR<16>))" to just the "LCL_VAR", necessitating workarounds in block morphing that had to rematerialize the block node to restore IR's validity. It is better to simply not create questionable IR in the first place. * Add a test * Re-enable tests * Fix regressions By using layout compatibility in "gtNewStructVal" instead of handle equality. This is safe to do because "gtNewStructVal" is only used in contexts of block copies (as opposed to call arguments).
- Loading branch information
1 parent
af2a48d
commit 6134ee9
Showing
8 changed files
with
117 additions
and
48 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
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
31 changes: 31 additions & 0 deletions
31
src/tests/JIT/Regression/JitBlue/Runtime_69232/Runtime_69232.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.Numerics; | ||
using System.Runtime.CompilerServices; | ||
|
||
public unsafe class Runtime_69232 | ||
{ | ||
public static int Main() | ||
{ | ||
return Problem(new(1, 1, 1, 1)) ? 101 : 100; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static bool Problem(Vector4 vtor) | ||
{ | ||
FakeVtor a = GetFakeVtor(vtor); | ||
|
||
return a.FirstFlt != 1; | ||
} | ||
|
||
private static FakeVtor GetFakeVtor(Vector4 v) => *(FakeVtor*)&v; | ||
|
||
struct FakeVtor | ||
{ | ||
public float FirstFlt; | ||
public float SecondFlt; | ||
public float ThirdFlt; | ||
public float FourthFlt; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_69232/Runtime_69232.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> |
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