aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-07-31 14:24:02 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-07-31 14:24:02 +0000
commit91987857e694109fa312c9d2d83785aee5fb9c28 (patch)
tree3b452bba62175cb7ca1c21add51e201f53792dd3 /gcc/tree-vect-patterns.c
parentbeb456c375ea71d57e35400e9b7107e09e996965 (diff)
downloadgcc-91987857e694109fa312c9d2d83785aee5fb9c28.zip
gcc-91987857e694109fa312c9d2d83785aee5fb9c28.tar.gz
gcc-91987857e694109fa312c9d2d83785aee5fb9c28.tar.bz2
[27/46] Remove duplicated stmt_vec_info lookups
Various places called vect_dr_stmt or vinfo_for_stmt multiple times on the same input. This patch makes them reuse the earlier result. It also splits a couple of single vinfo_for_stmt calls out into separate statements so that they can be reused in later patches. 2018-07-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-data-refs.c (vect_analyze_data_ref_dependence) (vect_slp_analyze_node_dependences, vect_analyze_data_ref_accesses) (vect_permute_store_chain, vect_permute_load_chain) (vect_shift_permute_load_chain, vect_transform_grouped_load): Avoid repeated stmt_vec_info lookups. * tree-vect-loop-manip.c (vect_can_advance_ivs_p): Likewise. (vect_update_ivs_after_vectorizer): Likewise. * tree-vect-loop.c (vect_is_simple_reduction): Likewise. (vect_create_epilog_for_reduction, vectorizable_reduction): Likewise. * tree-vect-patterns.c (adjust_bool_stmts): Likewise. * tree-vect-slp.c (vect_analyze_slp_instance): Likewise. (vect_bb_slp_scalar_cost): Likewise. * tree-vect-stmts.c (get_group_alias_ptr_type): Likewise. From-SVN: r263142
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index d5cf851..9094441 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -3505,6 +3505,8 @@ static tree
adjust_bool_stmts (hash_set <gimple *> &bool_stmt_set,
tree out_type, gimple *stmt)
{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+
/* Gather original stmts in the bool pattern in their order of appearance
in the IL. */
auto_vec<gimple *> bool_stmts (bool_stmt_set.elements ());
@@ -3517,11 +3519,11 @@ adjust_bool_stmts (hash_set <gimple *> &bool_stmt_set,
hash_map <tree, tree> defs;
for (unsigned i = 0; i < bool_stmts.length (); ++i)
adjust_bool_pattern (gimple_assign_lhs (bool_stmts[i]),
- out_type, vinfo_for_stmt (stmt), defs);
+ out_type, stmt_info, defs);
/* Pop the last pattern seq stmt and install it as pattern root for STMT. */
gimple *pattern_stmt
- = gimple_seq_last_stmt (STMT_VINFO_PATTERN_DEF_SEQ (vinfo_for_stmt (stmt)));
+ = gimple_seq_last_stmt (STMT_VINFO_PATTERN_DEF_SEQ (stmt_info));
return gimple_assign_lhs (pattern_stmt);
}