This patch adds an SVE pattern to recognize the use of a select with an
fadda in the form fadda(ptrue, x, select(mask, y, -0.0)). In this case
the select can be folded away, with the select mask used as the
predicate for fadda. This improves the codegen when vectorizing loops
with ordered fp reductions.
Tests have been added for the f16 cases, although the folding doesn't
currently work for these as -0.0 isn't treated as a legal f16 immediate.
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
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.