Pass a vec_info to duplicate_and_interleave
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 21 Oct 2019 06:41:01 +0000 (06:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 21 Oct 2019 06:41:01 +0000 (06:41 +0000)
2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>

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

gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h

index 42762a9be4e735c2dec7a66f06a218da34eaee4d..67b640cb42274813ffcd86236f24b2d0595468eb 100644 (file)
@@ -1,3 +1,10 @@
+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.
+       * tree-vect-loop.c (get_initial_defs_for_reduction): Likewise.
+
 2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-vectorizer.h (get_vectype_for_scalar_type): Take a vec_info.
index 304bb5e597fc8348ce5a8b10298afe3e9ea2cc5d..ecd972473b8ded199eb5b6437f0bdb21d25334b1 100644 (file)
@@ -3878,6 +3878,7 @@ get_initial_defs_for_reduction (slp_tree slp_node,
 {
   vec<stmt_vec_info> 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;
            }
index 886bbce43ec8e898cd28b419f09105fb8813fad7..cf1ff5a2941454b931deb68e9d3735146ddf1a9b 100644 (file)
@@ -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<tree> elts,
-                         unsigned int nresults, vec<tree> &results)
+duplicate_and_interleave (vec_info *, gimple_seq *seq, tree vector_type,
+                         vec<tree> elts, unsigned int nresults,
+                         vec<tree> &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];
                }
index 108e704eaf176093c6eba63d83287cd4f2b3852b..ef5492536dce018521697ea61f57b44e60a02b24 100644 (file)
@@ -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<tree>,
-                                     unsigned int, vec<tree> &);
+extern void duplicate_and_interleave (vec_info *, gimple_seq *, tree,
+                                     vec<tree>, unsigned int, vec<tree> &);
 extern int vect_get_place_in_interleaving_chain (stmt_vec_info, stmt_vec_info);
 
 /* In tree-vect-patterns.c.  */