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

gcc/
* tree-vectorizer.h (vect_supportable_shift): Take a vec_info.
* tree-vect-stmts.c (vect_supportable_shift): Likewise.
* tree-vect-patterns.c (vect_synth_mult_by_constant): Update call
accordingly.

From-SVN: r277224

gcc/ChangeLog
gcc/tree-vect-patterns.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h

index 4460d1e9e9da909e304986e66ffde0b25e84eacf..529a562d82f8c8f01ca9e6d7a9a89ef63bff0e9c 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-vectorizer.h (vect_supportable_shift): Take a vec_info.
+       * tree-vect-stmts.c (vect_supportable_shift): Likewise.
+       * tree-vect-patterns.c (vect_synth_mult_by_constant): Update call
+       accordingly.
+
 2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-vectorizer.c (get_vec_alignment_for_array_type): Use
index 5387563a15edfedbeab2b57d635f2a1304f20c8c..4faa6e7ddd8700e0cccb026eb1620b079933df57 100644 (file)
@@ -2720,6 +2720,7 @@ static gimple *
 vect_synth_mult_by_constant (tree op, tree val,
                             stmt_vec_info stmt_vinfo)
 {
+  vec_info *vinfo = stmt_vinfo->vinfo;
   tree itype = TREE_TYPE (op);
   machine_mode mode = TYPE_MODE (itype);
   struct algorithm alg;
@@ -2738,7 +2739,7 @@ vect_synth_mult_by_constant (tree op, tree val,
 
   /* Targets that don't support vector shifts but support vector additions
      can synthesize shifts that way.  */
-  bool synth_shift_p = !vect_supportable_shift (LSHIFT_EXPR, multtype);
+  bool synth_shift_p = !vect_supportable_shift (vinfo, LSHIFT_EXPR, multtype);
 
   HOST_WIDE_INT hwval = tree_to_shwi (val);
   /* Use MAX_COST here as we don't want to limit the sequence on rtx costs.
index acdd90784dcf4d6d354c85da2766884835be98bc..f76b5d4aac709e3b66515c263f05199cc9a6133d 100644 (file)
@@ -5465,7 +5465,7 @@ vectorizable_assignment (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
    either as shift by a scalar or by a vector.  */
 
 bool
-vect_supportable_shift (enum tree_code code, tree scalar_type)
+vect_supportable_shift (vec_info *, enum tree_code code, tree scalar_type)
 {
 
   machine_mode vec_mode;
index 5c3b3c9b91eecc2c48ef9985255335cf37841ce4..e1016d875f7266687d322b5bf078c76319a44e19 100644 (file)
@@ -1634,7 +1634,7 @@ extern void vect_get_load_cost (stmt_vec_info, int, bool,
                                stmt_vector_for_cost *, bool);
 extern void vect_get_store_cost (stmt_vec_info, int,
                                 unsigned int *, stmt_vector_for_cost *);
-extern bool vect_supportable_shift (enum tree_code, tree);
+extern bool vect_supportable_shift (vec_info *, enum tree_code, tree);
 extern tree vect_gen_perm_mask_any (tree, const vec_perm_indices &);
 extern tree vect_gen_perm_mask_checked (tree, const vec_perm_indices &);
 extern void optimize_mask_stores (class loop*);