From 830e90dab3dee5c8129c7760ff09ab112c2cd271 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 21 Oct 2019 06:41:25 +0000 Subject: [PATCH] Pass a vec_info to vect_halve_mask_nunits 2019-10-21 Richard Sandiford gcc/ * tree-vectorizer.h (vect_halve_mask_nunits): Take a vec_info. * tree-vect-loop.c (vect_halve_mask_nunits): Likewise. * tree-vect-loop-manip.c (vect_maybe_permute_loop_masks): Update call accordingly. * tree-vect-stmts.c (supportable_widening_operation): Likewise. From-SVN: r277233 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-vect-loop-manip.c | 4 ++-- gcc/tree-vect-loop.c | 2 +- gcc/tree-vect-stmts.c | 3 ++- gcc/tree-vectorizer.h | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c07777f93e..8ae719252d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-21 Richard Sandiford + + * tree-vectorizer.h (vect_halve_mask_nunits): Take a vec_info. + * tree-vect-loop.c (vect_halve_mask_nunits): Likewise. + * tree-vect-loop-manip.c (vect_maybe_permute_loop_masks): Update + call accordingly. + * tree-vect-stmts.c (supportable_widening_operation): Likewise. + 2019-10-21 Richard Sandiford * tree-vect-loop-manip.c (vect_maybe_permute_loop_masks): Take diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 1f1f26f231d..b3246bc7a09 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -317,7 +317,7 @@ interleave_supported_p (vec_perm_indices *indices, tree vectype, latter. Return true on success, adding any new statements to SEQ. */ static bool -vect_maybe_permute_loop_masks (loop_vec_info, gimple_seq *seq, +vect_maybe_permute_loop_masks (loop_vec_info loop_vinfo, gimple_seq *seq, rgroup_masks *dest_rgm, rgroup_masks *src_rgm) { @@ -330,7 +330,7 @@ vect_maybe_permute_loop_masks (loop_vec_info, gimple_seq *seq, { /* Unpacking the source masks gives at least as many mask bits as we need. We can then VIEW_CONVERT any excess bits away. */ - tree unpack_masktype = vect_halve_mask_nunits (src_masktype); + tree unpack_masktype = vect_halve_mask_nunits (loop_vinfo, src_masktype); for (unsigned int i = 0; i < dest_rgm->masks.length (); ++i) { tree src = src_rgm->masks[i / 2]; diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 21a0eaeb6cc..5c29084d687 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -7745,7 +7745,7 @@ loop_niters_no_overflow (loop_vec_info loop_vinfo) /* Return a mask type with half the number of elements as TYPE. */ tree -vect_halve_mask_nunits (tree type) +vect_halve_mask_nunits (vec_info *, tree type) { poly_uint64 nunits = exact_div (TYPE_VECTOR_SUBPARTS (type), 2); return build_truth_vector_type (nunits, current_vector_size); diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 92c31ab93a3..690e2c4012e 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -11385,6 +11385,7 @@ supportable_widening_operation (enum tree_code code, stmt_vec_info stmt_info, int *multi_step_cvt, vec *interm_types) { + vec_info *vinfo = stmt_info->vinfo; loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_info); class loop *vect_loop = NULL; machine_mode vec_mode; @@ -11570,7 +11571,7 @@ supportable_widening_operation (enum tree_code code, stmt_vec_info stmt_info, intermediate_mode = insn_data[icode1].operand[0].mode; if (VECTOR_BOOLEAN_TYPE_P (prev_type)) { - intermediate_type = vect_halve_mask_nunits (prev_type); + intermediate_type = vect_halve_mask_nunits (vinfo, prev_type); if (intermediate_mode != TYPE_MODE (intermediate_type)) return false; } diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 71b1da5b1ee..4199b7cb8ac 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1705,7 +1705,7 @@ extern opt_loop_vec_info vect_analyze_loop (class loop *, extern tree vect_build_loop_niters (loop_vec_info, bool * = NULL); extern void vect_gen_vector_loop_niters (loop_vec_info, tree, tree *, tree *, bool); -extern tree vect_halve_mask_nunits (tree); +extern tree vect_halve_mask_nunits (vec_info *, tree); extern tree vect_double_mask_nunits (tree); extern void vect_record_loop_mask (loop_vec_info, vec_loop_masks *, unsigned int, tree, tree); -- 2.30.2