aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorIra Rosen <ira.rosen@linaro.org>2011-03-24 08:23:39 +0000
committerIra Rosen <irar@gcc.gnu.org>2011-03-24 08:23:39 +0000
commitbfe068c3d311b07208084f3259929187f29ed37b (patch)
treeafb8a3198cdee843553c12f114920b4078828339 /gcc/tree-data-ref.c
parent3137991dfc4e0b6023c4b75b2ae1eb86bea32241 (diff)
downloadgcc-bfe068c3d311b07208084f3259929187f29ed37b.zip
gcc-bfe068c3d311b07208084f3259929187f29ed37b.tar.gz
gcc-bfe068c3d311b07208084f3259929187f29ed37b.tar.bz2
invoke.texi (max-stores-to-sink): Document.
* doc/invoke.texi (max-stores-to-sink): Document. * params.h (MAX_STORES_TO_SINK): Define. * opts.c (finish_options): Set MAX_STORES_TO_SINK to 0 if either vectorization or if-conversion is disabled. * tree-data-ref.c (dr_equal_offsets_p1): Moved and renamed from tree-vect-data-refs.c vect_equal_offsets. (dr_equal_offsets_p): New function. (find_data_references_in_bb): Remove static. * tree-data-ref.h (find_data_references_in_bb): Declare. (dr_equal_offsets_p): Likewise. * tree-vect-data-refs.c (vect_equal_offsets): Move to tree-data-ref.c. (vect_drs_dependent_in_basic_block): Update calls to vect_equal_offsets. (vect_check_interleaving): Likewise. * tree-ssa-phiopt.c: Include cfgloop.h and tree-data-ref.h. (cond_if_else_store_replacement): Rename to... (cond_if_else_store_replacement_1): ... this. Change arguments and documentation. (cond_if_else_store_replacement): New function. * Makefile.in (tree-ssa-phiopt.o): Adjust dependencies. * params.def (PARAM_MAX_STORES_TO_SINK): Define. From-SVN: r171381
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 62d024d..e01c677 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -991,6 +991,48 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple stmt,
return dr;
}
+/* Check if OFFSET1 and OFFSET2 (DR_OFFSETs of some data-refs) are identical
+ expressions. */
+static bool
+dr_equal_offsets_p1 (tree offset1, tree offset2)
+{
+ bool res;
+
+ STRIP_NOPS (offset1);
+ STRIP_NOPS (offset2);
+
+ if (offset1 == offset2)
+ return true;
+
+ if (TREE_CODE (offset1) != TREE_CODE (offset2)
+ || (!BINARY_CLASS_P (offset1) && !UNARY_CLASS_P (offset1)))
+ return false;
+
+ res = dr_equal_offsets_p1 (TREE_OPERAND (offset1, 0),
+ TREE_OPERAND (offset2, 0));
+
+ if (!res || !BINARY_CLASS_P (offset1))
+ return res;
+
+ res = dr_equal_offsets_p1 (TREE_OPERAND (offset1, 1),
+ TREE_OPERAND (offset2, 1));
+
+ return res;
+}
+
+/* Check if DRA and DRB have equal offsets. */
+bool
+dr_equal_offsets_p (struct data_reference *dra,
+ struct data_reference *drb)
+{
+ tree offset1, offset2;
+
+ offset1 = DR_OFFSET (dra);
+ offset2 = DR_OFFSET (drb);
+
+ return dr_equal_offsets_p1 (offset1, offset2);
+}
+
/* Returns true if FNA == FNB. */
static bool
@@ -4294,7 +4336,7 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt,
DATAREFS. Returns chrec_dont_know when failing to analyze a
difficult case, returns NULL_TREE otherwise. */
-static tree
+tree
find_data_references_in_bb (struct loop *loop, basic_block bb,
VEC (data_reference_p, heap) **datarefs)
{