+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.
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)
{
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;
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;
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;
|| (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;
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);