aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-11-16 10:36:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-11-16 10:36:20 +0000
commitf884cd2fea62eebe71b422e1c97e550958dd42ae (patch)
treeef31abcde95dea1776d82c4551525b79d39e9687 /gcc/tree-vect-loop.c
parent9b75f56d4b7951c60a656396dddd4a65787b95bc (diff)
downloadgcc-f884cd2fea62eebe71b422e1c97e550958dd42ae.zip
gcc-f884cd2fea62eebe71b422e1c97e550958dd42ae.tar.gz
gcc-f884cd2fea62eebe71b422e1c97e550958dd42ae.tar.bz2
Extend can_duplicate_and_interleave_p to mixed-size vectors
This patch makes can_duplicate_and_interleave_p cope with mixtures of vector sizes, by using queries based on get_vectype_for_scalar_type instead of directly querying GET_MODE_SIZE (vinfo->vector_mode). int_mode_for_size is now the first check we do for a candidate mode, so it seemed better to restrict it to MAX_FIXED_MODE_SIZE. This avoids unnecessary work and avoids trying to create scalar types that the target might not support. 2019-11-16 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (can_duplicate_and_interleave_p): Take an element type rather than an element mode. * tree-vect-slp.c (can_duplicate_and_interleave_p): Likewise. Use get_vectype_for_scalar_type to query the natural types for a given element type rather than basing everything on GET_MODE_SIZE (vinfo->vector_mode). Limit int_mode_for_size query to MAX_FIXED_MODE_SIZE. (duplicate_and_interleave): Update call accordingly. * tree-vect-loop.c (vectorizable_reduction): Likewise. From-SVN: r278335
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index e6ba91c..37290fa 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -6365,10 +6365,9 @@ vectorizable_reduction (stmt_vec_info stmt_info, slp_tree slp_node,
that value needs to be repeated for every instance of the
statement within the initial vector. */
unsigned int group_size = SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
- scalar_mode elt_mode = SCALAR_TYPE_MODE (TREE_TYPE (vectype_out));
if (!neutral_op
&& !can_duplicate_and_interleave_p (loop_vinfo, group_size,
- elt_mode))
+ TREE_TYPE (vectype_out)))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,