This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] vectorizing conditional expressions (PR tree-optimization/65947)
- From: Alan Lawrence <alan dot lawrence at arm dot com>
- To: Alan Hayward <alan dot hayward at arm dot com>, Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 22 Oct 2015 15:15:37 +0100
- Subject: Re: [PATCH] vectorizing conditional expressions (PR tree-optimization/65947)
- Authentication-results: sourceware.org; auth=none
- References: <D24A647B dot 901F%alan dot hayward at arm dot com>
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