BuildHWIntrinsic in lsraarm64.cpp is getting a little complicated, especially when it comes to handling RMW intrinsics and when ConditionalSelect wraps a RMW intrinsic.
The logic that handles the RMW intrinsics makes assumptions on which operand on the intrinsic is the RMW node based on flags. Instead, as mentioned in the discussion, we really just need to have a function that tells us which operand is the RMW node and then BuildHWIntrinsic will know how to handle it in a general way.
Discussion: https://github.com/dotnet/runtime/pull/104704#discussion_r1674828420
BuildHWIntrinsic
inlsraarm64.cpp
is getting a little complicated, especially when it comes to handling RMW intrinsics and whenConditionalSelect
wraps a RMW intrinsic.The logic that handles the RMW intrinsics makes assumptions on which operand on the intrinsic is the RMW node based on flags. Instead, as mentioned in the discussion, we really just need to have a function that tells us which operand is the RMW node and then
BuildHWIntrinsic
will know how to handle it in a general way.