public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [2/7] Make dr_analyze_innermost operate on innermost_loop_behavior
@ 2017-07-03  7:31 Richard Sandiford
  2017-07-03  9:40 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2017-07-03  7:31 UTC (permalink / raw)
  To: gcc-patches

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?

Richard


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.

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
 
 \f
-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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2/7] Make dr_analyze_innermost operate on innermost_loop_behavior
  2017-07-03  7:31 [2/7] Make dr_analyze_innermost operate on innermost_loop_behavior Richard Sandiford
@ 2017-07-03  9:40 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-07-03  9:40 UTC (permalink / raw)
  To: GCC Patches, Richard Sandiford

On Mon, Jul 3, 2017 at 9:30 AM, Richard Sandiford
<richard.sandiford@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.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.
>
> 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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-03  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03  7:31 [2/7] Make dr_analyze_innermost operate on innermost_loop_behavior Richard Sandiford
2017-07-03  9:40 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).