diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-13 17:59:50 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-13 17:59:50 +0000 |
commit | bfe1bb57ba4dfd78f8c1ac7d46cf27e8e7408676 (patch) | |
tree | 489dd37405fb9ba664020489aaec102ba690e05f /gcc/internal-fn.def | |
parent | 76a34e3f8565e36d164006e62f7380bfe6057154 (diff) | |
download | gcc-bfe1bb57ba4dfd78f8c1ac7d46cf27e8e7408676.zip gcc-bfe1bb57ba4dfd78f8c1ac7d46cf27e8e7408676.tar.gz gcc-bfe1bb57ba4dfd78f8c1ac7d46cf27e8e7408676.tar.bz2 |
Add support for vectorising live-out values using SVE LASTB
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 <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
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<mode>): Rename to...
(extract_last_<mode>): ...this optab.
(vec_extract<mode><Vel>): Update accordingly.
gcc/testsuite/
* gcc.target/aarch64/sve/live_1.c: New test.
* gcc.target/aarch64/sve/live_1_run.c: Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256632
Diffstat (limited to 'gcc/internal-fn.def')
-rw-r--r-- | gcc/internal-fn.def | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/internal-fn.def b/gcc/internal-fn.def index f098440..fb9f095 100644 --- a/gcc/internal-fn.def +++ b/gcc/internal-fn.def @@ -154,6 +154,10 @@ DEF_INTERNAL_OPTAB_FN (REDUC_IOR, ECF_CONST | ECF_NOTHROW, DEF_INTERNAL_OPTAB_FN (REDUC_XOR, ECF_CONST | ECF_NOTHROW, reduc_xor_scal, unary) +/* Extract the last active element from a vector. */ +DEF_INTERNAL_OPTAB_FN (EXTRACT_LAST, ECF_CONST | ECF_NOTHROW, + extract_last, cond_unary) + /* Unary math functions. */ DEF_INTERNAL_FLT_FN (ACOS, ECF_CONST, acos, unary) DEF_INTERNAL_FLT_FN (ASIN, ECF_CONST, asin, unary) |