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

Reply via email to