1 List-Id: <gcc-patches.gcc.gnu.org>
2 List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
3 From: Mike Frysinger <vapier at gentoo dot org>
4 To: gcc-patches at gcc dot gnu dot org
5 Subject: [PATCH] gcc: fix building w/isl-0.15
6 Date: Tue, 14 Jul 2015 10:45:12 -0400
7 Message-Id: <1436885112-2174-1-git-send-email-vapier@gentoo.org>
10 gcc/config.in | 6 ++++++
11 gcc/configure | 31 +++++++++++++++++++++++++++++++
12 gcc/configure.ac | 14 ++++++++++++++
13 gcc/graphite-dependences.c | 14 +++++++-------
14 gcc/graphite-optimize-isl.c | 8 ++++++--
15 gcc/graphite-poly.h | 5 +++++
16 6 files changed, 69 insertions(+), 9 deletions(-)
18 diff --git a/gcc/config.in b/gcc/config.in
19 index b031a62..23e1757 100644
22 @@ -1326,6 +1326,12 @@
26 +/* Define if isl_options_set_schedule_serialize_sccs exists. */
27 +#ifndef USED_FOR_TARGET
28 +#undef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
32 /* Define if isl_schedule_constraints_compute_schedule exists. */
33 #ifndef USED_FOR_TARGET
34 #undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
35 diff --git a/gcc/configure b/gcc/configure
36 index 9561e5c..6e81298 100755
39 @@ -27947,6 +27947,8 @@
41 # Check whether isl_schedule_constraints_compute_schedule is available;
42 # it's new in ISL-0.13.
43 + # Check whether isl_options_set_schedule_serialize_sccs is available;
44 + # it's new in ISL-0.15.
45 saved_CFLAGS="$CFLAGS"
46 CFLAGS="$CFLAGS $ISLINC"
48 @@ -27975,6 +27977,29 @@
49 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
50 $as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
52 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_options_set_schedule_serialize_sccs" >&5
53 +$as_echo_n "checking Checking for isl_options_set_schedule_serialize_sccs... " >&6; }
54 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55 +/* end confdefs.h. */
56 +#include <isl/schedule.h>
60 +isl_options_set_schedule_serialize_sccs (NULL, 0);
65 +if ac_fn_cxx_try_link "$LINENO"; then :
66 + ac_has_isl_options_set_schedule_serialize_sccs=yes
68 + ac_has_isl_options_set_schedule_serialize_sccs=no
70 +rm -f core conftest.err conftest.$ac_objext \
71 + conftest$ac_exeext conftest.$ac_ext
72 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_options_set_schedule_serialize_sccs" >&5
73 +$as_echo "$ac_has_isl_options_set_schedule_serialize_sccs" >&6; }
76 CFLAGS="$saved_CFLAGS"
78 @@ -27983,6 +28008,12 @@
79 $as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
83 + if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
85 +$as_echo "#define HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS 1" >>confdefs.h
91 diff --git a/gcc/configure.ac b/gcc/configure.ac
92 index cb14639..7fb964a 100644
93 --- a/gcc/configure.ac
94 +++ b/gcc/configure.ac
97 # Check whether isl_schedule_constraints_compute_schedule is available;
98 # it's new in ISL-0.13.
99 + # Check whether isl_options_set_schedule_serialize_sccs is available;
100 + # it's new in ISL-0.15.
101 saved_CFLAGS="$CFLAGS"
102 CFLAGS="$CFLAGS $ISLINC"
104 @@ -5547,6 +5549,13 @@
105 [ac_has_isl_schedule_constraints_compute_schedule=no])
106 AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
108 + AC_MSG_CHECKING([Checking for isl_options_set_schedule_serialize_sccs])
109 + AC_TRY_LINK([#include <isl/schedule.h>],
110 + [isl_options_set_schedule_serialize_sccs (NULL, 0);],
111 + [ac_has_isl_options_set_schedule_serialize_sccs=yes],
112 + [ac_has_isl_options_set_schedule_serialize_sccs=no])
113 + AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
116 CFLAGS="$saved_CFLAGS"
118 @@ -5554,6 +5563,11 @@
119 AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
120 [Define if isl_schedule_constraints_compute_schedule exists.])
123 + if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
124 + AC_DEFINE(HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS, 1,
125 + [Define if isl_options_set_schedule_serialize_sccs exists.])
130 diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
131 index 50fe73e..9a0986d 100644
132 --- a/gcc/graphite-dependences.c
133 +++ b/gcc/graphite-dependences.c
134 @@ -205,7 +205,7 @@ scop_get_transformed_schedule (scop_p scop, vec<poly_bb_p> pbbs)
135 /* Helper function used on each MAP of a isl_union_map. Computes the
136 maximal output dimension. */
140 max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
142 int global_max = *((int *) user);
143 @@ -217,7 +217,7 @@ max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
146 isl_space_free (space);
148 + return isl_stat_ok;
151 /* Extends the output dimension of MAP to MAX dimensions. */
152 @@ -241,12 +241,12 @@ struct extend_schedule_str {
154 /* Helper function for extend_schedule. */
158 extend_schedule_1 (__isl_take isl_map *map, void *user)
160 struct extend_schedule_str *str = (struct extend_schedule_str *) user;
161 str->umap = isl_union_map_add_map (str->umap, extend_map (map, str->max));
163 + return isl_stat_ok;
166 /* Return a relation that has uniform output dimensions. */
167 @@ -255,16 +255,16 @@ __isl_give isl_union_map *
168 extend_schedule (__isl_take isl_union_map *x)
173 struct extend_schedule_str str;
175 res = isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
176 - gcc_assert (res == 0);
177 + gcc_assert (res == isl_stat_ok);
180 str.umap = isl_union_map_empty (isl_union_map_get_space (x));
181 res = isl_union_map_foreach_map (x, extend_schedule_1, (void *) &str);
182 - gcc_assert (res == 0);
183 + gcc_assert (res == isl_stat_ok);
185 isl_union_map_free (x);
187 diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
188 index f490401..388e25c 100644
189 --- a/gcc/graphite-optimize-isl.c
190 +++ b/gcc/graphite-optimize-isl.c
191 @@ -506,13 +506,13 @@ getScheduleMap (isl_schedule *Schedule, isl_union_map **map_sepcl)
197 getSingleMap (__isl_take isl_map *map, void *user)
199 isl_map **singleMap = (isl_map **) user;
203 + return isl_stat_ok;
207 @@ -584,7 +584,11 @@ optimize_isl (scop_p scop)
209 isl_options_set_schedule_max_constant_term (scop->ctx, CONSTANT_BOUND);
210 isl_options_set_schedule_maximize_band_depth (scop->ctx, 1);
211 +#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
212 + isl_options_set_schedule_serialize_sccs (scop->ctx, 1);
214 isl_options_set_schedule_fuse (scop->ctx, ISL_SCHEDULE_FUSE_MIN);
216 isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_CONTINUE);
218 #ifdef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
219 diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
220 index 7ffd18e..7022a1d 100644
221 --- a/gcc/graphite-poly.h
222 +++ b/gcc/graphite-poly.h
223 @@ -24,6 +24,11 @@ along with GCC; see the file COPYING3. If not see
227 +#ifndef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
228 +# define isl_stat int
229 +# define isl_stat_ok 0
232 typedef struct poly_dr *poly_dr_p;
234 typedef struct poly_bb *poly_bb_p;