Hi, this is v3 with the patch split up into multiple ones. Sorry that it took so long... The first two patches and the fifth are independent but (3) and (4) are not so they would be squashed. 4 is still the largest one and now includes the suggested refactoring. It's still not terribly obvious what's happening but maybe better than before.
The strided loads/stores will need the same changes at some point. Even though we treat them as special cases of gathers/scatters right now (and also perform all the same checks) it's not intuitive that their IFNs don't have an alias pointer. I deferred that for now, though. The whole series was regtested and bootstrapped on x86, aarch64, and power10 and I built the patches individually on x86 as well as riscv. It was also regtested on rv64gcv_zvl512b. Robin Dapp (5): ifn: Add helper functions for gather/scatter. vect: Add helper macros for gather/scatter. vect: Add is_gather_scatter argument to misalignment hook. vect: Misalign checks for gather/scatter. riscv: testsuite: Fix misalignment check. gcc/config/aarch64/aarch64.cc | 12 +- gcc/config/arm/arm.cc | 12 +- gcc/config/epiphany/epiphany.cc | 8 +- gcc/config/gcn/gcn.cc | 6 +- gcc/config/loongarch/loongarch.cc | 8 +- gcc/config/riscv/riscv.cc | 29 +++- gcc/config/rs6000/rs6000.cc | 6 +- gcc/config/s390/s390.cc | 6 +- gcc/doc/tm.texi | 8 +- gcc/internal-fn.cc | 96 +++++++++-- gcc/internal-fn.h | 3 + gcc/optabs-query.cc | 6 +- gcc/target.def | 14 +- gcc/targhooks.cc | 2 + gcc/targhooks.h | 2 +- gcc/testsuite/lib/target-supports.exp | 2 +- gcc/tree-vect-data-refs.cc | 15 +- gcc/tree-vect-patterns.cc | 17 +- gcc/tree-vect-slp.cc | 28 ++-- gcc/tree-vect-stmts.cc | 231 ++++++++++++++++---------- gcc/tree-vectorizer.h | 12 ++ 21 files changed, 363 insertions(+), 160 deletions(-) -- 2.50.0