diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:21:41 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:21:41 +0000 |
commit | 6585ff8f3a55bbfed6a4f2c2addac7a27ed087d3 (patch) | |
tree | 61540cd369e12398dc0d0ced819f84da27426967 /gcc/tree-vect-patterns.c | |
parent | 4fbeb36361aab0c197c01f6268e442446f2c1fa8 (diff) | |
download | gcc-6585ff8f3a55bbfed6a4f2c2addac7a27ed087d3.zip gcc-6585ff8f3a55bbfed6a4f2c2addac7a27ed087d3.tar.gz gcc-6585ff8f3a55bbfed6a4f2c2addac7a27ed087d3.tar.bz2 |
[07/46] Add vec_info::lookup_stmt
This patch adds a vec_info replacement for vinfo_for_stmt. The main
difference is that the new routine can cope with arbitrary statements,
so there's no need to call vect_stmt_in_region_p first.
The patch only converts calls that are still needed at the end of the
series. Later patches get rid of most other calls to vinfo_for_stmt.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (vec_info::lookup_stmt): Declare.
* tree-vectorizer.c (vec_info::lookup_stmt): New function.
* tree-vect-loop.c (vect_determine_vf_for_stmt): Use it instead
of vinfo_for_stmt.
(vect_determine_vectorization_factor, vect_analyze_scalar_cycles_1)
(vect_compute_single_scalar_iteration_cost, vect_analyze_loop_form)
(vect_update_vf_for_slp, vect_analyze_loop_operations)
(vect_is_slp_reduction, vectorizable_induction)
(vect_transform_loop_stmt, vect_transform_loop): Likewise.
* tree-vect-patterns.c (vect_init_pattern_stmt):
(vect_determine_min_output_precision_1, vect_determine_precisions)
(vect_pattern_recog): Likewise.
* tree-vect-stmts.c (vect_analyze_stmt, vect_transform_stmt): Likewise.
* config/powerpcspe/powerpcspe.c (rs6000_density_test): Likewise.
* config/rs6000/rs6000.c (rs6000_density_test): Likewise.
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Likewise.
(vect_detect_hybrid_slp_1, vect_detect_hybrid_slp_2)
(vect_detect_hybrid_slp): Likewise. Change the walk_stmt_info
info field from a loop to a loop_vec_info.
From-SVN: r263122
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 1a431e7..de0454b 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -101,7 +101,8 @@ static void vect_init_pattern_stmt (gimple *pattern_stmt, stmt_vec_info orig_stmt_info, tree vectype) { - stmt_vec_info pattern_stmt_info = vinfo_for_stmt (pattern_stmt); + vec_info *vinfo = orig_stmt_info->vinfo; + stmt_vec_info pattern_stmt_info = vinfo->lookup_stmt (pattern_stmt); if (pattern_stmt_info == NULL) pattern_stmt_info = orig_stmt_info->vinfo->add_stmt (pattern_stmt); gimple_set_bb (pattern_stmt, gimple_bb (orig_stmt_info->stmt)); @@ -4401,6 +4402,7 @@ static bool vect_determine_min_output_precision_1 (stmt_vec_info stmt_info, tree lhs) { /* Take the maximum precision required by users of the result. */ + vec_info *vinfo = stmt_info->vinfo; unsigned int precision = 0; imm_use_iterator iter; use_operand_p use; @@ -4409,10 +4411,8 @@ vect_determine_min_output_precision_1 (stmt_vec_info stmt_info, tree lhs) gimple *use_stmt = USE_STMT (use); if (is_gimple_debug (use_stmt)) continue; - if (!vect_stmt_in_region_p (stmt_info->vinfo, use_stmt)) - return false; - stmt_vec_info use_stmt_info = vinfo_for_stmt (use_stmt); - if (!use_stmt_info->min_input_precision) + stmt_vec_info use_stmt_info = vinfo->lookup_stmt (use_stmt); + if (!use_stmt_info || !use_stmt_info->min_input_precision) return false; precision = MAX (precision, use_stmt_info->min_input_precision); } @@ -4657,7 +4657,8 @@ vect_determine_precisions (vec_info *vinfo) basic_block bb = bbs[nbbs - i - 1]; for (gimple_stmt_iterator si = gsi_last_bb (bb); !gsi_end_p (si); gsi_prev (&si)) - vect_determine_stmt_precisions (vinfo_for_stmt (gsi_stmt (si))); + vect_determine_stmt_precisions + (vinfo->lookup_stmt (gsi_stmt (si))); } } else @@ -4672,7 +4673,7 @@ vect_determine_precisions (vec_info *vinfo) else gsi_prev (&si); stmt = gsi_stmt (si); - stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + stmt_vec_info stmt_info = vinfo->lookup_stmt (stmt); if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) vect_determine_stmt_precisions (stmt_info); } @@ -4971,7 +4972,7 @@ vect_pattern_recog (vec_info *vinfo) gsi_stmt (si) != gsi_stmt (bb_vinfo->region_end); gsi_next (&si)) { gimple *stmt = gsi_stmt (si); - stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + stmt_vec_info stmt_info = bb_vinfo->lookup_stmt (stmt); if (stmt_info && !STMT_VINFO_VECTORIZABLE (stmt_info)) continue; |