From dcab2a0d1d4b2c0b4bba6f5e3834ec0678a2a5c8 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 21 Oct 2019 06:40:44 +0000 Subject: [PATCH] Pass a vec_info to vect_supportable_direct_optab_p 2019-10-21 Richard Sandiford 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 | 8 ++++++++ gcc/tree-vect-patterns.c | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 529a562d82f..d3cba283190 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-21 Richard Sandiford + + * 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 * tree-vectorizer.h (vect_supportable_shift): Take a vec_info. diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 4faa6e7ddd8..b0b31636e37 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -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); -- 2.30.2