aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@linux.ibm.com>2022-01-13 09:51:07 +0100
committerRobin Dapp <rdapp@linux.ibm.com>2022-01-13 20:05:18 +0100
commitb0e5163960eceab701a1a25dfa049e394fe5b3de (patch)
tree6f06da924ca25a3ea73e937f55eda28cbcdd51f7 /gcc/tree-vect-loop-manip.c
parent69561fc781aca3dea3aa4d5d562ef5a502965924 (diff)
downloadgcc-b0e5163960eceab701a1a25dfa049e394fe5b3de.zip
gcc-b0e5163960eceab701a1a25dfa049e394fe5b3de.tar.gz
gcc-b0e5163960eceab701a1a25dfa049e394fe5b3de.tar.bz2
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.
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index cdb8789..a7bbc91 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -421,6 +421,7 @@ vect_maybe_permute_loop_masks (gimple_seq *seq, rgroup_controls *dest_rgm,
static tree
vect_set_loop_controls_directly (class loop *loop, loop_vec_info loop_vinfo,
gimple_seq *preheader_seq,
+ gimple_seq *header_seq,
gimple_stmt_iterator loop_cond_gsi,
rgroup_controls *rgc, tree niters,
tree niters_skip, bool might_wrap_p)
@@ -664,6 +665,19 @@ vect_set_loop_controls_directly (class loop *loop, loop_vec_info loop_vinfo,
vect_set_loop_control (loop, ctrl, init_ctrl, next_ctrl);
}
+
+ int partial_load_bias = LOOP_VINFO_PARTIAL_LOAD_STORE_BIAS (loop_vinfo);
+ if (partial_load_bias != 0)
+ {
+ tree adjusted_len = rgc->bias_adjusted_ctrl;
+ gassign *minus = gimple_build_assign (adjusted_len, PLUS_EXPR,
+ rgc->controls[0],
+ build_int_cst
+ (TREE_TYPE (rgc->controls[0]),
+ partial_load_bias));
+ gimple_seq_add_stmt (header_seq, minus);
+ }
+
return next_ctrl;
}
@@ -744,6 +758,7 @@ vect_set_loop_condition_partial_vectors (class loop *loop,
/* Set up all controls for this group. */
test_ctrl = vect_set_loop_controls_directly (loop, loop_vinfo,
&preheader_seq,
+ &header_seq,
loop_cond_gsi, rgc,
niters, niters_skip,
might_wrap_p);