diff options
author | Sebastian Pop <pop@cri.ensmp.fr> | 2005-08-23 10:24:20 +0200 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2005-08-23 08:24:20 +0000 |
commit | 37b8a73b503a6d664904f511618b71ca37b3f6c0 (patch) | |
tree | 519608c83e01fb34fcdea8849d3554eaca59bf38 /gcc | |
parent | ce8f9416becbb4a98583e9cbd16a281b70a68938 (diff) | |
download | gcc-37b8a73b503a6d664904f511618b71ca37b3f6c0.zip gcc-37b8a73b503a6d664904f511618b71ca37b3f6c0.tar.gz gcc-37b8a73b503a6d664904f511618b71ca37b3f6c0.tar.bz2 |
lambda-code.c (lambda_vector_lexico_pos): Moved...
* lambda-code.c (lambda_vector_lexico_pos): Moved...
* lambda.h (lambda_vector_lexico_pos): ... here.
* tree-data-ref.c (build_classic_dist_vector): Return false when
the distance vector is lexicographically negative.
From-SVN: r103392
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lambda-code.c | 21 | ||||
-rw-r--r-- | gcc/lambda.h | 21 | ||||
-rw-r--r-- | gcc/tree-data-ref.c | 21 |
4 files changed, 47 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5de0010..a9275fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2005-08-23 Sebastian Pop <pop@cri.ensmp.fr> + * lambda-code.c (lambda_vector_lexico_pos): Moved... + * lambda.h (lambda_vector_lexico_pos): ... here. + * tree-data-ref.c (build_classic_dist_vector): Return false when + the distance vector is lexicographically negative. + +2005-08-23 Sebastian Pop <pop@cri.ensmp.fr> + PR tree-optimization/23511 * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Don't handle cases where TYPE_MIN_VALUE or TYPE_MAX_VALUE are NULL_TREE. diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 29b3e5a..cf995a3 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -2010,27 +2010,6 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, VEC_free (tree, heap, new_ivs); } -/* Returns true when the vector V is lexicographically positive, in - other words, when the first nonzero element is positive. */ - -static bool -lambda_vector_lexico_pos (lambda_vector v, - unsigned n) -{ - unsigned i; - for (i = 0; i < n; i++) - { - if (v[i] == 0) - continue; - if (v[i] < 0) - return false; - if (v[i] > 0) - return true; - } - return true; -} - - /* Return TRUE if this is not interesting statement from the perspective of determining if we have a perfect loop nest. */ diff --git a/gcc/lambda.h b/gcc/lambda.h index dea12ef..9855b6f 100644 --- a/gcc/lambda.h +++ b/gcc/lambda.h @@ -376,5 +376,26 @@ print_lambda_vector (FILE * outfile, lambda_vector vector, int n) fprintf (outfile, "%3d ", vector[i]); fprintf (outfile, "\n"); } + +/* Returns true when the vector V is lexicographically positive, in + other words, when the first nonzero element is positive. */ + +static inline bool +lambda_vector_lexico_pos (lambda_vector v, + unsigned n) +{ + unsigned i; + for (i = 0; i < n; i++) + { + if (v[i] == 0) + continue; + if (v[i] < 0) + return false; + if (v[i] > 0) + return true; + } + return true; +} + #endif /* LAMBDA_H */ diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 54494c2..d7a4253 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -3030,8 +3030,8 @@ subscript_dependence_tester (struct data_dependence_relation *ddr) NB_LOOPS is the total number of loops we are considering. FIRST_LOOP_DEPTH is the loop->depth of the first loop in the analyzed loop nest. - Return FALSE if the dependence relation is outside of the loop nest - starting at FIRST_LOOP_DEPTH. + Return FALSE when fail to represent the data dependence as a distance + vector. Return TRUE otherwise. */ static bool @@ -3196,6 +3196,23 @@ build_classic_dist_vector (struct data_dependence_relation *ddr, DDR_DIST_VECT (ddr) = dist_v; DDR_SIZE_VECT (ddr) = nb_loops; + + /* Verify a basic constraint: classic distance vectors should always + be lexicographically positive. */ + if (!lambda_vector_lexico_pos (DDR_DIST_VECT (ddr), + DDR_SIZE_VECT (ddr))) + { + if (DDR_SIZE_VECT (ddr) == 1) + /* This one is simple to fix, and can be fixed. + Multidimensional arrays cannot be fixed that simply. */ + lambda_vector_negate (DDR_DIST_VECT (ddr), DDR_DIST_VECT (ddr), + DDR_SIZE_VECT (ddr)); + else + /* This is not valid: we need the delta test for properly + fixing all this. */ + return false; + } + return true; } |