From patchwork Mon Aug 15 07:12:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 110002 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 67008B6F8B for ; Mon, 15 Aug 2011 17:15:36 +1000 (EST) Received: (qmail 13970 invoked by alias); 15 Aug 2011 07:14:29 -0000 Received: (qmail 13818 invoked by uid 22791); 15 Aug 2011 07:14:26 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, 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-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Aug 2011 07:14:11 +0000 Received: by gyg4 with SMTP id 4so3147649gyg.20 for ; Mon, 15 Aug 2011 00:14:10 -0700 (PDT) Received: by 10.151.24.17 with SMTP id b17mr4473409ybj.367.1313392450251; Mon, 15 Aug 2011 00:14:10 -0700 (PDT) Received: from napoca (adsl-99-184-92-236.dsl.austtx.sbcglobal.net [99.184.92.236]) by mx.google.com with ESMTPS id j45sm3255743yhe.50.2011.08.15.00.14.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Aug 2011 00:14:09 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 15 Aug 2011 02:14:07 -0500 From: Sebastian Pop To: skimo@kotnet.org, tobias@grosser.es Cc: gcc-patches@gcc.gnu.org, Sebastian Pop Subject: [PATCH 16/20] interchange with isl Date: Mon, 15 Aug 2011 02:12:55 -0500 Message-Id: <1313392379-1525-16-git-send-email-sebpop@gmail.com> In-Reply-To: <1313392379-1525-1-git-send-email-sebpop@gmail.com> References: <1313392379-1525-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 --- gcc/graphite-interchange.c | 17 +++++++++++++++++ gcc/graphite-poly.h | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c index b819ece..68b9c1e 100644 --- a/gcc/graphite-interchange.c +++ b/gcc/graphite-interchange.c @@ -502,6 +502,23 @@ pbb_interchange_loop_depths (graphite_dim_t depth1, graphite_dim_t depth2, ppl_Polyhedron_map_space_dimensions (poly, map, dim); free (map); + + { + isl_dim *d = isl_map_get_dim (pbb->transformed); + isl_dim *d1 = isl_dim_range (d); + unsigned n = isl_dim_size (d1, isl_dim_out); + isl_dim *d2 = isl_dim_add (d1, isl_dim_in, n); + isl_map *x = isl_map_universe (d2); + + x = isl_map_equate (x, isl_dim_in, dim1, isl_dim_out, dim2); + x = isl_map_equate (x, isl_dim_in, dim2, isl_dim_out, dim1); + + for (i = 0; i < n; i++) + if (i != dim1 && i != dim2) + x = isl_map_equate (x, isl_dim_in, i, isl_dim_out, i); + + pbb->transformed = isl_map_apply_range (pbb->transformed, x); + } } /* Apply the interchange of loops at depths DEPTH1 and DEPTH2 to all diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h index b05e2e7..bf537b1 100644 --- a/gcc/graphite-poly.h +++ b/gcc/graphite-poly.h @@ -1148,6 +1148,22 @@ pbb_update_scattering (poly_bb_p pbb, graphite_dim_t level, int dewey) ppl_delete_Linear_Expression (expr); ppl_Polyhedron_add_constraint (ph, new_cstr); ppl_delete_Constraint (new_cstr); + + { + isl_dim *d = isl_map_get_dim (pbb->transformed); + isl_dim *d1 = isl_dim_range (d); + unsigned i, n = isl_dim_size (d1, isl_dim_out); + isl_dim *d2 = isl_dim_add (d1, isl_dim_in, n); + isl_map *x = isl_map_universe (d2); + + x = isl_map_fix_si (x, isl_dim_out, sched, dewey); + + for (i = 0; i < n; i++) + if (i != sched) + x = isl_map_equate (x, isl_dim_in, i, isl_dim_out, i); + + pbb->transformed = isl_map_apply_range (pbb->transformed, x); + } } /* Updates the scattering of all the PBBs under LST to be at the DEWEY