aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-03-18 10:25:42 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-03-18 10:25:42 +0000
commitfcac74a177b6c86bf70320aae7145f3b79e54739 (patch)
treed1488179bfed051c219f22ecde86646c070342c7 /gcc/tree-data-ref.c
parentad6fdc197621e1f48d72df91f021c187949ba6c2 (diff)
downloadgcc-fcac74a177b6c86bf70320aae7145f3b79e54739.zip
gcc-fcac74a177b6c86bf70320aae7145f3b79e54739.tar.gz
gcc-fcac74a177b6c86bf70320aae7145f3b79e54739.tar.bz2
tree-data-ref.h (find_data_references_in_loop): Declare.
2013-03-18 Richard Biener <rguenther@suse.de> * tree-data-ref.h (find_data_references_in_loop): Declare. * tree-data-ref.c (get_references_in_stmt): Use a stack vector pre-allocated in the callers. (find_data_references_in_stmt): Adjust. (graphite_find_data_references_in_stmt): Likewise. (create_rdg_vertices): Likewise. (find_data_references_in_loop): Export. * tree-vect-data-refs.c (vect_analyze_data_ref_dependences): Compute dependences here... (vect_analyze_data_refs): ...not here. When we encounter a non-vectorizable data reference in basic-block vectorization truncate the data reference vector. Do not bother to fixup data-dependence information for gather loads. * tree-vect-slp.c (vect_slp_analyze_bb_1): Check the number of data references, as reported. From-SVN: r196775
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index ebb7f30..a387d82 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -4257,11 +4257,11 @@ compute_all_dependences (vec<data_reference_p> datarefs,
typedef struct data_ref_loc_d
{
- /* Position of the memory reference. */
- tree *pos;
+ /* Position of the memory reference. */
+ tree *pos;
- /* True if the memory reference is read. */
- bool is_read;
+ /* True if the memory reference is read. */
+ bool is_read;
} data_ref_loc;
@@ -4269,15 +4269,13 @@ typedef struct data_ref_loc_d
true if STMT clobbers memory, false otherwise. */
static bool
-get_references_in_stmt (gimple stmt, vec<data_ref_loc> *references)
+get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_stack> *references)
{
bool clobbers_memory = false;
data_ref_loc ref;
tree *op0, *op1;
enum gimple_code stmt_code = gimple_code (stmt);
- references->create (0);
-
/* ASM_EXPR and CALL_EXPR may embed arbitrary side effects.
As we cannot model data-references to not spelled out
accesses give up if they may occur. */
@@ -4348,11 +4346,12 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt,
vec<data_reference_p> *datarefs)
{
unsigned i;
- vec<data_ref_loc> references;
+ vec<data_ref_loc, va_stack> references;
data_ref_loc *ref;
bool ret = true;
data_reference_p dr;
+ vec_stack_alloc (data_ref_loc, references, 2);
if (get_references_in_stmt (stmt, &references))
{
references.release ();
@@ -4381,11 +4380,12 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt,
vec<data_reference_p> *datarefs)
{
unsigned i;
- vec<data_ref_loc> references;
+ vec<data_ref_loc, va_stack> references;
data_ref_loc *ref;
bool ret = true;
data_reference_p dr;
+ vec_stack_alloc (data_ref_loc, references, 2);
if (get_references_in_stmt (stmt, &references))
{
references.release ();
@@ -4437,7 +4437,7 @@ find_data_references_in_bb (struct loop *loop, basic_block bb,
TODO: This function should be made smarter so that it can handle address
arithmetic as if they were array accesses, etc. */
-static tree
+tree
find_data_references_in_loop (struct loop *loop,
vec<data_reference_p> *datarefs)
{
@@ -5005,7 +5005,7 @@ create_rdg_vertices (struct graph *rdg, vec<gimple> stmts, loop_p loop)
FOR_EACH_VEC_ELT (stmts, i, stmt)
{
- vec<data_ref_loc> references;
+ vec<data_ref_loc, va_stack> references;
data_ref_loc *ref;
struct vertex *v = &(rdg->vertices[i]);
@@ -5020,6 +5020,7 @@ create_rdg_vertices (struct graph *rdg, vec<gimple> stmts, loop_p loop)
if (gimple_code (stmt) == GIMPLE_PHI)
continue;
+ vec_stack_alloc (data_ref_loc, references, 2);
get_references_in_stmt (stmt, &references);
FOR_EACH_VEC_ELT (references, j, ref)
{