From: Richard Sandiford Date: Mon, 3 Jul 2017 13:36:26 +0000 (+0000) Subject: Make dr_analyze_innermost operate on innermost_loop_behavior X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abbe3756cd2374d23be9b9937b33401d231eb9b0;p=gcc.git 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 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0db67d6890..5abc06de67c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-07-03 Richard Sandiford + + * 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 * tree-vectorizer.h (_stmt_vec_info): Replace individual dr_* diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 0fcefdc43b1..1545fdb9076 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 0013049053f..c8bb813e77c 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 *, vec *, diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index 23e7870dd2d..6baa6062118 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))