On Mon, Jul 3, 2017 at 9:30 AM, Richard Sandiford
<richard.sandif...@linaro.org> wrote:
> 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.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Ok.

Thanks,
Richard.

> Richard
>
>
> 2017-07-03  Richard Sandiford  <richard.sandif...@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.
>
> Index: gcc/tree-data-ref.h
> ===================================================================
> --- gcc/tree-data-ref.h 2017-07-03 07:53:58.106558668 +0100
> +++ gcc/tree-data-ref.h 2017-07-03 08:03:19.181500132 +0100
> @@ -322,7 +322,7 @@ #define DDR_DIST_VECT(DDR, I) \
>  #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> *,
> Index: gcc/tree-data-ref.c
> ===================================================================
> --- gcc/tree-data-ref.c 2017-07-03 07:57:44.485520457 +0100
> +++ gcc/tree-data-ref.c 2017-07-03 08:03:19.181500132 +0100
> @@ -864,13 +864,12 @@ dr_analyze_innermost (struct data_refere
>                      fold_convert (ssizetype, base_iv.step),
>                      fold_convert (ssizetype, offset_iv.step));
>
> -  DR_BASE_ADDRESS (dr) = canonicalize_base_object_address (base_iv.base);
> +  drb->base_address = canonicalize_base_object_address (base_iv.base);
>
> -  DR_OFFSET (dr) = fold_convert (ssizetype, offset_iv.base);
> -  DR_INIT (dr) = init;
> -  DR_STEP (dr) = step;
> -
> -  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");
> Index: gcc/tree-predcom.c
> ===================================================================
> --- gcc/tree-predcom.c  2017-07-03 07:53:58.106558668 +0100
> +++ gcc/tree-predcom.c  2017-07-03 08:03:19.181500132 +0100
> @@ -1149,7 +1149,7 @@ find_looparound_phi (struct loop *loop,
>    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))

Reply via email to