On Fri, 11 Mar 2022, Roger Sayle wrote: +(match vec_same_elem_p + CONSTRUCTOR@0 + (if (uniform_vector_p (TREE_CODE (@0) == SSA_NAME + ? gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0)) : @0))))
Ah, I didn't remember we needed that, we don't seem to be very consistent about it. Probably for this reason, the transformation "Prefer vector1 << scalar to vector1 << vector2" does not match
typedef int vec __attribute__((vector_size(16))); vec f(vec a, int b){ vec bb = { b, b, b, b }; return a << bb; } which is only optimized at vector lowering time. +/* Push VEC_PERM earlier if that may help FMA perception (PR101895). */ +(for plusminus (plus minus) + (simplify + (plusminus (vec_perm (mult@0 @1 vec_same_elem_p@2) @0 @3) @4) + (plusminus (mult (vec_perm @1 @1 @3) @2) @4))) Don't you want :s on mult and vec_perm? -- Marc Glisse