summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-analyze.c
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2005-11-05 17:50:47 +0100
committerSebastian Pop <spop@gcc.gnu.org>2005-11-05 16:50:47 +0000
commit304afda64b71d7db8236375440c79ff0a7c3a748 (patch)
tree04c21f33875e763a6900f3781420822aed5db6ec /gcc/tree-vect-analyze.c
parent541c886c9f35a68fbe4e01d82c43909e9d0b4aa7 (diff)
downloadgcc-304afda64b71d7db8236375440c79ff0a7c3a748.tar.gz
lambda-code.c (lambda_transform_legal_p): Use DDR_NUM_DIST_VECTS for testing whether the data_dependence_relation...
* lambda-code.c (lambda_transform_legal_p): Use DDR_NUM_DIST_VECTS for testing whether the data_dependence_relation contains distance vectors. Iterate over all distance vectors of the ddr. * lambda.h: Define a vec of lambda_vector pointers. * tree-data-ref.c (dump_data_dependence_relation, dump_data_dependence_direction): Iterate over all distance and direction vectors of the ddr. (initialize_data_dependence_relation): Initialize DDR_DIR_VECTS and DDR_DIST_VECTS. (build_classic_dist_vector, build_classic_dir_vector): Push a set of distance/direction vectors instead of a single one. * tree-data-ref.h (dir_vects, dist_vects): Replace dir/dist lambda_vectors with a vec of lambda_vectors. (DDR_DIR_VECT, DDR_DIST_VECT): Redefined as operations on vec. (DDR_DIR_VECTS, DDR_DIST_VECTS, DDR_NUM_DIR_VECTS, DDR_NUM_DIST_VECTS): New. * tree-loop-linear.c (gather_interchange_stats): Test for the existence of distance vectors only after having checked that there is a dependence. Iterate over all distance vectors of the ddr. (linear_transform_loops): Use dump_data_dependence_relation. * tree-vect-analyze.c (vect_analyze_data_ref_dependence): Test for distance vectors using DDR_NUM_DIST_VECTS. Iterate over all the distance vectors of the ddr. From-SVN: r106530
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r--gcc/tree-vect-analyze.c84
1 files changed, 45 insertions, 39 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index a9681bd0c18..ab749fba34a 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -570,9 +570,9 @@ static bool
vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
loop_vec_info loop_vinfo)
{
+ unsigned int i;
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
- int dist = 0;
unsigned int loop_depth = 0;
struct loop *loop_nest = loop;
struct data_reference *dra = DDR_A (ddr);
@@ -596,7 +596,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
return true;
}
- if (!DDR_DIST_VECT (ddr))
+ if (DDR_NUM_DIST_VECTS (ddr) == 0)
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
@@ -614,48 +614,54 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
loop_nest = loop_nest->outer;
loop_depth++;
}
-
- dist = DDR_DIST_VECT (ddr)[loop_depth];
- if (vect_print_dump_info (REPORT_DR_DETAILS))
- fprintf (vect_dump, "dependence distance = %d.",dist);
- /* Same loop iteration. */
- if (dist % vectorization_factor == 0)
+ for (i = 0; i < DDR_NUM_DIST_VECTS (ddr); i++)
{
- /* Two references with distance zero have the same alignment. */
- VEC_safe_push (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmtinfo_a), drb);
- VEC_safe_push (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmtinfo_b), dra);
- if (vect_print_dump_info (REPORT_ALIGNMENT))
- fprintf (vect_dump, "accesses have the same alignment.");
- if (vect_print_dump_info (REPORT_DR_DETAILS))
- {
- fprintf (vect_dump, "dependence distance modulo vf == 0 between ");
- print_generic_expr (vect_dump, DR_REF (dra), TDF_SLIM);
- fprintf (vect_dump, " and ");
- print_generic_expr (vect_dump, DR_REF (drb), TDF_SLIM);
- }
- return false;
- }
+ int dist = DDR_DIST_VECT (ddr, i)[loop_depth];
- if (abs (dist) >= vectorization_factor)
- {
- /* Dependence distance does not create dependence, as far as vectorization
- is concerned, in this case. */
if (vect_print_dump_info (REPORT_DR_DETAILS))
- fprintf (vect_dump, "dependence distance >= VF.");
- return false;
- }
-
- if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
- {
- fprintf (vect_dump,
- "not vectorized: possible dependence between data-refs ");
- print_generic_expr (vect_dump, DR_REF (dra), TDF_SLIM);
- fprintf (vect_dump, " and ");
- print_generic_expr (vect_dump, DR_REF (drb), TDF_SLIM);
+ fprintf (vect_dump, "dependence distance = %d.", dist);
+
+ /* Same loop iteration. */
+ if (dist % vectorization_factor == 0)
+ {
+ /* Two references with distance zero have the same alignment. */
+ VEC_safe_push (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmtinfo_a), drb);
+ VEC_safe_push (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmtinfo_b), dra);
+ if (vect_print_dump_info (REPORT_ALIGNMENT))
+ fprintf (vect_dump, "accesses have the same alignment.");
+ if (vect_print_dump_info (REPORT_DR_DETAILS))
+ {
+ fprintf (vect_dump, "dependence distance modulo vf == 0 between ");
+ print_generic_expr (vect_dump, DR_REF (dra), TDF_SLIM);
+ fprintf (vect_dump, " and ");
+ print_generic_expr (vect_dump, DR_REF (drb), TDF_SLIM);
+ }
+ continue;
+ }
+
+ if (abs (dist) >= vectorization_factor)
+ {
+ /* Dependence distance does not create dependence, as far as vectorization
+ is concerned, in this case. */
+ if (vect_print_dump_info (REPORT_DR_DETAILS))
+ fprintf (vect_dump, "dependence distance >= VF.");
+ continue;
+ }
+
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
+ {
+ fprintf (vect_dump,
+ "not vectorized: possible dependence between data-refs ");
+ print_generic_expr (vect_dump, DR_REF (dra), TDF_SLIM);
+ fprintf (vect_dump, " and ");
+ print_generic_expr (vect_dump, DR_REF (drb), TDF_SLIM);
+ }
+
+ return true;
}
-
- return true;
+
+ return false;
}