From: Richard Sandiford Date: Mon, 21 Oct 2019 06:41:01 +0000 (+0000) Subject: Pass a vec_info to duplicate_and_interleave X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cdbe6e9bb4ae2882f77f94993783085fa342a9f9;p=gcc.git Pass a vec_info to duplicate_and_interleave 2019-10-21 Richard Sandiford gcc/ * 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. * tree-vect-loop.c (get_initial_defs_for_reduction): Likewise. From-SVN: r277228 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42762a9be4e..67b640cb422 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-21 Richard Sandiford + + * 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. + * tree-vect-loop.c (get_initial_defs_for_reduction): Likewise. + 2019-10-21 Richard Sandiford * tree-vectorizer.h (get_vectype_for_scalar_type): Take a vec_info. diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 304bb5e597f..ecd972473b8 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3878,6 +3878,7 @@ get_initial_defs_for_reduction (slp_tree slp_node, { vec stmts = SLP_TREE_SCALAR_STMTS (slp_node); stmt_vec_info stmt_vinfo = stmts[0]; + vec_info *vinfo = stmt_vinfo->vinfo; unsigned HOST_WIDE_INT nunits; unsigned j, number_of_places_left_in_vector; tree vector_type; @@ -3970,7 +3971,7 @@ get_initial_defs_for_reduction (slp_tree slp_node, { /* First time round, duplicate ELTS to fill the required number of vectors. */ - duplicate_and_interleave (&ctor_seq, vector_type, elts, + duplicate_and_interleave (vinfo, &ctor_seq, vector_type, elts, number_of_vectors, *vec_oprnds); break; } diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 886bbce43ec..cf1ff5a2941 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -3183,8 +3183,9 @@ vect_mask_constant_operand_p (stmt_vec_info stmt_vinfo) to cut down on the number of interleaves. */ void -duplicate_and_interleave (gimple_seq *seq, tree vector_type, vec elts, - unsigned int nresults, vec &results) +duplicate_and_interleave (vec_info *, gimple_seq *seq, tree vector_type, + vec elts, unsigned int nresults, + vec &results) { unsigned int nelts = elts.length (); tree element_type = TREE_TYPE (vector_type); @@ -3473,8 +3474,8 @@ vect_get_constant_vectors (tree op, slp_tree slp_node, else { if (vec_oprnds->is_empty ()) - duplicate_and_interleave (&ctor_seq, vector_type, elts, - number_of_vectors, + duplicate_and_interleave (vinfo, &ctor_seq, vector_type, + elts, number_of_vectors, permute_results); vec_cst = permute_results[number_of_vectors - j - 1]; } diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 108e704eaf1..ef5492536dc 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1754,8 +1754,8 @@ 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, unsigned int * = NULL, tree * = NULL, tree * = NULL); -extern void duplicate_and_interleave (gimple_seq *, tree, vec, - unsigned int, vec &); +extern void duplicate_and_interleave (vec_info *, gimple_seq *, tree, + vec, unsigned int, vec &); extern int vect_get_place_in_interleaving_chain (stmt_vec_info, stmt_vec_info); /* In tree-vect-patterns.c. */