diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2011-01-25 06:48:32 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2011-01-25 06:48:32 +0000 |
commit | 5c640e296a195f791a8ace575c967d7e6f1b69e8 (patch) | |
tree | 161cf05bc35732e9546711884cdfa0e1b5cb902f /gcc/tree-data-ref.c | |
parent | ac53c0698a1eea50ce05c00d9e7d088c7e43f916 (diff) | |
download | gcc-5c640e296a195f791a8ace575c967d7e6f1b69e8.zip gcc-5c640e296a195f791a8ace575c967d7e6f1b69e8.tar.gz gcc-5c640e296a195f791a8ace575c967d7e6f1b69e8.tar.bz2 |
Pass to dr_analyze_indices the analysis loop for subscripts.
2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
* graphite-scop-detection.c (stmt_has_simple_data_refs_p): Update
call to graphite_find_data_references_in_stmt.
* graphite-sese-to-poly.c (outermost_loop_in_sese_1): New.
(try_generate_gimple_bb): Call outermost_loop_in_sese_1. Update
call to graphite_find_data_references_in_stmt.
(analyze_drs_in_stmts): Same.
* tree-data-ref.c (dr_analyze_indices): Pass in parameter the loop
in which the scalar analysis of indices is performed.
(create_data_ref): Same. Update call to dr_analyze_indices.
(find_data_references_in_stmt): Update call to create_data_ref.
(graphite_find_data_references_in_stmt): Same.
* tree-data-ref.h (graphite_find_data_references_in_stmt): Update
declaration.
(create_data_ref): Same.
* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Update
call to create_data_ref.
From-SVN: r169218
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index ccc0091..5aecbff 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -820,13 +820,11 @@ dr_analyze_innermost (struct data_reference *dr) } /* Determines the base object and the list of indices of memory reference - DR, analyzed in loop nest NEST. */ + DR, analyzed in LOOP and instantiated in loop nest NEST. */ static void -dr_analyze_indices (struct data_reference *dr, struct loop *nest) +dr_analyze_indices (struct data_reference *dr, loop_p nest, loop_p loop) { - gimple stmt = DR_STMT (dr); - struct loop *loop = loop_containing_stmt (stmt); VEC (tree, heap) *access_fns = NULL; tree ref = unshare_expr (DR_REF (dr)), aref = ref, op; tree base, off, access_fn = NULL_TREE; @@ -935,11 +933,13 @@ free_data_ref (data_reference_p dr) /* Analyzes memory reference MEMREF accessed in STMT. The reference is read if IS_READ is true, write otherwise. Returns the - data_reference description of MEMREF. NEST is the outermost loop of the - loop nest in that the reference should be analyzed. */ + data_reference description of MEMREF. NEST is the outermost loop + in which the reference should be instantiated, LOOP is the loop in + which the data reference should be analyzed. */ struct data_reference * -create_data_ref (struct loop *nest, tree memref, gimple stmt, bool is_read) +create_data_ref (loop_p nest, loop_p loop, tree memref, gimple stmt, + bool is_read) { struct data_reference *dr; @@ -956,7 +956,7 @@ create_data_ref (struct loop *nest, tree memref, gimple stmt, bool is_read) DR_IS_READ (dr) = is_read; dr_analyze_innermost (dr); - dr_analyze_indices (dr, nest); + dr_analyze_indices (dr, nest, loop); dr_analyze_alias (dr); if (dump_file && (dump_flags & TDF_DETAILS)) @@ -4079,7 +4079,8 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref) { - dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read); + dr = create_data_ref (nest, loop_containing_stmt (stmt), + *ref->pos, stmt, ref->is_read); gcc_assert (dr != NULL); /* FIXME -- data dependence analysis does not work correctly for objects @@ -4100,12 +4101,14 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, return ret; } -/* Stores the data references in STMT to DATAREFS. If there is an unanalyzable - reference, returns false, otherwise returns true. NEST is the outermost - loop of the loop nest in which the references should be analyzed. */ +/* Stores the data references in STMT to DATAREFS. If there is an + unanalyzable reference, returns false, otherwise returns true. + NEST is the outermost loop of the loop nest in which the references + should be instantiated, LOOP is the loop in which the references + should be analyzed. */ bool -graphite_find_data_references_in_stmt (struct loop *nest, gimple stmt, +graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt, VEC (data_reference_p, heap) **datarefs) { unsigned i; @@ -4122,7 +4125,7 @@ graphite_find_data_references_in_stmt (struct loop *nest, gimple stmt, FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref) { - dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read); + dr = create_data_ref (nest, loop, *ref->pos, stmt, ref->is_read); gcc_assert (dr != NULL); VEC_safe_push (data_reference_p, heap, *datarefs, dr); } |