diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-03 23:27:03 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-03 23:27:03 +0000 |
commit | 02d46b9ca58a31fc5c45d606c768f271d7f11f93 (patch) | |
tree | e8668484a32fe653ef2fa654205db61ca3a6e327 /gcc/tree-data-ref.c | |
parent | 9e8dd3d2b18467bd58927b97f275c6f8f9a7db8b (diff) | |
download | gcc-02d46b9ca58a31fc5c45d606c768f271d7f11f93.tar.gz |
2005-06-03 Sebastian Pop <pop@cri.ensmp.fr>
* tree-data-ref.c (compute_self_dependence): New function.
(compute_all_dependences): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index c1fdb8ff53a..50b805b876c 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -2177,6 +2177,25 @@ compute_affine_dependence (struct data_dependence_relation *ddr) fprintf (dump_file, ")\n"); } +/* This computes the dependence relation for the same data + reference into DDR. */ + +static void +compute_self_dependence (struct data_dependence_relation *ddr) +{ + unsigned int i; + + for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++) + { + struct subscript *subscript = DDR_SUBSCRIPT (ddr, i); + + /* The accessed index overlaps for each iteration. */ + SUB_CONFLICTS_IN_A (subscript) = integer_zero_node; + SUB_CONFLICTS_IN_B (subscript) = integer_zero_node; + SUB_LAST_CONFLICT (subscript) = chrec_dont_know; + } +} + typedef struct data_dependence_relation *ddr_p; DEF_VEC_P(ddr_p); @@ -2196,8 +2215,11 @@ compute_all_dependences (varray_type datarefs, N = VARRAY_ACTIVE_SIZE (datarefs); + /* Note that we specifically skip i == j because it's a self dependence, and + use compute_self_dependence below. */ + for (i = 0; i < N; i++) - for (j = i; j < N; j++) + for (j = i + 1; j < N; j++) { struct data_reference *a, *b; struct data_dependence_relation *ddr; @@ -2210,6 +2232,22 @@ compute_all_dependences (varray_type datarefs, compute_affine_dependence (ddr); compute_subscript_distance (ddr); } + + /* Compute self dependence relation of each dataref to itself. */ + + for (i = 0; i < N; i++) + { + struct data_reference *a, *b; + struct data_dependence_relation *ddr; + + a = VARRAY_GENERIC_PTR (datarefs, i); + b = VARRAY_GENERIC_PTR (datarefs, i); + ddr = initialize_data_dependence_relation (a, b); + + VEC_safe_push (ddr_p, heap, *dependence_relations, ddr); + compute_self_dependence (ddr); + compute_subscript_distance (ddr); + } } /* Search the data references in LOOP, and record the information into |