From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30545 invoked by alias); 15 Jan 2011 09:08:40 -0000 Received: (qmail 30396 invoked by uid 22791); 15 Jan 2011 09:08:38 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,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; Sat, 15 Jan 2011 09:08:33 +0000 Received: by gxk20 with SMTP id 20so1501643gxk.20 for ; Sat, 15 Jan 2011 01:08:31 -0800 (PST) Received: by 10.151.11.2 with SMTP id o2mr2144045ybi.387.1295082511572; Sat, 15 Jan 2011 01:08:31 -0800 (PST) Received: from napoca (adsl-76-250-118-52.dsl.austtx.sbcglobal.net [76.250.118.52]) by mx.google.com with ESMTPS id w24sm874117ybk.9.2011.01.15.01.08.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 15 Jan 2011 01:08:31 -0800 (PST) Received: by napoca (sSMTP sendmail emulation); Sat, 15 Jan 2011 03:08:28 -0600 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, gcc-graphite@googlegroups.com, Sebastian Pop Subject: [PATCH 03/10] Test the profitability of interchange on the perfect nest. Date: Sat, 15 Jan 2011 10:09:00 -0000 Message-Id: <1295082315-32242-4-git-send-email-sebpop@gmail.com> In-Reply-To: <1295082315-32242-1-git-send-email-sebpop@gmail.com> References: <1295082315-32242-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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg01048.txt.bz2 2011-01-15 Sebastian Pop * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop nest and two loop depths as parameters. (lst_try_interchange_loops): Call lst_interchange_profitable_p after lst_perfect_nestify. --- gcc/ChangeLog.graphite | 7 +++++++ gcc/graphite-interchange.c | 16 +++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index d3bb503..4324a6e 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,12 @@ 2011-01-15 Sebastian Pop + * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop + nest and two loop depths as parameters. + (lst_try_interchange_loops): Call lst_interchange_profitable_p after + lst_perfect_nestify. + +2011-01-15 Sebastian Pop + * graphite-dependences.c (print_pddr): Call ppl_io_fprint_Pointset_Powerset_C_Polyhedron. diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c index b90c4e7..934839a 100644 --- a/gcc/graphite-interchange.c +++ b/gcc/graphite-interchange.c @@ -446,20 +446,18 @@ memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides) profitable to interchange the loops at DEPTH1 and DEPTH2. */ static bool -lst_interchange_profitable_p (lst_p loop1, lst_p loop2) +lst_interchange_profitable_p (lst_p nest, int depth1, int depth2) { mpz_t d1, d2; bool res; - gcc_assert (loop1 && loop2 - && LST_LOOP_P (loop1) && LST_LOOP_P (loop2) - && lst_depth (loop1) < lst_depth (loop2)); + gcc_assert (depth1 < depth2); mpz_init (d1); mpz_init (d2); - memory_strides_in_loop (loop1, lst_depth (loop1), d1); - memory_strides_in_loop (loop2, lst_depth (loop2), d2); + memory_strides_in_loop (nest, depth1, d1); + memory_strides_in_loop (nest, depth2, d2); res = mpz_cmp (d1, d2) < 0; @@ -592,12 +590,12 @@ lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2) lst_p before = NULL, nest = NULL, after = NULL; - if (!lst_interchange_profitable_p (loop1, loop2)) - return false; - if (!lst_perfectly_nested_p (loop1, loop2)) lst_perfect_nestify (loop1, loop2, &before, &nest, &after); + if (!lst_interchange_profitable_p (loop2, depth1, depth2)) + return false; + lst_apply_interchange (loop2, depth1, depth2); /* Sync the transformed LST information and the PBB scatterings -- 1.7.1