Patchwork [SMS] New flag to apply SMS when SC equals 1

login
register
mail settings
Submitter Revital Eres
Date April 15, 2011, 3:28 p.m.
Message ID <BANLkTim7EemZAcCqtXAO61q7ViGa_A+cpw@mail.gmail.com>
Download mbox | patch
Permalink /patch/91393/
State New
Headers show

Comments

Revital Eres - April 15, 2011, 3:28 p.m.
Hello,

The attached patch introduces a new flag to allow applying SMS when
stage count (SC) also equals 1.
Currently, SMS is applied only when SC greater than 1 as stage count
of 1 means that there is no interleaving between iterations and the
scheduling passes do the job in this case.
The new flag is introduced for debugging purposes to apply SMS
on more loops.

Bootstrap and regtest on ppc64-redhat-linux.

OK for mainline?

Thanks,
Revital

Changelog:

        * common.opt (fmodulo-sched-allow-sc-one): New flag.
        * modulo-sched.c (sms_schedule): Allow SMS when stage count
        equals one and -fmodulo-sched-allow-sc-one flag is set.
Richard Guenther - April 15, 2011, 3:41 p.m.
On Fri, Apr 15, 2011 at 5:28 PM, Revital Eres <revital.eres@linaro.org> wrote:
> Hello,
>
> The attached patch introduces a new flag to allow applying SMS when
> stage count (SC) also equals 1.
> Currently, SMS is applied only when SC greater than 1 as stage count
> of 1 means that there is no interleaving between iterations and the
> scheduling passes do the job in this case.
> The new flag is introduced for debugging purposes to apply SMS
> on more loops.
>
> Bootstrap and regtest on ppc64-redhat-linux.
>
> OK for mainline?

If it's for debugging, can you use a --parm instead (like
modulo-sched-min-sc or similar)?

Thanks,
Richard.

> Thanks,
> Revital
>
> Changelog:
>
>        * common.opt (fmodulo-sched-allow-sc-one): New flag.
>        * modulo-sched.c (sms_schedule): Allow SMS when stage count
>        equals one and -fmodulo-sched-allow-sc-one flag is set.
>
Revital Eres - April 16, 2011, 3 a.m.
Hello,

> If it's for debugging, can you use a --parm instead (like
> modulo-sched-min-sc or similar)?
>

I think I can use --param for debugging purposes in this case.
(I might add modulo-sched-max-sc as well)

Thanks,
Revital

> Thanks,
> Richard.
>
>> Thanks,
>> Revital
>>
>> Changelog:
>>
>>        * common.opt (fmodulo-sched-allow-sc-one): New flag.
>>        * modulo-sched.c (sms_schedule): Allow SMS when stage count
>>        equals one and -fmodulo-sched-allow-sc-one flag is set.
>>
>

Patch

=== modified file 'gcc/common.opt'
--- gcc/common.opt	2011-03-06 00:38:13 +0000

+++ gcc/common.opt	2011-04-10 11:46:08 +0000

@@ -1395,6 +1395,10 @@  fmodulo-sched-allow-regmoves

 Common Report Var(flag_modulo_sched_allow_regmoves)
 Perform SMS based modulo scheduling with register moves allowed
 
+fmodulo-sched-allow-sc-one

+Common Report Var(flag_modulo_sched_allow_sc_one)

+Perform SMS based modulo scheduling also when stage count equals one

+

 fmove-loop-invariants
 Common Report Var(flag_move_loop_invariants) Init(1) Optimization
 Move loop invariant computations out of loops

=== modified file 'gcc/modulo-sched.c'
--- gcc/modulo-sched.c	2011-03-27 07:11:08 +0000

+++ gcc/modulo-sched.c	2011-04-10 11:45:17 +0000

@@ -1223,8 +1223,10 @@  sms_schedule (void)

 	}
       
       /* Stage count of 1 means that there is no interleaving between
-         iterations, let the scheduling passes do the job.  */

-      if (stage_count <= 1

+         iterations, let the scheduling passes do the job unless 

+	 -fmodulo-sched-allow-sc-one flag is set.  */

+      if ((!flag_modulo_sched_allow_sc_one && (stage_count == 1))

+	  || (stage_count < 1)

 	  || (count_init && (loop_count <= stage_count))
 	  || (flag_branch_probabilities && (trip_count <= stage_count)))
 	{