This backports the patch to allow bootstrapping with ISL 0.15 to the GCC 5 branch (the GCC 4.9 branch will require backporting of some dependencies).
Bootstrapped with ISL 0.15 (in-tree), ISL 0.14 and ISL 0.12 (both installed). Committed to the branch. Richard. 2015-10-12 Richard Biener <rguent...@suse.de> Backport from mainline 2015-07-21 Mike Frysinger <vap...@gentoo.org> Bernhard Reutner-Fischer <al...@gcc.gnu.org> * configure.ac: Add check for new options in isl-0.15. * config.in, configure: Rebuilt. * graphite-blocking.c: Include <isl/constraint.h> * graphite-interchange.c, graphite-poly.c: Likewise. * graphhite-scop-detection.c, graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * graphite-isl-ast-to-gimple.c: Include <isl/constraint.h> and <isl/union_set.h>. * graphite-dependences.c: Include <isl/constraint.h>. (max_number_of_out_dimensions): Returns isl_stat. (extend_schedule_1): Likewise (extend_schedule): Corresponding changes. * graphite-optimize-isl.c: Include <isl/constraint.h> and <isl/union_set.h>. (getSingleMap): Change return type of isl_stat. (optimize_isl): Conditionally use isl_options_set_schedule_serialize_sccs. * graphite-poly.h (isl_stat, isl_stat_ok): Define fallbacks if not HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS. Index: gcc/config.in =================================================================== --- gcc/config.in (revision 228597) +++ gcc/config.in (working copy) @@ -1313,6 +1313,12 @@ #endif +/* Define if isl_options_set_schedule_serialize_sccs exists. */ +#ifndef USED_FOR_TARGET +#undef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS +#endif + + /* Define if isl_schedule_constraints_compute_schedule exists. */ #ifndef USED_FOR_TARGET #undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE Index: gcc/configure =================================================================== --- gcc/configure (revision 228597) +++ gcc/configure (working copy) @@ -28305,6 +28305,8 @@ fi # Check whether isl_schedule_constraints_compute_schedule is available; # it's new in ISL-0.13. +# Check whether isl_options_set_schedule_serialize_sccs is available; +# it's new in ISL-0.15. if test "x${ISLLIBS}" != "x" ; then saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ISLINC" @@ -28334,6 +28336,29 @@ rm -f core conftest.err conftest.$ac_obj { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5 $as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_options_set_schedule_serialize_sccs" >&5 +$as_echo_n "checking Checking for isl_options_set_schedule_serialize_sccs... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <isl/schedule.h> +int +main () +{ +isl_options_set_schedule_serialize_sccs (NULL, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_has_isl_options_set_schedule_serialize_sccs=yes +else + ac_has_isl_options_set_schedule_serialize_sccs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_options_set_schedule_serialize_sccs" >&5 +$as_echo "$ac_has_isl_options_set_schedule_serialize_sccs" >&6; } + LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" @@ -28342,6 +28367,12 @@ $as_echo "$ac_has_isl_schedule_constrain $as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h fi + + if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then + +$as_echo "#define HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS 1" >>confdefs.h + + fi fi # Check for plugin support Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 228597) +++ gcc/configure.ac (working copy) @@ -5746,6 +5746,8 @@ fi # Check whether isl_schedule_constraints_compute_schedule is available; # it's new in ISL-0.13. +# Check whether isl_options_set_schedule_serialize_sccs is available; +# it's new in ISL-0.15. if test "x${ISLLIBS}" != "x" ; then saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ISLINC" @@ -5759,6 +5761,13 @@ if test "x${ISLLIBS}" != "x" ; then [ac_has_isl_schedule_constraints_compute_schedule=no]) AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule) + AC_MSG_CHECKING([Checking for isl_options_set_schedule_serialize_sccs]) + AC_TRY_LINK([#include <isl/schedule.h>], + [isl_options_set_schedule_serialize_sccs (NULL, 0);], + [ac_has_isl_options_set_schedule_serialize_sccs=yes], + [ac_has_isl_options_set_schedule_serialize_sccs=no]) + AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs) + LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" @@ -5766,6 +5775,11 @@ if test "x${ISLLIBS}" != "x" ; then AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1, [Define if isl_schedule_constraints_compute_schedule exists.]) fi + + if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then + AC_DEFINE(HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS, 1, + [Define if isl_options_set_schedule_serialize_sccs exists.]) + fi fi GCC_ENABLE_PLUGINS Index: gcc/graphite-blocking.c =================================================================== --- gcc/graphite-blocking.c (revision 228597) +++ gcc/graphite-blocking.c (working copy) @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/union_map.h> Index: gcc/graphite-dependences.c =================================================================== --- gcc/graphite-dependences.c (revision 228597) +++ gcc/graphite-dependences.c (working copy) @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/union_map.h> @@ -227,7 +228,7 @@ scop_get_transformed_schedule (scop_p sc /* Helper function used on each MAP of a isl_union_map. Computes the maximal output dimension. */ -static int +static isl_stat max_number_of_out_dimensions (__isl_take isl_map *map, void *user) { int global_max = *((int *) user); @@ -239,7 +240,7 @@ max_number_of_out_dimensions (__isl_take isl_map_free (map); isl_space_free (space); - return 0; + return isl_stat_ok; } /* Extends the output dimension of MAP to MAX dimensions. */ @@ -263,12 +264,12 @@ struct extend_schedule_str { /* Helper function for extend_schedule. */ -static int +static isl_stat extend_schedule_1 (__isl_take isl_map *map, void *user) { struct extend_schedule_str *str = (struct extend_schedule_str *) user; str->umap = isl_union_map_add_map (str->umap, extend_map (map, str->max)); - return 0; + return isl_stat_ok; } /* Return a relation that has uniform output dimensions. */ @@ -277,16 +278,16 @@ __isl_give isl_union_map * extend_schedule (__isl_take isl_union_map *x) { int max = 0; - int res; + isl_stat res; struct extend_schedule_str str; res = isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max); - gcc_assert (res == 0); + gcc_assert (res == isl_stat_ok); str.max = max; str.umap = isl_union_map_empty (isl_union_map_get_space (x)); res = isl_union_map_foreach_map (x, extend_schedule_1, (void *) &str); - gcc_assert (res == 0); + gcc_assert (res == isl_stat_ok); isl_union_map_free (x); return str.umap; Index: gcc/graphite-interchange.c =================================================================== --- gcc/graphite-interchange.c (revision 228597) +++ gcc/graphite-interchange.c (working copy) @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/aff.h> #include <isl/set.h> #include <isl/map.h> Index: gcc/graphite-isl-ast-to-gimple.c =================================================================== --- gcc/graphite-isl-ast-to-gimple.c (revision 228597) +++ gcc/graphite-isl-ast-to-gimple.c (working copy) @@ -21,7 +21,9 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> +#include <isl/union_set.h> #include <isl/map.h> #include <isl/union_map.h> #include <isl/ast_build.h> Index: gcc/graphite-optimize-isl.c =================================================================== --- gcc/graphite-optimize-isl.c (revision 228597) +++ gcc/graphite-optimize-isl.c (working copy) @@ -21,7 +21,9 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> +#include <isl/union_set.h> #include <isl/map.h> #include <isl/union_map.h> #include <isl/schedule.h> @@ -530,13 +532,13 @@ getScheduleMap (isl_schedule *Schedule, return ScheduleMap; } -static int +static isl_stat getSingleMap (__isl_take isl_map *map, void *user) { isl_map **singleMap = (isl_map **) user; *singleMap = map; - return 0; + return isl_stat_ok; } static void @@ -608,7 +610,11 @@ optimize_isl (scop_p scop) isl_options_set_schedule_max_constant_term (scop->ctx, CONSTANT_BOUND); isl_options_set_schedule_maximize_band_depth (scop->ctx, 1); +#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS + isl_options_set_schedule_serialize_sccs (scop->ctx, 1); +#else isl_options_set_schedule_fuse (scop->ctx, ISL_SCHEDULE_FUSE_MIN); +#endif isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_CONTINUE); #ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE Index: gcc/graphite-poly.c =================================================================== --- gcc/graphite-poly.c (revision 228597) +++ gcc/graphite-poly.c (working copy) @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/union_map.h> Index: gcc/graphite-poly.h =================================================================== --- gcc/graphite-poly.h (revision 228597) +++ gcc/graphite-poly.h (working copy) @@ -22,6 +22,11 @@ along with GCC; see the file COPYING3. #ifndef GCC_GRAPHITE_POLY_H #define GCC_GRAPHITE_POLY_H +#ifndef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS +# define isl_stat int +# define isl_stat_ok 0 +#endif + typedef struct poly_dr *poly_dr_p; typedef struct poly_bb *poly_bb_p; Index: gcc/graphite-scop-detection.c =================================================================== --- gcc/graphite-scop-detection.c (revision 228597) +++ gcc/graphite-scop-detection.c (working copy) @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/union_map.h> Index: gcc/graphite-sese-to-poly.c =================================================================== --- gcc/graphite-sese-to-poly.c (revision 228597) +++ gcc/graphite-sese-to-poly.c (working copy) @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/union_map.h> Index: gcc/graphite.c =================================================================== --- gcc/graphite.c (revision 228597) +++ gcc/graphite.c (working copy) @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. #include "config.h" #ifdef HAVE_isl +#include <isl/constraint.h> #include <isl/set.h> #include <isl/map.h> #include <isl/options.h>