diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:24:02 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:24:02 +0000 |
commit | 91987857e694109fa312c9d2d83785aee5fb9c28 (patch) | |
tree | 3b452bba62175cb7ca1c21add51e201f53792dd3 /gcc/tree-vect-loop-manip.c | |
parent | beb456c375ea71d57e35400e9b7107e09e996965 (diff) | |
download | gcc-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-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index 83ddff2..662f556 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1377,6 +1377,7 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo) tree evolution_part; gphi *phi = gsi.phi (); + stmt_vec_info phi_info = loop_vinfo->lookup_stmt (phi); if (dump_enabled_p ()) { dump_printf_loc (MSG_NOTE, vect_location, "Analyze phi: "); @@ -1397,8 +1398,7 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo) /* Analyze the evolution function. */ - evolution_part - = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (vinfo_for_stmt (phi)); + evolution_part = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (phi_info); if (evolution_part == NULL_TREE) { if (dump_enabled_p ()) @@ -1500,6 +1500,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, gphi *phi = gsi.phi (); gphi *phi1 = gsi1.phi (); + stmt_vec_info phi_info = loop_vinfo->lookup_stmt (phi); if (dump_enabled_p ()) { dump_printf_loc (MSG_NOTE, vect_location, @@ -1517,7 +1518,7 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, } type = TREE_TYPE (gimple_phi_result (phi)); - step_expr = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (vinfo_for_stmt (phi)); + step_expr = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (phi_info); step_expr = unshare_expr (step_expr); /* FORNOW: We do not support IVs whose evolution function is a polynomial |