From: rsandifo Date: Mon, 21 Oct 2019 06:40:41 +0000 (+0000) Subject: Pass a vec_info to vect_supportable_shift X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2251dcb34a121e2b8ef7fac458fcbd8289aa5ad;p=thirdparty%2Fgcc.git Pass a vec_info to vect_supportable_shift 2019-10-21 Richard Sandiford 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277224 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4460d1e9e9da..529a562d82f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-21 Richard Sandiford + + * 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 * tree-vectorizer.c (get_vec_alignment_for_array_type): Use diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 5387563a15ed..4faa6e7ddd87 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -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. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index acdd90784dcf..f76b5d4aac70 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -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; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 5c3b3c9b91ee..e1016d875f72 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -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*);