Due to the imperfect support of AArch64TargetTransformInfo for SVE Intrinsic, the loop-reduce pass did not obtain the correct information. It will assign the wrong type to the LSRUser, and the generated assembly appears redundant.
This patch is simple support for AArch64TargetTransformInfo. Please have a look and give some advance.
If it's OK, I will go on with other SVE intrinsic support.
How literal is the description of this property in TargetTransformInfo.h. Specifically it says:
However, these are predicated loads and stores and thus they take an extra operand that controls when/if memory is accessed.
Looking at EarlyCSE I can see there exists support for the common masked_load and masked_store intrinsics, where masks are considered (see isNonTargetIntrinsicMatch), but I cannot see such for target intrinsics.
This makes me believe we cannot just populate MemIntrinsicInfo for the SVE intrinsics because the data will be incomplete and potentially cause things like EarlyCSE to do the wrong thing.