> @@ -7577,8 +7577,14 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
>       values into the low-numbered elements.  */
>    if ((double_reduc || neutral_op)
>        && !nunits_out.is_constant ()
> -      && (SLP_TREE_LANES (slp_node) != 1 && !reduc_chain)
> -      && !operand_equal_p (neutral_op, vect_phi_initial_value 
> (reduc_def_phi))
> +      && (!neutral_op
> +       || (!reduc_chain
> +            && (SLP_TREE_LANES (slp_node) != 1
> +                || (!VECT_REDUC_INFO_REUSED_ACCUMULATOR (reduc_info)
> +                    && STMT_VINFO_DEF_TYPE (stmt_info)
> +                             != vect_reduction_def))
> +            && !operand_equal_p (neutral_op,
> +                                 vect_phi_initial_value (reduc_def_phi))))
>        && !direct_internal_fn_supported_p (IFN_VEC_SHL_INSERT,
>                                         vectype_out, OPTIMIZE_FOR_SPEED))
>      {

Not that I had much exposure to this part before (and not to take anything away 
from your fix) but I find the new condition even more confusing :)
Like nested neutral_op, !neutral_op, reduc_chain, !reduc_chain.

Can we split it somehow or add more comments?

-- 
Regards
 Robin

Reply via email to