public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bin Cheng <Bin.Cheng@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>
Subject: [PATCH GCC][5/6]Change parameters to make functions independent to vect structure
Date: Tue, 23 May 2017 16:23:00 -0000	[thread overview]
Message-ID: <VI1PR0802MB2176E6B3AA141AAFDFEF5590E7F90@VI1PR0802MB2176.eurprd08.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

Hi,
This is a simple patch changing parameter to below functions:
  create_intersect_range_checks_index
  create_intersect_range_checks
as well as updating calls to these functions.  This is to make
them independent to vectorizer's data structure.
Bootstrap and test on x86_64 and AArch64, is it OK?

Thanks,
bin
2017-05-22  Bin Cheng  <bin.cheng@arm.com>

	* tree-vect-loop-manip.c (create_intersect_range_checks_index): Pass
	in parameter loop, rather than loop_vinfo.
	(create_intersect_range_checks): Ditto.
	(vect_create_cond_for_alias_checks): Update call to above function.

[-- Attachment #2: 0005-parameter-20170516.txt --]
[-- Type: text/plain, Size: 3652 bytes --]

From a2c40984d2fb57e60f4d04f22c86b4dbbced425b Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Mon, 22 May 2017 12:03:45 +0100
Subject: [PATCH 5/6] parameter-20170516.txt

---
 gcc/tree-vect-loop-manip.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index f48336b..62b1fe8 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -2044,11 +2044,11 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
     *cond_expr = part_cond_expr;
 }
 
-/* Given two data references and segment lengths described by DR_A and DR_B,
-   create expression checking if the two addresses ranges intersect with
-   each other based on index of the two addresses.  This can only be done
-   if DR_A and DR_B referring to the same (array) object and the index is
-   the only difference.  For example:
+/* Given LOOP's two data references and segment lengths described by DR_A
+   and DR_B, create expression checking if the two addresses ranges intersect
+   with each other based on index of the two addresses.  This can only be
+   done if DR_A and DR_B referring to the same (array) object and the index
+   is the only difference.  For example:
 
                        DR_A                           DR_B
       data-ref         arr[i]                         arr[j]
@@ -2070,7 +2070,7 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
    Note evolution step of index needs to be considered in comparison.  */
 
 static bool
-create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
+create_intersect_range_checks_index (struct loop *loop, tree *cond_expr,
 				     const dr_with_seg_len& dr_a,
 				     const dr_with_seg_len& dr_b)
 {
@@ -2109,7 +2109,6 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
   unsigned HOST_WIDE_INT niter_len2 = (seg_len2 + abs_step - 1) / abs_step;
 
   unsigned int i;
-  struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
   for (i = 0; i < DR_NUM_DIMENSIONS (dr_a.dr); i++)
     {
       tree access1 = DR_ACCESS_FN (dr_a.dr, i);
@@ -2186,12 +2185,12 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
      || (DR_B_addr_0 + DER_B_segment_length_0) <= DR_A_addr_0))  */
 
 static void
-create_intersect_range_checks (loop_vec_info loop_vinfo, tree *cond_expr,
+create_intersect_range_checks (struct loop *loop, tree *cond_expr,
 			       const dr_with_seg_len& dr_a,
 			       const dr_with_seg_len& dr_b)
 {
   *cond_expr = NULL_TREE;
-  if (create_intersect_range_checks_index (loop_vinfo, cond_expr, dr_a, dr_b))
+  if (create_intersect_range_checks_index (loop, cond_expr, dr_a, dr_b))
     return;
 
   tree segment_length_a = dr_a.seg_len;
@@ -2263,6 +2262,7 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, tree * cond_expr)
   if (comp_alias_ddrs.is_empty ())
     return;
 
+  struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
   for (size_t i = 0, s = comp_alias_ddrs.length (); i < s; ++i)
     {
       const dr_with_seg_len& dr_a = comp_alias_ddrs[i].first;
@@ -2279,7 +2279,7 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo, tree * cond_expr)
 	}
 
       /* Create condition expression for each pair data references.  */
-      create_intersect_range_checks (loop_vinfo, &part_cond_expr, dr_a, dr_b);
+      create_intersect_range_checks (loop, &part_cond_expr, dr_a, dr_b);
       if (*cond_expr)
 	*cond_expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
 				  *cond_expr, part_cond_expr);
-- 
1.9.1


             reply	other threads:[~2017-05-23 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 16:23 Bin Cheng [this message]
2017-05-26 11:30 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0802MB2176E6B3AA141AAFDFEF5590E7F90@VI1PR0802MB2176.eurprd08.prod.outlook.com \
    --to=bin.cheng@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).