diff options
author | Richard Biener <rguenther@suse.de> | 2018-06-25 11:04:01 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-06-25 11:04:01 +0000 |
commit | ca823c85882f5a0ca9779d8cd7adfcec02549d3b (patch) | |
tree | 5ba2be9dfcf5d0e1a7deb28abaeace299556a695 /gcc/tree-vect-slp.c | |
parent | f2227a6696f136a181a208d291eb44769a7721e0 (diff) | |
download | gcc-ca823c85882f5a0ca9779d8cd7adfcec02549d3b.zip gcc-ca823c85882f5a0ca9779d8cd7adfcec02549d3b.tar.gz gcc-ca823c85882f5a0ca9779d8cd7adfcec02549d3b.tar.bz2 |
tree-vectorizer.h (struct vec_info_shared): New structure with parts split out from struct vec_info and loop_nest from...
2018-06-25 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (struct vec_info_shared): New structure
with parts split out from struct vec_info and loop_nest from
struct _loop_vec_info.
(struct vec_info): Adjust accordingly.
(struct _loop_vec_info): Likewise.
(LOOP_VINFO_LOOP_NEST): Adjust.
(LOOP_VINFO_DATAREFS): Likewise.
(LOOP_VINFO_DDRS): Likewise.
(struct _bb_vec_info): Likewise.
(BB_VINFO_DATAREFS): Likewise.
(BB_VINFO_DDRS): Likewise.
(struct _stmt_vec_info): Add dr_aux member.
(DR_VECT_AUX): Adjust to refer to member of DR_STMTs vinfo.
(DR_MISALIGNMENT_UNINITIALIZED): New.
(set_dr_misalignment): Adjust.
(dr_misalignment): Assert misalign isn't DR_MISALIGNMENT_UNINITIALIZED.
(vect_analyze_loop): Adjust prototype.
(vect_analyze_loop_form): Likewise.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependences):
Compute dependences lazily.
(vect_record_base_alignments): Use shared datarefs/ddrs.
(vect_verify_datarefs_alignment): Likewise.
(vect_analyze_data_refs_alignment): Likewise.
(vect_analyze_data_ref_accesses): Likewise.
(vect_analyze_data_refs): Likewise.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Add
constructor parameter for shared part.
(vect_analyze_loop_form): Pass in shared part and adjust.
(vect_analyze_loop_2): Pass in storage for the number of
stmts. Move loop nest finding to the caller. Compute
datarefs lazily.
(vect_analyze_loop): Pass in shared part.
(vect_transform_loop): Verify shared datarefs are unchanged.
* tree-vect-slp.c (_bb_vec_info::_bb_vec_info): Add
constructor parameter for shared part.
(vect_slp_analyze_bb_1): Pass in shared part and adjust.
(vect_slp_bb): Verify shared datarefs are unchanged before
transform.
* tree-vect-stmts.c (ensure_base_align): Adjust for DR_AUX
change.
(new_stmt_vec_info): Initialize DR_AUX misalignment to
DR_MISALIGNMENT_UNINITIALIZED.
* tree-vectorizer.c (vec_info::vec_info): Add constructor
parameter for shared part.
(vec_info::~vec_info): Adjust.
(vec_info_shared::vec_info_shared): New.
(vec_info_shared::~vec_info_shared): Likewise.
(vec_info_shared::save_datarefs): Likewise.
(vec_info_shared::check_datarefs): Likewise.
(try_vectorize_loop_1): Construct shared part live for analyses
of a single loop for multiple vector sizes.
* tree-parloops.c (gather_scalar_reductions): Adjust.
From-SVN: r262009
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 74abf5f..6739ade 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2440,8 +2440,9 @@ vect_detect_hybrid_slp (loop_vec_info loop_vinfo) REGION_BEGIN_IN (inclusive) and REGION_END_IN (exclusive). */ _bb_vec_info::_bb_vec_info (gimple_stmt_iterator region_begin_in, - gimple_stmt_iterator region_end_in) - : vec_info (vec_info::bb, init_cost (NULL)), + gimple_stmt_iterator region_end_in, + vec_info_shared *shared) + : vec_info (vec_info::bb, init_cost (NULL), shared), bb (gsi_bb (region_begin_in)), region_begin (region_begin_in), region_end (region_end_in) @@ -2803,7 +2804,7 @@ static bb_vec_info vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin, gimple_stmt_iterator region_end, vec<data_reference_p> datarefs, int n_stmts, - bool &fatal) + bool &fatal, vec_info_shared *shared) { bb_vec_info bb_vinfo; slp_instance instance; @@ -2823,11 +2824,12 @@ vect_slp_analyze_bb_1 (gimple_stmt_iterator region_begin, return NULL; } - bb_vinfo = new _bb_vec_info (region_begin, region_end); + bb_vinfo = new _bb_vec_info (region_begin, region_end, shared); if (!bb_vinfo) return NULL; BB_VINFO_DATAREFS (bb_vinfo) = datarefs; + bb_vinfo->shared->save_datarefs (); /* Analyze the data references. */ @@ -3018,14 +3020,16 @@ vect_slp_bb (basic_block bb) bool vectorized = false; bool fatal = false; + vec_info_shared shared; bb_vinfo = vect_slp_analyze_bb_1 (region_begin, region_end, - datarefs, insns, fatal); + datarefs, insns, fatal, &shared); if (bb_vinfo && dbg_cnt (vect_slp)) { if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "SLPing BB part\n"); + bb_vinfo->shared->check_datarefs (); vect_schedule_slp (bb_vinfo); unsigned HOST_WIDE_INT bytes; |