/* Gimple Represented as Polyhedra.
- Copyright (C) 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 2006-2016 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>.
This file is part of GCC.
The wiki page http://gcc.gnu.org/wiki/Graphite contains pointers to
the related work. */
-#include "config.h"
-
-#ifdef HAVE_isl
-/* Workaround for GMP 5.1.3 bug, see PR56019. */
-#include <stddef.h>
-
-#include <isl/constraint.h>
-#include <isl/set.h>
-#include <isl/map.h>
-#include <isl/options.h>
-#include <isl/union_map.h>
-#endif
+#define USES_ISL
+#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree-ssa-loop.h"
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
-#include "graphite-poly.h"
#include "dbgcnt.h"
#include "tree-parloops.h"
#include "tree-cfgcleanup.h"
-#include "graphite-scop-detection.h"
-#include "graphite-isl-ast-to-gimple.h"
-#include "graphite-sese-to-poly.h"
+#include "graphite.h"
/* Print global statistics to FILE. */
gimple_stmt_iterator psi;
loop_p loop = bb->loop_father;
- if (!bb_in_sese_p (bb, SCOP_REGION (scop)))
+ if (!bb_in_sese_p (bb, scop->scop_info->region))
continue;
n_bbs++;
n_p_stmts += bb->count;
}
- if (loop->header == bb && loop_in_sese_p (loop, SCOP_REGION (scop)))
+ if (loop->header == bb && loop_in_sese_p (loop, scop->scop_info->region))
{
n_loops++;
n_p_loops += bb->count;
fprintf (file, "\nFunction Name: %s\n", current_function_name ());
- edge scop_begin = scop->region->entry;
- edge scop_end = scop->region->exit;
+ edge scop_begin = scop->scop_info->region.entry;
+ edge scop_end = scop->scop_info->region.exit;
fprintf (file, "\nSCoP (entry_edge (bb_%d, bb_%d), ",
scop_begin->src->index, scop_begin->dest->index);
scev_reset ();
cleanup_tree_cfg ();
profile_status_for_fn (cfun) = PROFILE_ABSENT;
- release_recorded_exits ();
+ release_recorded_exits (cfun);
tree_estimate_probability ();
}
FOR_EACH_VEC_ELT (scops, i, scop)
if (dbg_cnt (graphite_scop))
{
- scop->ctx = ctx;
- build_poly_scop (scop);
-
- if (dump_file && dump_flags)
- print_scop (dump_file, scop, 3);
-
- if (POLY_SCOP_P (scop)
- && apply_poly_transforms (scop)
- && graphite_regenerate_ast_isl (scop))
- need_cfg_cleanup_p = true;
-
+ scop->isl_context = ctx;
+ if (!build_poly_scop (scop))
+ continue;
+
+ if (!apply_poly_transforms (scop))
+ continue;
+
+ need_cfg_cleanup_p = true;
+ /* When code generation is not successful, do not continue
+ generating code for the next scops: the IR has to be cleaned up
+ and could be in an inconsistent state. */
+ if (!graphite_regenerate_ast_isl (scop))
+ break;
}
free_scops (scops);
isl_ctx_free (ctx);
}
-#else /* If ISL is not available: #ifndef HAVE_isl. */
+#else /* If isl is not available: #ifndef HAVE_isl. */
static void
graphite_transform_loops (void)
{
- sorry ("Graphite loop optimizations cannot be used (ISL is not available).");
+ sorry ("Graphite loop optimizations cannot be used (isl is not available).");
}
#endif
is turned on. */
if (flag_graphite_identity
|| flag_loop_parallelize_all
- || flag_loop_optimize_isl)
+ || flag_loop_nest_optimize)
flag_graphite = 1;
return flag_graphite != 0;