From patchwork Wed Aug 11 18:30:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Simb=C3=BCrger?= X-Patchwork-Id: 61500 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]) by ozlabs.org (Postfix) with SMTP id AAAAFB70DE for ; Thu, 12 Aug 2010 04:31:00 +1000 (EST) Received: (qmail 16687 invoked by alias); 11 Aug 2010 18:30:56 -0000 Received: (qmail 16501 invoked by uid 22791); 11 Aug 2010 18:30:54 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ew0-f47.google.com (HELO mail-ew0-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Aug 2010 18:30:47 +0000 Received: by ewy7 with SMTP id 7so263283ewy.20 for ; Wed, 11 Aug 2010 11:30:45 -0700 (PDT) Received: by 10.213.19.82 with SMTP id z18mr15454708eba.74.1281551444258; Wed, 11 Aug 2010 11:30:44 -0700 (PDT) Received: from simbuerg@googlemail.com (dslb-088-075-197-233.pools.arcor-ip.net [88.75.197.233]) by mx.google.com with ESMTPS id z55sm612076eeh.9.2010.08.11.11.30.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Aug 2010 11:30:42 -0700 (PDT) Received: by simbuerg@googlemail.com (sSMTP sendmail emulation); Wed, 11 Aug 2010 20:30:27 +0200 From: =?UTF-8?q?Andreas=20Simb=C3=BCrger?= To: gcc-graphite@googlegroups.com Cc: gcc-patches@gcc.gnu.org, =?UTF-8?q?Andreas=20Simb=C3=BCrger?= Subject: [PATCH 3/3] Support official CLooG.org versions. Date: Wed, 11 Aug 2010 20:30:12 +0200 Message-Id: <1281551412-9101-4-git-send-email-simbuerg@googlemail.com> In-Reply-To: References: X-IsSubscribed: yes 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 2010-08-11 Andreas Simbuerger * configure.ac: Support official CLooG.org versions. * configure: Regenerate. --- configure | 156 +++++++++++++++++++++++++++++++++++++++++------ configure.ac | 90 +++++++++++++++++++++------- gcc/ChangeLog.graphite | 5 ++ 3 files changed, 208 insertions(+), 43 deletions(-) diff --git a/configure b/configure index 8edfde3..23b6cf1 100755 --- a/configure +++ b/configure @@ -5891,8 +5891,11 @@ fi # Check for CLOOG -clooglibs=" -lcloog " -clooginc=" -DCLOOG_PPL_BACKEND " + +clooglibs= +clooginc= +clooglegacyinc="-DCLOOG_PPL_BACKEND " +cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG " # Check whether --with-cloog was given. @@ -5925,19 +5928,19 @@ case $with_cloog in "" | yes) ;; *) - clooglibs="-L$with_cloog/lib -lcloog" - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND " + clooglibs="-L$with_cloog/lib ${clooglibs} " + clooginc="-I$with_cloog/include ${clooginc} " ;; esac if test "x$with_cloog_include" != x; then - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND " + clooginc="-I$with_cloog_include ${clooginc}" fi if test "x$with_cloog_lib" != x; then - clooglibs="-L$with_cloog_lib -lcloog" + clooglibs="-L$with_cloog_lib ${clooglibs}" fi if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog ' - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' ${clooglibs} ' + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include ${clooginc} ' enable_cloog_version_check=no fi @@ -5949,21 +5952,133 @@ else fi -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5 -$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; } +if test "x$with_cloog" != "xno"; then + # Test for CLooG variant. + saved_cflags=$CFLAGS + saved_libs=$LIBS + saved_ldflags=$LDFLAGS + cloog_lib= + cloog_inc= + + + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc} " + LDFLAGS="${LDFLAGS} ${clooglibs} " + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLooG's backend" >&5 +$as_echo_n "checking for CLooG's backend... " >&6; } + cloog_lib="-lcloog"; + cloog_inc=$clooglegacyinc; + LIBS=$cloog_lib + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: PPL (Legacy)" >&5 +$as_echo "PPL (Legacy)" >&6; } +else + + cloog_lib="-lcloog-isl"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ISL" >&5 +$as_echo "ISL" >&6; } +else + + cloog_lib="-lcloog-ppl"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: PPL" >&5 +$as_echo "PPL" >&6; } +else + + cloog_lib="-lcloog-polylib"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +int +main () +{ +cloog_version () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: PolyLib" >&5 +$as_echo "PolyLib" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + clooglibs=$clooglibs$cloog_lib + clooginc=$clooginc$cloog_inc + CFLAGS=$saved_cflags + LIBS=$saved_libs + LDFLAGS=$saved_ldflags + + # Test for CLooG version + if test "${ENABLE_CLOOG_CHECK}" = "yes"; then + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15.5 (or later revision) of CLooG" >&5 +$as_echo_n "checking for version 0.15.5 (or later revision) of CLooG... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ #include "cloog/cloog.h" int main () { - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 - choke me - #endif + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 + choke me + #endif ; return 0; @@ -5977,9 +6092,9 @@ int main () { - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 - choke me - #endif + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 + choke me + #endif ; return 0; @@ -5998,7 +6113,8 @@ else $as_echo "no" >&6; }; clooglibs= ; clooginc= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" + CFLAGS="$saved_CFLAGS" + fi fi # Flags needed for CLOOG diff --git a/configure.ac b/configure.ac index f78c527..4e7274e 100644 --- a/configure.ac +++ b/configure.ac @@ -1586,8 +1586,11 @@ AC_SUBST(pplinc) # Check for CLOOG -clooglibs=" -lcloog " -clooginc=" -DCLOOG_PPL_BACKEND " + +clooglibs= +clooginc= +clooglegacyinc="-DCLOOG_PPL_BACKEND " +cloogorginc="-DCLOOG_INT_GMP -DCLOOG_ORG " AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLooG-PPL package Equivalent to --with-cloog-include=PATH/include @@ -1607,19 +1610,19 @@ case $with_cloog in "" | yes) ;; *) - clooglibs="-L$with_cloog/lib -lcloog" - clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND " + clooglibs="-L$with_cloog/lib ${clooglibs} " + clooginc="-I$with_cloog/include ${clooginc} " ;; esac if test "x$with_cloog_include" != x; then - clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND " + clooginc="-I$with_cloog_include ${clooginc}" fi if test "x$with_cloog_lib" != x; then - clooglibs="-L$with_cloog_lib -lcloog" + clooglibs="-L$with_cloog_lib ${clooglibs}" fi if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then - clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' -lcloog ' - clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND ' + clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' ${clooglibs} ' + clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include ${clooginc} ' enable_cloog_version_check=no fi @@ -1628,21 +1631,62 @@ AC_ARG_ENABLE(cloog-version-check, ENABLE_CLOOG_CHECK=$enableval, ENABLE_CLOOG_CHECK=yes) -if test "x$with_cloog" != "xno" -a "${ENABLE_CLOOG_CHECK}" = "yes"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" - AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG]) - AC_TRY_COMPILE([#include "cloog/cloog.h"],[ - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 - choke me - #endif - ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[ - #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 - choke me - #endif - ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], - [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) - CFLAGS="$saved_CFLAGS" +if test "x$with_cloog" != "xno"; then + # Test for CLooG variant. + saved_cflags=$CFLAGS + saved_libs=$LIBS + saved_ldflags=$LDFLAGS + cloog_lib= + cloog_inc= + m4_define([CLOOG_BACKEND_PROG],[AC_LANG_PROGRAM( + [#include ], + [cloog_version ()])]) + + CFLAGS="${CFLAGS} ${gmpinc} ${pplinc} ${clooginc} ${cloogorginc} " + LDFLAGS="${LDFLAGS} ${clooglibs} " + + AC_MSG_CHECKING(for CLooG's backend) + cloog_lib="-lcloog"; + cloog_inc=$clooglegacyinc; + LIBS=$cloog_lib + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([PPL (Legacy)])],[ + cloog_lib="-lcloog-isl"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([ISL])],[ + cloog_lib="-lcloog-ppl"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([PPL])],[ + cloog_lib="-lcloog-polylib"; + cloog_inc=$cloogorginc; + LIBS=$cloog_lib; + AC_LINK_IFELSE([CLOOG_BACKEND_PROG], [AC_MSG_RESULT([PolyLib])],[ + AC_MSG_RESULT([none])])])])]) + + clooglibs=$clooglibs$cloog_lib + clooginc=$clooginc$cloog_inc + CFLAGS=$saved_cflags + LIBS=$saved_libs + LDFLAGS=$saved_ldflags + + # Test for CLooG version + if test "${ENABLE_CLOOG_CHECK}" = "yes"; then + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc" + AC_MSG_CHECKING([for version 0.15.5 (or later revision) of CLooG]) + AC_TRY_COMPILE([#include "cloog/cloog.h"],[ + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 5 + choke me + #endif + ], [AC_TRY_COMPILE([#include "cloog/cloog.h"],[ + #if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15 || CLOOG_VERSION_REVISION < 9 + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([buggy but acceptable])])], + [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ]) + CFLAGS="$saved_CFLAGS" + fi fi # Flags needed for CLOOG diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 54c33ef..5eaa47c 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,10 @@ 2010-08-11 Andreas Simbuerger + * configure.ac: Support official CLooG.org versions. + * configure: Regenerate. + +2010-08-11 Andreas Simbuerger + * graphite-poly.c: Change include order. 2010-08-11 Andreas Simbuerger