On Fri, Oct 25, 2019 at 2:37 PM Richard Sandiford <richard.sandif...@arm.com> wrote: > > This is another patch in the series to remove the assumption that > all modes involved in vectorisation have to be the same size. > Rather than have the target provide a list of vector sizes, > it makes the target provide a list of vector "approaches", > with each approach represented by a mode. > > A later patch will pass this mode to targetm.vectorize.related_mode > to get the vector mode for a given element mode. Until then, the modes > simply act as an alternative way of specifying the vector size.
Is there a restriction to use integer vector modes for the hook or would FP vector modes be OK as well? Note that your x86 change likely disables word_mode vectorization with -mno-sse? That is, how do we represent GPR vectorization "size" here? The preferred SIMD mode hook may return an integer mode, are non-vector modes OK for autovectorize_vector_modes? Thanks, Richard. > > 2019-10-24 Richard Sandiford <richard.sandif...@arm.com> > > gcc/ > * target.h (vector_sizes, auto_vector_sizes): Delete. > (vector_modes, auto_vector_modes): New typedefs. > * target.def (autovectorize_vector_sizes): Replace with... > (autovectorize_vector_modes): ...this new hook. > * doc/tm.texi.in (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): > Replace with... > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): ...this new hook. > * doc/tm.texi: Regenerate. > * targhooks.h (default_autovectorize_vector_sizes): Delete. > (default_autovectorize_vector_modes): New function. > * targhooks.c (default_autovectorize_vector_sizes): Delete. > (default_autovectorize_vector_modes): New function. > * omp-general.c (omp_max_vf): Use autovectorize_vector_modes instead > of autovectorize_vector_sizes. Use the number of units in the mode > to calculate the maximum VF. > * omp-low.c (omp_clause_aligned_alignment): Use > autovectorize_vector_modes instead of autovectorize_vector_sizes. > Use a loop based on related_mode to iterate through all supported > vector modes for a given scalar mode. > * optabs-query.c (can_vec_mask_load_store_p): Use > autovectorize_vector_modes instead of autovectorize_vector_sizes. > * tree-vect-loop.c (vect_analyze_loop, vect_transform_loop): Likewise. > * tree-vect-slp.c (vect_slp_bb_region): Likewise. > * config/aarch64/aarch64.c (aarch64_autovectorize_vector_sizes): > Replace with... > (aarch64_autovectorize_vector_modes): ...this new function. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Delete. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): Define. > * config/arc/arc.c (arc_autovectorize_vector_sizes): Replace with... > (arc_autovectorize_vector_modes): ...this new function. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Delete. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): Define. > * config/arm/arm.c (arm_autovectorize_vector_sizes): Replace with... > (arm_autovectorize_vector_modes): ...this new function. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Delete. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): Define. > * config/i386/i386.c (ix86_autovectorize_vector_sizes): Replace > with... > (ix86_autovectorize_vector_modes): ...this new function. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Delete. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): Define. > * config/mips/mips.c (mips_autovectorize_vector_sizes): Replace > with... > (mips_autovectorize_vector_modes): ...this new function. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Delete. > (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES): Define. > > Index: gcc/target.h > =================================================================== > --- gcc/target.h 2019-09-30 17:19:39.843166118 +0100 > +++ gcc/target.h 2019-10-25 13:27:15.525762975 +0100 > @@ -205,11 +205,11 @@ enum vect_cost_model_location { > class vec_perm_indices; > > /* The type to use for lists of vector sizes. */ > -typedef vec<poly_uint64> vector_sizes; > +typedef vec<machine_mode> vector_modes; > > /* Same, but can be used to construct local lists that are > automatically freed. */ > -typedef auto_vec<poly_uint64, 8> auto_vector_sizes; > +typedef auto_vec<machine_mode, 8> auto_vector_modes; > > /* The target structure. This holds all the backend hooks. */ > #define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; > Index: gcc/target.def > =================================================================== > --- gcc/target.def 2019-10-25 13:26:59.309877555 +0100 > +++ gcc/target.def 2019-10-25 13:27:15.525762975 +0100 > @@ -1894,20 +1894,28 @@ reached. The default is @var{mode} whic > /* Returns a mask of vector sizes to iterate over when auto-vectorizing > after processing the preferred one derived from preferred_simd_mode. */ > DEFHOOK > -(autovectorize_vector_sizes, > - "If the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is > not\n\ > -the only one that is worth considering, this hook should add all suitable\n\ > -vector sizes to @var{sizes}, in order of decreasing preference. The first\n\ > -one should be the size of @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}.\n\ > -If @var{all} is true, add suitable vector sizes even when they are > generally\n\ > +(autovectorize_vector_modes, > + "If using the mode returned by > @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}\n\ > +is not the only approach worth considering, this hook should add one mode > to\n\ > +@var{modes} for each useful alternative approach. These modes are then\n\ > +passed to @code{TARGET_VECTORIZE_RELATED_MODE} to obtain the vector mode\n\ > +for a given element mode.\n\ > +\n\ > +The modes returned in @var{modes} should use the smallest element mode\n\ > +possible for the vectorization approach that they represent, preferring\n\ > +integer modes over floating-poing modes in the event of a tie. The first\n\ > +mode should be the @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} for its\n\ > +element mode.\n\ > +\n\ > +If @var{all} is true, add suitable vector modes even when they are > generally\n\ > not expected to be worthwhile.\n\ > \n\ > The hook does not need to do anything if the vector returned by\n\ > @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is the only one relevant\n\ > for autovectorization. The default implementation does nothing.", > void, > - (vector_sizes *sizes, bool all), > - default_autovectorize_vector_sizes) > + (vector_modes *modes, bool all), > + default_autovectorize_vector_modes) > > DEFHOOK > (related_mode, > Index: gcc/doc/tm.texi.in > =================================================================== > --- gcc/doc/tm.texi.in 2019-10-25 13:26:59.009879675 +0100 > +++ gcc/doc/tm.texi.in 2019-10-25 13:27:15.521763003 +0100 > @@ -4179,7 +4179,7 @@ address; but often a machine-dependent > > @hook TARGET_VECTORIZE_SPLIT_REDUCTION > > -@hook TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > +@hook TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > > @hook TARGET_VECTORIZE_RELATED_MODE > > Index: gcc/doc/tm.texi > =================================================================== > --- gcc/doc/tm.texi 2019-10-25 13:26:59.305877583 +0100 > +++ gcc/doc/tm.texi 2019-10-25 13:27:15.521763003 +0100 > @@ -6016,12 +6016,20 @@ against lower halves of vectors recursiv > reached. The default is @var{mode} which means no splitting. > @end deftypefn > > -@deftypefn {Target Hook} void TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > (vector_sizes *@var{sizes}, bool @var{all}) > -If the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is not > -the only one that is worth considering, this hook should add all suitable > -vector sizes to @var{sizes}, in order of decreasing preference. The first > -one should be the size of @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}. > -If @var{all} is true, add suitable vector sizes even when they are generally > +@deftypefn {Target Hook} void TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > (vector_modes *@var{modes}, bool @var{all}) > +If using the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} > +is not the only approach worth considering, this hook should add one mode to > +@var{modes} for each useful alternative approach. These modes are then > +passed to @code{TARGET_VECTORIZE_RELATED_MODE} to obtain the vector mode > +for a given element mode. > + > +The modes returned in @var{modes} should use the smallest element mode > +possible for the vectorization approach that they represent, preferring > +integer modes over floating-poing modes in the event of a tie. The first > +mode should be the @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} for its > +element mode. > + > +If @var{all} is true, add suitable vector modes even when they are generally > not expected to be worthwhile. > > The hook does not need to do anything if the vector returned by > Index: gcc/targhooks.h > =================================================================== > --- gcc/targhooks.h 2019-10-25 13:26:59.309877555 +0100 > +++ gcc/targhooks.h 2019-10-25 13:27:15.525762975 +0100 > @@ -113,7 +113,7 @@ default_builtin_support_vector_misalignm > int, bool); > extern machine_mode default_preferred_simd_mode (scalar_mode mode); > extern machine_mode default_split_reduction (machine_mode); > -extern void default_autovectorize_vector_sizes (vector_sizes *, bool); > +extern void default_autovectorize_vector_modes (vector_modes *, bool); > extern opt_machine_mode default_vectorize_related_mode (machine_mode, > scalar_mode, > poly_uint64); > Index: gcc/targhooks.c > =================================================================== > --- gcc/targhooks.c 2019-10-25 13:26:59.309877555 +0100 > +++ gcc/targhooks.c 2019-10-25 13:27:15.525762975 +0100 > @@ -1299,11 +1299,10 @@ default_split_reduction (machine_mode mo > return mode; > } > > -/* By default only the size derived from the preferred vector mode > - is tried. */ > +/* By default only the preferred vector mode is tried. */ > > void > -default_autovectorize_vector_sizes (vector_sizes *, bool) > +default_autovectorize_vector_modes (vector_modes *, bool) > { > } > > Index: gcc/omp-general.c > =================================================================== > --- gcc/omp-general.c 2019-10-25 09:21:28.798326303 +0100 > +++ gcc/omp-general.c 2019-10-25 13:27:15.521763003 +0100 > @@ -508,13 +508,16 @@ omp_max_vf (void) > && global_options_set.x_flag_tree_loop_vectorize)) > return 1; > > - auto_vector_sizes sizes; > - targetm.vectorize.autovectorize_vector_sizes (&sizes, true); > - if (!sizes.is_empty ()) > + auto_vector_modes modes; > + targetm.vectorize.autovectorize_vector_modes (&modes, true); > + if (!modes.is_empty ()) > { > poly_uint64 vf = 0; > - for (unsigned int i = 0; i < sizes.length (); ++i) > - vf = ordered_max (vf, sizes[i]); > + for (unsigned int i = 0; i < modes.length (); ++i) > + /* The returned modes use the smallest element size (and thus > + the largest nunits) for the vectorization approach that they > + represent. */ > + vf = ordered_max (vf, GET_MODE_NUNITS (modes[i])); > return vf; > } > > Index: gcc/omp-low.c > =================================================================== > --- gcc/omp-low.c 2019-10-11 15:43:51.283513446 +0100 > +++ gcc/omp-low.c 2019-10-25 13:27:15.525762975 +0100 > @@ -3947,11 +3947,8 @@ omp_clause_aligned_alignment (tree claus > /* Otherwise return implementation defined alignment. */ > unsigned int al = 1; > opt_scalar_mode mode_iter; > - auto_vector_sizes sizes; > - targetm.vectorize.autovectorize_vector_sizes (&sizes, true); > - poly_uint64 vs = 0; > - for (unsigned int i = 0; i < sizes.length (); ++i) > - vs = ordered_max (vs, sizes[i]); > + auto_vector_modes modes; > + targetm.vectorize.autovectorize_vector_modes (&modes, true); > static enum mode_class classes[] > = { MODE_INT, MODE_VECTOR_INT, MODE_FLOAT, MODE_VECTOR_FLOAT }; > for (int i = 0; i < 4; i += 2) > @@ -3962,19 +3959,18 @@ omp_clause_aligned_alignment (tree claus > machine_mode vmode = targetm.vectorize.preferred_simd_mode (mode); > if (GET_MODE_CLASS (vmode) != classes[i + 1]) > continue; > - 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 (); > + machine_mode alt_vmode; > + for (unsigned int j = 0; j < modes.length (); ++j) > + if (related_vector_mode (modes[j], mode).exists (&alt_vmode) > + && known_ge (GET_MODE_SIZE (alt_vmode), GET_MODE_SIZE (vmode))) > + vmode = alt_vmode; > > tree type = lang_hooks.types.type_for_mode (mode, 1); > if (type == NULL_TREE || TYPE_MODE (type) != mode) > continue; > - poly_uint64 nelts = exact_div (GET_MODE_SIZE (vmode), > - GET_MODE_SIZE (mode)); > - type = build_vector_type (type, nelts); > - if (TYPE_MODE (type) != vmode) > - continue; > + type = build_vector_type_for_mode (type, vmode); > + /* The functions above are not allowed to return invalid modes. */ > + gcc_assert (TYPE_MODE (type) == vmode); > if (TYPE_ALIGN_UNIT (type) > al) > al = TYPE_ALIGN_UNIT (type); > } > Index: gcc/optabs-query.c > =================================================================== > --- gcc/optabs-query.c 2019-10-25 13:26:59.305877583 +0100 > +++ gcc/optabs-query.c 2019-10-25 13:27:15.525762975 +0100 > @@ -589,11 +589,11 @@ can_vec_mask_load_store_p (machine_mode > && convert_optab_handler (op, vmode, mask_mode) != CODE_FOR_nothing) > return true; > > - auto_vector_sizes vector_sizes; > - targetm.vectorize.autovectorize_vector_sizes (&vector_sizes, true); > - for (unsigned int i = 0; i < vector_sizes.length (); ++i) > + auto_vector_modes vector_modes; > + targetm.vectorize.autovectorize_vector_modes (&vector_modes, true); > + for (unsigned int i = 0; i < vector_modes.length (); ++i) > { > - poly_uint64 cur = vector_sizes[i]; > + poly_uint64 cur = GET_MODE_SIZE (vector_modes[i]); > poly_uint64 nunits; > if (!multiple_p (cur, GET_MODE_SIZE (smode), &nunits)) > continue; > Index: gcc/tree-vect-loop.c > =================================================================== > --- gcc/tree-vect-loop.c 2019-10-25 13:26:59.137878771 +0100 > +++ gcc/tree-vect-loop.c 2019-10-25 13:27:15.525762975 +0100 > @@ -2319,12 +2319,12 @@ vect_analyze_loop_2 (loop_vec_info loop_ > vect_analyze_loop (class loop *loop, loop_vec_info orig_loop_vinfo, > vec_info_shared *shared) > { > - auto_vector_sizes vector_sizes; > + auto_vector_modes vector_modes; > > /* Autodetect first vector size we try. */ > - targetm.vectorize.autovectorize_vector_sizes (&vector_sizes, > + targetm.vectorize.autovectorize_vector_modes (&vector_modes, > loop->simdlen != 0); > - unsigned int next_size = 0; > + unsigned int mode_i = 0; > > DUMP_VECT_SCOPE ("analyze_loop_nest"); > > @@ -2343,7 +2343,7 @@ vect_analyze_loop (class loop *loop, loo > unsigned n_stmts = 0; > poly_uint64 autodetected_vector_size = 0; > opt_loop_vec_info first_loop_vinfo = opt_loop_vec_info::success (NULL); > - poly_uint64 next_vector_size = 0; > + machine_mode next_vector_mode = VOIDmode; > while (1) > { > /* Check the CFG characteristics of the loop (nesting, entry/exit). */ > @@ -2357,7 +2357,7 @@ vect_analyze_loop (class loop *loop, loo > gcc_checking_assert (first_loop_vinfo == NULL); > return loop_vinfo; > } > - loop_vinfo->vector_size = next_vector_size; > + loop_vinfo->vector_size = GET_MODE_SIZE (next_vector_mode); > > bool fatal = false; > > @@ -2365,7 +2365,7 @@ vect_analyze_loop (class loop *loop, loo > LOOP_VINFO_ORIG_LOOP_INFO (loop_vinfo) = orig_loop_vinfo; > > opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal, &n_stmts); > - if (next_size == 0) > + if (mode_i == 0) > autodetected_vector_size = loop_vinfo->vector_size; > > if (res) > @@ -2399,11 +2399,12 @@ vect_analyze_loop (class loop *loop, loo > return opt_loop_vec_info::propagate_failure (res); > } > > - if (next_size < vector_sizes.length () > - && known_eq (vector_sizes[next_size], autodetected_vector_size)) > - next_size += 1; > + if (mode_i < vector_modes.length () > + && known_eq (GET_MODE_SIZE (vector_modes[mode_i]), > + autodetected_vector_size)) > + mode_i += 1; > > - if (next_size == vector_sizes.length () > + if (mode_i == vector_modes.length () > || known_eq (autodetected_vector_size, 0U)) > { > if (first_loop_vinfo) > @@ -2423,15 +2424,11 @@ vect_analyze_loop (class loop *loop, loo > } > > /* Try the next biggest vector size. */ > - next_vector_size = vector_sizes[next_size++]; > + next_vector_mode = vector_modes[mode_i++]; > if (dump_enabled_p ()) > - { > - dump_printf_loc (MSG_NOTE, vect_location, > - "***** Re-trying analysis with " > - "vector size "); > - dump_dec (MSG_NOTE, next_vector_size); > - dump_printf (MSG_NOTE, "\n"); > - } > + dump_printf_loc (MSG_NOTE, vect_location, > + "***** Re-trying analysis with vector mode %s\n", > + GET_MODE_NAME (next_vector_mode)); > } > } > > @@ -8277,9 +8274,9 @@ vect_transform_loop (loop_vec_info loop_ > > if (epilogue) > { > - auto_vector_sizes vector_sizes; > - targetm.vectorize.autovectorize_vector_sizes (&vector_sizes, false); > - unsigned int next_size = 0; > + auto_vector_modes vector_modes; > + targetm.vectorize.autovectorize_vector_modes (&vector_modes, false); > + unsigned int next_i = 0; > > /* Note LOOP_VINFO_NITERS_KNOWN_P and LOOP_VINFO_INT_NITERS work > on niters already ajusted for the iterations of the prologue. */ > @@ -8295,18 +8292,20 @@ vect_transform_loop (loop_vec_info loop_ > epilogue->any_upper_bound = true; > > unsigned int ratio; > - while (next_size < vector_sizes.length () > - && !(constant_multiple_p (loop_vinfo->vector_size, > - vector_sizes[next_size], &ratio) > + while (next_i < vector_modes.length () > + && !(constant_multiple_p > + (loop_vinfo->vector_size, > + GET_MODE_SIZE (vector_modes[next_i]), &ratio) > && eiters >= lowest_vf / ratio)) > - next_size += 1; > + next_i += 1; > } > else > - while (next_size < vector_sizes.length () > - && maybe_lt (loop_vinfo->vector_size, vector_sizes[next_size])) > - next_size += 1; > + while (next_i < vector_modes.length () > + && maybe_lt (loop_vinfo->vector_size, > + GET_MODE_SIZE (vector_modes[next_i]))) > + next_i += 1; > > - if (next_size == vector_sizes.length ()) > + if (next_i == vector_modes.length ()) > epilogue = NULL; > } > > Index: gcc/tree-vect-slp.c > =================================================================== > --- gcc/tree-vect-slp.c 2019-10-25 13:26:59.141878743 +0100 > +++ gcc/tree-vect-slp.c 2019-10-25 13:27:15.525762975 +0100 > @@ -3087,12 +3087,12 @@ vect_slp_bb_region (gimple_stmt_iterator > unsigned int n_stmts) > { > bb_vec_info bb_vinfo; > - auto_vector_sizes vector_sizes; > + auto_vector_modes vector_modes; > > /* Autodetect first vector size we try. */ > - poly_uint64 next_vector_size = 0; > - targetm.vectorize.autovectorize_vector_sizes (&vector_sizes, false); > - unsigned int next_size = 0; > + machine_mode next_vector_mode = VOIDmode; > + targetm.vectorize.autovectorize_vector_modes (&vector_modes, false); > + unsigned int mode_i = 0; > > vec_info_shared shared; > > @@ -3109,7 +3109,7 @@ vect_slp_bb_region (gimple_stmt_iterator > bb_vinfo->shared->save_datarefs (); > else > bb_vinfo->shared->check_datarefs (); > - bb_vinfo->vector_size = next_vector_size; > + bb_vinfo->vector_size = GET_MODE_SIZE (next_vector_mode); > > if (vect_slp_analyze_bb_1 (bb_vinfo, n_stmts, fatal) > && dbg_cnt (vect_slp)) > @@ -3136,17 +3136,18 @@ vect_slp_bb_region (gimple_stmt_iterator > vectorized = true; > } > > - if (next_size == 0) > + if (mode_i == 0) > autodetected_vector_size = bb_vinfo->vector_size; > > delete bb_vinfo; > > - if (next_size < vector_sizes.length () > - && known_eq (vector_sizes[next_size], autodetected_vector_size)) > - next_size += 1; > + if (mode_i < vector_modes.length () > + && known_eq (GET_MODE_SIZE (vector_modes[mode_i]), > + autodetected_vector_size)) > + mode_i += 1; > > if (vectorized > - || next_size == vector_sizes.length () > + || mode_i == vector_modes.length () > || known_eq (autodetected_vector_size, 0U) > /* If vect_slp_analyze_bb_1 signaled that analysis for all > vector sizes will fail do not bother iterating. */ > @@ -3154,15 +3155,11 @@ vect_slp_bb_region (gimple_stmt_iterator > return vectorized; > > /* Try the next biggest vector size. */ > - next_vector_size = vector_sizes[next_size++]; > + next_vector_mode = vector_modes[mode_i++]; > if (dump_enabled_p ()) > - { > - dump_printf_loc (MSG_NOTE, vect_location, > - "***** Re-trying analysis with " > - "vector size "); > - dump_dec (MSG_NOTE, next_vector_size); > - dump_printf (MSG_NOTE, "\n"); > - } > + dump_printf_loc (MSG_NOTE, vect_location, > + "***** Re-trying analysis with vector mode %s\n", > + GET_MODE_NAME (next_vector_mode)); > } > } > > Index: gcc/config/aarch64/aarch64.c > =================================================================== > --- gcc/config/aarch64/aarch64.c 2019-10-25 13:26:59.177878488 +0100 > +++ gcc/config/aarch64/aarch64.c 2019-10-25 13:27:15.505763118 +0100 > @@ -15203,12 +15203,12 @@ aarch64_preferred_simd_mode (scalar_mode > /* Return a list of possible vector sizes for the vectorizer > to iterate over. */ > static void > -aarch64_autovectorize_vector_sizes (vector_sizes *sizes, bool) > +aarch64_autovectorize_vector_modes (vector_modes *modes, bool) > { > if (TARGET_SVE) > - sizes->safe_push (BYTES_PER_SVE_VECTOR); > - sizes->safe_push (16); > - sizes->safe_push (8); > + modes->safe_push (VNx16QImode); > + modes->safe_push (V16QImode); > + modes->safe_push (V8QImode); > } > > /* Implement TARGET_MANGLE_TYPE. */ > @@ -20915,9 +20915,9 @@ #define TARGET_VECTORIZE_BUILTINS > #define TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION \ > aarch64_builtin_vectorized_function > > -#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > -#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \ > - aarch64_autovectorize_vector_sizes > +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES \ > + aarch64_autovectorize_vector_modes > > #undef TARGET_ATOMIC_ASSIGN_EXPAND_FENV > #define TARGET_ATOMIC_ASSIGN_EXPAND_FENV \ > Index: gcc/config/arc/arc.c > =================================================================== > --- gcc/config/arc/arc.c 2019-10-25 09:21:25.974346475 +0100 > +++ gcc/config/arc/arc.c 2019-10-25 13:27:15.505763118 +0100 > @@ -607,15 +607,15 @@ arc_preferred_simd_mode (scalar_mode mod > } > > /* Implements target hook > - TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES. */ > + TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES. */ > > static void > -arc_autovectorize_vector_sizes (vector_sizes *sizes, bool) > +arc_autovectorize_vector_modes (vector_modes *modes, bool) > { > if (TARGET_PLUS_QMACW) > { > - sizes->quick_push (8); > - sizes->quick_push (4); > + modes->quick_push (V4HImode); > + modes->quick_push (V2HImode); > } > } > > @@ -726,8 +726,8 @@ #define TARGET_VECTOR_MODE_SUPPORTED_P a > #undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE > #define TARGET_VECTORIZE_PREFERRED_SIMD_MODE arc_preferred_simd_mode > > -#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > -#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > arc_autovectorize_vector_sizes > +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > arc_autovectorize_vector_modes > > #undef TARGET_CAN_USE_DOLOOP_P > #define TARGET_CAN_USE_DOLOOP_P arc_can_use_doloop_p > Index: gcc/config/arm/arm.c > =================================================================== > --- gcc/config/arm/arm.c 2019-10-23 11:29:47.933883742 +0100 > +++ gcc/config/arm/arm.c 2019-10-25 13:27:15.513763059 +0100 > @@ -289,7 +289,7 @@ static bool arm_builtin_support_vector_m > static void arm_conditional_register_usage (void); > static enum flt_eval_method arm_excess_precision (enum > excess_precision_type); > static reg_class_t arm_preferred_rename_class (reg_class_t rclass); > -static void arm_autovectorize_vector_sizes (vector_sizes *, bool); > +static void arm_autovectorize_vector_modes (vector_modes *, bool); > static int arm_default_branch_cost (bool, bool); > static int arm_cortex_a5_branch_cost (bool, bool); > static int arm_cortex_m_branch_cost (bool, bool); > @@ -522,9 +522,9 @@ #define TARGET_VECTOR_MODE_SUPPORTED_P a > #define TARGET_ARRAY_MODE_SUPPORTED_P arm_array_mode_supported_p > #undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE > #define TARGET_VECTORIZE_PREFERRED_SIMD_MODE arm_preferred_simd_mode > -#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > -#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \ > - arm_autovectorize_vector_sizes > +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES \ > + arm_autovectorize_vector_modes > > #undef TARGET_MACHINE_DEPENDENT_REORG > #define TARGET_MACHINE_DEPENDENT_REORG arm_reorg > @@ -29012,12 +29012,12 @@ arm_vector_alignment (const_tree type) > } > > static void > -arm_autovectorize_vector_sizes (vector_sizes *sizes, bool) > +arm_autovectorize_vector_modes (vector_modes *modes, bool) > { > if (!TARGET_NEON_VECTORIZE_DOUBLE) > { > - sizes->safe_push (16); > - sizes->safe_push (8); > + modes->safe_push (V16QImode); > + modes->safe_push (V8QImode); > } > } > > Index: gcc/config/i386/i386.c > =================================================================== > --- gcc/config/i386/i386.c 2019-10-25 13:26:59.277877782 +0100 > +++ gcc/config/i386/i386.c 2019-10-25 13:27:15.517763031 +0100 > @@ -21387,35 +21387,35 @@ ix86_preferred_simd_mode (scalar_mode mo > 256bit and 128bit vectors. */ > > static void > -ix86_autovectorize_vector_sizes (vector_sizes *sizes, bool all) > +ix86_autovectorize_vector_modes (vector_modes *modes, bool all) > { > if (TARGET_AVX512F && !TARGET_PREFER_AVX256) > { > - sizes->safe_push (64); > - sizes->safe_push (32); > - sizes->safe_push (16); > + modes->safe_push (V64QImode); > + modes->safe_push (V32QImode); > + modes->safe_push (V16QImode); > } > else if (TARGET_AVX512F && all) > { > - sizes->safe_push (32); > - sizes->safe_push (16); > - sizes->safe_push (64); > + modes->safe_push (V32QImode); > + modes->safe_push (V16QImode); > + modes->safe_push (V64QImode); > } > else if (TARGET_AVX && !TARGET_PREFER_AVX128) > { > - sizes->safe_push (32); > - sizes->safe_push (16); > + modes->safe_push (V32QImode); > + modes->safe_push (V16QImode); > } > else if (TARGET_AVX && all) > { > - sizes->safe_push (16); > - sizes->safe_push (32); > + modes->safe_push (V16QImode); > + modes->safe_push (V32QImode); > } > else if (TARGET_MMX_WITH_SSE) > - sizes->safe_push (16); > + modes->safe_push (V16QImode); > > if (TARGET_MMX_WITH_SSE) > - sizes->safe_push (8); > + modes->safe_push (V8QImode); > } > > /* Implemenation of targetm.vectorize.get_mask_mode. */ > @@ -22954,9 +22954,9 @@ #define TARGET_VECTORIZE_PREFERRED_SIMD_ > #undef TARGET_VECTORIZE_SPLIT_REDUCTION > #define TARGET_VECTORIZE_SPLIT_REDUCTION \ > ix86_split_reduction > -#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > -#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \ > - ix86_autovectorize_vector_sizes > +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES \ > + ix86_autovectorize_vector_modes > #undef TARGET_VECTORIZE_GET_MASK_MODE > #define TARGET_VECTORIZE_GET_MASK_MODE ix86_get_mask_mode > #undef TARGET_VECTORIZE_INIT_COST > Index: gcc/config/mips/mips.c > =================================================================== > --- gcc/config/mips/mips.c 2019-10-17 14:22:54.903313423 +0100 > +++ gcc/config/mips/mips.c 2019-10-25 13:27:15.517763031 +0100 > @@ -13453,13 +13453,13 @@ mips_preferred_simd_mode (scalar_mode mo > return word_mode; > } > > -/* Implement TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES. */ > +/* Implement TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES. */ > > static void > -mips_autovectorize_vector_sizes (vector_sizes *sizes, bool) > +mips_autovectorize_vector_modes (vector_modes *modes, bool) > { > if (ISA_HAS_MSA) > - sizes->safe_push (16); > + modes->safe_push (V16QImode); > } > > /* Implement TARGET_INIT_LIBFUNCS. */ > @@ -22694,9 +22694,9 @@ #define TARGET_SCALAR_MODE_SUPPORTED_P m > > #undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE > #define TARGET_VECTORIZE_PREFERRED_SIMD_MODE mips_preferred_simd_mode > -#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES > -#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \ > - mips_autovectorize_vector_sizes > +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES > +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES \ > + mips_autovectorize_vector_modes > > #undef TARGET_INIT_BUILTINS > #define TARGET_INIT_BUILTINS mips_init_builtins