Commit 43fdde57 by Richard Sandiford Committed by Richard Sandiford

Pass a vec_info to can_duplicate_and_interleave_p

2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (can_duplicate_and_interleave_p): Take a vec_info.
	* tree-vect-slp.c (can_duplicate_and_interleave_p): Likewise.
	(duplicate_and_interleave): Update call accordingly.
	* tree-vect-loop.c (vectorizable_reduction): Likewise.

From-SVN: r277229
parent cdbe6e9b
2019-10-21 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (can_duplicate_and_interleave_p): Take a vec_info.
* tree-vect-slp.c (can_duplicate_and_interleave_p): Likewise.
(duplicate_and_interleave): Update call accordingly.
* tree-vect-loop.c (vectorizable_reduction): Likewise.
2019-10-21 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (duplicate_and_interleave): Take a vec_info.
* tree-vect-slp.c (duplicate_and_interleave): Likewise.
(vect_get_constant_vectors): Update call accordingly.
......
......@@ -6145,7 +6145,8 @@ vectorizable_reduction (stmt_vec_info stmt_info, slp_tree slp_node,
unsigned int group_size = SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
scalar_mode elt_mode = SCALAR_TYPE_MODE (TREE_TYPE (vectype_out));
if (!neutral_op
&& !can_duplicate_and_interleave_p (group_size, elt_mode))
&& !can_duplicate_and_interleave_p (loop_vinfo, group_size,
elt_mode))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
......
......@@ -233,7 +233,8 @@ vect_get_place_in_interleaving_chain (stmt_vec_info stmt_info,
(if nonnull). */
bool
can_duplicate_and_interleave_p (unsigned int count, machine_mode elt_mode,
can_duplicate_and_interleave_p (vec_info *, unsigned int count,
machine_mode elt_mode,
unsigned int *nvectors_out,
tree *vector_type_out,
tree *permutes)
......@@ -432,7 +433,7 @@ again:
|| dt == vect_external_def)
&& !current_vector_size.is_constant ()
&& (TREE_CODE (type) == BOOLEAN_TYPE
|| !can_duplicate_and_interleave_p (stmts.length (),
|| !can_duplicate_and_interleave_p (vinfo, stmts.length (),
TYPE_MODE (type))))
{
if (dump_enabled_p ())
......@@ -3183,7 +3184,7 @@ vect_mask_constant_operand_p (stmt_vec_info stmt_vinfo)
to cut down on the number of interleaves. */
void
duplicate_and_interleave (vec_info *, gimple_seq *seq, tree vector_type,
duplicate_and_interleave (vec_info *vinfo, gimple_seq *seq, tree vector_type,
vec<tree> elts, unsigned int nresults,
vec<tree> &results)
{
......@@ -3194,7 +3195,7 @@ duplicate_and_interleave (vec_info *, gimple_seq *seq, tree vector_type,
unsigned int nvectors = 1;
tree new_vector_type;
tree permutes[2];
if (!can_duplicate_and_interleave_p (nelts, TYPE_MODE (element_type),
if (!can_duplicate_and_interleave_p (vinfo, nelts, TYPE_MODE (element_type),
&nvectors, &new_vector_type,
permutes))
gcc_unreachable ();
......
......@@ -1751,7 +1751,8 @@ extern void vect_get_slp_defs (vec<tree> , slp_tree, vec<vec<tree> > *);
extern bool vect_slp_bb (basic_block);
extern stmt_vec_info vect_find_last_scalar_stmt_in_slp (slp_tree);
extern bool is_simple_and_all_uses_invariant (stmt_vec_info, loop_vec_info);
extern bool can_duplicate_and_interleave_p (unsigned int, machine_mode,
extern bool can_duplicate_and_interleave_p (vec_info *, unsigned int,
machine_mode,
unsigned int * = NULL,
tree * = NULL, tree * = NULL);
extern void duplicate_and_interleave (vec_info *, gimple_seq *, tree,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment