summaryrefslogtreecommitdiff
path: root/gcc/graphite.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/graphite.c')
-rw-r--r--gcc/graphite.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/gcc/graphite.c b/gcc/graphite.c
index a23587674f2..04e1da29118 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -1,5 +1,6 @@
/* Gimple Represented as Polyhedra.
- Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>.
This file is part of GCC.
@@ -33,6 +34,17 @@ along with GCC; see the file COPYING3. If not see
the functions that are used for transforming the code. */
#include "config.h"
+
+#ifdef HAVE_cloog
+#include <isl/set.h>
+#include <isl/map.h>
+#include <isl/options.h>
+#include <isl/union_map.h>
+#include <cloog/cloog.h>
+#include <cloog/isl/domain.h>
+#include <cloog/isl/cloog.h>
+#endif
+
#include "system.h"
#include "coretypes.h"
#include "diagnostic-core.h"
@@ -47,8 +59,6 @@ along with GCC; see the file COPYING3. If not see
#ifdef HAVE_cloog
-#include "ppl_c.h"
-#include "graphite-ppl.h"
#include "graphite-poly.h"
#include "graphite-scop-detection.h"
#include "graphite-clast-to-gimple.h"
@@ -186,10 +196,8 @@ print_graphite_statistics (FILE* file, VEC (scop_p, heap) *scops)
/* Initialize graphite: when there are no loops returns false. */
static bool
-graphite_initialize (void)
+graphite_initialize (isl_ctx *ctx)
{
- int ppl_initialized;
-
if (number_of_loops () <= 1
/* FIXME: This limit on the number of basic blocks of a function
should be removed when the SCOP detection is faster. */
@@ -198,6 +206,7 @@ graphite_initialize (void)
if (dump_file && (dump_flags & TDF_DETAILS))
print_global_statistics (dump_file);
+ isl_ctx_free (ctx);
return false;
}
@@ -205,10 +214,7 @@ graphite_initialize (void)
recompute_all_dominators ();
initialize_original_copy_tables ();
- ppl_initialized = ppl_initialize ();
- gcc_assert (ppl_initialized == 0);
-
- cloog_state = cloog_state_malloc ();
+ cloog_state = cloog_isl_state_malloc (ctx);
if (dump_file && dump_flags)
dump_function_to_file (current_function_decl, dump_file, dump_flags);
@@ -232,13 +238,14 @@ graphite_finalize (bool need_cfg_cleanup_p)
}
cloog_state_free (cloog_state);
- ppl_finalize ();
free_original_copy_tables ();
if (dump_file && dump_flags)
print_loops (dump_file, 3);
}
+isl_ctx *the_isl_ctx;
+
/* Perform a set of linear transforms on the loops of the current
function. */
@@ -250,15 +257,19 @@ graphite_transform_loops (void)
bool need_cfg_cleanup_p = false;
VEC (scop_p, heap) *scops = NULL;
htab_t bb_pbb_mapping;
+ isl_ctx *ctx;
/* If a function is parallel it was most probably already run through graphite
once. No need to run again. */
if (parallelized_function_p (cfun->decl))
return;
- if (!graphite_initialize ())
+ ctx = isl_ctx_alloc ();
+ isl_options_set_on_error(ctx, ISL_ON_ERROR_ABORT);
+ if (!graphite_initialize (ctx))
return;
+ the_isl_ctx = ctx;
build_scops (&scops);
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -272,6 +283,7 @@ graphite_transform_loops (void)
FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
{
+ scop->ctx = ctx;
build_poly_scop (scop);
if (POLY_SCOP_P (scop)
@@ -283,6 +295,8 @@ graphite_transform_loops (void)
htab_delete (bb_pbb_mapping);
free_scops (scops);
graphite_finalize (need_cfg_cleanup_p);
+ the_isl_ctx = NULL;
+ isl_ctx_free (ctx);
}
#else /* If Cloog is not available: #ifndef HAVE_cloog. */