aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 07:15:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 07:15:20 +0000
commit86e3672871beff63eebb195642566224c9f80891 (patch)
tree2904209c48ac70db2e36ec1f0c1f7534c4b09f0a /gcc/omp-low.c
parent87133c45a06aa9c04cb6bc13b3b0733ec43efcec (diff)
downloadgcc-86e3672871beff63eebb195642566224c9f80891.zip
gcc-86e3672871beff63eebb195642566224c9f80891.tar.gz
gcc-86e3672871beff63eebb195642566224c9f80891.tar.bz2
poly_int: current_vector_size and TARGET_AUTOVECTORIZE_VECTOR_SIZES
This patch changes the type of current_vector_size to poly_uint64. It also changes TARGET_AUTOVECTORIZE_VECTOR_SIZES so that it fills in a vector of possible sizes (as poly_uint64s) instead of returning a bitmask. The documentation claimed that the hook didn't need to include the default vector size (returned by preferred_simd_mode), but that wasn't consistent with the omp-low.c usage. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.h (vector_sizes, auto_vector_sizes): New typedefs. * target.def (autovectorize_vector_sizes): Return the vector sizes by pointer, using vector_sizes rather than a bitmask. * targhooks.h (default_autovectorize_vector_sizes): Update accordingly. * targhooks.c (default_autovectorize_vector_sizes): Likewise. * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes): Likewise. * config/arc/arc.c (arc_autovectorize_vector_sizes): Likewise. * config/arm/arm.c (arm_autovectorize_vector_sizes): Likewise. * config/i386/i386.c (ix86_autovectorize_vector_sizes): Likewise. * config/mips/mips.c (mips_autovectorize_vector_sizes): Likewise. * omp-general.c (omp_max_vf): Likewise. * omp-low.c (omp_clause_aligned_alignment): Likewise. * optabs-query.c (can_vec_mask_load_store_p): Likewise. * tree-vect-loop.c (vect_analyze_loop): Likewise. * tree-vect-slp.c (vect_slp_bb): Likewise. * doc/tm.texi: Regenerate. * tree-vectorizer.h (current_vector_size): Change from an unsigned int to a poly_uint64. * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Take the vector size as a poly_uint64 rather than an unsigned int. (current_vector_size): Change from an unsigned int to a poly_uint64. (get_vectype_for_scalar_type): Update accordingly. * tree.h (build_truth_vector_type): Take the size and number of units as a poly_uint64 rather than an unsigned int. (build_vector_type): Add a temporary overload that takes the number of units as a poly_uint64 rather than an unsigned int. * tree.c (make_vector_type): Likewise. (build_truth_vector_type): Take the number of units as a poly_uint64 rather than an unsigned int. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256131
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index f6267ec..efbdd05 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3381,9 +3381,11 @@ omp_clause_aligned_alignment (tree clause)
/* Otherwise return implementation defined alignment. */
unsigned int al = 1;
opt_scalar_mode mode_iter;
- int vs = targetm.vectorize.autovectorize_vector_sizes ();
- if (vs)
- vs = 1 << floor_log2 (vs);
+ auto_vector_sizes sizes;
+ targetm.vectorize.autovectorize_vector_sizes (&sizes);
+ poly_uint64 vs = 0;
+ for (unsigned int i = 0; i < sizes.length (); ++i)
+ vs = ordered_max (vs, sizes[i]);
static enum mode_class classes[]
= { MODE_INT, MODE_VECTOR_INT, MODE_FLOAT, MODE_VECTOR_FLOAT };
for (int i = 0; i < 4; i += 2)
@@ -3394,16 +3396,16 @@ omp_clause_aligned_alignment (tree clause)
machine_mode vmode = targetm.vectorize.preferred_simd_mode (mode);
if (GET_MODE_CLASS (vmode) != classes[i + 1])
continue;
- while (vs
- && GET_MODE_SIZE (vmode) < vs
+ while (maybe_ne (vs, 0U)
+ && known_lt (GET_MODE_SIZE (vmode), vs)
&& GET_MODE_2XWIDER_MODE (vmode).exists ())
vmode = GET_MODE_2XWIDER_MODE (vmode).require ();
tree type = lang_hooks.types.type_for_mode (mode, 1);
if (type == NULL_TREE || TYPE_MODE (type) != mode)
continue;
- type = build_vector_type (type, GET_MODE_SIZE (vmode)
- / GET_MODE_SIZE (mode));
+ unsigned int nelts = GET_MODE_SIZE (vmode) / GET_MODE_SIZE (mode);
+ type = build_vector_type (type, nelts);
if (TYPE_MODE (type) != vmode)
continue;
if (TYPE_ALIGN_UNIT (type) > al)