Fix ambiguity between vect_get_vec_defs with/without vectype
commit8332b991e42dbffd1f2a7b7aa9a23f5aa242e602
authorRichard Biener <rguenther@suse.de>
Fri, 1 Dec 2023 10:14:53 +0000 (1 11:14 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 1 Dec 2023 11:54:50 +0000 (1 12:54 +0100)
treee8406475ce237b1e007dca695cbf49320c93f5db
parent9e6885467476da963e941986b14ffb57fee6bf50
Fix ambiguity between vect_get_vec_defs with/without vectype

When querying a single set of vector defs with the overloaded
vect_get_vec_defs API then when you try to use the overload with
the vector type specified the call will be ambiguous with the
variant without the vector type.  The following fixes this by
re-ordering the vector type argument to come before the output
def vector argument.

I've changed vectorizable_conversion as that triggered this
so it has coverage showing this works.  The motivation is to
reduce the number of (redundant) get_vectype_for_scalar_type
calls.

* tree-vectorizer.h (vect_get_vec_defs): Re-order arguments.
* tree-vect-stmts.cc (vect_get_vec_defs): Likewise.
(vectorizable_condition): Update caller.
(vectorizable_comparison_1): Likewise.
(vectorizable_conversion): Specify the vector type to be
used for invariant/external defs.
* tree-vect-loop.cc (vect_transform_reduction): Update caller.
gcc/tree-vect-loop.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h