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

gcc/
* tree-vect-patterns.c (vect_supportable_direct_optab_p): Take
a vec_info.
(vect_recog_dot_prod_pattern): Update call accordingly.
(vect_recog_sad_pattern, vect_recog_pow_pattern): Likewise.
(vect_recog_widen_sum_pattern): Likewise.

From-SVN: r277225

gcc/ChangeLog
gcc/tree-vect-patterns.c

index 529a562d82f8c8f01ca9e6d7a9a89ef63bff0e9c..d3cba28319076d711cf441591f4b395a4a6c7d97 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-vect-patterns.c (vect_supportable_direct_optab_p): Take
+       a vec_info.
+       (vect_recog_dot_prod_pattern): Update call accordingly.
+       (vect_recog_sad_pattern, vect_recog_pow_pattern): Likewise.
+       (vect_recog_widen_sum_pattern): Likewise.
+
 2019-10-21  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-vectorizer.h (vect_supportable_shift): Take a vec_info.
index 4faa6e7ddd8700e0cccb026eb1620b079933df57..b0b31636e3799dcccb4212ff093174a7db2d4c3f 100644 (file)
@@ -187,7 +187,7 @@ vect_get_external_def_edge (vec_info *vinfo, tree var)
    is nonnull.  */
 
 static bool
-vect_supportable_direct_optab_p (tree otype, tree_code code,
+vect_supportable_direct_optab_p (vec_info *, tree otype, tree_code code,
                                 tree itype, tree *vecotype_out,
                                 tree *vecitype_out = NULL)
 {
@@ -985,7 +985,7 @@ vect_recog_dot_prod_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
   vect_pattern_detected ("vect_recog_dot_prod_pattern", last_stmt);
 
   tree half_vectype;
-  if (!vect_supportable_direct_optab_p (type, DOT_PROD_EXPR, half_type,
+  if (!vect_supportable_direct_optab_p (vinfo, type, DOT_PROD_EXPR, half_type,
                                        type_out, &half_vectype))
     return NULL;
 
@@ -1143,7 +1143,7 @@ vect_recog_sad_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
   vect_pattern_detected ("vect_recog_sad_pattern", last_stmt);
 
   tree half_vectype;
-  if (!vect_supportable_direct_optab_p (sum_type, SAD_EXPR, half_type,
+  if (!vect_supportable_direct_optab_p (vinfo, sum_type, SAD_EXPR, half_type,
                                        type_out, &half_vectype))
     return NULL;
 
@@ -1273,6 +1273,7 @@ vect_recog_widen_mult_pattern (stmt_vec_info last_stmt_info, tree *type_out)
 static gimple *
 vect_recog_pow_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
 {
+  vec_info *vinfo = stmt_vinfo->vinfo;
   gimple *last_stmt = stmt_vinfo->stmt;
   tree base, exp;
   gimple *stmt;
@@ -1366,7 +1367,7 @@ vect_recog_pow_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
       || (TREE_CODE (exp) == REAL_CST
           && real_equal (&TREE_REAL_CST (exp), &dconst2)))
     {
-      if (!vect_supportable_direct_optab_p (TREE_TYPE (base), MULT_EXPR,
+      if (!vect_supportable_direct_optab_p (vinfo, TREE_TYPE (base), MULT_EXPR,
                                            TREE_TYPE (base), type_out))
        return NULL;
 
@@ -1472,8 +1473,8 @@ vect_recog_widen_sum_pattern (stmt_vec_info stmt_vinfo, tree *type_out)
 
   vect_pattern_detected ("vect_recog_widen_sum_pattern", last_stmt);
 
-  if (!vect_supportable_direct_optab_p (type, WIDEN_SUM_EXPR, unprom0.type,
-                                       type_out))
+  if (!vect_supportable_direct_optab_p (vinfo, type, WIDEN_SUM_EXPR,
+                                       unprom0.type, type_out))
     return NULL;
 
   var = vect_recog_temp_ssa_var (type, NULL);