aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-06-25 11:04:01 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-06-25 11:04:01 +0000
commitca823c85882f5a0ca9779d8cd7adfcec02549d3b (patch)
tree5ba2be9dfcf5d0e1a7deb28abaeace299556a695 /gcc/tree-vect-data-refs.c
parentf2227a6696f136a181a208d291eb44769a7721e0 (diff)
downloadgcc-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-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index db5232e..9f848fe 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -568,15 +568,20 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo,
DUMP_VECT_SCOPE ("vect_analyze_data_ref_dependences");
- LOOP_VINFO_DDRS (loop_vinfo)
- .create (LOOP_VINFO_DATAREFS (loop_vinfo).length ()
- * LOOP_VINFO_DATAREFS (loop_vinfo).length ());
+ if (!LOOP_VINFO_DDRS (loop_vinfo).exists ())
+ {
+ LOOP_VINFO_DDRS (loop_vinfo)
+ .create (LOOP_VINFO_DATAREFS (loop_vinfo).length ()
+ * LOOP_VINFO_DATAREFS (loop_vinfo).length ());
+ /* We need read-read dependences to compute
+ STMT_VINFO_SAME_ALIGN_REFS. */
+ if (!compute_all_dependences (LOOP_VINFO_DATAREFS (loop_vinfo),
+ &LOOP_VINFO_DDRS (loop_vinfo),
+ LOOP_VINFO_LOOP_NEST (loop_vinfo), true))
+ return false;
+ }
+
LOOP_VINFO_NO_DATA_DEPENDENCIES (loop_vinfo) = true;
- /* We need read-read dependences to compute STMT_VINFO_SAME_ALIGN_REFS. */
- if (!compute_all_dependences (LOOP_VINFO_DATAREFS (loop_vinfo),
- &LOOP_VINFO_DDRS (loop_vinfo),
- LOOP_VINFO_LOOP_NEST (loop_vinfo), true))
- return false;
/* For epilogues we either have no aliases or alias versioning
was applied to original loop. Therefore we may just get max_vf
@@ -833,7 +838,7 @@ vect_record_base_alignments (vec_info *vinfo)
struct loop *loop = loop_vinfo ? LOOP_VINFO_LOOP (loop_vinfo) : NULL;
data_reference *dr;
unsigned int i;
- FOR_EACH_VEC_ELT (vinfo->datarefs, i, dr)
+ FOR_EACH_VEC_ELT (vinfo->shared->datarefs, i, dr)
{
gimple *stmt = vect_dr_stmt (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -1155,7 +1160,7 @@ verify_data_ref_alignment (data_reference_p dr)
bool
vect_verify_datarefs_alignment (loop_vec_info vinfo)
{
- vec<data_reference_p> datarefs = vinfo->datarefs;
+ vec<data_reference_p> datarefs = vinfo->shared->datarefs;
struct data_reference *dr;
unsigned int i;
@@ -2353,14 +2358,14 @@ vect_analyze_data_refs_alignment (loop_vec_info vinfo)
/* Mark groups of data references with same alignment using
data dependence information. */
- vec<ddr_p> ddrs = vinfo->ddrs;
+ vec<ddr_p> ddrs = vinfo->shared->ddrs;
struct data_dependence_relation *ddr;
unsigned int i;
FOR_EACH_VEC_ELT (ddrs, i, ddr)
vect_find_same_alignment_drs (ddr);
- vec<data_reference_p> datarefs = vinfo->datarefs;
+ vec<data_reference_p> datarefs = vinfo->shared->datarefs;
struct data_reference *dr;
vect_record_base_alignments (vinfo);
@@ -2914,7 +2919,7 @@ bool
vect_analyze_data_ref_accesses (vec_info *vinfo)
{
unsigned int i;
- vec<data_reference_p> datarefs = vinfo->datarefs;
+ vec<data_reference_p> datarefs = vinfo->shared->datarefs;
struct data_reference *dr;
DUMP_VECT_SCOPE ("vect_analyze_data_ref_accesses");
@@ -4131,7 +4136,7 @@ vect_analyze_data_refs (vec_info *vinfo, poly_uint64 *min_vf)
/* Go through the data-refs, check that the analysis succeeded. Update
pointer from stmt_vec_info struct to DR and vectype. */
- vec<data_reference_p> datarefs = vinfo->datarefs;
+ vec<data_reference_p> datarefs = vinfo->shared->datarefs;
FOR_EACH_VEC_ELT (datarefs, i, dr)
{
gimple *stmt;