Re: [PATCH GCC][03/13]Mark and skip distributed loops

2017-06-13 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 11:47 AM, Richard Biener
 wrote:
> On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng  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  
>>
>> * tree-loop-distribution.c (generate_loops_for_partition): Mark
>> distributed loops.
>> (pass_loop_distribution::execute): Skip distributed loops.


Re: [PATCH GCC][03/13]Mark and skip distributed loops

2017-06-13 Thread Richard Biener
On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng  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  
>
> * tree-loop-distribution.c (generate_loops_for_partition): Mark
> distributed loops.
> (pass_loop_distribution::execute): Skip distributed loops.


[PATCH GCC][03/13]Mark and skip distributed loops

2017-06-12 Thread Bin Cheng
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  

* tree-loop-distribution.c (generate_loops_for_partition): Mark
distributed loops.
(pass_loop_distribution::execute): Skip distributed loops.From 705ad383bb8a806eb8b0fcd6faa298938dd3176b Mon Sep 17 00:00:00 2001
From: Bin Cheng 
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