+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.
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,
(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)
|| 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 ())
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)
{
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 ();
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,