From patchwork Mon Aug 2 20:20:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 60662 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 E2AB7B6F14 for ; Tue, 3 Aug 2010 06:30:04 +1000 (EST) Received: (qmail 4758 invoked by alias); 2 Aug 2010 20:25:19 -0000 Received: (qmail 4089 invoked by uid 22791); 2 Aug 2010 20:25:03 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, TW_SV, TW_TM, 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, 02 Aug 2010 20:24:54 +0000 Received: by gxk2 with SMTP id 2so1547881gxk.20 for ; Mon, 02 Aug 2010 13:24:52 -0700 (PDT) Received: by 10.150.68.4 with SMTP id q4mr7720804yba.261.1280780692683; Mon, 02 Aug 2010 13:24:52 -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 h11sm4389579ybk.17.2010.08.02.13.24.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 13:24:52 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 02 Aug 2010 15:24:49 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: Tobias Grosser , gcc-graphite Subject: [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG). Date: Mon, 2 Aug 2010 15:20:34 -0500 Message-Id: <1280780438-17543-62-git-send-email-sebpop@gmail.com> In-Reply-To: <1280780438-17543-1-git-send-email-sebpop@gmail.com> References: <1280780438-17543-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 From: spop 2010-07-27 Andreas Simbuerger * graphite-clast-to-gimple.c (free_scattering): Change CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering (CLOOG_ORG). (build_cloog_prog): Same. * graphite-cloog-compat.h (cloog_domain): Removed. (cloog_scattering): New. (cloog_set_domain): Removed. (cloog_set_scattering): New. (cloog_next_domain): Removed. (cloog_next_scattering): New. (cloog_set_next_domain): Removed. (cloog_set_next_scattering): New. (CloogScatteringList): New. (CloogScattering): New. (cloog_scattering_free): New. (new_Cloog_Scattering_from_ppl_Polyhedron): New. * graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162608 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/ChangeLog.graphite | 21 +++++++++++++++++++++ gcc/graphite-clast-to-gimple.c | 25 +++++++++++++------------ gcc/graphite-cloog-compat.h | 30 ++++++++++++++++++++---------- gcc/graphite-cloog-util.c | 21 +++++++++++++++++++++ gcc/graphite-cloog-util.h | 2 ++ 6 files changed, 98 insertions(+), 22 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2391126..dfa57af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,26 @@ 2010-08-02 Andreas Simbuerger + * graphite-clast-to-gimple.c (free_scattering): Change + CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering + (CLOOG_ORG). + (build_cloog_prog): Same. + * graphite-cloog-compat.h (cloog_domain): Removed. + (cloog_scattering): New. + (cloog_set_domain): Removed. + (cloog_set_scattering): New. + (cloog_next_domain): Removed. + (cloog_next_scattering): New. + (cloog_set_next_domain): Removed. + (cloog_set_next_scattering): New. + (CloogScatteringList): New. + (CloogScattering): New. + (cloog_scattering_free): New. + (new_Cloog_Scattering_from_ppl_Polyhedron): New. + * graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron): + New. + +2010-08-02 Andreas Simbuerger + * graphite-clast-to-gimple.c (build_cloog_prog): Extend with CloogState. (set_cloog_options): Same. diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index b5e53b5..4916f91 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,26 @@ 2010-07-27 Andreas Simbuerger + * graphite-clast-to-gimple.c (free_scattering): Change + CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering + (CLOOG_ORG). + (build_cloog_prog): Same. + * graphite-cloog-compat.h (cloog_domain): Removed. + (cloog_scattering): New. + (cloog_set_domain): Removed. + (cloog_set_scattering): New. + (cloog_next_domain): Removed. + (cloog_next_scattering): New. + (cloog_set_next_domain): Removed. + (cloog_set_next_scattering): New. + (CloogScatteringList): New. + (CloogScattering): New. + (cloog_scattering_free): New. + (new_Cloog_Scattering_from_ppl_Polyhedron): New. + * graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron): + New. + +2010-07-27 Andreas Simbuerger + * graphite-clast-to-gimple.c (build_cloog_prog): Extend with CloogState. (set_cloog_options): Same. diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 11867cf..138c0df 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -1127,14 +1127,14 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt, /* Free the SCATTERING domain list. */ static void -free_scattering (CloogDomainList *scattering) +free_scattering (CloogScatteringList *scattering) { while (scattering) { - CloogDomain *dom = cloog_domain (scattering); - CloogDomainList *next = cloog_next_domain (scattering); + CloogScattering *dom = cloog_scattering (scattering); + CloogScatteringList *next = cloog_next_scattering (scattering); - cloog_domain_free (dom); + cloog_scattering_free (dom); free (scattering); scattering = next; } @@ -1212,7 +1212,7 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, poly_bb_p pbb; CloogLoop *loop_list = NULL; CloogBlockList *block_list = NULL; - CloogDomainList *scattering = NULL; + CloogScatteringList *scattering = NULL; int nbs = 2 * max_nb_loops + 1; int *scaldims; @@ -1264,17 +1264,18 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, /* Build scattering list. */ { /* XXX: Replace with cloog_domain_list_alloc(), when available. */ - CloogDomainList *new_scattering - = (CloogDomainList *) xmalloc (sizeof (CloogDomainList)); + CloogScatteringList *new_scattering + = (CloogScatteringList *) xmalloc (sizeof (CloogScatteringList)); ppl_Polyhedron_t scat; - CloogDomain *dom; + CloogScattering *dom; scat = PBB_TRANSFORMED_SCATTERING (pbb); - dom = new_Cloog_Domain_from_ppl_Polyhedron (scat, scop_nb_params (scop), - state); + dom = new_Cloog_Scattering_from_ppl_Polyhedron + (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb), + state); - cloog_set_next_domain (new_scattering, scattering); - cloog_set_domain (new_scattering, dom); + cloog_set_next_scattering (new_scattering, scattering); + cloog_set_scattering (new_scattering, dom); scattering = new_scattering; } } diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h index f27ee5a..56b6bb3 100644 --- a/gcc/graphite-cloog-compat.h +++ b/gcc/graphite-cloog-compat.h @@ -58,6 +58,16 @@ typedef const char *clast_name_p; new_Cloog_Domain_from_ppl_Polyhedron (POLY) #define cloog_domain_from_cloog_matrix(STATE, MAT, NB)\ cloog_domain_matrix2domain (MAT) + +/* CloogScatteringList compatibility. */ +#define CloogScatteringList CloogDomainList +#define CloogScattering CloogDomain +#define cloog_set_next_scattering cloog_set_next_domain +#define cloog_set_scattering cloog_set_domain +#define cloog_scattering cloog_domain +#define cloog_next_scattering cloog_next_domain +#define cloog_scattering_free cloog_domain_free + #endif /* Adapt CLooG accessors from CLooG legacy to @@ -71,28 +81,28 @@ cloog_statement_usr (CloogStatement *cs) return cs->usr; } -static inline CloogDomain * -cloog_domain (CloogDomainList *dl) +static inline CloogScattering * +cloog_scattering (CloogScatteringList *sl) { - return dl->domain; + return sl->scatt; } static inline void -cloog_set_domain (CloogDomainList *dl, CloogDomain *domain) +cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt) { - dl->domain = domain; + sl->scatt = scatt; } -static inline CloogDomainList * -cloog_next_domain (CloogDomainList *dl) +static inline CloogScatteringList * +cloog_next_scattering (CloogScatteringList *sl) { - return dl->next; + return sl->next; } static inline void -cloog_set_next_domain (CloogDomainList *dl, CloogDomainList *next) +cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next) { - dl->next = next; + sl->next = next; } static inline int diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c index 500443f..1770458 100644 --- a/gcc/graphite-cloog-util.c +++ b/gcc/graphite-cloog-util.c @@ -238,6 +238,27 @@ new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph, int nb_params, return res; } +/* Create a CloogScattering from polyhedron PH. */ + +CloogScattering * +new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph, + int nb_params ATTRIBUTE_UNUSED, + int nb_scatt ATTRIBUTE_UNUSED, + CloogState *state ATTRIBUTE_UNUSED) +{ +#ifdef CLOOG_ORG + CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph); + CloogScattering *res = cloog_scattering_from_cloog_matrix (state, mat, + nb_scatt, + nb_params); + + cloog_matrix_free (mat); + return res; +#else + return new_Cloog_Domain_from_ppl_Polyhedron (ph, nb_params, state); +#endif +} + /* Creates a CloogDomain from a pointset powerset PS. */ CloogDomain * diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h index eaa48f3..d7758ce 100644 --- a/gcc/graphite-cloog-util.h +++ b/gcc/graphite-cloog-util.h @@ -27,6 +27,8 @@ along with GCC; see the file COPYING3. If not see CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t); CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t, int, CloogState *); +CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron + (ppl_const_Polyhedron_t, int, int, CloogState *); CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset (ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *); void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);