Skip to content

Commit f028127

Browse files
github-actions[bot]AndyAyersMS
andauthoredAug 19, 2024
[release/9.0-rc1] JIT: fix unused operand marking in LowerHWIntrinsicTernaryLogic (#106574)
* JIT: fix unused operand marking in LowerHWIntrinsicTernaryLogic In `LowerHWIntrinsicTernaryLogic` we do some operand swapping and replacing, and were not accounting for this when marking operands as unused. Fixes #106480. * review feedback --------- Co-authored-by: Andy Ayers <andya@microsoft.com>
1 parent 2a9d9bc commit f028127

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed
 

‎src/coreclr/jit/lowerxarch.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -3927,6 +3927,13 @@ GenTree* Lowering::LowerHWIntrinsicTernaryLogic(GenTreeHWIntrinsic* node)
39273927
}
39283928
}
39293929

3930+
// Update the locals to reflect any operand swaps we did above.
3931+
3932+
op1 = node->Op(1);
3933+
op2 = node->Op(2);
3934+
op3 = node->Op(3);
3935+
assert(op4 == node->Op(4));
3936+
39303937
GenTree* replacementNode = nullptr;
39313938

39323939
switch (useFlags)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// Found by Antigen
5+
// Reduced from 121.36 KB to 3.38
6+
// Further redued by hand
7+
8+
using System;
9+
using System.Runtime.Intrinsics;
10+
using System.Runtime.Intrinsics.X86;
11+
using Xunit;
12+
13+
public class Runtime_106480
14+
{
15+
Vector512<ushort> v512_ushort_102 = Vector512<ushort>.AllBitsSet;
16+
17+
void Problem()
18+
{
19+
if (Avx512F.IsSupported)
20+
{
21+
byte byte_126 = 5;
22+
Avx512F.TernaryLogic(v512_ushort_102, v512_ushort_102, v512_ushort_102, byte_126);
23+
}
24+
}
25+
26+
[Fact]
27+
public static void Test()
28+
{
29+
new Runtime_106480().Problem();
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<Optimize>True</Optimize>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<Compile Include="$(MSBuildProjectName).cs" />
7+
</ItemGroup>
8+
</Project>

0 commit comments

Comments
 (0)