public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH GCC][03/13]Mark and skip distributed loops
@ 2017-06-12 17:02 Bin Cheng
  2017-06-13 10:47 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Bin Cheng @ 2017-06-12 17:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- 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


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

* Re: [PATCH GCC][03/13]Mark and skip distributed loops
  2017-06-12 17:02 [PATCH GCC][03/13]Mark and skip distributed loops Bin Cheng
@ 2017-06-13 10:47 ` Richard Biener
  2017-06-13 10:58   ` Bin.Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2017-06-13 10:47 UTC (permalink / raw)
  To: Bin Cheng; +Cc: gcc-patches, nd

On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This simple patch marks distributed loops and skips it in following distribution.
>
> Bootstrap and test on x86_64 and AArch64.  Is it OK?

This is not necessary, FOR_EACH_LOOP first builds a vector of loops to
iterate over
so it will never pick up loops added during iteration.

Richard.

> 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.

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

* Re: [PATCH GCC][03/13]Mark and skip distributed loops
  2017-06-13 10:47 ` Richard Biener
@ 2017-06-13 10:58   ` Bin.Cheng
  0 siblings, 0 replies; 3+ messages in thread
From: Bin.Cheng @ 2017-06-13 10:58 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Tue, Jun 13, 2017 at 11:47 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
>> Hi,
>> This simple patch marks distributed loops and skips it in following distribution.
>>
>> Bootstrap and test on x86_64 and AArch64.  Is it OK?
>
> This is not necessary, FOR_EACH_LOOP first builds a vector of loops to
> iterate over
> so it will never pick up loops added during iteration.
This was originally for loop nest distribution, but I didn't include
that part in this series.  I will withdraw it for now.

Thanks,
bin
>
> Richard.
>
>> 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.

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

end of thread, other threads:[~2017-06-13 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 17:02 [PATCH GCC][03/13]Mark and skip distributed loops Bin Cheng
2017-06-13 10:47 ` Richard Biener
2017-06-13 10:58   ` Bin.Cheng

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).