From patchwork Mon Aug 15 07:12:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 110001 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 71214B6F8B for ; Mon, 15 Aug 2011 17:15:33 +1000 (EST) Received: (qmail 13835 invoked by alias); 15 Aug 2011 07:14:28 -0000 Received: (qmail 13605 invoked by uid 22791); 15 Aug 2011 07:14:23 -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-gw0-f47.google.com (HELO mail-gw0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Aug 2011 07:14:08 +0000 Received: by gwb11 with SMTP id 11so3155603gwb.20 for ; Mon, 15 Aug 2011 00:14:07 -0700 (PDT) Received: by 10.91.15.3 with SMTP id s3mr3587365agi.0.1313392447444; Mon, 15 Aug 2011 00:14:07 -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 l19sm3216134anm.41.2011.08.15.00.14.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Aug 2011 00:14:07 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 15 Aug 2011 02:14:04 -0500 From: Sebastian Pop To: skimo@kotnet.org, tobias@grosser.es Cc: gcc-patches@gcc.gnu.org, Sebastian Pop Subject: [PATCH 15/20] strip-mine with isl Date: Mon, 15 Aug 2011 02:12:54 -0500 Message-Id: <1313392379-1525-15-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-blocking.c | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c index 429b405..0741f82 100644 --- a/gcc/graphite-blocking.c +++ b/gcc/graphite-blocking.c @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see #include #include #include +#include #include #include #endif @@ -112,9 +113,11 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) psct_add_scattering_dimension (pbb, strip); psct_add_scattering_dimension (pbb, strip + 1); - ppl_Polyhedron_space_dimension (res, &dim); + pbb->transformed = isl_map_insert_dims (pbb->transformed, isl_dim_out, + strip, 2); + /* Lower bound of the striped loop. */ { ppl_Constraint_t new_cstr; @@ -128,6 +131,15 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) ppl_delete_Linear_Expression (expr); ppl_Polyhedron_add_constraint (res, new_cstr); ppl_delete_Constraint (new_cstr); + + { + isl_dim *d = isl_map_get_dim (pbb->transformed); + isl_constraint *c = isl_inequality_alloc (d); + + c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, -stride); + c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, 1); + pbb->transformed = isl_map_add_constraint (pbb->transformed, c); + } } /* Upper bound of the striped loop. */ @@ -144,6 +156,16 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) ppl_delete_Linear_Expression (expr); ppl_Polyhedron_add_constraint (res, new_cstr); ppl_delete_Constraint (new_cstr); + + { + isl_dim *d = isl_map_get_dim (pbb->transformed); + isl_constraint *c = isl_inequality_alloc (d); + + c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, stride); + c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, -1); + c = isl_constraint_set_constant_si (c, stride - 1); + pbb->transformed = isl_map_add_constraint (pbb->transformed, c); + } } /* Static scheduling for ITER level. @@ -160,6 +182,14 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) ppl_delete_Linear_Expression (expr); ppl_Polyhedron_add_constraint (res, new_cstr); ppl_delete_Constraint (new_cstr); + + { + isl_dim *d = isl_map_get_dim (pbb->transformed); + isl_constraint *c = isl_equality_alloc (d); + + c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip + 1, 1); + pbb->transformed = isl_map_add_constraint (pbb->transformed, c); + } } }