diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-11-14 15:12:58 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-11-14 15:12:58 +0000 |
commit | df7c22831f1e48dba49479c5960c1c180d8eab2c (patch) | |
tree | 4778c923cb13cbea0d49eb5ba6c6365451d9995a /gcc/machmode.h | |
parent | 7f52eb891b738337d5cf82c7c440a5eea8c7b0c9 (diff) | |
download | gcc-df7c22831f1e48dba49479c5960c1c180d8eab2c.zip gcc-df7c22831f1e48dba49479c5960c1c180d8eab2c.tar.gz gcc-df7c22831f1e48dba49479c5960c1c180d8eab2c.tar.bz2 |
Support vectorisation with mixed vector sizes
After previous patches, it's now possible to make the vectoriser
support multiple vector sizes in the same vector region, using
related_vector_mode to pick the right vector mode for a given
element mode. No port yet takes advantage of this, but I have
a follow-on patch for AArch64.
This patch also seemed like a good opportunity to add some more dump
messages: one to make it clear which vector size/mode was being used
when analysis passed or failed, and another to say when we've decided
to skip a redundant vector size/mode.
2019-11-14 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* machmode.h (opt_machine_mode::operator==): New function.
(opt_machine_mode::operator!=): Likewise.
* tree-vectorizer.h (vec_info::vector_mode): Update comment.
(get_related_vectype_for_scalar_type): Delete.
(get_vectype_for_scalar_type_and_size): Declare.
* tree-vect-slp.c (vect_slp_bb_region): Print dump messages to say
whether analysis passed or failed, and with what vector modes.
Use related_vector_mode to check whether trying a particular
vector mode would be redundant with the autodetected mode,
and print a dump message if we decide to skip it.
* tree-vect-loop.c (vect_analyze_loop): Likewise.
(vect_create_epilog_for_reduction): Use
get_related_vectype_for_scalar_type instead of
get_vectype_for_scalar_type_and_size.
* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Replace
with...
(get_related_vectype_for_scalar_type): ...this new function.
Take a starting/"prevailing" vector mode rather than a vector size.
Take an optional nunits argument, with the same meaning as for
related_vector_mode. Use related_vector_mode when not
auto-detecting a mode, falling back to mode_for_vector if no
target mode exists.
(get_vectype_for_scalar_type): Update accordingly.
(get_same_sized_vectype): Likewise.
* tree-vectorizer.c (get_vec_alignment_for_array_type): Likewise.
From-SVN: r278240
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r-- | gcc/machmode.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h index 6750833..a507ed6 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -258,6 +258,9 @@ public: bool exists () const; template<typename U> bool exists (U *) const; + bool operator== (const T &m) const { return m_mode == m; } + bool operator!= (const T &m) const { return m_mode != m; } + private: machine_mode m_mode; }; |