From patchwork Mon Aug 2 20:20:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 60657 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 BEBD3B70AA for ; Tue, 3 Aug 2010 06:29:32 +1000 (EST) Received: (qmail 4507 invoked by alias); 2 Aug 2010 20:25:16 -0000 Received: (qmail 4131 invoked by uid 22791); 2 Aug 2010 20:25:06 -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, RCVD_IN_DNSWL_NONE, TW_SV, TW_TM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Aug 2010 20:24:47 +0000 Received: by mail-yx0-f175.google.com with SMTP id 11so1550084yxi.20 for ; Mon, 02 Aug 2010 13:24:46 -0700 (PDT) Received: by 10.100.248.5 with SMTP id v5mr5784670anh.115.1280780686095; Mon, 02 Aug 2010 13:24:46 -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 i25sm10329106anh.37.2010.08.02.13.24.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 02 Aug 2010 13:24:45 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Mon, 02 Aug 2010 15:24:42 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: Tobias Grosser , gcc-graphite Subject: [PATCH 59/65] Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy. Date: Mon, 2 Aug 2010 15:20:32 -0500 Message-Id: <1280780438-17543-60-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 (clast_name_to_gcc): Parameter type of NAME now depends on used CLooG version. (clast_to_gcc_expression): Replace expr_* with clast_expr_*. (gcc_type_for_clast_expr): Same. (print_clast_stmt): Replace pprint with clast_pprint. * graphite-cloog-compat.h: Provide compatibility macros for CLooG Legacy. (clast_name_p): New. (clast_expr_term): New. (clast_expr_red): New. (clast_expr_bin): New. (clast_pprint): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162606 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/ChangeLog.graphite | 15 +++++++++++++++ gcc/graphite-clast-to-gimple.c | 28 +++++++++++++++++----------- gcc/graphite-cloog-compat.h | 12 ++++++++++++ 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 273f743..c830a22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,20 @@ 2010-08-02 Andreas Simbuerger + * graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter + type of NAME now depends on used CLooG version. + (clast_to_gcc_expression): Replace expr_* with clast_expr_*. + (gcc_type_for_clast_expr): Same. + (print_clast_stmt): Replace pprint with clast_pprint. + * graphite-cloog-compat.h: Provide compatibility macros for + CLooG Legacy. + (clast_name_p): New. + (clast_expr_term): New. + (clast_expr_red): New. + (clast_expr_bin): New. + (clast_pprint): New. + +2010-08-02 Andreas Simbuerger + * graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options compatible to newer CLooG releases (CLOOG_ORG). (build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG). diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 6361c49..7e12177 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,20 @@ 2010-07-27 Andreas Simbuerger + * graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter + type of NAME now depends on used CLooG version. + (clast_to_gcc_expression): Replace expr_* with clast_expr_*. + (gcc_type_for_clast_expr): Same. + (print_clast_stmt): Replace pprint with clast_pprint. + * graphite-cloog-compat.h: Provide compatibility macros for + CLooG Legacy. + (clast_name_p): New. + (clast_expr_term): New. + (clast_expr_red): New. + (clast_expr_bin): New. + (clast_pprint): New. + +2010-07-27 Andreas Simbuerger + * graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options compatible to newer CLooG releases (CLOOG_ORG). (build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG). diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index a611ca7..29c8ffb 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -97,12 +97,18 @@ new_clast_name_index (const char *name, int index) SCATTERING_DIMENSIONS vector. */ static inline int -clast_name_to_index (const char *name, htab_t index_table) +clast_name_to_index (clast_name_p name, htab_t index_table) { struct clast_name_index tmp; PTR *slot; +#ifdef CLOOG_ORG + gcc_assert (name->type == clast_expr_name); + tmp.name = ((const struct clast_name*) name)->name; +#else tmp.name = name; +#endif + slot = htab_find_slot (index_table, &tmp, NO_INSERT); if (slot && *slot) @@ -165,7 +171,7 @@ newivs_to_depth_to_newiv (VEC (tree, heap) *newivs, int depth) Cloog representation. */ static tree -clast_name_to_gcc (const char *name, sese region, VEC (tree, heap) *newivs, +clast_name_to_gcc (clast_name_p name, sese region, VEC (tree, heap) *newivs, htab_t newivs_index, htab_t params_index) { int index; @@ -267,7 +273,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e, { switch (e->type) { - case expr_term: + case clast_expr_term: { struct clast_term *t = (struct clast_term *) e; @@ -319,7 +325,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e, return gmp_cst_to_tree (type, t->val); } - case expr_red: + case clast_expr_red: { struct clast_reduction *r = (struct clast_reduction *) e; @@ -346,7 +352,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e, break; } - case expr_bin: + case clast_expr_bin: { struct clast_binary *b = (struct clast_binary *) e; struct clast_expr *lhs = (struct clast_expr *) b->LHS; @@ -485,7 +491,7 @@ gcc_type_for_clast_term (struct clast_term *t, sese region, VEC (tree, heap) *newivs, htab_t newivs_index, htab_t params_index) { - gcc_assert (t->expr.type == expr_term); + gcc_assert (t->expr.type == clast_expr_term); if (!t->var) return gcc_type_for_value (t->val); @@ -557,15 +563,15 @@ gcc_type_for_clast_expr (struct clast_expr *e, { switch (e->type) { - case expr_term: + case clast_expr_term: return gcc_type_for_clast_term ((struct clast_term *) e, region, newivs, newivs_index, params_index); - case expr_red: + case clast_expr_red: return gcc_type_for_clast_red ((struct clast_reduction *) e, region, newivs, newivs_index, params_index); - case expr_bin: + case clast_expr_bin: return gcc_type_for_clast_bin ((struct clast_binary *) e, region, newivs, newivs_index, params_index); @@ -1359,7 +1365,7 @@ print_clast_stmt (FILE *file, struct clast_stmt *stmt) { CloogOptions *options = set_cloog_options (); - pprint (file, stmt, 0, options); + clast_pprint (file, stmt, 0, options); cloog_options_free (options); } @@ -1404,7 +1410,7 @@ print_generated_program (FILE *file, scop_p scop) fprintf (file, " )\n"); fprintf (file, " (clast: \n"); - pprint (file, pc.stmt, 0, options); + clast_pprint (file, pc.stmt, 0, options); fprintf (file, " )\n"); cloog_options_free (options); diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h index 6608318..8ff0e43 100644 --- a/gcc/graphite-cloog-compat.h +++ b/gcc/graphite-cloog-compat.h @@ -23,6 +23,12 @@ along with GCC; see the file COPYING3. If not see #define GRAPHITE_CLOOG_COMPAT_H /* Restore compatibility to CLooG Legacy. */ +#ifdef CLOOG_ORG +typedef const struct clast_expr *clast_name_p; +#else +typedef const char *clast_name_p; +#endif + #ifndef CLOOG_ORG /* CloogOptions compatibility. */ @@ -32,6 +38,12 @@ along with GCC; see the file COPYING3. If not see #define cloog_program_scatter(PROG, SCATT, OPT)\ cloog_program_scatter (PROG, SCATT) +/* CLAST compatibility. */ +#define clast_expr_term expr_term +#define clast_expr_red expr_red +#define clast_expr_bin expr_bin +#define clast_pprint pprint + #endif /* Adapt CLooG accessors from CLooG legacy to