From patchwork Fri Oct 28 06:50:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Revital Eres X-Patchwork-Id: 4866 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D951F23DEF for ; Fri, 28 Oct 2011 06:50:59 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id C9FCDA185DA for ; Fri, 28 Oct 2011 06:50:59 +0000 (UTC) Received: by faan26 with SMTP id n26so5046635faa.11 for ; Thu, 27 Oct 2011 23:50:59 -0700 (PDT) Received: by 10.223.77.6 with SMTP id e6mr3906114fak.32.1319784659492; Thu, 27 Oct 2011 23:50:59 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.223.17.10 with SMTP id q10cs119620faa; Thu, 27 Oct 2011 23:50:58 -0700 (PDT) Received: by 10.229.79.5 with SMTP id n5mr290701qck.275.1319784655854; Thu, 27 Oct 2011 23:50:55 -0700 (PDT) Received: from mail-qy0-f178.google.com (mail-qy0-f178.google.com [209.85.216.178]) by mx.google.com with ESMTPS id c10si1745073qcu.50.2011.10.27.23.50.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Oct 2011 23:50:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.216.178 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) client-ip=209.85.216.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.178 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) smtp.mail=revital.eres@linaro.org Received: by qyg36 with SMTP id 36so4671928qyg.16 for ; Thu, 27 Oct 2011 23:50:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.65.130 with SMTP id j2mr285921qci.213.1319784654751; Thu, 27 Oct 2011 23:50:54 -0700 (PDT) Received: by 10.229.246.20 with HTTP; Thu, 27 Oct 2011 23:50:54 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 Oct 2011 08:50:54 +0200 Message-ID: Subject: Re: [PATCH, SMS] Fix marking of SMSed loops as BB_DISABLE_SCHEDULE From: Revital Eres To: Ayal Zaks Cc: gcc-patches@gcc.gnu.org, Patch Tracking 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 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);