Sorry for the slow review. Alejandro Martinez Vicente <alejandro.martinezvice...@arm.com> writes: > diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c > index 4942c69..7840ed8 100644 > --- a/gcc/tree-vect-loop.c > +++ b/gcc/tree-vect-loop.c > @@ -5881,6 +5881,31 @@ vect_expand_fold_left (gimple_stmt_iterator *gsi, tree > scalar_dest, > return lhs; > } > > +/* Get a masked internal function equivalent to REDUC_FN. VECTYPE_IN is the > + type of the vector input. */ > + > +static internal_fn > +get_masked_reduction_fn (internal_fn reduc_fn, tree vectype_in) > +{ > + internal_fn mask_reduc_fn; > + > + switch (reduc_fn) > + { > + case IFN_FOLD_LEFT_PLUS: > + mask_reduc_fn = IFN_MASK_FOLD_LEFT_PLUS; > + break; > + > + default: > + mask_reduc_fn = IFN_LAST;
Very minor, but it'd be simpler to return IFN_LAST directly here and... > + } > + > + if (mask_reduc_fn != IFN_LAST ...remove this check. > + && direct_internal_fn_supported_p (mask_reduc_fn, vectype_in, > + OPTIMIZE_FOR_SPEED)) > + return mask_reduc_fn; > + return IFN_LAST; > +} > + > /* Perform an in-order reduction (FOLD_LEFT_REDUCTION). STMT_INFO is the > statement that sets the live-out value. REDUC_DEF_STMT is the phi > statement. CODE is the operation performed by STMT_INFO and OPS are OK with that change, thanks. Richard