Skip to content

Commit a16df1d

Browse files
authored
Check containment for op3 for ternary instruction (#116229)
* Check containment for op3 for ternary instruction * review comment
1 parent 73882e8 commit a16df1d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/coreclr/jit/lsraxarch.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,8 +2946,18 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou
29462946
}
29472947
#endif // TARGET_AMD64
29482948

2949-
srcCount += isRMW ? BuildDelayFreeUses(op3, op1, op3RegCandidates)
2950-
: BuildOperandUses(op3, op3RegCandidates);
2949+
if (op3->OperIs(GT_HWINTRINSIC) && op3->AsHWIntrinsic()->OperIsMemoryLoad() && op3->isContained())
2950+
{
2951+
srcCount += BuildAddrUses(op3->AsHWIntrinsic()->Op(1), op3RegCandidates);
2952+
}
2953+
else if (isRMW && !op3->isContained())
2954+
{
2955+
srcCount += BuildDelayFreeUses(op3, op1, op3RegCandidates);
2956+
}
2957+
else
2958+
{
2959+
srcCount += BuildOperandUses(op3, op3RegCandidates);
2960+
}
29512961

29522962
if (op4 != nullptr)
29532963
{

0 commit comments

Comments
 (0)