Instcombine will canonicalize select(c, binop(a, b), a) to binop(select(c, b, identityvalue), a). The original select form makes a more natural form for vector predicated operations for vector architectures like SVE where predication is well supported. This patch enables shouldFoldSelectWithIdentityConstant for SVE so that more predicated instructions can be generated, helping simplify the handling with identity constants.
Predicated FMA patterns have also been adjusted here as they need to look at FMF's. Other operations like add/sub, mul, and/or/xor and mla/mls I have other patches for, most of which are fairly simple.
There is one test (scalable_int_min_max) that increases in size. There are multiple selects that could be combined into a single select but does not currently fold.
This needs to be hasSVEorSME because we use the same patterns for SME. That said, I'm wondering if it can be emitted altogether given knowing VT is a legal scalable vector should be sufficient.