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][03/13]Mark and skip distributed loops
Date: Mon, 12 Jun 2017 17:02:00 -0000	[thread overview]
Message-ID: <VI1PR0802MB21767C65CF638F9E628ADAD5E7CD0@VI1PR0802MB2176.eurprd08.prod.outlook.com> (raw)

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

Hi,
This simple patch marks distributed loops and skips it in following distribution.

Bootstrap and test on x86_64 and AArch64.  Is it OK?

Thanks,
bin
2017-06-07  Bin Cheng  <bin.cheng@arm.com>

	* tree-loop-distribution.c (generate_loops_for_partition): Mark
	distributed loops.
	(pass_loop_distribution::execute): Skip distributed loops.

[-- Attachment #2: 0003-record-and-skip-distributed-loop-20170607.txt --]
[-- Type: text/plain, Size: 1773 bytes --]

From 705ad383bb8a806eb8b0fcd6faa298938dd3176b Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Wed, 7 Jun 2017 13:20:08 +0100
Subject: [PATCH 03/14] record-and-skip-distributed-loop-20170607.txt

---
 gcc/tree-loop-distribution.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 9f0c801..b0b9d66 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -618,8 +618,11 @@ generate_loops_for_partition (struct loop *loop, partition *partition,
 
   if (copy_p)
     {
+      int ldist_alias_id = loop->num;
       loop = copy_loop_before (loop);
       gcc_assert (loop != NULL);
+      loop->ldist_alias_id = ldist_alias_id;
+      loop->aux = (void *)loop;
       create_preheader (loop, CP_SIMPLE_PREHEADERS);
       create_bb_after_loop (loop);
     }
@@ -1770,6 +1773,9 @@ pass_loop_distribution::execute (function *fun)
 	gimple_set_uid (gsi_stmt (gsi), -1);
     }
 
+  FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
+    loop->aux = NULL;
+
   /* We can at the moment only distribute non-nested loops, thus restrict
      walking to innermost loops.  */
   FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
@@ -1779,6 +1785,10 @@ pass_loop_distribution::execute (function *fun)
       int num = loop->num;
       unsigned int i;
 
+      /* Skip distributed loops.  */
+      if (loop->aux != NULL)
+	continue;
+
       /* If the loop doesn't have a single exit we will fail anyway,
 	 so do that early.  */
       if (!single_exit (loop))
@@ -1865,6 +1875,9 @@ out:
 	fprintf (dump_file, "Loop %d is the same.\n", num);
     }
 
+  FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
+    loop->aux = NULL;
+
   if (cd)
     delete cd;
 
-- 
1.9.1


             reply	other threads:[~2017-06-12 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 17:02 Bin Cheng [this message]
2017-06-13 10:47 ` Richard Biener
2017-06-13 10:58   ` Bin.Cheng

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=VI1PR0802MB21767C65CF638F9E628ADAD5E7CD0@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).