From patchwork Mon Aug 23 18:50:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 62504 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 EB033B6EEB for ; Tue, 24 Aug 2010 04:51:12 +1000 (EST) Received: (qmail 29798 invoked by alias); 23 Aug 2010 18:51:10 -0000 Received: (qmail 29710 invoked by uid 22791); 23 Aug 2010 18:51:08 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Aug 2010 18:51:03 +0000 Received: by gxk2 with SMTP id 2so2666383gxk.20 for ; Mon, 23 Aug 2010 11:51:02 -0700 (PDT) Received: by 10.100.57.1 with SMTP id f1mr5821883ana.205.1282589461818; Mon, 23 Aug 2010 11:51:01 -0700 (PDT) Received: from napoca (cpe-70-120-196-107.austin.res.rr.com [70.120.196.107]) by mx.google.com with ESMTPS id b17sm11310065anh.5.2010.08.23.11.50.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Aug 2010 11:51:01 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 23 Aug 2010 13:50:58 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: gcc-graphite@googlegroups.com, Sebastian Pop Subject: [PATCH] Speed-up loop blocking: strip-mining is always legal. Date: Mon, 23 Aug 2010 13:50:53 -0500 Message-Id: <1282589453-18405-2-git-send-email-sebpop@gmail.com> In-Reply-To: <1282589453-18405-1-git-send-email-sebpop@gmail.com> References: <1282589453-18405-1-git-send-email-sebpop@gmail.com> X-IsSubscribed: yes 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 2010-08-23 Sebastian Pop * graphite-blocking.c (scop_do_strip_mine): Do not call graphite_legal_transform. (scop_do_block): Same. --- gcc/ChangeLog.graphite | 6 ++++++ gcc/graphite-blocking.c | 29 +++++++---------------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index e351bbf..4d03474 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,9 @@ +2010-08-23 Sebastian Pop + + * graphite-blocking.c (scop_do_strip_mine): Do not call + graphite_legal_transform. + (scop_do_block): Same. + 2010-08-20 Vladimir Kargov * graphite-scop-detection.c (graphite_can_represent_loop): Correct the diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c index deb25ec..6a8b88a 100644 --- a/gcc/graphite-blocking.c +++ b/gcc/graphite-blocking.c @@ -254,28 +254,13 @@ lst_do_strip_mine (lst_p lst) return res; } -/* Strip mines all the loops in SCOP. Nothing profitable in all this: - this is just a driver function. */ +/* Strip mines all the loops in SCOP. Returns true when some loops + have been strip-mined. */ bool scop_do_strip_mine (scop_p scop) { - bool transform_done = false; - - store_scattering (scop); - - transform_done = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); - - if (!transform_done) - return false; - - if (!graphite_legal_transform (scop)) - { - restore_scattering (scop); - return false; - } - - return transform_done; + return lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); } /* Loop blocks all the loops in SCOP. Returns true when we manage to @@ -292,10 +277,10 @@ scop_do_block (scop_p scop) strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); interchanged = scop_do_interchange (scop); - /* If we don't interchange loops, then the strip mine is not - profitable, and the transform is not a loop blocking. */ - if (!interchanged - || !graphite_legal_transform (scop)) + /* If we don't interchange loops, the strip mine alone will not be + profitable, and the transform is not a loop blocking: so revert + the transform. */ + if (!interchanged) { restore_scattering (scop); return false;