aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-12-01 20:07:37 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2014-12-01 20:07:37 +0100
commit797d88589e5ccb5bf5c1143aa728e517387fa87a (patch)
treebe3a2b7a117e5b375f803f3e1ae52c2afe3068f4 /gcc
parent81ba15f10524cc46bf2afbe4fc07f783315c6d94 (diff)
downloadgcc-797d88589e5ccb5bf5c1143aa728e517387fa87a.zip
gcc-797d88589e5ccb5bf5c1143aa728e517387fa87a.tar.gz
gcc-797d88589e5ccb5bf5c1143aa728e517387fa87a.tar.bz2
re PR middle-end/64017 (Support ISL 0.14.0 (to fix ICE with gfortran.dg/graphite/pr42393.f90))
2014-12-01 Tobias Burnus <burnus@net-b.de> Jack Howarth <howarth@bromo.med.uc.edu> PR middle-end/64017 * configure.ac * (ac_has_isl_schedule_constraints_compute_schedule): New check. * doc/install.texi (ISL): Permit ISL 0.14. * graphite-optimize-isl.c (getScheduleForBandList, * optimize_isl): Conditionally use ISL 0.13+ functions. * graphite-interchange.c: Make 'extern "C"' conditional. * graphite-isl-ast-to-gimple.c: Ditto. * graphite-poly.c: Ditto. * graphite-sese-to-poly.c: Ditto. * config.in: Regenerate. * gcc/configure: Regenerate. Co-Authored-By: Jack Howarth <howarth@bromo.med.uc.edu> From-SVN: r218247
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/config.in6
-rwxr-xr-xgcc/configure41
-rw-r--r--gcc/configure.ac24
-rw-r--r--gcc/doc/install.texi2
-rw-r--r--gcc/graphite-interchange.c6
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c6
-rw-r--r--gcc/graphite-optimize-isl.c26
-rw-r--r--gcc/graphite-poly.c6
-rw-r--r--gcc/graphite-sese-to-poly.c10
10 files changed, 130 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f1e029e..88cfeef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2014-12-01 Tobias Burnus <burnus@net-b.de>
+ Jack Howarth <howarth@bromo.med.uc.edu>
+
+ PR middle-end/64017
+ * configure.ac (ac_has_isl_schedule_constraints_compute_schedule):
+ New check.
+ * doc/install.texi (ISL): Permit ISL 0.14.
+ * graphite-optimize-isl.c (getScheduleForBandList, optimize_isl):
+ Conditionally use ISL 0.13+ functions.
+ * graphite-interchange.c: Make 'extern "C"' conditional.
+ * graphite-isl-ast-to-gimple.c: Ditto.
+ * graphite-poly.c: Ditto.
+ * graphite-sese-to-poly.c: Ditto.
+ * config.in: Regenerate.
+ * gcc/configure: Regenerate.
+
2014-12-01 Segher Boessenkool <segher@kernel.crashing.org>
* combine.c (distribute_links): Handle multiple SETs.
diff --git a/gcc/config.in b/gcc/config.in
index 9cc0198..65d5e42 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1295,6 +1295,12 @@
#endif
+/* Define if isl_schedule_constraints_compute_schedule exists. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+#endif
+
+
/* Define to 1 if you have the `kill' function. */
#ifndef USED_FOR_TARGET
#undef HAVE_KILL
diff --git a/gcc/configure b/gcc/configure
index 4f9d1df..6b46bbb 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -28057,6 +28057,47 @@ $as_echo "#define HAVE_isl 1" >>confdefs.h
fi
+# Check whether isl_schedule_constraints_compute_schedule is available;
+# it's new in ISL-0.13.
+if test "x${ISLLIBS}" != "x" ; then
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $ISLINC"
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS $ISLLIBS $GMPLIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_schedule_constraints_compute_schedule" >&5
+$as_echo_n "checking Checking for isl_schedule_constraints_compute_schedule... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <isl/schedule.h>
+int
+main ()
+{
+isl_schedule_constraints_compute_schedule (NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_has_isl_schedule_constraints_compute_schedule=yes
+else
+ ac_has_isl_schedule_constraints_compute_schedule=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_schedule_constraints_compute_schedule" >&5
+$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
+
+ LIBS="$saved_LIBS"
+ CFLAGS="$saved_CFLAGS"
+
+ if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
+
+$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
+
+ fi
+fi
+
# Check for plugin support
# Check whether --enable-plugin was given.
if test "${enable_plugin+set}" = set; then :
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 2293fb8..48c8000 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5601,6 +5601,30 @@ if test "x${ISLLIBS}" != "x" ; then
AC_DEFINE(HAVE_isl, 1, [Define if isl is in use.])
fi
+# Check whether isl_schedule_constraints_compute_schedule is available;
+# it's new in ISL-0.13.
+if test "x${ISLLIBS}" != "x" ; then
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $ISLINC"
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS $ISLLIBS $GMPLIBS"
+
+ AC_MSG_CHECKING([Checking for isl_schedule_constraints_compute_schedule])
+ AC_TRY_LINK([#include <isl/schedule.h>],
+ [isl_schedule_constraints_compute_schedule (NULL);],
+ [ac_has_isl_schedule_constraints_compute_schedule=yes],
+ [ac_has_isl_schedule_constraints_compute_schedule=no])
+ AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
+
+ LIBS="$saved_LIBS"
+ CFLAGS="$saved_CFLAGS"
+
+ if test x"$ac_has_isl_schedule_constraints_compute_schedule" = x"yes"; then
+ AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
+ [Define if isl_schedule_constraints_compute_schedule exists.])
+ fi
+fi
+
GCC_ENABLE_PLUGINS
AC_SUBST(pluginlibs)
AC_SUBST(enable_plugin)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index e9ea4a2..1fbef63 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -383,7 +383,7 @@ installed but it is not in your default library search path, the
@option{--with-mpc} configure option should be used. See also
@option{--with-mpc-lib} and @option{--with-mpc-include}.
-@item ISL Library version 0.12.2
+@item ISL Library version 0.14 (or 0.12.2)
Necessary to build GCC with the Graphite loop optimizations.
It can be downloaded from @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/}
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index 81ba391..9f30d24 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -30,11 +30,13 @@ along with GCC; see the file COPYING3. If not see
#include <isl/union_map.h>
#include <isl/ilp.h>
#include <isl/val.h>
-#if defined(__cplusplus)
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
extern "C" {
#endif
#include <isl/val_gmp.h>
-#if defined(__cplusplus)
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
}
#endif
#endif
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index bbf3055..456b24e 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -25,11 +25,13 @@ along with GCC; see the file COPYING3. If not see
#include <isl/map.h>
#include <isl/union_map.h>
#include <isl/ast_build.h>
-#if defined(__cplusplus)
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
extern "C" {
#endif
#include <isl/val_gmp.h>
-#if defined(__cplusplus)
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
}
#endif
#endif
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index 195101a..4cce700 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -460,7 +460,11 @@ getScheduleForBandList (isl_band_list *BandList, isl_union_map **map_sepcl)
if (flag_loop_unroll_jam && (i != (ScheduleDimensions - depth)))
continue;
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+ if (isl_band_member_is_coincident (Band, i))
+#else
if (isl_band_member_is_zero_distance (Band, i))
+#endif
{
isl_map *TileMap;
isl_union_map *TileUMap;
@@ -564,6 +568,9 @@ optimize_isl (scop_p scop)
{
isl_schedule *schedule;
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+ isl_schedule_constraints *schedule_constraints;
+#endif
isl_union_set *domain;
isl_union_map *validity, *proximity, *dependences;
isl_union_map *schedule_map;
@@ -579,11 +586,30 @@ optimize_isl (scop_p scop)
proximity = isl_union_map_copy (validity);
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+ schedule_constraints = isl_schedule_constraints_on_domain (domain);
+ schedule_constraints
+ = isl_schedule_constraints_set_proximity (schedule_constraints,
+ proximity);
+ schedule_constraints
+ = isl_schedule_constraints_set_validity (schedule_constraints,
+ isl_union_map_copy (validity));
+ schedule_constraints
+ = isl_schedule_constraints_set_coincidence (schedule_constraints,
+ validity);
+#endif
+
isl_options_set_schedule_max_constant_term (scop->ctx, CONSTANT_BOUND);
isl_options_set_schedule_maximize_band_depth (scop->ctx, 1);
isl_options_set_schedule_fuse (scop->ctx, ISL_SCHEDULE_FUSE_MIN);
isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_CONTINUE);
+
+#ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
+ schedule = isl_schedule_constraints_compute_schedule(schedule_constraints);
+#else
schedule = isl_union_set_compute_schedule (domain, validity, proximity);
+#endif
+
isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_ABORT);
if (!schedule)
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 77ccc3d..fa313df 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -29,11 +29,13 @@ along with GCC; see the file COPYING3. If not see
#include <isl/ilp.h>
#include <isl/aff.h>
#include <isl/val.h>
-#if defined(__cplusplus)
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
extern "C" {
#endif
#include <isl/val_gmp.h>
-#if defined(__cplusplus)
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
}
#endif
#endif
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 2e140ec..9136d63 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -27,15 +27,13 @@ along with GCC; see the file COPYING3. If not see
#include <isl/constraint.h>
#include <isl/aff.h>
#include <isl/val.h>
-/* For C++ linkage of C functions.
- Missing from isl/val_gmp.h in isl 0.12 versions.
- Appearing in isl/val_gmp.h in isl 0.13.
- To be removed when passing to isl 0.13. */
-#if defined(__cplusplus)
+
+/* Since ISL-0.13, the extern is in val_gmp.h. */
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
extern "C" {
#endif
#include <isl/val_gmp.h>
-#if defined(__cplusplus)
+#if !defined(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE) && defined(__cplusplus)
}
#endif
#endif