summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-linear.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-05 16:50:47 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-05 16:50:47 +0000
commit1532ec98ed8763b683bf055299ea1c213203dd88 (patch)
tree04c21f33875e763a6900f3781420822aed5db6ec /gcc/tree-loop-linear.c
parent1da60ab0ff2214c59b6e1b8f8efe8ecee98f9811 (diff)
downloadgcc-1532ec98ed8763b683bf055299ea1c213203dd88.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-linear.c')
-rw-r--r--gcc/tree-loop-linear.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index 0b13e2b5524..da790dc842f 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -98,7 +98,7 @@ gather_interchange_stats (varray_type dependence_relations,
unsigned int *nb_deps_not_carried_by_loop,
unsigned int *access_strides)
{
- unsigned int i;
+ unsigned int i, j;
*dependence_steps = 0;
*nb_deps_not_carried_by_loop = 0;
@@ -106,7 +106,6 @@ gather_interchange_stats (varray_type dependence_relations,
for (i = 0; i < VARRAY_ACTIVE_SIZE (dependence_relations); i++)
{
- int dist;
struct data_dependence_relation *ddr =
(struct data_dependence_relation *)
VARRAY_GENERIC_PTR (dependence_relations, i);
@@ -114,21 +113,24 @@ gather_interchange_stats (varray_type dependence_relations,
/* If we don't know anything about this dependence, or the distance
vector is NULL, or there is no dependence, then there is no reuse of
data. */
-
- if (DDR_DIST_VECT (ddr) == NULL
- || DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
- || DDR_ARE_DEPENDENT (ddr) == chrec_known)
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
+ || DDR_ARE_DEPENDENT (ddr) == chrec_known
+ || DDR_NUM_DIST_VECTS (ddr) == 0)
continue;
-
-
- dist = DDR_DIST_VECT (ddr)[loop->depth - first_loop->depth];
- if (dist == 0)
- (*nb_deps_not_carried_by_loop) += 1;
- else if (dist < 0)
- (*dependence_steps) += -dist;
- else
- (*dependence_steps) += dist;
+ for (j = 0; j < DDR_NUM_DIST_VECTS (ddr); j++)
+ {
+ int dist = DDR_DIST_VECT (ddr, j)[loop->depth - first_loop->depth];
+
+ if (dist == 0)
+ (*nb_deps_not_carried_by_loop) += 1;
+
+ else if (dist < 0)
+ (*dependence_steps) += -dist;
+
+ else
+ (*dependence_steps) += dist;
+ }
}
/* Compute the access strides. */
@@ -307,16 +309,7 @@ linear_transform_loops (struct loops *loops)
VARRAY_GENERIC_PTR (dependence_relations, j);
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
- {
- fprintf (dump_file, "DISTANCE_V (");
- print_lambda_vector (dump_file, DDR_DIST_VECT (ddr),
- DDR_SIZE_VECT (ddr));
- fprintf (dump_file, ")\n");
- fprintf (dump_file, "DIRECTION_V (");
- print_lambda_vector (dump_file, DDR_DIR_VECT (ddr),
- DDR_SIZE_VECT (ddr));
- fprintf (dump_file, ")\n");
- }
+ dump_data_dependence_relation (dump_file, ddr);
}
fprintf (dump_file, "\n\n");
}