public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Revital Eres <revital.eres@linaro.org>
To: Ayal Zaks <ayal.zaks@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH, SMS] Fix marking of SMSed loops as BB_DISABLE_SCHEDULE
Date: Fri, 28 Oct 2011 08:22:00 -0000	[thread overview]
Message-ID: <CAHz1=dVv7VkjsAYysprjnViS1nhSMnEpeQyZqxQCU2x-iV_VWg@mail.gmail.com> (raw)
In-Reply-To: <CAHTt4KuB=sgpgb6hJr9Bpzt47XHrhet8PT-bpBdBtJu1sH0CnQ@mail.gmail.com>

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

Hello,

>> Tested and bootstrap on all languages except java (PR50879) on
>> ppc64-redhat-linux, enabling SMS on loops with SC 1.
>>
>> OK for mainline?
>>
>
> OK, seems reasonable.
>
> Please fix typo (in original comment):
> -            scheduling passes doesn't touch it.  */
> +            scheduling passes don't touch it.  */

I realize that I forgot to guard the marking in the epilogue and
prologue with -fresched-modulo-sched, sorry about that. I am testing
the attached patch and will commit it after testing completes if there
are no further comments.

Thanks,
Revital

[-- Attachment #2: patch_mark_fix.txt --]
[-- Type: text/plain, Size: 1635 bytes --]

Index: modulo-sched.c
===================================================================
--- modulo-sched.c	(revision 180557)
+++ modulo-sched.c	(working copy)
@@ -1173,6 +1173,8 @@ generate_prolog_epilog (partial_schedule
   /* Put the prolog on the entry edge.  */
   e = loop_preheader_edge (loop);
   split_edge_and_insert (e, get_insns ());
+  if (!flag_resched_modulo_sched)
+    e->dest->flags |= BB_DISABLE_SCHEDULE;
 
   end_sequence ();
 
@@ -1186,9 +1188,24 @@ generate_prolog_epilog (partial_schedule
   gcc_assert (single_exit (loop));
   e = single_exit (loop);
   split_edge_and_insert (e, get_insns ());
+  if (!flag_resched_modulo_sched)
+    e->dest->flags |= BB_DISABLE_SCHEDULE;
+
   end_sequence ();
 }
 
+/* Mark LOOP as software pipelined so the later
+   scheduling passes don't touch it.  */
+static void
+mark_loop_unsched (struct loop *loop)
+{
+  unsigned i;
+  basic_block *bbs = get_loop_body (loop);
+
+  for (i = 0; i < loop->num_nodes; i++)
+    bbs[i]->flags |= BB_DISABLE_SCHEDULE;
+}
+
 /* Return true if all the BBs of the loop are empty except the
    loop header.  */
 static bool
@@ -1714,9 +1731,10 @@ sms_schedule (void)
 	  permute_partial_schedule (ps, g->closing_branch->first_note);
 
           /* Mark this loop as software pipelined so the later
-	     scheduling passes doesn't touch it.  */
+	     scheduling passes don't touch it.  */
 	  if (! flag_resched_modulo_sched)
-	    g->bb->flags |= BB_DISABLE_SCHEDULE;
+	    mark_loop_unsched (loop);
+	  
 	  /* The life-info is not valid any more.  */
 	  df_set_bb_dirty (g->bb);
 

      reply	other threads:[~2011-10-28  6:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 15:26 Revital Eres
2011-10-27 22:05 ` Ayal Zaks
2011-10-28  8:22   ` Revital Eres [this message]

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='CAHz1=dVv7VkjsAYysprjnViS1nhSMnEpeQyZqxQCU2x-iV_VWg@mail.gmail.com' \
    --to=revital.eres@linaro.org \
    --cc=ayal.zaks@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patches@linaro.org \
    /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).