This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix PR tree-optimization/52091


Hi,

The testcase in the PR fails when the vectorizer tries to create a
reduction init statement for a non-reduction use. This patch adds a check
that if operand's def stmt is a double reduction phi node, the use should
be a phi node too.

Bootstrapped and tested on powerpc64-suse-linux.
Committed.

Ira

ChangeLog:

	PR tree-optimization/52091
	* tree-vectorizer.h (vect_is_simple_use): Add an argument.
	(vect_is_simple_use_1): Likewise.
	* tree-vect-loop.c (vectorizable_reduction): Update calls
	to vect_is_simple_use_1 and vect_is_simple_use.
	(vectorizable_live_operation): Likewise.
	* tree-vect-patterns.c (widened_name_p,
	vect_recog_vector_vector_shift_pattern, check_bool_pattern):
	Likewise.
	* tree-vect-stmts.c (process_use, vect_get_vec_def_for_operand,
	vectorizable_call, vectorizable_conversion,
	vectorizable_assignment, vectorizable_shift,
	vectorizable_operation, vectorizable_store, vectorizable_load):
	Likewise.
	(vect_is_simple_cond): Add an argument, pass it to
	vect_is_simple_use_1.
	(vectorizable_condition): Update calls to vect_is_simple_cond,
	vect_is_simple_use.
	(vect_is_simple_use): Add an argument, the statement in which
	OPERAND is used.  Check that if OPERAND's def stmt is a double
	reduction phi node, the use is a phi node too.
	(vect_is_simple_use_1): Add an argument, pass it to
	vect_is_simple_use.
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Update a call
	to vect_is_simple_use.

testsuite/ChangeLog:

	PR tree-optimization/52091
	* gcc.dg/vect/pr52091.c: New test.

(See attached file: patch.txt)

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]