r275962 - in /trunk/gcc: ChangeLog tree-vect-lo...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Thu Sep 19 13:33:00 GMT 2019


Author: rsandifo
Date: Thu Sep 19 13:33:55 2019
New Revision: 275962

URL: https://gcc.gnu.org/viewcvs?rev=275962&root=gcc&view=rev
Log:
Enforce correct COND_EXPR order for EXTRACT_LAST_REDUCTION

For conditional reductions, the "then" value needs to be the candidate
value calculated by this iteration while the "else" value needs to be
the result carried over from previous iterations.  If the COND_EXPR
is the other way around, we need to swap it.

2019-09-19  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vectorizable_condition): Take an int
	reduction index instead of a boolean flag.
	* tree-vect-stmts.c (vectorizable_condition): Likewise.
	Swap the "then" and "else" values for EXTRACT_LAST_REDUCTION
	reductions if the reduction accumulator is the "then" rather
	than the "else" value.
	(vect_analyze_stmt): Update call accordingly.
	(vect_transform_stmt): Likewise.
	* tree-vect-loop.c (vectorizable_reduction): Likewise,
	asserting that the index is > 0.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vect-loop.c
    trunk/gcc/tree-vect-stmts.c
    trunk/gcc/tree-vectorizer.h



More information about the Gcc-cvs mailing list