diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-15 16:13:33 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-15 16:13:33 +0000 |
commit | 2e54c85da51bec4d019f0d04f391314939247df7 (patch) | |
tree | 2a696ea15c824e9308e4456e69b42c210b4e281b /gcc/tree-data-ref.h | |
parent | bc55e08243291d5cd3f306ae2e452fec00eb722a (diff) | |
download | gcc-2e54c85da51bec4d019f0d04f391314939247df7.tar.gz |
2008-10-15 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/37686
* testsuite/gcc.dg/tree-ssa/pr37686.c: New.
* tree-loop-linear.c (linear_transform_loops): Build a
loop nest vector. Pass it to lambda_compute_access_matrices.
* tree-data-ref.h (struct access_matrix): Store the loop nest
relative to which it encodes the information.
(AM_LOOP_NEST_NUM): Renamed AM_LOOP_NEST.
(am_vector_index_for_loop): Reimplemented: iterate over the
loop nest for finding the loop index in the access matrix.
(lambda_compute_access_matrices): Update declaration.
* lambda-code.c (build_access_matrix): Pass the loop nest and
record it.
(lambda_compute_access_matrices): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141141 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.h')
-rw-r--r-- | gcc/tree-data-ref.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h index ee514c5ee92..bd36d237e7e 100644 --- a/gcc/tree-data-ref.h +++ b/gcc/tree-data-ref.h @@ -128,13 +128,13 @@ typedef struct scop *scop_p; */ struct access_matrix { - int loop_nest_num; + VEC (loop_p, heap) *loop_nest; int nb_induction_vars; VEC (tree, heap) *parameters; VEC (lambda_vector, heap) *matrix; }; -#define AM_LOOP_NEST_NUM(M) (M)->loop_nest_num +#define AM_LOOP_NEST(M) (M)->loop_nest #define AM_NB_INDUCTION_VARS(M) (M)->nb_induction_vars #define AM_PARAMETERS(M) (M)->parameters #define AM_MATRIX(M) (M)->matrix @@ -149,8 +149,14 @@ struct access_matrix static inline int am_vector_index_for_loop (struct access_matrix *access_matrix, int loop_num) { - gcc_assert (loop_num >= AM_LOOP_NEST_NUM (access_matrix)); - return loop_num - AM_LOOP_NEST_NUM (access_matrix); + int i; + loop_p l; + + for (i = 0; VEC_iterate (loop_p, AM_LOOP_NEST (access_matrix), i, l); i++) + if (l->num == loop_num) + return i; + + gcc_unreachable(); } int access_matrix_get_index_for_parameter (tree, struct access_matrix *); @@ -581,7 +587,7 @@ bool lambda_transform_legal_p (lambda_trans_matrix, int, void lambda_collect_parameters (VEC (data_reference_p, heap) *, VEC (tree, heap) **); bool lambda_compute_access_matrices (VEC (data_reference_p, heap) *, - VEC (tree, heap) *, int); + VEC (tree, heap) *, VEC (loop_p, heap) *); /* In tree-data-ref.c */ void split_constant_offset (tree , tree *, tree *); |