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: 91393 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 029B3B6EEE for ; Sat, 16 Apr 2011 01:28:14 +1000 (EST) Received: (qmail 1630 invoked by alias); 15 Apr 2011 15:28:12 -0000 Received: (qmail 1622 invoked by uid 22791); 15 Apr 2011 15:28:12 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Apr 2011 15:28:04 +0000 Received: by qyk35 with SMTP id 35so4435341qyk.20 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 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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))) {