Add support for vectorising live-out values using SVE LASTB

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 13 January 2018 17:59 EST

This patch uses the SVE LASTB instruction to optimise cases in which a value produced by the final scalar iteration of a vectorised loop is live outside the loop. Previously this situation would stop us from using a fully-masked loop.

2018-01-13 Richard Sandiford Alan Hayward David Sherwood

gcc/
- doc/md.texi (extract_last_@var{m}): Document.
- optabs.def (extract_last_optab): New optab.
- internal-fn.def (EXTRACT_LAST): New internal function.
- internal-fn.c (cond_unary_direct): New macro. (expand_cond_unary_optab_fn): Likewise. (direct_cond_unary_optab_supported_p): Likewise.
- tree-vect-loop.c (vectorizable_live_operation): Allow fully-masked loops using EXTRACT_LAST.
- config/aarch64/aarch64-sve.md (aarch64_sve_lastb): Rename to... (extract_last_): ...this optab. (vec_extract): Update accordingly.

gcc/testsuite/
- gcc.target/aarch64/sve/live_1.c: New test.
- gcc.target/aarch64/sve/live_1_run.c: Likewise.

384eaff13bc Add support for vectorising live-out values using SVE LASTB
gcc/ChangeLog | 16 +++++
gcc/config/aarch64/aarch64-sve.md | 8 +--
gcc/doc/md.texi | 8 +++
gcc/internal-fn.c | 5 ++
gcc/internal-fn.def | 4 ++
gcc/optabs.def | 2 +
gcc/testsuite/ChangeLog | 7 ++
gcc/testsuite/gcc.target/aarch64/sve/live_1.c | 41 +++++++++++
gcc/testsuite/gcc.target/aarch64/sve/live_1_run.c | 35 +++++++++
gcc/tree-vect-loop.c | 87 ++++++++++++++++++-----
10 files changed, 191 insertions(+), 22 deletions(-)

Upstream: gcc.gnu.org


  • Share