-
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.
Implement vpblendvb optimization in the JIT (#69509)
* Move conditonal select handling to lowering, reproduce current behavior * WIP: adding optimization * Add BlendVariable optimization to lowering * Add new test that is optimized by this change * Ran jit-format * Fix test failures due to incorrect ordering of operands * Address PR feedback * Ran jit-format
- Loading branch information
Showing
7 changed files
with
259 additions
and
78 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
src/tests/JIT/Regression/JitBlue/Runtime_67039/Runtime_67039.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,26 @@ | ||
// 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; | ||
using System.Runtime.Intrinsics; | ||
|
||
public class Runtime_67039 | ||
{ | ||
public static int Main() | ||
{ | ||
Vector128<float> left = Vector128.Create(1.0f, 2, 3, 4); | ||
Vector128<float> right = Vector128.Create(4.0f, 3, 2, 1); | ||
|
||
var result = Vector128.ConditionalSelect(Vector128.GreaterThan(left, right), left, right); | ||
|
||
Vector128<float> expectedResult = Vector128.Create(4.0f, 3, 3, 4); | ||
if (result == expectedResult) | ||
{ | ||
return 100; | ||
} | ||
else | ||
{ | ||
return 0; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_67039/Runtime_67039.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> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |