From patchwork Sun Apr 17 06:33:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Revital Eres X-Patchwork-Id: 1054 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:48:39 -0000 Delivered-To: patches@linaro.org Received: by 10.220.158.206 with SMTP id g14cs238vcx; Sat, 16 Apr 2011 23:33:18 -0700 (PDT) Received: by 10.14.49.83 with SMTP id w59mr1198030eeb.38.1303021997825; Sat, 16 Apr 2011 23:33:17 -0700 (PDT) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id r50si9701701eeh.25.2011.04.16.23.33.15 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Apr 2011 23:33:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of revital.eres@linaro.org) client-ip=209.85.215.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.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 eya25 with SMTP id 25so1280564eya.37 for ; Sat, 16 Apr 2011 23:33:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.0.211 with SMTP id 19mr3390391ebc.145.1303021995434; Sat, 16 Apr 2011 23:33:15 -0700 (PDT) Received: by 10.213.10.144 with HTTP; Sat, 16 Apr 2011 23:33:15 -0700 (PDT) Date: Sun, 17 Apr 2011 09:33:15 +0300 Message-ID: Subject: [PATCH] New flag to apply SMS when SC equals 1 (Second try) From: Revital Eres To: Richard Guenther , gcc-patches@gcc.gnu.org Cc: zaks@il.ibm.com, Patch Tracking Hello, Following Richard's suggestion here is the patch again. Tested on ppc64-redhat-linux. OK for mainline? Thanks, Revital Changelog * params.def (sms-min-sc): New param flag. * modulo-sched.c (sms_schedule): Use it. === modified file 'gcc/modulo-sched.c' --- gcc/modulo-sched.c 2011-03-27 07:11:08 +0000 +++ gcc/modulo-sched.c 2011-04-17 06:24:21 +0000 @@ -1222,9 +1222,10 @@ sms_schedule (void) PS_STAGE_COUNT(ps) = stage_count; } - /* Stage count of 1 means that there is no interleaving between - iterations, let the scheduling passes do the job. */ - if (stage_count <= 1 + /* The default value of PARAM_SMS_MIN_SC is 2 as stage count of + 1 means that there is no interleaving between iterations thus + we let the scheduling passes do the job in this case. */ + if (stage_count < (unsigned) PARAM_VALUE (PARAM_SMS_MIN_SC) || (count_init && (loop_count <= stage_count)) || (flag_branch_probabilities && (trip_count <= stage_count))) { === modified file 'gcc/params.def' --- gcc/params.def 2011-02-02 15:52:08 +0000 +++ gcc/params.def 2011-04-17 05:48:44 +0000 @@ -344,6 +344,11 @@ DEFPARAM(PARAM_SMS_MAX_II_FACTOR, "sms-max-ii-factor", "A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop", 100, 0, 0) +/* The minimum value of stage count that swing modulo scheduler will generate. */ +DEFPARAM(PARAM_SMS_MIN_SC, + "sms-min-sc", + "The minimum value of stage count that swing modulo scheduler will generate.", + 2, 1, 1) DEFPARAM(PARAM_SMS_DFA_HISTORY, "sms-dfa-history", "The number of cycles the swing modulo scheduler considers when checking conflicts using DFA",