Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0-rc1] JIT: fix unused operand marking in LowerHWIntrinsicTernaryLogic #106574

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/coreclr/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3927,6 +3927,13 @@ GenTree* Lowering::LowerHWIntrinsicTernaryLogic(GenTreeHWIntrinsic* node)
}
}

// Update the locals to reflect any operand swaps we did above.

op1 = node->Op(1);
op2 = node->Op(2);
op3 = node->Op(3);
assert(op4 == node->Op(4));

GenTree* replacementNode = nullptr;

switch (useFlags)
Expand Down
31 changes: 31 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_106480/Runtime_106480.cs
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.

// Found by Antigen
// Reduced from 121.36 KB to 3.38
// Further redued by hand

using System;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using Xunit;

public class Runtime_106480
{
Vector512<ushort> v512_ushort_102 = Vector512<ushort>.AllBitsSet;

void Problem()
{
if (Avx512F.IsSupported)
{
byte byte_126 = 5;
Avx512F.TernaryLogic(v512_ushort_102, v512_ushort_102, v512_ushort_102, byte_126);
}
}

[Fact]
public static void Test()
{
new Runtime_106480().Problem();
}
}
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>
Loading