On 22/10/2015 15:15, "Alan Lawrence" <[email protected]> wrote:
>Just one very small point...
>
>On 19/10/15 09:17, Alan Hayward wrote:
>
> > - if (check_reduction
> > - && (!commutative_tree_code (code) || !associative_tree_code
>(code)))
> > + if (check_reduction)
> > {
> > - if (dump_enabled_p ())
> > - report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt,
> > - "reduction: not commutative/associative: ");
> > - return NULL;
> > + if (code != COND_EXPR
> > + && (!commutative_tree_code (code) || !associative_tree_code
>(code)))
> > + {
> > + if (dump_enabled_p ())
> > + report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt,
> > + "reduction: not commutative/associative: ");
> > + return NULL;
> > + }
> > +
> > + if (code == COND_EXPR)
> > + *v_reduc_type = COND_REDUCTION;
>
>Wouldn't this be easier written as
>
>if (code == COND_EXPR)
> *v_reduc_type = COND_REDUCTION;
>else if (!commutative_tree_code (code) || !associative_tree_code (code))
> {...}
>
>? Your call!
>
>Cheers, Alan
Good spot! I suspect that’s slipped through when I’ve rewritten bits.
I’ll add this in with Richard’s suggestion of the change around the call
to vectorizable_condition.
Alan.