aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-07-03 13:36:26 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-07-03 13:36:26 +0000
commitabbe3756cd2374d23be9b9937b33401d231eb9b0 (patch)
treebd2a0cbaf76fe375cab734bd599ca7a3c6d8783d
parentd8ac7e2840b8c9f3ac7a8197ca5e03bbc72ba090 (diff)
downloadgcc-abbe3756cd2374d23be9b9937b33401d231eb9b0.zip
gcc-abbe3756cd2374d23be9b9937b33401d231eb9b0.tar.gz
gcc-abbe3756cd2374d23be9b9937b33401d231eb9b0.tar.bz2
Make dr_analyze_innermost operate on innermost_loop_behavior
This means that callers to dr_analyze_innermost don't need a full data_reference and don't need to fill in any fields beforehand. 2017-07-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-data-ref.h (dr_analyze_innermost): Replace the dr argument with a "innermost_loop_behavior *" and refeence tree. * tree-data-ref.c (dr_analyze_innermost): Likewise. (create_data_ref): Update call accordingly. * tree-predcom.c (find_looparound_phi): Likewise. From-SVN: r249913
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-data-ref.c22
-rw-r--r--gcc/tree-data-ref.h2
-rw-r--r--gcc/tree-predcom.c2
4 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a0db67d..5abc06d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2017-07-03 Richard Sandiford <richard.sandiford@linaro.org>
+ * tree-data-ref.h (dr_analyze_innermost): Replace the dr argument
+ with a "innermost_loop_behavior *" and refeence tree.
+ * tree-data-ref.c (dr_analyze_innermost): Likewise.
+ (create_data_ref): Update call accordingly.
+ * tree-predcom.c (find_looparound_phi): Likewise.
+
+2017-07-03 Richard Sandiford <richard.sandiford@linaro.org>
+
* tree-vectorizer.h (_stmt_vec_info): Replace individual dr_*
fields with dr_wrt_vec_loop.
(STMT_VINFO_DR_BASE_ADDRESS, STMT_VINFO_DR_INIT, STMT_VINFO_DR_OFFSET)
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 0fcefdc..1545fdb 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -749,7 +749,7 @@ canonicalize_base_object_address (tree addr)
return build_fold_addr_expr (TREE_OPERAND (addr, 0));
}
-/* Analyze the behavior of memory reference DR. There are two modes:
+/* Analyze the behavior of memory reference REF. There are two modes:
- BB analysis. In this case we simply split the address into base,
init and offset components, without reference to any containing loop.
@@ -766,13 +766,13 @@ canonicalize_base_object_address (tree addr)
Perform BB analysis if LOOP is null, or if LOOP is the function's
dummy outermost loop. In other cases perform loop analysis.
- Return true if the analysis succeeded and store the results in DR if so.
+ Return true if the analysis succeeded and store the results in DRB if so.
BB analysis can only fail for bitfield or reversed-storage accesses. */
bool
-dr_analyze_innermost (struct data_reference *dr, struct loop *loop)
+dr_analyze_innermost (innermost_loop_behavior *drb, tree ref,
+ struct loop *loop)
{
- tree ref = DR_REF (dr);
HOST_WIDE_INT pbitsize, pbitpos;
tree base, poffset;
machine_mode pmode;
@@ -864,13 +864,12 @@ dr_analyze_innermost (struct data_reference *dr, struct loop *loop)
fold_convert (ssizetype, base_iv.step),
fold_convert (ssizetype, offset_iv.step));
- DR_BASE_ADDRESS (dr) = canonicalize_base_object_address (base_iv.base);
-
- DR_OFFSET (dr) = fold_convert (ssizetype, offset_iv.base);
- DR_INIT (dr) = init;
- DR_STEP (dr) = step;
+ drb->base_address = canonicalize_base_object_address (base_iv.base);
- DR_ALIGNED_TO (dr) = size_int (highest_pow2_factor (offset_iv.base));
+ drb->offset = fold_convert (ssizetype, offset_iv.base);
+ drb->init = init;
+ drb->step = step;
+ drb->aligned_to = size_int (highest_pow2_factor (offset_iv.base));
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "success.\n");
@@ -1069,7 +1068,8 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple *stmt,
DR_REF (dr) = memref;
DR_IS_READ (dr) = is_read;
- dr_analyze_innermost (dr, nest != NULL ? loop : NULL);
+ dr_analyze_innermost (&DR_INNERMOST (dr), memref,
+ nest != NULL ? loop : NULL);
dr_analyze_indices (dr, nest, loop);
dr_analyze_alias (dr);
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 0013049..c8bb813 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -322,7 +322,7 @@ typedef struct data_dependence_relation *ddr_p;
#define DDR_REVERSED_P(DDR) (DDR)->reversed_p
-bool dr_analyze_innermost (struct data_reference *, struct loop *);
+bool dr_analyze_innermost (innermost_loop_behavior *, tree, struct loop *);
extern bool compute_data_dependences_for_loop (struct loop *, bool,
vec<loop_p> *,
vec<data_reference_p> *,
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 23e7870..6baa606 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1149,7 +1149,7 @@ find_looparound_phi (struct loop *loop, dref ref, dref root)
memset (&init_dr, 0, sizeof (struct data_reference));
DR_REF (&init_dr) = init_ref;
DR_STMT (&init_dr) = phi;
- if (!dr_analyze_innermost (&init_dr, loop))
+ if (!dr_analyze_innermost (&DR_INNERMOST (&init_dr), init_ref, loop))
return NULL;
if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref))