diff options
author | Richard Biener <rguenther@suse.de> | 2021-07-29 14:14:48 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-08-04 15:28:07 +0200 |
commit | 31855ba6b16cd138d7484076a08cd40d609654b8 (patch) | |
tree | 0aadaf8b611556e6771087979a40d839e0e6a276 /gcc/gcov-io.c | |
parent | f2e5d2717d9e249edc5e0d45e49e4f9ef81fc694 (diff) | |
download | gcc-31855ba6b16cd138d7484076a08cd40d609654b8.zip gcc-31855ba6b16cd138d7484076a08cd40d609654b8.tar.gz gcc-31855ba6b16cd138d7484076a08cd40d609654b8.tar.bz2 |
Add emulated gather capability to the vectorizer
This adds a gather vectorization capability to the vectorizer
without target support by decomposing the offset vector, doing
sclar loads and then building a vector from the result. This
is aimed mainly at cases where vectorizing the rest of the loop
offsets the cost of vectorizing the gather.
Note it's difficult to avoid vectorizing the offset load, but in
some cases later passes can turn the vector load + extract into
scalar loads, see the followup patch.
On SPEC CPU 2017 510.parest_r this improves runtime from 250s
to 219s on a Zen2 CPU which has its native gather instructions
disabled (using those the runtime instead increases to 254s)
using -Ofast -march=znver2 [-flto]. It turns out the critical
loops in this benchmark all perform gather operations.
2021-07-30 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_check_gather_scatter):
Include widening conversions only when the result is
still handed by native gather or the current offset
size not already matches the data size.
Also succeed analysis in case there's no native support,
noted by a IFN_LAST ifn and a NULL decl.
(vect_analyze_data_refs): Always consider gathers.
* tree-vect-patterns.c (vect_recog_gather_scatter_pattern):
Test for no IFN gather rather than decl gather.
* tree-vect-stmts.c (vect_model_load_cost): Pass in the
gather-scatter info and cost emulated gathers accordingly.
(vect_truncate_gather_scatter_offset): Properly test for
no IFN gather.
(vect_use_strided_gather_scatters_p): Likewise.
(get_load_store_type): Handle emulated gathers and its
restrictions.
(vectorizable_load): Likewise. Emulate them by extracting
scalar offsets, doing scalar loads and a vector construct.
* gcc.target/i386/vect-gather-1.c: New testcase.
* gfortran.dg/vect/vect-8.f90: Adjust.
Diffstat (limited to 'gcc/gcov-io.c')
0 files changed, 0 insertions, 0 deletions