diff mbox

[3/3] Remove code that supported legacy CLooG.

Message ID 5a1e2cd1eee25b22538e085c04ebb50ade7ae496.1311289011.git.tobias@grosser.es
State New
Headers show

Commit Message

Tobias Grosser July 21, 2011, 11 p.m. UTC
2011-07-21  Tobias Grosser  <tobias@grosser.es>

	* configure: Regenerated.
	* config/cloog.m4: Do not define CLOOG_ORG

and in gcc/

2011-07-21  Tobias Grosser  <tobias@grosser.es>

	* Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
	Remove graphite-cloog-util.h.
	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
	build_iv_mapping, translate_clast_user, translate_clast,
	free_scattering, initialize_cloog_names, build_cloog_prog,
	create_params_index): Do not use old compatibility functions.
	(clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
	* graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
	compatibility functions.
	(new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
	cloog.
	* graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
	* graphite.c (graphite.c): Do not call outdated cloog_initialize() and
	cloog_finalize().
	* graphite-cloog-compat.h: Remove.
---
 ChangeLog                      |    5 +
 config/cloog.m4                |    2 +-
 configure                      |    2 +-
 gcc/ChangeLog                  |   18 +++
 gcc/Makefile.in                |    4 +-
 gcc/graphite-clast-to-gimple.c |   93 ++++++--------
 gcc/graphite-cloog-compat.h    |  275 ----------------------------------------
 gcc/graphite-cloog-util.c      |   15 +--
 gcc/graphite-cloog-util.h      |    1 -
 gcc/graphite.c                 |    2 -
 10 files changed, 72 insertions(+), 345 deletions(-)
 delete mode 100644 gcc/graphite-cloog-compat.h

Comments

Sebastian Pop July 21, 2011, 11:46 p.m. UTC | #1
On Thu, Jul 21, 2011 at 18:00, Tobias Grosser <tobias@grosser.es> wrote:
>  static void
>  create_params_index (htab_t index_table, CloogProgram *prog) {
> -  CloogNames* names = cloog_program_names (prog);
> -  int nb_parameters = cloog_names_nb_parameters (names);
> -  char **parameters = cloog_names_parameters (names);
> +  CloogNames* names = prog->names;

Please also fix the formatting here:
CloogNames *names = prog->names;

The rest of the patch looks good.  Before checking in, please wait for a
configure maintainer to approve the config changes.

Thanks,
Sebastian
Tobias Grosser July 21, 2011, 11:50 p.m. UTC | #2
On 07/22/2011 01:46 AM, Sebastian Pop wrote:
> On Thu, Jul 21, 2011 at 18:00, Tobias Grosser<tobias@grosser.es>  wrote:
>>   static void
>>   create_params_index (htab_t index_table, CloogProgram *prog) {
>> -  CloogNames* names = cloog_program_names (prog);
>> -  int nb_parameters = cloog_names_nb_parameters (names);
>> -  char **parameters = cloog_names_parameters (names);
>> +  CloogNames* names = prog->names;
>
> Please also fix the formatting here:
> CloogNames *names = prog->names;
>
> The rest of the patch looks good.  Before checking in, please wait for a
> configure maintainer to approve the config changes.

Thanks for the review. I will obviously wait for the OK of a configure 
maintainer.

Tobi
Sebastian Pop Aug. 2, 2011, 3:47 p.m. UTC | #3
Ping.

Could one of the configure maintainers review these changes?

Thanks,
Sebastian

On Thu, Jul 21, 2011 at 18:00, Tobias Grosser <tobias@grosser.es> wrote:
> 2011-07-21  Tobias Grosser  <tobias@grosser.es>
>
>        * configure: Regenerated.
>        * config/cloog.m4: Do not define CLOOG_ORG
>
> and in gcc/
>
> 2011-07-21  Tobias Grosser  <tobias@grosser.es>
>
>        * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
>        Remove graphite-cloog-util.h.
>        * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
>        build_iv_mapping, translate_clast_user, translate_clast,
>        free_scattering, initialize_cloog_names, build_cloog_prog,
>        create_params_index): Do not use old compatibility functions.
>        (clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
>        * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
>        compatibility functions.
>        (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
>        cloog.
>        * graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
>        * graphite.c (graphite.c): Do not call outdated cloog_initialize() and
>        cloog_finalize().
>        * graphite-cloog-compat.h: Remove.
> ---
>  ChangeLog                      |    5 +
>  config/cloog.m4                |    2 +-
>  configure                      |    2 +-
>  gcc/ChangeLog                  |   18 +++
>  gcc/Makefile.in                |    4 +-
>  gcc/graphite-clast-to-gimple.c |   93 ++++++--------
>  gcc/graphite-cloog-compat.h    |  275 ----------------------------------------
>  gcc/graphite-cloog-util.c      |   15 +--
>  gcc/graphite-cloog-util.h      |    1 -
>  gcc/graphite.c                 |    2 -
>  10 files changed, 72 insertions(+), 345 deletions(-)
>  delete mode 100644 gcc/graphite-cloog-compat.h
>
> diff --git a/ChangeLog b/ChangeLog
> index 3d83bd2..9499da4 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,6 +1,11 @@
>  2011-07-21  Tobias Grosser  <tobias@grosser.es>
>
>        * configure: Regenerated.
> +       * config/cloog.m4: Do not define CLOOG_ORGt
> +
> +2011-07-21  Tobias Grosser  <tobias@grosser.es>
> +
> +       * configure: Regenerated.
>        * configure.ac: Require cloog isl 0.16.3
>
>  2011-07-21  Tobias Grosser  <tobias@grosser.es>
> diff --git a/config/cloog.m4 b/config/cloog.m4
> index 8662acd..9c42445 100644
> --- a/config/cloog.m4
> +++ b/config/cloog.m4
> @@ -109,7 +109,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
>   _cloog_saved_LDFLAGS=$LDFLAGS
>   _cloog_saved_LIBS=$LIBS
>
> -  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +  _cloogorginc="-DCLOOG_INT_GMP"
>
>   dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
>   CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
> diff --git a/configure b/configure
> index 57f099b..8de7bc69 100755
> --- a/configure
> +++ b/configure
> @@ -5771,7 +5771,7 @@ if test "x$with_cloog" != "xno"; then
>   _cloog_saved_LDFLAGS=$LDFLAGS
>   _cloog_saved_LIBS=$LIBS
>
> -  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
> +  _cloogorginc="-DCLOOG_INT_GMP"
>
>     CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
>   CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index b9d95fa..b6009b7 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,21 @@
> +2011-07-21  Tobias Grosser  <tobias@grosser.es>
> +
> +       * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
> +       Remove graphite-cloog-util.h.
> +       * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
> +       build_iv_mapping, translate_clast_user, translate_clast,
> +       free_scattering, initialize_cloog_names, build_cloog_prog,
> +       create_params_index): Do not use old compatibility functions.
> +       (clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
> +       * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
> +       compatibility functions.
> +       (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
> +       cloog.
> +       * graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
> +       * graphite.c (graphite.c): Do not call outdated cloog_initialize() and
> +       cloog_finalize().
> +       * graphite-cloog-compat.h: Remove.
> +
>  2011-07-21  Georg-Johann Lay  <avr@gjlay.de>
>
>        * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> index d924fb6..c5a2f7f 100644
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -2690,9 +2690,9 @@ graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
>    $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
>    $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
>    graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
> -   graphite-dependences.h graphite-cloog-compat.h
> +   graphite-dependences.h
>  graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
> -   coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
> +   coretypes.h graphite-cloog-util.h
>  graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
>    coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
>    sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
> diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
> index 6b17631..da9b84f 100644
> --- a/gcc/graphite-clast-to-gimple.c
> +++ b/gcc/graphite-clast-to-gimple.c
> @@ -38,7 +38,8 @@ along with GCC; see the file COPYING3.  If not see
>  #include "graphite-poly.h"
>  #include "graphite-clast-to-gimple.h"
>  #include "graphite-dependences.h"
> -#include "graphite-cloog-compat.h"
> +
> +typedef const struct clast_expr *clast_name_p;
>
>  /* This flag is set when an error occurred during the translation of
>    CLAST to Gimple.  */
> @@ -86,12 +87,8 @@ 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);
>
> @@ -683,7 +680,7 @@ gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
>   struct clast_stmt *stmt = (struct clast_stmt *) stmt_for;
>   struct clast_user_stmt *body = clast_get_body_of_loop (stmt);
>   CloogStatement *cs = body->statement;
> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
> +  poly_bb_p pbb = (poly_bb_p) cs->usr;
>
>   return max_signed_precision_type (lb_type, max_precision_type
>                                    (ub_type, compute_type_for_level
> @@ -740,7 +737,7 @@ build_iv_mapping (VEC (tree, heap) *iv_map, sese region,
>   struct clast_stmt *t;
>   int depth = 0;
>   CloogStatement *cs = user_stmt->statement;
> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
> +  poly_bb_p pbb = (poly_bb_p) cs->usr;
>   gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
>
>   for (t = user_stmt->substitutions; t; t = t->next, depth++)
> @@ -856,7 +853,7 @@ translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
>  {
>   int i, nb_loops;
>   basic_block new_bb;
> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (stmt->statement);
> +  poly_bb_p pbb = (poly_bb_p) stmt->statement->usr;
>   gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
>   VEC (tree, heap) *iv_map;
>
> @@ -1076,8 +1073,8 @@ free_scattering (CloogScatteringList *scattering)
>  {
>   while (scattering)
>     {
> -      CloogScattering *dom = cloog_scattering (scattering);
> -      CloogScatteringList *next = cloog_next_scattering (scattering);
> +      CloogScattering *dom = scattering->scatt;
> +      CloogScatteringList *next = scattering->next;
>
>       cloog_scattering_free (dom);
>       free (scattering);
> @@ -1095,13 +1092,13 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>   sese region = SCOP_REGION (scop);
>   int i;
>   int nb_iterators = scop_max_loop_depth (scop);
> -  int nb_scattering = cloog_program_nb_scattdims (prog);
> +  int nb_scattering = prog->nb_scattdims;
>   int nb_parameters = VEC_length (tree, SESE_PARAMS (region));
>   char **iterators = XNEWVEC (char *, nb_iterators * 2);
>   char **scattering = XNEWVEC (char *, nb_scattering);
>   char **parameters= XNEWVEC (char *, nb_parameters);
>
> -  cloog_program_set_names (prog, cloog_names_malloc ());
> +  prog->names = cloog_names_malloc ();
>
>   for (i = 0; i < nb_parameters; i++)
>     {
> @@ -1118,8 +1115,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>       snprintf (parameters[i], len, "%s_%d", name, SSA_NAME_VERSION (param));
>     }
>
> -  cloog_names_set_nb_parameters (cloog_program_names (prog), nb_parameters);
> -  cloog_names_set_parameters (cloog_program_names (prog), parameters);
> +  prog->names->nb_parameters = nb_parameters;
> +  prog->names->parameters = parameters;
>
>   for (i = 0; i < nb_iterators; i++)
>     {
> @@ -1128,10 +1125,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>       snprintf (iterators[i], len, "git_%d", i);
>     }
>
> -  cloog_names_set_nb_iterators (cloog_program_names (prog),
> -                               nb_iterators);
> -  cloog_names_set_iterators (cloog_program_names (prog),
> -                            iterators);
> +  prog->names->nb_iterators = nb_iterators;
> +  prog->names->iterators = iterators;
>
>   for (i = 0; i < nb_scattering; i++)
>     {
> @@ -1140,10 +1135,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>       snprintf (scattering[i], len, "scat_%d", i);
>     }
>
> -  cloog_names_set_nb_scattering (cloog_program_names (prog),
> -                                nb_scattering);
> -  cloog_names_set_scattering (cloog_program_names (prog),
> -                             scattering);
> +  prog->names->nb_scattering = nb_scattering;
> +  prog->names->scattering = scattering;
>  }
>
>  /* Initialize a CLooG input file.  */
> @@ -1186,12 +1179,13 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>   int nbs = 2 * max_nb_loops + 1;
>   int *scaldims;
>
> -  cloog_program_set_context
> -    (prog, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
> -      scop_nb_params (scop), cloog_state));
> +  prog->context =
> +    new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
> +                                                scop_nb_params (scop),
> +                                                cloog_state);
>   nbs = unify_scattering_dimensions (scop);
>   scaldims = (int *) xmalloc (nbs * (sizeof (int)));
> -  cloog_program_set_nb_scattdims (prog, nbs);
> +  prog->nb_scattdims = nbs;
>   initialize_cloog_names (scop, prog);
>
>   FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
> @@ -1211,14 +1205,14 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>                                                          scop_nb_params (scop),
>                                                          cloog_state);
>       block = cloog_block_alloc (stmt, 0, NULL, pbb_dim_iter_domain (pbb));
> -      cloog_statement_set_usr (stmt, pbb);
> +      stmt->usr = pbb;
>
>       /* Build loop list.  */
>       {
>         CloogLoop *new_loop_list = cloog_loop_malloc (cloog_state);
> -        cloog_loop_set_next (new_loop_list, loop_list);
> -        cloog_loop_set_domain (new_loop_list, dom);
> -        cloog_loop_set_block (new_loop_list, block);
> +        new_loop_list->next = loop_list;
> +        new_loop_list->domain = dom;
> +        new_loop_list->block = block;
>         loop_list = new_loop_list;
>       }
>
> @@ -1226,8 +1220,8 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>       {
>         CloogBlockList *new_block_list = cloog_block_list_malloc ();
>
> -        cloog_block_list_set_next (new_block_list, block_list);
> -        cloog_block_list_set_block (new_block_list, block);
> +        new_block_list->next = block_list;
> +        new_block_list->block = block;
>         block_list = new_block_list;
>       }
>
> @@ -1244,19 +1238,19 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>           (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb),
>            cloog_state);
>
> -        cloog_set_next_scattering (new_scattering, scattering);
> -        cloog_set_scattering (new_scattering, dom);
> +        new_scattering->next = scattering;
> +        new_scattering->scatt = dom;
>         scattering = new_scattering;
>       }
>     }
>
> -  cloog_program_set_loop (prog, loop_list);
> -  cloog_program_set_blocklist (prog, block_list);
> +  prog->loop = loop_list;
> +  prog->blocklist = block_list;
>
>   for (i = 0; i < nbs; i++)
>     scaldims[i] = 0 ;
>
> -  cloog_program_set_scaldims (prog, scaldims);
> +  prog->scaldims = scaldims;
>
>   /* Extract scalar dimensions to simplify the code generation problem.  */
>   cloog_program_extract_scalars (prog, scattering, options);
> @@ -1277,22 +1271,21 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>   free_scattering (scattering);
>
>   /* Iterators corresponding to scalar dimensions have to be extracted.  */
> -  cloog_names_scalarize (cloog_program_names (prog), nbs,
> -                        cloog_program_scaldims (prog));
> +  cloog_names_scalarize (prog->names, nbs, prog->scaldims);
>
>   /* Free blocklist.  */
>   {
> -    CloogBlockList *next = cloog_program_blocklist (prog);
> +    CloogBlockList *next = prog->blocklist;
>
>     while (next)
>       {
>         CloogBlockList *toDelete = next;
> -        next = cloog_block_list_next (next);
> -        cloog_block_list_set_next (toDelete, NULL);
> -        cloog_block_list_set_block (toDelete, NULL);
> +        next = next->next;
> +        toDelete->next =  NULL;
> +        toDelete->block = NULL;
>         cloog_block_list_free (toDelete);
>       }
> -    cloog_program_set_blocklist (prog, NULL);
> +    prog->blocklist = NULL;
>   }
>  }
>
> @@ -1314,14 +1307,8 @@ set_cloog_options (void)
>      GLooG.  */
>   options->esp = 1;
>
> -#ifdef CLOOG_ORG
>   /* Silence CLooG to avoid failing tests due to debug output to stderr.  */
>   options->quiet = 1;
> -#else
> -  /* Enable C pretty-printing mode: normalizes the substitution
> -     equations for statements.  */
> -  options->cpp = 1;
> -#endif
>
>   /* Allow cloog to build strides with a stride width different to one.
>      This example has stride = 4:
> @@ -1419,9 +1406,9 @@ debug_generated_program (scop_p scop)
>
>  static void
>  create_params_index (htab_t index_table, CloogProgram *prog) {
> -  CloogNames* names = cloog_program_names (prog);
> -  int nb_parameters = cloog_names_nb_parameters (names);
> -  char **parameters = cloog_names_parameters (names);
> +  CloogNames* names = prog->names;
> +  int nb_parameters = names->nb_parameters;
> +  char **parameters = names->parameters;
>   int i;
>
>   for (i = 0; i < nb_parameters; i++)
> diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
> deleted file mode 100644
> index 011377d..0000000
> --- a/gcc/graphite-cloog-compat.h
> +++ /dev/null
> @@ -1,275 +0,0 @@
> -/* Compatibility layer for using upstream CLooG versions with
> -   CLooG legacy code.
> -   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
> -   Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>.
> -
> -This file is part of GCC.
> -
> -GCC is free software; you can redistribute it and/or modify
> -it under the terms of the GNU General Public License as published by
> -the Free Software Foundation; either version 3, or (at your option)
> -any later version.
> -
> -GCC is distributed in the hope that it will be useful,
> -but WITHOUT ANY WARRANTY; without even the implied warranty of
> -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -GNU General Public License for more details.
> -
> -You should have received a copy of the GNU General Public License
> -along with GCC; see the file COPYING3.  If not see
> -<http://www.gnu.org/licenses/>.  */
> -
> -#ifndef GRAPHITE_CLOOG_COMPAT_H
> -#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
> -
> -#ifdef CLOOG_ORG
> -#define cloog_initialize()
> -#define cloog_finalize()
> -#endif
> -
> -#ifndef CLOOG_ORG
> -
> -/* CloogOptions compatibility.  */
> -#define build_cloog_prog(SCOP, PROG, OPT)\
> -  build_cloog_prog (SCOP, PROG)
> -#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
> -  cloog_program_extract_scalars (PROG, SCATT)
> -#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
> -
> -/* CloogState compatibility.  */
> -#define CloogState void
> -#define cloog_state_malloc() NULL
> -#define cloog_state_free(STATE)
> -#define cloog_loop_malloc(STATE) cloog_loop_malloc ()
> -#define cloog_options_malloc(STATE) cloog_options_malloc ()
> -#define cloog_statement_alloc(STATE, INDEX) cloog_statement_alloc (INDEX)
> -#define new_Cloog_Domain_from_ppl_Pointset_Powerset(PSPS, NB, STATE)\
> -  new_Cloog_Domain_from_ppl_Pointset_Powerset (PSPS)
> -#define new_Cloog_Domain_from_ppl_Polyhedron(POLY, NB, STATE)\
> -  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
> -#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST)\
> -  cloog_program_dump_cloog (DUMPFILE, PROGRAM)
> -
> -#endif
> -
> -/* Adapt CLooG accessors from CLooG legacy to
> -   newer CLooG versions.  */
> -
> -#ifdef CLOOG_ORG
> -
> -static inline void *
> -cloog_statement_usr (CloogStatement *cs)
> -{
> -  return cs->usr;
> -}
> -
> -static inline CloogScattering *
> -cloog_scattering (CloogScatteringList *sl)
> -{
> -  return sl->scatt;
> -}
> -
> -static inline void
> -cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
> -{
> -  sl->scatt = scatt;
> -}
> -
> -static inline CloogScatteringList *
> -cloog_next_scattering (CloogScatteringList *sl)
> -{
> -  return sl->next;
> -}
> -
> -static inline void
> -cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
> -{
> -  sl->next = next;
> -}
> -
> -static inline int
> -cloog_program_nb_scattdims (CloogProgram *prog)
> -{
> -  return prog->nb_scattdims;
> -}
> -
> -static inline void
> -cloog_program_set_nb_scattdims (CloogProgram *prog, int nb_scattdims)
> -{
> -  prog->nb_scattdims = nb_scattdims;
> -}
> -
> -static inline CloogNames *
> -cloog_program_names (CloogProgram *prog)
> -{
> -  return prog->names;
> -}
> -
> -static inline void
> -cloog_program_set_names (CloogProgram *prog, CloogNames *names)
> -{
> -  prog->names = names;
> -}
> -
> -static inline void
> -cloog_program_set_context (CloogProgram *prog, CloogDomain *domain)
> -{
> -  prog->context = domain;
> -}
> -
> -static inline void
> -cloog_program_set_loop (CloogProgram *prog, CloogLoop *loop)
> -{
> -  prog->loop = loop;
> -}
> -
> -static inline CloogBlockList *
> -cloog_program_blocklist (CloogProgram *prog)
> -{
> -  return prog->blocklist;
> -}
> -
> -static inline void
> -cloog_program_set_blocklist (CloogProgram *prog, CloogBlockList *bl)
> -{
> -  prog->blocklist = bl;
> -}
> -
> -static inline int *
> -cloog_program_scaldims (CloogProgram *prog)
> -{
> -  return prog->scaldims;
> -}
> -
> -static inline void
> -cloog_program_set_scaldims (CloogProgram *prog, int *s)
> -{
> -  prog->scaldims = s;
> -}
> -
> -static inline int
> -cloog_names_nb_parameters (CloogNames *names)
> -{
> -  return names->nb_parameters;
> -}
> -
> -static inline void
> -cloog_names_set_nb_parameters (CloogNames *names, int nb_parameters)
> -{
> -  names->nb_parameters = nb_parameters;
> -}
> -
> -static inline char **
> -cloog_names_parameters (CloogNames *names)
> -{
> -  return names->parameters;
> -}
> -
> -static inline void
> -cloog_names_set_parameters (CloogNames *names, char **parameters)
> -{
> -  names->parameters = parameters;
> -}
> -
> -static inline void
> -cloog_names_set_nb_iterators (CloogNames *names, int nb_iterators)
> -{
> -  names->nb_iterators = nb_iterators;
> -}
> -
> -static inline void
> -cloog_names_set_iterators (CloogNames *names, char **iterators)
> -{
> -  names->iterators = iterators;
> -}
> -
> -static inline void
> -cloog_names_set_nb_scattering (CloogNames *names, int nb_scattering)
> -{
> -  names->nb_scattering = nb_scattering;
> -}
> -
> -static inline void
> -cloog_names_set_scattering (CloogNames *names, char **scattering)
> -{
> -  names->scattering = scattering;
> -}
> -
> -static inline void
> -cloog_statement_set_usr (CloogStatement *cs, void *u)
> -{
> -  cs->usr = u;
> -}
> -
> -static inline void
> -cloog_loop_set_next (CloogLoop *loop, CloogLoop *next)
> -{
> -  loop->next = next;
> -}
> -
> -static inline void
> -cloog_loop_set_domain (CloogLoop *loop, CloogDomain *domain)
> -{
> -  loop->domain = domain;
> -}
> -
> -static inline void
> -cloog_loop_set_block (CloogLoop *loop, CloogBlock *block)
> -{
> -  loop->block = block;
> -}
> -
> -static inline CloogBlockList *
> -cloog_block_list_next (CloogBlockList *bl)
> -{
> -  return bl->next;
> -}
> -
> -static inline void
> -cloog_block_list_set_next (CloogBlockList *bl, CloogBlockList *next)
> -{
> -  bl->next = next;
> -}
> -
> -static inline void
> -cloog_block_list_set_block (CloogBlockList *bl, CloogBlock *block)
> -{
> -  bl->block = block;
> -}
> -
> -static inline int cloog_matrix_ncolumns (CloogMatrix * m)
> -{
> -  return m->NbColumns;
> -}
> -
> -static inline int cloog_matrix_nrows (CloogMatrix * m)
> -{
> -   return m->NbRows;
> -}
> -#endif /* CLOOG_ORG  */
> -#endif /* GRAPHITE_CLOOG_COMPAT_H  */
> diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
> index c3d0cc1..9bc24a0 100644
> --- a/gcc/graphite-cloog-util.c
> +++ b/gcc/graphite-cloog-util.c
> @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
>  #include "ppl_c.h"
>  #include "cloog/cloog.h"
>  #include "graphite-cloog-util.h"
> -#include "graphite-cloog-compat.h"
>
>  /* Counts the number of constraints in PCS.  */
>
> @@ -253,7 +252,6 @@ new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
>                                           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,
> @@ -261,9 +259,6 @@ new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
>
>   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.  */
> @@ -314,14 +309,14 @@ openscop_print_cloog_matrix (FILE *file, CloogMatrix *mat,
>                             int output, int input, int locals,
>                             int params)
>  {
> -  int i, j;
> +  unsigned i, j;
>
> -  fprintf (file, "%d %d %d %d %d %d \n", cloog_matrix_nrows (mat),
> -          cloog_matrix_ncolumns (mat), output, input, locals, params);
> +  fprintf (file, "%d %d %d %d %d %d \n", mat->NbRows,
> +          mat->NbColumns, output, input, locals, params);
>
> -  for (i = 0; i < cloog_matrix_nrows (mat); i++)
> +  for (i = 0; i < mat->NbRows; i++)
>     {
> -      for (j = 0; j < cloog_matrix_ncolumns (mat); j++)
> +      for (j = 0; j < mat->NbColumns; j++)
>         if (j == 0)
>          fprintf (file, "%ld ", mpz_get_si (mat->p[i][j]));
>         else
> diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
> index 9686e7c..da26ee9 100644
> --- a/gcc/graphite-cloog-util.h
> +++ b/gcc/graphite-cloog-util.h
> @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
>  #define GRAPHITE_CLOOG_UTIL_H
>
>  #include "cloog/cloog.h"
> -#include "graphite-cloog-compat.h"
>
>  CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
>  CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
> diff --git a/gcc/graphite.c b/gcc/graphite.c
> index b013447..e746c61 100644
> --- a/gcc/graphite.c
> +++ b/gcc/graphite.c
> @@ -209,7 +209,6 @@ graphite_initialize (void)
>   gcc_assert (ppl_initialized == 0);
>
>   cloog_state = cloog_state_malloc ();
> -  cloog_initialize ();
>
>   if (dump_file && dump_flags)
>     dump_function_to_file (current_function_decl, dump_file, dump_flags);
> @@ -233,7 +232,6 @@ graphite_finalize (bool need_cfg_cleanup_p)
>     }
>
>   cloog_state_free (cloog_state);
> -  cloog_finalize ();
>   ppl_finalize ();
>   free_original_copy_tables ();
>
> --
> 1.7.4.1
>
>
Tobias Grosser Aug. 10, 2011, 10:05 p.m. UTC | #4
On 08/02/2011 04:47 PM, Sebastian Pop wrote:
> Ping.
>
> Could one of the configure maintainers review these changes?
>
> Thanks,
> Sebastian

Ping II.

This is needed for move graphite to the official cloog.org library 
interface [1].

Thanks a lot for your time
Tobi

[1] http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00976.html


>
> On Thu, Jul 21, 2011 at 18:00, Tobias Grosser<tobias@grosser.es>  wrote:
>> 2011-07-21  Tobias Grosser<tobias@grosser.es>
>>
>>         * configure: Regenerated.
>>         * config/cloog.m4: Do not define CLOOG_ORG
>>
>> and in gcc/
>>
>> 2011-07-21  Tobias Grosser<tobias@grosser.es>
>>
>>         * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
>>         Remove graphite-cloog-util.h.
>>         * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
>>         build_iv_mapping, translate_clast_user, translate_clast,
>>         free_scattering, initialize_cloog_names, build_cloog_prog,
>>         create_params_index): Do not use old compatibility functions.
>>         (clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
>>         * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
>>         compatibility functions.
>>         (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
>>         cloog.
>>         * graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
>>         * graphite.c (graphite.c): Do not call outdated cloog_initialize() and
>>         cloog_finalize().
>>         * graphite-cloog-compat.h: Remove.
>> ---
>>   ChangeLog                      |    5 +
>>   config/cloog.m4                |    2 +-
>>   configure                      |    2 +-
>>   gcc/ChangeLog                  |   18 +++
>>   gcc/Makefile.in                |    4 +-
>>   gcc/graphite-clast-to-gimple.c |   93 ++++++--------
>>   gcc/graphite-cloog-compat.h    |  275 ----------------------------------------
>>   gcc/graphite-cloog-util.c      |   15 +--
>>   gcc/graphite-cloog-util.h      |    1 -
>>   gcc/graphite.c                 |    2 -
>>   10 files changed, 72 insertions(+), 345 deletions(-)
>>   delete mode 100644 gcc/graphite-cloog-compat.h
>>
>> diff --git a/ChangeLog b/ChangeLog
>> index 3d83bd2..9499da4 100644
>> --- a/ChangeLog
>> +++ b/ChangeLog
>> @@ -1,6 +1,11 @@
>>   2011-07-21  Tobias Grosser<tobias@grosser.es>
>>
>>         * configure: Regenerated.
>> +       * config/cloog.m4: Do not define CLOOG_ORGt
>> +
>> +2011-07-21  Tobias Grosser<tobias@grosser.es>
>> +
>> +       * configure: Regenerated.
>>         * configure.ac: Require cloog isl 0.16.3
>>
>>   2011-07-21  Tobias Grosser<tobias@grosser.es>
>> diff --git a/config/cloog.m4 b/config/cloog.m4
>> index 8662acd..9c42445 100644
>> --- a/config/cloog.m4
>> +++ b/config/cloog.m4
>> @@ -109,7 +109,7 @@ AC_DEFUN([CLOOG_FIND_FLAGS],
>>    _cloog_saved_LDFLAGS=$LDFLAGS
>>    _cloog_saved_LIBS=$LIBS
>>
>> -  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>> +  _cloogorginc="-DCLOOG_INT_GMP"
>>
>>    dnl clooglibs&  clooginc may have been initialized by CLOOG_INIT_FLAGS.
>>    CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
>> diff --git a/configure b/configure
>> index 57f099b..8de7bc69 100755
>> --- a/configure
>> +++ b/configure
>> @@ -5771,7 +5771,7 @@ if test "x$with_cloog" != "xno"; then
>>    _cloog_saved_LDFLAGS=$LDFLAGS
>>    _cloog_saved_LIBS=$LIBS
>>
>> -  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
>> +  _cloogorginc="-DCLOOG_INT_GMP"
>>
>>      CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
>>    CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
>> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
>> index b9d95fa..b6009b7 100644
>> --- a/gcc/ChangeLog
>> +++ b/gcc/ChangeLog
>> @@ -1,3 +1,21 @@
>> +2011-07-21  Tobias Grosser<tobias@grosser.es>
>> +
>> +       * Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
>> +       Remove graphite-cloog-util.h.
>> +       * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
>> +       build_iv_mapping, translate_clast_user, translate_clast,
>> +       free_scattering, initialize_cloog_names, build_cloog_prog,
>> +       create_params_index): Do not use old compatibility functions.
>> +       (clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
>> +       * graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
>> +       compatibility functions.
>> +       (new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
>> +       cloog.
>> +       * graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
>> +       * graphite.c (graphite.c): Do not call outdated cloog_initialize() and
>> +       cloog_finalize().
>> +       * graphite-cloog-compat.h: Remove.
>> +
>>   2011-07-21  Georg-Johann Lay<avr@gjlay.de>
>>
>>         * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
>> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
>> index d924fb6..c5a2f7f 100644
>> --- a/gcc/Makefile.in
>> +++ b/gcc/Makefile.in
>> @@ -2690,9 +2690,9 @@ graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
>>     $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
>>     $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
>>     graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
>> -   graphite-dependences.h graphite-cloog-compat.h
>> +   graphite-dependences.h
>>   graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
>> -   coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
>> +   coretypes.h graphite-cloog-util.h
>>   graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
>>     coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
>>     sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
>> diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
>> index 6b17631..da9b84f 100644
>> --- a/gcc/graphite-clast-to-gimple.c
>> +++ b/gcc/graphite-clast-to-gimple.c
>> @@ -38,7 +38,8 @@ along with GCC; see the file COPYING3.  If not see
>>   #include "graphite-poly.h"
>>   #include "graphite-clast-to-gimple.h"
>>   #include "graphite-dependences.h"
>> -#include "graphite-cloog-compat.h"
>> +
>> +typedef const struct clast_expr *clast_name_p;
>>
>>   /* This flag is set when an error occurred during the translation of
>>     CLAST to Gimple.  */
>> @@ -86,12 +87,8 @@ 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);
>>
>> @@ -683,7 +680,7 @@ gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
>>    struct clast_stmt *stmt = (struct clast_stmt *) stmt_for;
>>    struct clast_user_stmt *body = clast_get_body_of_loop (stmt);
>>    CloogStatement *cs = body->statement;
>> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
>> +  poly_bb_p pbb = (poly_bb_p) cs->usr;
>>
>>    return max_signed_precision_type (lb_type, max_precision_type
>>                                     (ub_type, compute_type_for_level
>> @@ -740,7 +737,7 @@ build_iv_mapping (VEC (tree, heap) *iv_map, sese region,
>>    struct clast_stmt *t;
>>    int depth = 0;
>>    CloogStatement *cs = user_stmt->statement;
>> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
>> +  poly_bb_p pbb = (poly_bb_p) cs->usr;
>>    gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
>>
>>    for (t = user_stmt->substitutions; t; t = t->next, depth++)
>> @@ -856,7 +853,7 @@ translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
>>   {
>>    int i, nb_loops;
>>    basic_block new_bb;
>> -  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (stmt->statement);
>> +  poly_bb_p pbb = (poly_bb_p) stmt->statement->usr;
>>    gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
>>    VEC (tree, heap) *iv_map;
>>
>> @@ -1076,8 +1073,8 @@ free_scattering (CloogScatteringList *scattering)
>>   {
>>    while (scattering)
>>      {
>> -      CloogScattering *dom = cloog_scattering (scattering);
>> -      CloogScatteringList *next = cloog_next_scattering (scattering);
>> +      CloogScattering *dom = scattering->scatt;
>> +      CloogScatteringList *next = scattering->next;
>>
>>        cloog_scattering_free (dom);
>>        free (scattering);
>> @@ -1095,13 +1092,13 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>>    sese region = SCOP_REGION (scop);
>>    int i;
>>    int nb_iterators = scop_max_loop_depth (scop);
>> -  int nb_scattering = cloog_program_nb_scattdims (prog);
>> +  int nb_scattering = prog->nb_scattdims;
>>    int nb_parameters = VEC_length (tree, SESE_PARAMS (region));
>>    char **iterators = XNEWVEC (char *, nb_iterators * 2);
>>    char **scattering = XNEWVEC (char *, nb_scattering);
>>    char **parameters= XNEWVEC (char *, nb_parameters);
>>
>> -  cloog_program_set_names (prog, cloog_names_malloc ());
>> +  prog->names = cloog_names_malloc ();
>>
>>    for (i = 0; i<  nb_parameters; i++)
>>      {
>> @@ -1118,8 +1115,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>>        snprintf (parameters[i], len, "%s_%d", name, SSA_NAME_VERSION (param));
>>      }
>>
>> -  cloog_names_set_nb_parameters (cloog_program_names (prog), nb_parameters);
>> -  cloog_names_set_parameters (cloog_program_names (prog), parameters);
>> +  prog->names->nb_parameters = nb_parameters;
>> +  prog->names->parameters = parameters;
>>
>>    for (i = 0; i<  nb_iterators; i++)
>>      {
>> @@ -1128,10 +1125,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>>        snprintf (iterators[i], len, "git_%d", i);
>>      }
>>
>> -  cloog_names_set_nb_iterators (cloog_program_names (prog),
>> -                               nb_iterators);
>> -  cloog_names_set_iterators (cloog_program_names (prog),
>> -                            iterators);
>> +  prog->names->nb_iterators = nb_iterators;
>> +  prog->names->iterators = iterators;
>>
>>    for (i = 0; i<  nb_scattering; i++)
>>      {
>> @@ -1140,10 +1135,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
>>        snprintf (scattering[i], len, "scat_%d", i);
>>      }
>>
>> -  cloog_names_set_nb_scattering (cloog_program_names (prog),
>> -                                nb_scattering);
>> -  cloog_names_set_scattering (cloog_program_names (prog),
>> -                             scattering);
>> +  prog->names->nb_scattering = nb_scattering;
>> +  prog->names->scattering = scattering;
>>   }
>>
>>   /* Initialize a CLooG input file.  */
>> @@ -1186,12 +1179,13 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>>    int nbs = 2 * max_nb_loops + 1;
>>    int *scaldims;
>>
>> -  cloog_program_set_context
>> -    (prog, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
>> -      scop_nb_params (scop), cloog_state));
>> +  prog->context =
>> +    new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
>> +                                                scop_nb_params (scop),
>> +                                                cloog_state);
>>    nbs = unify_scattering_dimensions (scop);
>>    scaldims = (int *) xmalloc (nbs * (sizeof (int)));
>> -  cloog_program_set_nb_scattdims (prog, nbs);
>> +  prog->nb_scattdims = nbs;
>>    initialize_cloog_names (scop, prog);
>>
>>    FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
>> @@ -1211,14 +1205,14 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>>                                                           scop_nb_params (scop),
>>                                                           cloog_state);
>>        block = cloog_block_alloc (stmt, 0, NULL, pbb_dim_iter_domain (pbb));
>> -      cloog_statement_set_usr (stmt, pbb);
>> +      stmt->usr = pbb;
>>
>>        /* Build loop list.  */
>>        {
>>          CloogLoop *new_loop_list = cloog_loop_malloc (cloog_state);
>> -        cloog_loop_set_next (new_loop_list, loop_list);
>> -        cloog_loop_set_domain (new_loop_list, dom);
>> -        cloog_loop_set_block (new_loop_list, block);
>> +        new_loop_list->next = loop_list;
>> +        new_loop_list->domain = dom;
>> +        new_loop_list->block = block;
>>          loop_list = new_loop_list;
>>        }
>>
>> @@ -1226,8 +1220,8 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>>        {
>>          CloogBlockList *new_block_list = cloog_block_list_malloc ();
>>
>> -        cloog_block_list_set_next (new_block_list, block_list);
>> -        cloog_block_list_set_block (new_block_list, block);
>> +        new_block_list->next = block_list;
>> +        new_block_list->block = block;
>>          block_list = new_block_list;
>>        }
>>
>> @@ -1244,19 +1238,19 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>>            (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb),
>>             cloog_state);
>>
>> -        cloog_set_next_scattering (new_scattering, scattering);
>> -        cloog_set_scattering (new_scattering, dom);
>> +        new_scattering->next = scattering;
>> +        new_scattering->scatt = dom;
>>          scattering = new_scattering;
>>        }
>>      }
>>
>> -  cloog_program_set_loop (prog, loop_list);
>> -  cloog_program_set_blocklist (prog, block_list);
>> +  prog->loop = loop_list;
>> +  prog->blocklist = block_list;
>>
>>    for (i = 0; i<  nbs; i++)
>>      scaldims[i] = 0 ;
>>
>> -  cloog_program_set_scaldims (prog, scaldims);
>> +  prog->scaldims = scaldims;
>>
>>    /* Extract scalar dimensions to simplify the code generation problem.  */
>>    cloog_program_extract_scalars (prog, scattering, options);
>> @@ -1277,22 +1271,21 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
>>    free_scattering (scattering);
>>
>>    /* Iterators corresponding to scalar dimensions have to be extracted.  */
>> -  cloog_names_scalarize (cloog_program_names (prog), nbs,
>> -                        cloog_program_scaldims (prog));
>> +  cloog_names_scalarize (prog->names, nbs, prog->scaldims);
>>
>>    /* Free blocklist.  */
>>    {
>> -    CloogBlockList *next = cloog_program_blocklist (prog);
>> +    CloogBlockList *next = prog->blocklist;
>>
>>      while (next)
>>        {
>>          CloogBlockList *toDelete = next;
>> -        next = cloog_block_list_next (next);
>> -        cloog_block_list_set_next (toDelete, NULL);
>> -        cloog_block_list_set_block (toDelete, NULL);
>> +        next = next->next;
>> +        toDelete->next =  NULL;
>> +        toDelete->block = NULL;
>>          cloog_block_list_free (toDelete);
>>        }
>> -    cloog_program_set_blocklist (prog, NULL);
>> +    prog->blocklist = NULL;
>>    }
>>   }
>>
>> @@ -1314,14 +1307,8 @@ set_cloog_options (void)
>>       GLooG.  */
>>    options->esp = 1;
>>
>> -#ifdef CLOOG_ORG
>>    /* Silence CLooG to avoid failing tests due to debug output to stderr.  */
>>    options->quiet = 1;
>> -#else
>> -  /* Enable C pretty-printing mode: normalizes the substitution
>> -     equations for statements.  */
>> -  options->cpp = 1;
>> -#endif
>>
>>    /* Allow cloog to build strides with a stride width different to one.
>>       This example has stride = 4:
>> @@ -1419,9 +1406,9 @@ debug_generated_program (scop_p scop)
>>
>>   static void
>>   create_params_index (htab_t index_table, CloogProgram *prog) {
>> -  CloogNames* names = cloog_program_names (prog);
>> -  int nb_parameters = cloog_names_nb_parameters (names);
>> -  char **parameters = cloog_names_parameters (names);
>> +  CloogNames* names = prog->names;
>> +  int nb_parameters = names->nb_parameters;
>> +  char **parameters = names->parameters;
>>    int i;
>>
>>    for (i = 0; i<  nb_parameters; i++)
>> diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
>> deleted file mode 100644
>> index 011377d..0000000
>> --- a/gcc/graphite-cloog-compat.h
>> +++ /dev/null
>> @@ -1,275 +0,0 @@
>> -/* Compatibility layer for using upstream CLooG versions with
>> -   CLooG legacy code.
>> -   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
>> -   Contributed by Andreas Simbuerger<simbuerg@fim.uni-passau.de>.
>> -
>> -This file is part of GCC.
>> -
>> -GCC is free software; you can redistribute it and/or modify
>> -it under the terms of the GNU General Public License as published by
>> -the Free Software Foundation; either version 3, or (at your option)
>> -any later version.
>> -
>> -GCC is distributed in the hope that it will be useful,
>> -but WITHOUT ANY WARRANTY; without even the implied warranty of
>> -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> -GNU General Public License for more details.
>> -
>> -You should have received a copy of the GNU General Public License
>> -along with GCC; see the file COPYING3.  If not see
>> -<http://www.gnu.org/licenses/>.  */
>> -
>> -#ifndef GRAPHITE_CLOOG_COMPAT_H
>> -#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
>> -
>> -#ifdef CLOOG_ORG
>> -#define cloog_initialize()
>> -#define cloog_finalize()
>> -#endif
>> -
>> -#ifndef CLOOG_ORG
>> -
>> -/* CloogOptions compatibility.  */
>> -#define build_cloog_prog(SCOP, PROG, OPT)\
>> -  build_cloog_prog (SCOP, PROG)
>> -#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
>> -  cloog_program_extract_scalars (PROG, SCATT)
>> -#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
>> -
>> -/* CloogState compatibility.  */
>> -#define CloogState void
>> -#define cloog_state_malloc() NULL
>> -#define cloog_state_free(STATE)
>> -#define cloog_loop_malloc(STATE) cloog_loop_malloc ()
>> -#define cloog_options_malloc(STATE) cloog_options_malloc ()
>> -#define cloog_statement_alloc(STATE, INDEX) cloog_statement_alloc (INDEX)
>> -#define new_Cloog_Domain_from_ppl_Pointset_Powerset(PSPS, NB, STATE)\
>> -  new_Cloog_Domain_from_ppl_Pointset_Powerset (PSPS)
>> -#define new_Cloog_Domain_from_ppl_Polyhedron(POLY, NB, STATE)\
>> -  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
>> -#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST)\
>> -  cloog_program_dump_cloog (DUMPFILE, PROGRAM)
>> -
>> -#endif
>> -
>> -/* Adapt CLooG accessors from CLooG legacy to
>> -   newer CLooG versions.  */
>> -
>> -#ifdef CLOOG_ORG
>> -
>> -static inline void *
>> -cloog_statement_usr (CloogStatement *cs)
>> -{
>> -  return cs->usr;
>> -}
>> -
>> -static inline CloogScattering *
>> -cloog_scattering (CloogScatteringList *sl)
>> -{
>> -  return sl->scatt;
>> -}
>> -
>> -static inline void
>> -cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
>> -{
>> -  sl->scatt = scatt;
>> -}
>> -
>> -static inline CloogScatteringList *
>> -cloog_next_scattering (CloogScatteringList *sl)
>> -{
>> -  return sl->next;
>> -}
>> -
>> -static inline void
>> -cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
>> -{
>> -  sl->next = next;
>> -}
>> -
>> -static inline int
>> -cloog_program_nb_scattdims (CloogProgram *prog)
>> -{
>> -  return prog->nb_scattdims;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_nb_scattdims (CloogProgram *prog, int nb_scattdims)
>> -{
>> -  prog->nb_scattdims = nb_scattdims;
>> -}
>> -
>> -static inline CloogNames *
>> -cloog_program_names (CloogProgram *prog)
>> -{
>> -  return prog->names;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_names (CloogProgram *prog, CloogNames *names)
>> -{
>> -  prog->names = names;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_context (CloogProgram *prog, CloogDomain *domain)
>> -{
>> -  prog->context = domain;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_loop (CloogProgram *prog, CloogLoop *loop)
>> -{
>> -  prog->loop = loop;
>> -}
>> -
>> -static inline CloogBlockList *
>> -cloog_program_blocklist (CloogProgram *prog)
>> -{
>> -  return prog->blocklist;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_blocklist (CloogProgram *prog, CloogBlockList *bl)
>> -{
>> -  prog->blocklist = bl;
>> -}
>> -
>> -static inline int *
>> -cloog_program_scaldims (CloogProgram *prog)
>> -{
>> -  return prog->scaldims;
>> -}
>> -
>> -static inline void
>> -cloog_program_set_scaldims (CloogProgram *prog, int *s)
>> -{
>> -  prog->scaldims = s;
>> -}
>> -
>> -static inline int
>> -cloog_names_nb_parameters (CloogNames *names)
>> -{
>> -  return names->nb_parameters;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_nb_parameters (CloogNames *names, int nb_parameters)
>> -{
>> -  names->nb_parameters = nb_parameters;
>> -}
>> -
>> -static inline char **
>> -cloog_names_parameters (CloogNames *names)
>> -{
>> -  return names->parameters;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_parameters (CloogNames *names, char **parameters)
>> -{
>> -  names->parameters = parameters;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_nb_iterators (CloogNames *names, int nb_iterators)
>> -{
>> -  names->nb_iterators = nb_iterators;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_iterators (CloogNames *names, char **iterators)
>> -{
>> -  names->iterators = iterators;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_nb_scattering (CloogNames *names, int nb_scattering)
>> -{
>> -  names->nb_scattering = nb_scattering;
>> -}
>> -
>> -static inline void
>> -cloog_names_set_scattering (CloogNames *names, char **scattering)
>> -{
>> -  names->scattering = scattering;
>> -}
>> -
>> -static inline void
>> -cloog_statement_set_usr (CloogStatement *cs, void *u)
>> -{
>> -  cs->usr = u;
>> -}
>> -
>> -static inline void
>> -cloog_loop_set_next (CloogLoop *loop, CloogLoop *next)
>> -{
>> -  loop->next = next;
>> -}
>> -
>> -static inline void
>> -cloog_loop_set_domain (CloogLoop *loop, CloogDomain *domain)
>> -{
>> -  loop->domain = domain;
>> -}
>> -
>> -static inline void
>> -cloog_loop_set_block (CloogLoop *loop, CloogBlock *block)
>> -{
>> -  loop->block = block;
>> -}
>> -
>> -static inline CloogBlockList *
>> -cloog_block_list_next (CloogBlockList *bl)
>> -{
>> -  return bl->next;
>> -}
>> -
>> -static inline void
>> -cloog_block_list_set_next (CloogBlockList *bl, CloogBlockList *next)
>> -{
>> -  bl->next = next;
>> -}
>> -
>> -static inline void
>> -cloog_block_list_set_block (CloogBlockList *bl, CloogBlock *block)
>> -{
>> -  bl->block = block;
>> -}
>> -
>> -static inline int cloog_matrix_ncolumns (CloogMatrix * m)
>> -{
>> -  return m->NbColumns;
>> -}
>> -
>> -static inline int cloog_matrix_nrows (CloogMatrix * m)
>> -{
>> -   return m->NbRows;
>> -}
>> -#endif /* CLOOG_ORG  */
>> -#endif /* GRAPHITE_CLOOG_COMPAT_H  */
>> diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
>> index c3d0cc1..9bc24a0 100644
>> --- a/gcc/graphite-cloog-util.c
>> +++ b/gcc/graphite-cloog-util.c
>> @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3.  If not see
>>   #include "ppl_c.h"
>>   #include "cloog/cloog.h"
>>   #include "graphite-cloog-util.h"
>> -#include "graphite-cloog-compat.h"
>>
>>   /* Counts the number of constraints in PCS.  */
>>
>> @@ -253,7 +252,6 @@ new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
>>                                            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,
>> @@ -261,9 +259,6 @@ new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
>>
>>    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.  */
>> @@ -314,14 +309,14 @@ openscop_print_cloog_matrix (FILE *file, CloogMatrix *mat,
>>                              int output, int input, int locals,
>>                              int params)
>>   {
>> -  int i, j;
>> +  unsigned i, j;
>>
>> -  fprintf (file, "%d %d %d %d %d %d \n", cloog_matrix_nrows (mat),
>> -          cloog_matrix_ncolumns (mat), output, input, locals, params);
>> +  fprintf (file, "%d %d %d %d %d %d \n", mat->NbRows,
>> +          mat->NbColumns, output, input, locals, params);
>>
>> -  for (i = 0; i<  cloog_matrix_nrows (mat); i++)
>> +  for (i = 0; i<  mat->NbRows; i++)
>>      {
>> -      for (j = 0; j<  cloog_matrix_ncolumns (mat); j++)
>> +      for (j = 0; j<  mat->NbColumns; j++)
>>          if (j == 0)
>>           fprintf (file, "%ld ", mpz_get_si (mat->p[i][j]));
>>          else
>> diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
>> index 9686e7c..da26ee9 100644
>> --- a/gcc/graphite-cloog-util.h
>> +++ b/gcc/graphite-cloog-util.h
>> @@ -22,7 +22,6 @@ along with GCC; see the file COPYING3.  If not see
>>   #define GRAPHITE_CLOOG_UTIL_H
>>
>>   #include "cloog/cloog.h"
>> -#include "graphite-cloog-compat.h"
>>
>>   CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
>>   CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
>> diff --git a/gcc/graphite.c b/gcc/graphite.c
>> index b013447..e746c61 100644
>> --- a/gcc/graphite.c
>> +++ b/gcc/graphite.c
>> @@ -209,7 +209,6 @@ graphite_initialize (void)
>>    gcc_assert (ppl_initialized == 0);
>>
>>    cloog_state = cloog_state_malloc ();
>> -  cloog_initialize ();
>>
>>    if (dump_file&&  dump_flags)
>>      dump_function_to_file (current_function_decl, dump_file, dump_flags);
>> @@ -233,7 +232,6 @@ graphite_finalize (bool need_cfg_cleanup_p)
>>      }
>>
>>    cloog_state_free (cloog_state);
>> -  cloog_finalize ();
>>    ppl_finalize ();
>>    free_original_copy_tables ();
>>
>> --
>> 1.7.4.1
>>
>>
diff mbox

Patch

diff --git a/ChangeLog b/ChangeLog
index 3d83bd2..9499da4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@ 
 2011-07-21  Tobias Grosser  <tobias@grosser.es>
 
 	* configure: Regenerated.
+	* config/cloog.m4: Do not define CLOOG_ORGt 
+
+2011-07-21  Tobias Grosser  <tobias@grosser.es>
+
+	* configure: Regenerated.
 	* configure.ac: Require cloog isl 0.16.3
 
 2011-07-21  Tobias Grosser  <tobias@grosser.es>
diff --git a/config/cloog.m4 b/config/cloog.m4
index 8662acd..9c42445 100644
--- a/config/cloog.m4
+++ b/config/cloog.m4
@@ -109,7 +109,7 @@  AC_DEFUN([CLOOG_FIND_FLAGS],
   _cloog_saved_LDFLAGS=$LDFLAGS
   _cloog_saved_LIBS=$LIBS
 
-  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+  _cloogorginc="-DCLOOG_INT_GMP"
  
   dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
   CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
diff --git a/configure b/configure
index 57f099b..8de7bc69 100755
--- a/configure
+++ b/configure
@@ -5771,7 +5771,7 @@  if test "x$with_cloog" != "xno"; then
   _cloog_saved_LDFLAGS=$LDFLAGS
   _cloog_saved_LIBS=$LIBS
 
-  _cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG"
+  _cloogorginc="-DCLOOG_INT_GMP"
 
     CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
   CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b9d95fa..b6009b7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,21 @@ 
+2011-07-21  Tobias Grosser  <tobias@grosser.es>
+
+	* Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
+	Remove graphite-cloog-util.h.
+	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
+	build_iv_mapping, translate_clast_user, translate_clast,
+	free_scattering, initialize_cloog_names, build_cloog_prog,
+	create_params_index): Do not use old compatibility functions.
+	(clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
+	* graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
+	compatibility functions.
+	(new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
+	cloog.
+	* graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
+	* graphite.c (graphite.c): Do not call outdated cloog_initialize() and
+	cloog_finalize().
+	* graphite-cloog-compat.h: Remove.
+
 2011-07-21  Georg-Johann Lay  <avr@gjlay.de>
 	
 	* config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index d924fb6..c5a2f7f 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2690,9 +2690,9 @@  graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
    $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
    $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
    graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
-   graphite-dependences.h graphite-cloog-compat.h
+   graphite-dependences.h
 graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
-   coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
+   coretypes.h graphite-cloog-util.h
 graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
    coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
    sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 6b17631..da9b84f 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -38,7 +38,8 @@  along with GCC; see the file COPYING3.  If not see
 #include "graphite-poly.h"
 #include "graphite-clast-to-gimple.h"
 #include "graphite-dependences.h"
-#include "graphite-cloog-compat.h"
+
+typedef const struct clast_expr *clast_name_p;
 
 /* This flag is set when an error occurred during the translation of
    CLAST to Gimple.  */
@@ -86,12 +87,8 @@  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);
 
@@ -683,7 +680,7 @@  gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
   struct clast_stmt *stmt = (struct clast_stmt *) stmt_for;
   struct clast_user_stmt *body = clast_get_body_of_loop (stmt);
   CloogStatement *cs = body->statement;
-  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
+  poly_bb_p pbb = (poly_bb_p) cs->usr;
 
   return max_signed_precision_type (lb_type, max_precision_type
 				    (ub_type, compute_type_for_level
@@ -740,7 +737,7 @@  build_iv_mapping (VEC (tree, heap) *iv_map, sese region,
   struct clast_stmt *t;
   int depth = 0;
   CloogStatement *cs = user_stmt->statement;
-  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
+  poly_bb_p pbb = (poly_bb_p) cs->usr;
   gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
 
   for (t = user_stmt->substitutions; t; t = t->next, depth++)
@@ -856,7 +853,7 @@  translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
 {
   int i, nb_loops;
   basic_block new_bb;
-  poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (stmt->statement);
+  poly_bb_p pbb = (poly_bb_p) stmt->statement->usr;
   gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
   VEC (tree, heap) *iv_map;
 
@@ -1076,8 +1073,8 @@  free_scattering (CloogScatteringList *scattering)
 {
   while (scattering)
     {
-      CloogScattering *dom = cloog_scattering (scattering);
-      CloogScatteringList *next = cloog_next_scattering (scattering);
+      CloogScattering *dom = scattering->scatt;
+      CloogScatteringList *next = scattering->next;
 
       cloog_scattering_free (dom);
       free (scattering);
@@ -1095,13 +1092,13 @@  initialize_cloog_names (scop_p scop, CloogProgram *prog)
   sese region = SCOP_REGION (scop);
   int i;
   int nb_iterators = scop_max_loop_depth (scop);
-  int nb_scattering = cloog_program_nb_scattdims (prog);
+  int nb_scattering = prog->nb_scattdims;
   int nb_parameters = VEC_length (tree, SESE_PARAMS (region));
   char **iterators = XNEWVEC (char *, nb_iterators * 2);
   char **scattering = XNEWVEC (char *, nb_scattering);
   char **parameters= XNEWVEC (char *, nb_parameters);
 
-  cloog_program_set_names (prog, cloog_names_malloc ());
+  prog->names = cloog_names_malloc ();
 
   for (i = 0; i < nb_parameters; i++)
     {
@@ -1118,8 +1115,8 @@  initialize_cloog_names (scop_p scop, CloogProgram *prog)
       snprintf (parameters[i], len, "%s_%d", name, SSA_NAME_VERSION (param));
     }
 
-  cloog_names_set_nb_parameters (cloog_program_names (prog), nb_parameters);
-  cloog_names_set_parameters (cloog_program_names (prog), parameters);
+  prog->names->nb_parameters = nb_parameters;
+  prog->names->parameters = parameters;
 
   for (i = 0; i < nb_iterators; i++)
     {
@@ -1128,10 +1125,8 @@  initialize_cloog_names (scop_p scop, CloogProgram *prog)
       snprintf (iterators[i], len, "git_%d", i);
     }
 
-  cloog_names_set_nb_iterators (cloog_program_names (prog),
-				nb_iterators);
-  cloog_names_set_iterators (cloog_program_names (prog),
-			     iterators);
+  prog->names->nb_iterators = nb_iterators;
+  prog->names->iterators = iterators;
 
   for (i = 0; i < nb_scattering; i++)
     {
@@ -1140,10 +1135,8 @@  initialize_cloog_names (scop_p scop, CloogProgram *prog)
       snprintf (scattering[i], len, "scat_%d", i);
     }
 
-  cloog_names_set_nb_scattering (cloog_program_names (prog),
-				 nb_scattering);
-  cloog_names_set_scattering (cloog_program_names (prog),
-			      scattering);
+  prog->names->nb_scattering = nb_scattering;
+  prog->names->scattering = scattering;
 }
 
 /* Initialize a CLooG input file.  */
@@ -1186,12 +1179,13 @@  build_cloog_prog (scop_p scop, CloogProgram *prog,
   int nbs = 2 * max_nb_loops + 1;
   int *scaldims;
 
-  cloog_program_set_context
-    (prog, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
-      scop_nb_params (scop), cloog_state));
+  prog->context =
+    new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
+						 scop_nb_params (scop),
+						 cloog_state);
   nbs = unify_scattering_dimensions (scop);
   scaldims = (int *) xmalloc (nbs * (sizeof (int)));
-  cloog_program_set_nb_scattdims (prog, nbs);
+  prog->nb_scattdims = nbs;
   initialize_cloog_names (scop, prog);
 
   FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb)
@@ -1211,14 +1205,14 @@  build_cloog_prog (scop_p scop, CloogProgram *prog,
                                                          scop_nb_params (scop),
                                                          cloog_state);
       block = cloog_block_alloc (stmt, 0, NULL, pbb_dim_iter_domain (pbb));
-      cloog_statement_set_usr (stmt, pbb);
+      stmt->usr = pbb;
 
       /* Build loop list.  */
       {
         CloogLoop *new_loop_list = cloog_loop_malloc (cloog_state);
-        cloog_loop_set_next (new_loop_list, loop_list);
-        cloog_loop_set_domain (new_loop_list, dom);
-        cloog_loop_set_block (new_loop_list, block);
+        new_loop_list->next = loop_list;
+        new_loop_list->domain = dom;
+        new_loop_list->block = block;
         loop_list = new_loop_list;
       }
 
@@ -1226,8 +1220,8 @@  build_cloog_prog (scop_p scop, CloogProgram *prog,
       {
         CloogBlockList *new_block_list = cloog_block_list_malloc ();
 
-        cloog_block_list_set_next (new_block_list, block_list);
-        cloog_block_list_set_block (new_block_list, block);
+        new_block_list->next = block_list;
+        new_block_list->block = block;
         block_list = new_block_list;
       }
 
@@ -1244,19 +1238,19 @@  build_cloog_prog (scop_p scop, CloogProgram *prog,
           (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb),
            cloog_state);
 
-        cloog_set_next_scattering (new_scattering, scattering);
-        cloog_set_scattering (new_scattering, dom);
+        new_scattering->next = scattering;
+        new_scattering->scatt = dom;
         scattering = new_scattering;
       }
     }
 
-  cloog_program_set_loop (prog, loop_list);
-  cloog_program_set_blocklist (prog, block_list);
+  prog->loop = loop_list;
+  prog->blocklist = block_list;
 
   for (i = 0; i < nbs; i++)
     scaldims[i] = 0 ;
 
-  cloog_program_set_scaldims (prog, scaldims);
+  prog->scaldims = scaldims;
 
   /* Extract scalar dimensions to simplify the code generation problem.  */
   cloog_program_extract_scalars (prog, scattering, options);
@@ -1277,22 +1271,21 @@  build_cloog_prog (scop_p scop, CloogProgram *prog,
   free_scattering (scattering);
 
   /* Iterators corresponding to scalar dimensions have to be extracted.  */
-  cloog_names_scalarize (cloog_program_names (prog), nbs,
-			 cloog_program_scaldims (prog));
+  cloog_names_scalarize (prog->names, nbs, prog->scaldims);
 
   /* Free blocklist.  */
   {
-    CloogBlockList *next = cloog_program_blocklist (prog);
+    CloogBlockList *next = prog->blocklist;
 
     while (next)
       {
         CloogBlockList *toDelete = next;
-        next = cloog_block_list_next (next);
-        cloog_block_list_set_next (toDelete, NULL);
-        cloog_block_list_set_block (toDelete, NULL);
+        next = next->next;
+        toDelete->next =  NULL;
+        toDelete->block = NULL;
         cloog_block_list_free (toDelete);
       }
-    cloog_program_set_blocklist (prog, NULL);
+    prog->blocklist = NULL;
   }
 }
 
@@ -1314,14 +1307,8 @@  set_cloog_options (void)
      GLooG.  */
   options->esp = 1;
 
-#ifdef CLOOG_ORG
   /* Silence CLooG to avoid failing tests due to debug output to stderr.  */
   options->quiet = 1;
-#else
-  /* Enable C pretty-printing mode: normalizes the substitution
-     equations for statements.  */
-  options->cpp = 1;
-#endif
 
   /* Allow cloog to build strides with a stride width different to one.
      This example has stride = 4:
@@ -1419,9 +1406,9 @@  debug_generated_program (scop_p scop)
 
 static void
 create_params_index (htab_t index_table, CloogProgram *prog) {
-  CloogNames* names = cloog_program_names (prog);
-  int nb_parameters = cloog_names_nb_parameters (names);
-  char **parameters = cloog_names_parameters (names);
+  CloogNames* names = prog->names;
+  int nb_parameters = names->nb_parameters;
+  char **parameters = names->parameters;
   int i;
 
   for (i = 0; i < nb_parameters; i++)
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
deleted file mode 100644
index 011377d..0000000
--- a/gcc/graphite-cloog-compat.h
+++ /dev/null
@@ -1,275 +0,0 @@ 
-/* Compatibility layer for using upstream CLooG versions with
-   CLooG legacy code.
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
-   Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
-
-#ifndef GRAPHITE_CLOOG_COMPAT_H
-#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
-
-#ifdef CLOOG_ORG
-#define cloog_initialize()
-#define cloog_finalize()
-#endif
-
-#ifndef CLOOG_ORG
-
-/* CloogOptions compatibility.  */
-#define build_cloog_prog(SCOP, PROG, OPT)\
-  build_cloog_prog (SCOP, PROG)
-#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
-  cloog_program_extract_scalars (PROG, SCATT)
-#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
-
-/* CloogState compatibility.  */
-#define CloogState void
-#define cloog_state_malloc() NULL
-#define cloog_state_free(STATE)
-#define cloog_loop_malloc(STATE) cloog_loop_malloc ()
-#define cloog_options_malloc(STATE) cloog_options_malloc ()
-#define cloog_statement_alloc(STATE, INDEX) cloog_statement_alloc (INDEX)
-#define new_Cloog_Domain_from_ppl_Pointset_Powerset(PSPS, NB, STATE)\
-  new_Cloog_Domain_from_ppl_Pointset_Powerset (PSPS)
-#define new_Cloog_Domain_from_ppl_Polyhedron(POLY, NB, STATE)\
-  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
-#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST)\
-  cloog_program_dump_cloog (DUMPFILE, PROGRAM)
-
-#endif
-
-/* Adapt CLooG accessors from CLooG legacy to
-   newer CLooG versions.  */
-
-#ifdef CLOOG_ORG
-
-static inline void *
-cloog_statement_usr (CloogStatement *cs)
-{
-  return cs->usr;
-}
-
-static inline CloogScattering *
-cloog_scattering (CloogScatteringList *sl)
-{
-  return sl->scatt;
-}
-
-static inline void
-cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
-{
-  sl->scatt = scatt;
-}
-
-static inline CloogScatteringList *
-cloog_next_scattering (CloogScatteringList *sl)
-{
-  return sl->next;
-}
-
-static inline void
-cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
-{
-  sl->next = next;
-}
-
-static inline int
-cloog_program_nb_scattdims (CloogProgram *prog)
-{
-  return prog->nb_scattdims;
-}
-
-static inline void
-cloog_program_set_nb_scattdims (CloogProgram *prog, int nb_scattdims)
-{
-  prog->nb_scattdims = nb_scattdims;
-}
-
-static inline CloogNames *
-cloog_program_names (CloogProgram *prog)
-{
-  return prog->names;
-}
-
-static inline void
-cloog_program_set_names (CloogProgram *prog, CloogNames *names)
-{
-  prog->names = names;
-}
-
-static inline void
-cloog_program_set_context (CloogProgram *prog, CloogDomain *domain)
-{
-  prog->context = domain;
-}
-
-static inline void
-cloog_program_set_loop (CloogProgram *prog, CloogLoop *loop)
-{
-  prog->loop = loop;
-}
-
-static inline CloogBlockList *
-cloog_program_blocklist (CloogProgram *prog)
-{
-  return prog->blocklist;
-}
-
-static inline void
-cloog_program_set_blocklist (CloogProgram *prog, CloogBlockList *bl)
-{
-  prog->blocklist = bl;
-}
-
-static inline int *
-cloog_program_scaldims (CloogProgram *prog)
-{
-  return prog->scaldims;
-}
-
-static inline void
-cloog_program_set_scaldims (CloogProgram *prog, int *s)
-{
-  prog->scaldims = s;
-}
-
-static inline int
-cloog_names_nb_parameters (CloogNames *names)
-{
-  return names->nb_parameters;
-}
-
-static inline void
-cloog_names_set_nb_parameters (CloogNames *names, int nb_parameters)
-{
-  names->nb_parameters = nb_parameters;
-}
-
-static inline char **
-cloog_names_parameters (CloogNames *names)
-{
-  return names->parameters;
-}
-
-static inline void
-cloog_names_set_parameters (CloogNames *names, char **parameters)
-{
-  names->parameters = parameters;
-}
-
-static inline void
-cloog_names_set_nb_iterators (CloogNames *names, int nb_iterators)
-{
-  names->nb_iterators = nb_iterators;
-}
-
-static inline void
-cloog_names_set_iterators (CloogNames *names, char **iterators)
-{
-  names->iterators = iterators;
-}
-
-static inline void
-cloog_names_set_nb_scattering (CloogNames *names, int nb_scattering)
-{
-  names->nb_scattering = nb_scattering;
-}
-
-static inline void
-cloog_names_set_scattering (CloogNames *names, char **scattering)
-{
-  names->scattering = scattering;
-}
-
-static inline void
-cloog_statement_set_usr (CloogStatement *cs, void *u)
-{
-  cs->usr = u;
-}
-
-static inline void
-cloog_loop_set_next (CloogLoop *loop, CloogLoop *next)
-{
-  loop->next = next;
-}
-
-static inline void
-cloog_loop_set_domain (CloogLoop *loop, CloogDomain *domain)
-{
-  loop->domain = domain;
-}
-
-static inline void
-cloog_loop_set_block (CloogLoop *loop, CloogBlock *block)
-{
-  loop->block = block;
-}
-
-static inline CloogBlockList *
-cloog_block_list_next (CloogBlockList *bl)
-{
-  return bl->next;
-}
-
-static inline void
-cloog_block_list_set_next (CloogBlockList *bl, CloogBlockList *next)
-{
-  bl->next = next;
-}
-
-static inline void
-cloog_block_list_set_block (CloogBlockList *bl, CloogBlock *block)
-{
-  bl->block = block;
-}
-
-static inline int cloog_matrix_ncolumns (CloogMatrix * m)
-{
-  return m->NbColumns;
-}
-
-static inline int cloog_matrix_nrows (CloogMatrix * m)
-{
-   return m->NbRows;
-}
-#endif /* CLOOG_ORG  */
-#endif /* GRAPHITE_CLOOG_COMPAT_H  */
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index c3d0cc1..9bc24a0 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -28,7 +28,6 @@  along with GCC; see the file COPYING3.  If not see
 #include "ppl_c.h"
 #include "cloog/cloog.h"
 #include "graphite-cloog-util.h"
-#include "graphite-cloog-compat.h"
 
 /* Counts the number of constraints in PCS.  */
 
@@ -253,7 +252,6 @@  new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
                                           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,
@@ -261,9 +259,6 @@  new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
 
   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.  */
@@ -314,14 +309,14 @@  openscop_print_cloog_matrix (FILE *file, CloogMatrix *mat,
 			     int output, int input, int locals,
 			     int params)
 {
-  int i, j;
+  unsigned i, j;
 
-  fprintf (file, "%d %d %d %d %d %d \n", cloog_matrix_nrows (mat),
-	   cloog_matrix_ncolumns (mat), output, input, locals, params);
+  fprintf (file, "%d %d %d %d %d %d \n", mat->NbRows,
+	   mat->NbColumns, output, input, locals, params);
 
-  for (i = 0; i < cloog_matrix_nrows (mat); i++)
+  for (i = 0; i < mat->NbRows; i++)
     {
-      for (j = 0; j < cloog_matrix_ncolumns (mat); j++)
+      for (j = 0; j < mat->NbColumns; j++)
         if (j == 0)
 	  fprintf (file, "%ld ", mpz_get_si (mat->p[i][j]));
         else
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index 9686e7c..da26ee9 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -22,7 +22,6 @@  along with GCC; see the file COPYING3.  If not see
 #define GRAPHITE_CLOOG_UTIL_H
 
 #include "cloog/cloog.h"
-#include "graphite-cloog-compat.h"
 
 CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
 CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
diff --git a/gcc/graphite.c b/gcc/graphite.c
index b013447..e746c61 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -209,7 +209,6 @@  graphite_initialize (void)
   gcc_assert (ppl_initialized == 0);
 
   cloog_state = cloog_state_malloc ();
-  cloog_initialize ();
 
   if (dump_file && dump_flags)
     dump_function_to_file (current_function_decl, dump_file, dump_flags);
@@ -233,7 +232,6 @@  graphite_finalize (bool need_cfg_cleanup_p)
     }
 
   cloog_state_free (cloog_state);
-  cloog_finalize ();
   ppl_finalize ();
   free_original_copy_tables ();