Pass a vec_info to can_duplicate_and_interleave_p
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 21 Oct 2019 06:41:05 +0000 (06:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 21 Oct 2019 06:41:05 +0000 (06:41 +0000)
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

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

index 67b640cb42274813ffcd86236f24b2d0595468eb..efb89174cab698c82e5cae1aecd8112829a407ac 100644 (file)
@@ -1,3 +1,10 @@
+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.
index ecd972473b8ded199eb5b6437f0bdb21d25334b1..21a0eaeb6ccf20787f22aa411cfbb3ecf4749d11 100644 (file)
@@ -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,
index cf1ff5a2941454b931deb68e9d3735146ddf1a9b..ddb6086fbc9135e634b1ae4a5c9c36d1773e6aad 100644 (file)
@@ -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 ();
index ef5492536dce018521697ea61f57b44e60a02b24..e363d27eee5acf436056b1ec55ac140c38e73865 100644 (file)
@@ -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,