Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions eng/pipelines/coreclr/jitstress-isas-sve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pr:
- src/coreclr/jit/emitarm64sve.cpp
- src/coreclr/jit/emitfmtsarm64sve.h
- src/coreclr/jit/lsraarm64.cpp
- src/coreclr/jit/lowerarmarch.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add entries for following?

  • lsraarmarch.cpp
  • codegenarmarch.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Also alphabetically ordered the list.


schedules:
- cron: "30 19 * * 6"
Expand Down
46 changes: 44 additions & 2 deletions src/coreclr/jit/lowerarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4035,7 +4035,7 @@ GenTree* Lowering::LowerHWIntrinsicCndSel(GenTreeHWIntrinsic* cndSelNode)
GenTree* nestedOp2 = nestedCndSel->Op(2);
GenTree* nestedOp3 = nestedCndSel->Op(3);

JITDUMP("lowering ConditionalSelect HWIntrinisic (before):\n");
JITDUMP("lowering nested ConditionalSelect HWIntrinisic (before):\n");
DISPTREERANGE(BlockRange(), cndSelNode);
JITDUMP("\n");

Expand All @@ -4057,13 +4057,55 @@ GenTree* Lowering::LowerHWIntrinsicCndSel(GenTreeHWIntrinsic* cndSelNode)
BlockRange().Remove(nestedOp1);
BlockRange().Remove(nestedCndSel);

JITDUMP("lowering ConditionalSelect HWIntrinisic (after):\n");
JITDUMP("lowering nested ConditionalSelect HWIntrinisic (after):\n");
DISPTREERANGE(BlockRange(), cndSelNode);
JITDUMP("\n");

return cndSelNode;
}
}
else if (op1->IsMaskAllBitsSet())
{
// Any case where op2 is not an embedded HWIntrinsic
if (!op2->OperIsHWIntrinsic() ||
!HWIntrinsicInfo::IsEmbeddedMaskedOperation(op2->AsHWIntrinsic()->GetHWIntrinsicId()))
{
JITDUMP("lowering ConditionalSelect HWIntrinisic (before):\n");
DISPTREERANGE(BlockRange(), cndSelNode);
JITDUMP("\n");

// Transform
// CndSel(AllTrue, op2, op3) to
// op2

LIR::Use use;
if (BlockRange().TryGetUse(cndSelNode, &use))
{
use.ReplaceWith(op2);
}
else
{
op2->SetUnusedValue();
}

if (op3->IsMaskZero())
{
BlockRange().Remove(op3);
}
else
{
op3->SetUnusedValue();
}
op1->SetUnusedValue();
BlockRange().Remove(cndSelNode);

JITDUMP("lowering ConditionalSelect HWIntrinisic (after):\n");
DISPTREERANGE(BlockRange(), op2);
JITDUMP("\n");

return op2;
}
}

ContainCheckHWIntrinsic(cndSelNode);
return cndSelNode->gtNext;
Expand Down
31 changes: 31 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_105719/Runtime_105719.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.

using Xunit;
using System;
using System.Runtime.CompilerServices;
using System.Numerics;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;

public class Runtime_105723
{
[Fact]
public static void TestEntryPoint()
{
if (Sve.IsSupported)
{
var vr3 = Sve.CreateTrueMaskInt32();
var vr4 = Vector.Create<int>(1);
var vr5 = Vector128.CreateScalar(0).AsVector();
Vector<int> vr6 = Sve.ConditionalSelect(vr3, vr4, vr5);
Consume(vr6);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static void Consume(Vector<int> v)
{
;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
<NoWarn>$(NoWarn);SYSLIB5003</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>