summaryrefslogtreecommitdiff
path: root/gcc/lambda-code.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-20 20:25:54 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-20 20:25:54 +0000
commit6b421feb1404049aaedeedac8e2df3414cf6534f (patch)
tree45b8c5480ee9c4ad169479540e3dedfe214df603 /gcc/lambda-code.c
parenta002e999a1b878cb65b502fe5a33e3f5a012c2fa (diff)
downloadgcc-6b421feb1404049aaedeedac8e2df3414cf6534f.tar.gz
* tree-chrec.c (eq_evolutions_p): New.
* tree-chrec.h (eq_evolutions_p): Declared. * tree-data-ref.c: Fix formatting. (datadep_stats, dependence_stats): New. (gcd): Moved... (print_direction_vector): New. (dump_data_dependence_relation): Use print_direction_vector. (object_analysis, create_data_ref): Handle COMPONENT_REF. (compute_subscript_distance): Static. (initialize_data_dependence_relation): Static. Get the number of loops surrounding the references from the callers, and initialize DDR_SIZE_VECT to nb_loops. Use both base_addr_differ_p and base_object_differ_p analyzers. (analyze_ziv_subscript, analyze_siv_subscript_cst_affine, compute_overlap_steps_for_affine_1_2, analyze_subscript_affine_affine): Count the classified dependences. Print a message when a test failed. (can_use_analyze_subscript_affine_affine): New. (analyze_siv_subscript): Compute the data dependences on symbolic scevs that verify can_use_analyze_subscript_affine_affine. (chrec_steps_divide_constant_p): Returns true, false, or unknown. (analyze_miv_subscript): Update use of chrec_steps_divide_constant_p. Handle symbolic scevs. (analyze_overlapping_iterations): Let symbolic affine scevs to be analyzed. (subscript_dependence_tester): Moved... (build_classic_dist_vector, build_classic_dir_vector): Don't use lambda_vector_clear on newly allocated vectors. Get nb_loops from DDR_SIZE_VECT instead of getting it in parameter. (subscript_dependence_tester): ... here. Take as a parameter loop_nest_depth. Call build_classic_dist_vector and build_classic_dir_vector. (compute_affine_dependence): Update subscript_dependence_tester parameters. Update datadep_stats counters. Call compute_subscript_distance. (compute_self_dependence): Save the dist and dir vectors. Call compute_subscript_distance. (ddr_p, DEF_VEC_P(ddr_p), DEF_VEC_ALLOC_P(ddr_p,heap)): Moved... (compute_all_dependences): Reorder parameters as they were before conversion to VEC. Pass nb_loops and loop_nest_depth. Don't call compute_subscript_distance. Update the use of compute_affine_dependence and initialize_data_dependence_relation. (find_data_references_in_loop): Handle COMPONENT_REF. (compute_data_dependences_for_loop): Initialize dependence_stats. Don't call build_classic_dist_vector and build_classic_dir_vector. Update the parameters of initialize_data_dependence_relation and compute_all_dependences. Print the statistics from datadep_stats. (analyze_all_data_dependences): Static. Not used until the pass for checking the data dependences is contributed. * tree-data-ref.h (ddr_p, DEF_VEC_P(ddr_p), DEF_VEC_ALLOC_P(ddr_p,heap)): ... here. (initialize_data_dependence_relation, compute_affine_dependence, analyze_all_data_dependences, compute_subscript_distance): Removed. (print_direction_vector): New. * lambda.h (gcd): ... here. (lambda_vector_gcd): Moved here from gcd_vector. * lambda-code.c (gcd, gcd_vector): Removed. (lambda_compute_target_space): Use lambda_vector_gcd. Fix formatting. * Makefile.in (tree-vect-patterns.o): Depends on TREE_DATA_REF_H. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lambda-code.c')
-rw-r--r--gcc/lambda-code.c55
1 files changed, 8 insertions, 47 deletions
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index ee1d1692e47..9d61c774231 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1,5 +1,5 @@
/* Loop transformation code generation
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC.
@@ -441,45 +441,6 @@ lambda_lattice_compute_base (lambda_loopnest nest)
return ret;
}
-/* Compute the greatest common denominator of two numbers (A and B) using
- Euclid's algorithm. */
-
-static int
-gcd (int a, int b)
-{
-
- int x, y, z;
-
- x = abs (a);
- y = abs (b);
-
- while (x > 0)
- {
- z = y % x;
- y = x;
- x = z;
- }
-
- return (y);
-}
-
-/* Compute the greatest common denominator of a VECTOR of SIZE numbers. */
-
-static int
-gcd_vector (lambda_vector vector, int size)
-{
- int i;
- int gcd1 = 0;
-
- if (size > 0)
- {
- gcd1 = vector[0];
- for (i = 1; i < size; i++)
- gcd1 = gcd (gcd1, vector[i]);
- }
- return gcd1;
-}
-
/* Compute the least common multiple of two numbers A and B . */
static int
@@ -848,7 +809,7 @@ lambda_compute_target_space (lambda_loopnest auxillary_nest,
LN_LOOPS (target_nest)[i] = target_loop;
/* Computes the gcd of the coefficients of the linear part. */
- gcd1 = gcd_vector (target[i], i);
+ gcd1 = lambda_vector_gcd (target[i], i);
/* Include the denominator in the GCD. */
gcd1 = gcd (gcd1, determinant);
@@ -911,9 +872,9 @@ lambda_compute_target_space (lambda_loopnest auxillary_nest,
}
/* Find the gcd and divide by it here, rather than doing it
at the tree level. */
- gcd1 = gcd_vector (LLE_COEFFICIENTS (target_expr), depth);
- gcd2 = gcd_vector (LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
+ gcd1 = lambda_vector_gcd (LLE_COEFFICIENTS (target_expr), depth);
+ gcd2 = lambda_vector_gcd (LLE_INVARIANT_COEFFICIENTS (target_expr),
+ invariants);
gcd1 = gcd (gcd1, gcd2);
gcd1 = gcd (gcd1, LLE_CONSTANT (target_expr));
gcd1 = gcd (gcd1, LLE_DENOMINATOR (target_expr));
@@ -967,9 +928,9 @@ lambda_compute_target_space (lambda_loopnest auxillary_nest,
}
/* Find the gcd and divide by it here, instead of at the
tree level. */
- gcd1 = gcd_vector (LLE_COEFFICIENTS (target_expr), depth);
- gcd2 = gcd_vector (LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
+ gcd1 = lambda_vector_gcd (LLE_COEFFICIENTS (target_expr), depth);
+ gcd2 = lambda_vector_gcd (LLE_INVARIANT_COEFFICIENTS (target_expr),
+ invariants);
gcd1 = gcd (gcd1, gcd2);
gcd1 = gcd (gcd1, LLE_CONSTANT (target_expr));
gcd1 = gcd (gcd1, LLE_DENOMINATOR (target_expr));