Skip to content

Commit

Permalink
JIT: Fix CndSel(AllTrue, op2, op3) -> op2 "next" node return (dotne…
Browse files Browse the repository at this point in the history
…t#106954)

When lowering makes this transformation it should proceed lowering from
the original next node of the `CndSel`, not from `op2`. If we proceed
lowering from `op2` we will relower some nodes.

Fix dotnet#106876
  • Loading branch information
jakobbotsch authored and mikelle-rogers committed Dec 4, 2024
1 parent c0cab18 commit 7accca1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/coreclr/jit/lowerarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4042,6 +4042,9 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
// node - The hardware intrinsic node of the form
// ConditionalSelect(mask, trueValue, falseValue)
//
// Returns:
// Next node to lower.
//
GenTree* Lowering::LowerHWIntrinsicCndSel(GenTreeHWIntrinsic* cndSelNode)
{
assert(cndSelNode->OperIsHWIntrinsic(NI_Sve_ConditionalSelect));
Expand Down Expand Up @@ -4134,13 +4137,15 @@ GenTree* Lowering::LowerHWIntrinsicCndSel(GenTreeHWIntrinsic* cndSelNode)
op3->SetUnusedValue();
}
op1->SetUnusedValue();

GenTree* next = cndSelNode->gtNext;
BlockRange().Remove(cndSelNode);

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

return op2;
return next;
}
}

Expand Down

0 comments on commit 7accca1

Please sign in to comment.