-
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/8.0] JIT: Fix illegal IR created by GetElement/ToScalar lowe…
…ring (#91874) * JIT: Fix illegal IR created by GetElement/ToScalar lowering These could create TYP_ULONG/TYP_UINT indirs/LCL_FLD nodes, which are illegal. Fix #91174 * Add test * Fix license header in new test --------- Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
- Loading branch information
1 parent
52ff583
commit ac388a1
Showing
3 changed files
with
50 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
30 changes: 30 additions & 0 deletions
30
src/tests/JIT/Regression/JitBlue/Runtime_91174/Runtime_91174.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,30 @@ | ||
// 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 System.Runtime.Intrinsics; | ||
using Xunit; | ||
|
||
public class Runtime_91174 | ||
{ | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static int Foo(ref Vector256<uint> v1, ref Vector256<uint> v2) | ||
{ | ||
if (Vector256.ToScalar(v1) < Vector256.ToScalar(v2)) | ||
{ | ||
Console.WriteLine("FAIL"); | ||
return 101; | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
[Fact] | ||
public static int TestEntryPoint() | ||
{ | ||
Vector256<uint> v1 = Vector256.Create<uint>(20); | ||
Vector256<uint> v2 = Vector256.Create<uint>(10); | ||
return Foo(ref v1, ref v2); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_91174/Runtime_91174.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,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |