[PATCH] D129623: [AArch64][SVE] Fold fadda(ptrue, x, select(mask, y, -0.0)) into fadda(mask, x, y)
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 09:36:28 PDT 2022
paulwalker-arm added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:288-291
+ (AArch64fadda_p_node (nxv2i1 (SVEAllActive)), node:$op2,
+ (vselect node:$op1, node:$op3, (splat_vector (f32 fpimm_minus0)))),
+ (AArch64fadda_p_node (nxv4i1 (SVEAllActive)), node:$op2,
+ (vselect node:$op1, node:$op3, (splat_vector (f32 fpimm_minus0)))),
----------------
You shouldn't need duplicate patterns within the PatFrag based on types as this kind of defeats the point of a PatFrags. The main exception to this is the scalar operand of `splat_vector` due to the way it's defined.
The problem here is that you cannot infer the types which is down to the loose definition of `AArch64fadda_p_node` or rather `SDT_AArch64ReduceWithInit`. You'll have to double check it's correct but when I tighten it up to say
```
SDTCisVec<1>, SDTCVecEltisVT<1,i1>, SDTCisVec<3>, SDTCisSameNumEltsAs<1,3>
```
i.e. The first operand is a predicate vector and has the same number of elements as the third operand.
I only needed a single f32 and f64 pattern without any other types mentioned.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129623/new/
https://reviews.llvm.org/D129623
More information about the llvm-commits
mailing list