diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-10-21 06:40:36 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-10-21 06:40:36 +0000 |
commit | da157e2ee9e12348df78246ee33b244b7cc334df (patch) | |
tree | d082adc3becb58d53fcfa1683ccb991a353b9bd3 /gcc/tree-vectorizer.c | |
parent | 5bf2f16265fdc120bc2aff12729c831f93fad7a1 (diff) | |
download | gcc-da157e2ee9e12348df78246ee33b244b7cc334df.zip gcc-da157e2ee9e12348df78246ee33b244b7cc334df.tar.gz gcc-da157e2ee9e12348df78246ee33b244b7cc334df.tar.bz2 |
Avoid setting current_vector_size in get_vec_alignment_for_array_type
The increase_alignment pass was using get_vectype_for_scalar_type
to get the preferred vector type for each array element type.
This has the effect of carrying over the vector size chosen by
the first successful call to all subsequent calls, whereas it seems
more natural to treat each array type independently and pick the
"best" vector type for each element type.
2019-10-21 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.c (get_vec_alignment_for_array_type): Use
get_vectype_for_scalar_type_and_size instead of
get_vectype_for_scalar_type.
From-SVN: r277223
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 1a0cc93..0c0c018 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1347,7 +1347,8 @@ get_vec_alignment_for_array_type (tree type) gcc_assert (TREE_CODE (type) == ARRAY_TYPE); poly_uint64 array_size, vector_size; - tree vectype = get_vectype_for_scalar_type (strip_array_types (type)); + tree scalar_type = strip_array_types (type); + tree vectype = get_vectype_for_scalar_type_and_size (scalar_type, 0); if (!vectype || !poly_int_tree_p (TYPE_SIZE (type), &array_size) || !poly_int_tree_p (TYPE_SIZE (vectype), &vector_size) |