summaryrefslogtreecommitdiff
path: root/gcc/lambda.h
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.h
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.h')
-rw-r--r--gcc/lambda.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/gcc/lambda.h b/gcc/lambda.h
index 817f084351a..7a43be29b59 100644
--- a/gcc/lambda.h
+++ b/gcc/lambda.h
@@ -1,5 +1,5 @@
/* Lambda matrix and vector interface.
- 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.
@@ -380,6 +380,44 @@ print_lambda_vector (FILE * outfile, lambda_vector vector, int n)
fprintf (outfile, "\n");
}
+/* Compute the greatest common divisor of two numbers using
+ Euclid's algorithm. */
+
+static inline 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 divisor of a VECTOR of SIZE numbers. */
+
+static inline int
+lambda_vector_gcd (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;
+}
+
/* Returns true when the vector V is lexicographically positive, in
other words, when the first nonzero element is positive. */