vect: Add bias parameter for partial vectorization
authorRobin Dapp <rdapp@linux.ibm.com>
Thu, 13 Jan 2022 08:51:07 +0000 (09:51 +0100)
committerRobin Dapp <rdapp@linux.ibm.com>
Thu, 13 Jan 2022 19:05:18 +0000 (20:05 +0100)
commitb0e5163960eceab701a1a25dfa049e394fe5b3de
tree6f06da924ca25a3ea73e937f55eda28cbcdd51f7
parent69561fc781aca3dea3aa4d5d562ef5a502965924
vect: Add bias parameter for partial vectorization

This introduces a bias parameter for the len_load/len_store ifns as well as
optabs that is meant to distinguish between Power and s390 variants.
PowerPC's instructions require a bias of 0, while in s390's case
vll/vstl do not support lengths of zero bytes and a bias of -1 must be used.

gcc/ChangeLog:

* internal-fn.c (expand_partial_load_optab_fn): Add bias.
(expand_partial_store_optab_fn): Likewise.
(internal_len_load_store_bias): New function.
* internal-fn.h (VECT_PARTIAL_BIAS_UNSUPPORTED): New define.
(internal_len_load_store_bias): New function.
* tree-vect-loop-manip.c (vect_set_loop_controls_directly): Set bias.
(vect_set_loop_condition_partial_vectors): Add header_seq parameter.
* tree-vect-loop.c (vect_verify_loop_lens): Verify bias.
(vect_estimate_min_profitable_iters): Account for bias.
(vect_get_loop_len): Add bias-adjusted length.
* tree-vect-stmts.c (vectorizable_store): Use.
(vectorizable_load): Use.
* tree-vectorizer.h (struct rgroup_controls): Add bias-adjusted length.
(LOOP_VINFO_PARTIAL_LOAD_STORE_BIAS): New macro.
* config/rs6000/vsx.md: Use const0 bias predicate.
* doc/md.texi: Document bias value.
gcc/config/rs6000/vsx.md
gcc/doc/md.texi
gcc/internal-fn.c
gcc/internal-fn.h
gcc/tree-vect-loop-manip.c
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h