From patchwork Wed Nov 18 19:10:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Klose X-Patchwork-Id: 546172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1943C14140E for ; Thu, 19 Nov 2015 06:10:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ZJ13W/3Y; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=MMpi/n2bM0lf3Yb5W PwfWb90UGkEJMFLABkNm8A1VEGf3htea9IwLvdk+5RKerUnqwYjY17RICWWo9Cg3 MxHNyLWsvafVOyAgT15r4TbS3eiK7SjTLov+sq9H85c+/VQ1VCPs1DrTOacXAvxM Ed4R3pTlOWZSxpd8G3tdN7lQTY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=1Pr1fOSJaw3Ezz0ggsZySMY BL2k=; b=ZJ13W/3YL/s4bng0T698k8SYLd0uq6iuJ09n9hbRBnfetAeLOwKetyY rmLZzCyUHX9cqTfv98K5noe5HVp78iMwgwFA3ZfuwNuRsvucuNGmNzl6Q0jUkOA7 HiLfd3RYhBScw2g0DUesfRwwyTY9zg4DXglkbC9k9110fk81mXU8= Received: (qmail 126793 invoked by alias); 18 Nov 2015 19:10:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 126780 invoked by uid 89); 18 Nov 2015 19:10:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_20, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: einhorn.in-berlin.de Received: from einhorn.in-berlin.de (HELO einhorn.in-berlin.de) (192.109.42.8) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 18 Nov 2015 19:10:05 +0000 X-Envelope-From: doko@ubuntu.com Received: from [192.168.178.29] (ip5f5bf74a.dynamic.kabel-deutschland.de [95.91.247.74] (may be forged)) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-4) with ESMTP id tAIJA1Bv017198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Nov 2015 20:10:01 +0100 Subject: [PATCH] [4.9] Re: [PATCH][5] Backport ISL 0.15 support To: Richard Biener , gcc-patches@gcc.gnu.org References: From: Matthias Klose Message-ID: <564CCD09.2070006@ubuntu.com> Date: Wed, 18 Nov 2015 20:10:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: On 12.10.2015 12:58, Richard Biener wrote: > > 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). I don't think so. 4.8 and 4.9 don't use as much ISL code as 5 does. I had a look at the backport and came up with something which is just mechanical changes for the cpp conditional. The version check in the toplevel configure needs to be extended. I'm currently not checking non matching isl and cloog versions. Now build for 4.9 using ISL 0.15 and 0.14. Ok to commit to the branch? Matthias 2015-11-18 Matthias Klose * configure.ac: Permit also ISL 0.15 with CLooG. * configure: Regenerate. gcc/ 2015-11-18 Matthias Klose Backport from the gcc-5-branch Backport from mainline 2015-07-21 Mike Frysinger Bernhard Reutner-Fischer * configure.ac: Add check for new options in isl-0.15. * config.in, configure: Rebuilt. * graphite-blocking.c: Include * graphite-interchange.c, graphite-poly.c: Likewise. * graphhite-scop-detection.c, graphite-sese-to-poly.c: Likewise. * graphite.c, graphite-poly.c: Likewise. * graphite-dependences.c: Include . (max_number_of_out_dimensions): Returns isl_stat. (extend_schedule_1): Likewise (extend_schedule): Corresponding changes. * graphite-optimize-isl.c: Include and . (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: configure.ac =================================================================== --- configure.ac (revision 230544) +++ configure.ac (working copy) @@ -1660,6 +1660,9 @@ ISL_CHECK_VERSION(0,12) if test "${gcc_cv_isl}" = no ; then ISL_CHECK_VERSION(0,14) + if test "${gcc_cv_isl}" = no ; then + ISL_CHECK_VERSION(0,15) + fi fi fi fi Index: gcc/config.in =================================================================== --- gcc/config.in (revision 230544) +++ gcc/config.in (working copy) @@ -1223,6 +1223,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.ac =================================================================== --- gcc/configure.ac (revision 230544) +++ gcc/configure.ac (working copy) @@ -5535,6 +5535,8 @@ # 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. saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $ISLINC" saved_LIBS="$LIBS" @@ -5547,6 +5549,13 @@ [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_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" @@ -5554,6 +5563,11 @@ 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 Index: gcc/graphite-blocking.c =================================================================== --- gcc/graphite-blocking.c (revision 230544) +++ gcc/graphite-blocking.c (working copy) @@ -24,6 +24,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include Index: gcc/graphite-dependences.c =================================================================== --- gcc/graphite-dependences.c (revision 230544) +++ gcc/graphite-dependences.c (working copy) @@ -22,6 +22,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include @@ -183,7 +184,7 @@ /* 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); @@ -195,7 +196,7 @@ isl_map_free (map); isl_space_free (space); - return 0; + return isl_stat_ok; } /* Extends the output dimension of MAP to MAX dimensions. */ @@ -219,12 +220,12 @@ /* 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. */ @@ -233,16 +234,16 @@ 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 230544) +++ gcc/graphite-interchange.c (working copy) @@ -24,6 +24,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include Index: gcc/graphite-optimize-isl.c =================================================================== --- gcc/graphite-optimize-isl.c (revision 230544) +++ gcc/graphite-optimize-isl.c (working copy) @@ -21,7 +21,9 @@ #include "config.h" #ifdef HAVE_cloog +#include #include +#include #include #include #include @@ -415,13 +417,13 @@ 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 @@ -469,7 +471,11 @@ 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); schedule = isl_union_set_compute_schedule (domain, validity, proximity); isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_ABORT); Index: gcc/graphite-poly.c =================================================================== --- gcc/graphite-poly.c (revision 230544) +++ gcc/graphite-poly.c (working copy) @@ -22,6 +22,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include Index: gcc/graphite-poly.h =================================================================== --- gcc/graphite-poly.h (revision 230544) +++ gcc/graphite-poly.h (working copy) @@ -22,6 +22,11 @@ #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 230544) +++ gcc/graphite-scop-detection.c (working copy) @@ -22,6 +22,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include Index: gcc/graphite-sese-to-poly.c =================================================================== --- gcc/graphite-sese-to-poly.c (revision 230544) +++ gcc/graphite-sese-to-poly.c (working copy) @@ -21,6 +21,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include Index: gcc/graphite.c =================================================================== --- gcc/graphite.c (revision 230544) +++ gcc/graphite.c (working copy) @@ -35,6 +35,7 @@ #include "config.h" #ifdef HAVE_cloog +#include #include #include #include