From patchwork Thu May 19 04:44:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Revital Eres X-Patchwork-Id: 1528 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:52:46 -0000 Delivered-To: patches@linaro.org Received: by 10.224.54.134 with SMTP id q6cs100131qag; Wed, 18 May 2011 21:44:49 -0700 (PDT) Received: by 10.213.29.2 with SMTP id o2mr951431ebc.69.1305780289138; Wed, 18 May 2011 21:44:49 -0700 (PDT) Received: from mail-ew0-f50.google.com (mail-ew0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id y15si5616410eeh.25.2011.05.18.21.44.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 May 2011 21:44:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) client-ip=209.85.215.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) smtp.mail=revital.eres@linaro.org Received: by mail-ew0-f50.google.com with SMTP id 10so757575ewy.37 for ; Wed, 18 May 2011 21:44:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.29.142 with SMTP id q14mr530507ebc.129.1305780288625; Wed, 18 May 2011 21:44:48 -0700 (PDT) Received: by 10.213.98.72 with HTTP; Wed, 18 May 2011 21:44:48 -0700 (PDT) Date: Thu, 19 May 2011 07:44:48 +0300 Message-ID: Subject: [PATCH, SMS 4/4] Misc. fixes From: Revital Eres To: Ayal Zaks Cc: gcc-patches@gcc.gnu.org, Patch Tracking Hello, The attached patch contains misc. fixes and changes. The patch was tested together with the rest of the patches in this series. On ppc64-redhat-linux regtest as well as bootstrap with SMS flags enabling SMS also on loops with stage count 1. Regtested on SPU. On arm-linux-gnueabi regtseted on c,c++. Bootstrap c language with SMS flags enabling SMS also on loops with stage count 1. OK for mainline? Thanks, Revital Changelog: * modulo-sched.c: Change comment. (reset_sched_times): Fix print message. (print_partial_schedule): Add print info. Index: modulo-sched.c =================================================================== --- modulo-sched.c (revision 173786) +++ modulo-sched.c (working copy) @@ -84,13 +84,14 @@ along with GCC; see the file COPYING3. II cycles (i.e. use register copies to prevent a def from overwriting itself before reaching the use). - SMS works with countable loops whose loop count can be easily - adjusted. This is because we peel a constant number of iterations - into a prologue and epilogue for which we want to avoid emitting - the control part, and a kernel which is to iterate that constant - number of iterations less than the original loop. So the control - part should be a set of insns clearly identified and having its - own iv, not otherwise used in the loop (at-least for now), which + SMS works with countable loops (1) whose control part can be easily + decoupled from the rest of the loop and (2) whose loop count can + be easily adjusted. This is because we peel a constant number of + iterations into a prologue and epilogue for which we want to avoid + emitting the control part, and a kernel which is to iterate that + constant number of iterations less than the original loop. So the + control part should be a set of insns clearly identified and having + its own iv, not otherwise used in the loop (at-least for now), which initializes a register before the loop to the number of iterations. Currently SMS relies on the do-loop pattern to recognize such loops, where (1) the control part comprises of all insns defining and/or @@ -595,8 +596,8 @@ reset_sched_times (partial_schedule_ptr /* Print the scheduling times after the rotation. */ fprintf (dump_file, "crr_insn->node=%d (insn id %d), " "crr_insn->cycle=%d, min_cycle=%d", crr_insn->node->cuid, - INSN_UID (crr_insn->node->insn), SCHED_TIME (u), - normalized_time); + INSN_UID (crr_insn->node->insn), normalized_time, + new_min_cycle); if (JUMP_P (crr_insn->node->insn)) fprintf (dump_file, " (branch)"); fprintf (dump_file, "\n"); @@ -2530,8 +2531,13 @@ print_partial_schedule (partial_schedule fprintf (dump, "\n[ROW %d ]: ", i); while (ps_i) { - fprintf (dump, "%d, ", - INSN_UID (ps_i->node->insn)); + if (JUMP_P (ps_i->node->insn)) + fprintf (dump, "%d (branch), ", + INSN_UID (ps_i->node->insn)); + else + fprintf (dump, "%d, ", + INSN_UID (ps_i->node->insn)); + ps_i = ps_i->next_in_row; } }