From patchwork Fri Apr 15 15:28:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Revital Eres X-Patchwork-Id: 1037 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:32 -0000 Delivered-To: patches@linaro.org Received: by 10.224.67.148 with SMTP id r20cs57993qai; Fri, 15 Apr 2011 08:28:04 -0700 (PDT) Received: by 10.229.237.18 with SMTP id km18mr1552395qcb.126.1302881284529; Fri, 15 Apr 2011 08:28:04 -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 q12si5767951qcu.193.2011.04.15.08.28.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Apr 2011 08:28:03 -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 qyk2 with SMTP id 2so2138404qyk.16 for ; Fri, 15 Apr 2011 08:28:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.195.74 with SMTP id eb10mr671557qab.99.1302881283128; Fri, 15 Apr 2011 08:28:03 -0700 (PDT) Received: by 10.224.28.136 with HTTP; Fri, 15 Apr 2011 08:28:03 -0700 (PDT) Date: Fri, 15 Apr 2011 18:28:03 +0300 Message-ID: Subject: [PATCH, SMS] New flag to apply SMS when SC equals 1 From: Revital Eres To: zaks@il.ibm.com, gcc-patches@gcc.gnu.org Cc: Patch Tracking 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))) {