2010-11-11 22:33:24 +01:00
|
|
|
# This file is part of GCC.
|
|
|
|
#
|
|
|
|
# GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free
|
|
|
|
# Software Foundation; either version 3, or (at your option) any later
|
|
|
|
# version.
|
|
|
|
#
|
|
|
|
# GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with GCC; see the file COPYING3. If not see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>
|
|
|
|
|
|
|
|
# CLOOG_INIT_FLAGS ()
|
|
|
|
# -------------------------
|
|
|
|
# Provide configure switches for CLooG support.
|
|
|
|
# Initialize clooglibs/clooginc according to the user input.
|
|
|
|
AC_DEFUN([CLOOG_INIT_FLAGS],
|
|
|
|
[
|
2010-11-15 17:30:20 +01:00
|
|
|
AC_ARG_WITH([cloog-include],
|
2010-11-11 22:33:24 +01:00
|
|
|
[AS_HELP_STRING(
|
|
|
|
[--with-cloog-include=PATH],
|
|
|
|
[Specify directory for installed CLooG include files])])
|
2010-11-15 17:30:20 +01:00
|
|
|
AC_ARG_WITH([cloog-lib],
|
2010-11-11 22:33:24 +01:00
|
|
|
[AS_HELP_STRING(
|
|
|
|
[--with-cloog-lib=PATH],
|
|
|
|
[Specify the directory for the installed CLooG library])])
|
2010-11-12 23:08:57 +01:00
|
|
|
|
2010-11-11 22:33:24 +01:00
|
|
|
AC_ARG_ENABLE(cloog-version-check,
|
|
|
|
[AS_HELP_STRING(
|
|
|
|
[--disable-cloog-version-check],
|
|
|
|
[disable check for CLooG version])],
|
|
|
|
ENABLE_CLOOG_CHECK=$enableval,
|
|
|
|
ENABLE_CLOOG_CHECK=yes)
|
|
|
|
|
|
|
|
# Initialize clooglibs and clooginc.
|
|
|
|
case $with_cloog in
|
|
|
|
no)
|
|
|
|
clooglibs=
|
|
|
|
clooginc=
|
|
|
|
;;
|
|
|
|
"" | yes)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
clooglibs="-L$with_cloog/lib"
|
|
|
|
clooginc="-I$with_cloog/include"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "x${with_cloog_include}" != x ; then
|
|
|
|
clooginc="-I$with_cloog_include"
|
|
|
|
fi
|
|
|
|
if test "x${with_cloog_lib}" != x; then
|
|
|
|
clooglibs="-L$with_cloog_lib"
|
|
|
|
fi
|
2013-01-15 14:07:56 +01:00
|
|
|
dnl If no --with-cloog flag was specified and there is in-tree CLooG
|
|
|
|
dnl source, set up flags to use that and skip any version tests
|
|
|
|
dnl as we cannot run them reliably before building CLooG
|
2012-08-26 14:20:01 +02:00
|
|
|
if test "x${clooginc}" = x && test "x${clooglibs}" = x \
|
2012-07-02 13:43:46 +02:00
|
|
|
&& test -d ${srcdir}/cloog; then
|
|
|
|
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
|
|
|
|
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -I'${srcdir}'/cloog/include '
|
2013-01-15 14:07:56 +01:00
|
|
|
ENABLE_CLOOG_CHECK=no
|
|
|
|
AC_MSG_WARN([using in-tree CLooG, disabling version check])
|
2012-07-02 13:43:46 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
clooginc="-DCLOOG_INT_GMP ${clooginc}"
|
2012-09-03 16:40:17 +02:00
|
|
|
clooglibs="${clooglibs} -lcloog-isl ${isllibs} -lisl"
|
2010-11-11 22:33:24 +01:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
|
|
|
|
# ----------------------------------------------------
|
|
|
|
# Provide actions for failed CLooG detection.
|
|
|
|
AC_DEFUN([CLOOG_REQUESTED],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([CLOOG_INIT_FLAGS])
|
|
|
|
|
2011-01-25 20:47:36 +01:00
|
|
|
if test "x${with_cloog}" = xno; then
|
|
|
|
$2
|
|
|
|
elif test "x${with_cloog}" != x \
|
2010-11-11 22:33:24 +01:00
|
|
|
|| test "x${with_cloog_include}" != x \
|
|
|
|
|| test "x${with_cloog_lib}" != x ; then
|
|
|
|
$1
|
|
|
|
else
|
|
|
|
$2
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
|
|
|
|
# --------------------------------------------
|
|
|
|
# Helper for verifying CLooG's compile time version.
|
|
|
|
m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
|
2012-07-02 13:43:46 +02:00
|
|
|
[#include "cloog/version.h"],
|
2010-11-11 22:33:24 +01:00
|
|
|
[#if CLOOG_VERSION_MAJOR != $1 \
|
|
|
|
|| CLOOG_VERSION_MINOR != $2 \
|
|
|
|
|| CLOOG_VERSION_REVISION < $3
|
|
|
|
choke me
|
|
|
|
#endif])])
|
|
|
|
|
|
|
|
# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
|
|
|
|
# ----------------------------------------------------------------
|
|
|
|
# Test the found CLooG to be exact of version MAJOR.MINOR and at least
|
|
|
|
# REVISION.
|
|
|
|
AC_DEFUN([CLOOG_CHECK_VERSION],
|
|
|
|
[
|
2012-07-02 13:43:46 +02:00
|
|
|
AC_REQUIRE([CLOOG_INIT_FLAGS])
|
2010-11-11 22:33:24 +01:00
|
|
|
|
|
|
|
if test "${ENABLE_CLOOG_CHECK}" = yes ; then
|
|
|
|
_cloog_saved_CFLAGS=$CFLAGS
|
|
|
|
_cloog_saved_LDFLAGS=$LDFLAGS
|
|
|
|
|
2012-07-02 13:43:46 +02:00
|
|
|
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
|
|
|
|
LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
|
2010-11-11 22:33:24 +01:00
|
|
|
|
2013-01-15 14:07:56 +01:00
|
|
|
AC_MSG_CHECKING([for version $1.$2.$3 of CLooG])
|
|
|
|
AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
|
[multiple changes]
2012-07-02 Richard Guenther <rguenther@suse.de>
Merge from graphite branch
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* config/cloog.m4: Remove support for CLooG-ppl and CLooG-parma,
both cloog.org and legacy versions. The only supported version will
be CLooG with the isl backend.
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* configure.ac: Require cloog isl 0.17.0
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* config/cloog.m4: Do not define CLOOG_ORG
gcc/
* Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
Remove graphite-cloog-util.h.
* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
build_iv_mapping, translate_clast_user, translate_clast,
free_scattering, initialize_cloog_names, build_cloog_prog,
create_params_index): Do not use old compatibility functions.
(clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
* graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
compatibility functions.
(new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
cloog.
* graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
* graphite.c (graphite.c): Do not call outdated cloog_initialize() and
cloog_finalize().
* graphite-cloog-compat.h: Remove.
2011-08-09 Tobias Grosser <tobias@grosser.es>
gcc/
* graphite-clast-to-gimple.c (new_clast_name_index): Store a copy
of the string, no just a reference.
(clast_name_index): Add a new field, that specifies if we need to free
the name.
(free_clast_name_index): If necessary, free the name string.
(clast_name_index_elt_info): Calculate the hash based on the string
content, not the memory location it is stored in.
(clast_name_to_level): Specify that we do not need to free the name.
(clast_name_to_index): Dito.
(clast_name_to_lb_ub): Dito.
(eq_clast_name_indexes): Compare the strings, not their base pointers.
(free_scattering): Removed.
(initialize_cloog_names): Renamed to add_names_to_union_domain().
(add_names_to_union_domain): Changed to work on a union_domain,
instead of a CloogNames structure.
(build_cloog_prog): Removed.
(build_cloog_union_domain): New.
(generate_cloog_input): New.
(scop_to_clast): Use CloogInput instead of CloogProgram.
(print_generated_program): Adapt to new scop_to_clast() and do not
print the CloogProgram any more.
(create_params_index): Removed, functionality integrated in
add_names_to_union_domain().
(gloog): Adapt to new scop_to_clast().
* graphite-clast-to-gimple.h (scop_to_clast): Remove.
2012-01-11 Tobias Grosser <tobias@grosser.es>
* graphite-clast-to-gimple.c (clast_name_to_index,
clast_name_to_lb_ub, clast_name_to_gcc): Change types.
(clast_to_gcc_expression): Add clast_expr_name as a new
case. Do not assume a clast_expr_term points always to a
clast_expr_name.
(type_for_clast_term): Do not assume a clast_expr_term points always to
a clast_expr_name.
(type_for_clast_name): New.
(type_for_clast_expr): Add clast_expr_name as a new case.
2011-08-03 Sebastian Pop <sebpop@gmail.com>
* graphite-cloog-util.c (new_Cloog_Domain_from_ppl_Polyhedron,
new_Cloog_Scattering_from_ppl_Polyhedron,
new_Cloog_Domain_from_ppl_Pointset_Powerset): Remove ATTRIBUTE_UNUSED.
From-SVN: r189155
2012-07-02 13:33:21 +02:00
|
|
|
[gcc_cv_cloog=yes],
|
2013-01-15 14:07:56 +01:00
|
|
|
[gcc_cv_cloog=no])
|
|
|
|
AC_MSG_RESULT([$gcc_cv_cloog])
|
2010-11-11 22:33:24 +01:00
|
|
|
|
|
|
|
CFLAGS=$_cloog_saved_CFLAGS
|
|
|
|
LDFLAGS=$_cloog_saved_LDFLAGS
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# CLOOG_IF_FAILED (ACTION-IF-FAILED)
|
|
|
|
# ----------------------------------
|
|
|
|
# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
|
|
|
|
# the checks failed.
|
|
|
|
AC_DEFUN([CLOOG_IF_FAILED],
|
|
|
|
[
|
|
|
|
CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
|
|
|
|
|
[multiple changes]
2012-07-02 Richard Guenther <rguenther@suse.de>
Merge from graphite branch
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* config/cloog.m4: Remove support for CLooG-ppl and CLooG-parma,
both cloog.org and legacy versions. The only supported version will
be CLooG with the isl backend.
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* configure.ac: Require cloog isl 0.17.0
2011-07-21 Tobias Grosser <tobias@grosser.es>
* configure: Regenerated.
* config/cloog.m4: Do not define CLOOG_ORG
gcc/
* Makefile.in (graphite-clast-to-gimple.o, graphite-cloog-util.o):
Remove graphite-cloog-util.h.
* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop,
build_iv_mapping, translate_clast_user, translate_clast,
free_scattering, initialize_cloog_names, build_cloog_prog,
create_params_index): Do not use old compatibility functions.
(clast_name_to_index, set_cloog_options): Remove code for legacy cloog.
* graphite-cloog-util.c (openscop_print_cloog_matrix): Do not use old
compatibility functions.
(new_Cloog_Scattering_from_ppl_Polyhedron): Remove code for legacy
cloog.
* graphite-cloog-util.h: Remove include of graphite-cloog-util.h.
* graphite.c (graphite.c): Do not call outdated cloog_initialize() and
cloog_finalize().
* graphite-cloog-compat.h: Remove.
2011-08-09 Tobias Grosser <tobias@grosser.es>
gcc/
* graphite-clast-to-gimple.c (new_clast_name_index): Store a copy
of the string, no just a reference.
(clast_name_index): Add a new field, that specifies if we need to free
the name.
(free_clast_name_index): If necessary, free the name string.
(clast_name_index_elt_info): Calculate the hash based on the string
content, not the memory location it is stored in.
(clast_name_to_level): Specify that we do not need to free the name.
(clast_name_to_index): Dito.
(clast_name_to_lb_ub): Dito.
(eq_clast_name_indexes): Compare the strings, not their base pointers.
(free_scattering): Removed.
(initialize_cloog_names): Renamed to add_names_to_union_domain().
(add_names_to_union_domain): Changed to work on a union_domain,
instead of a CloogNames structure.
(build_cloog_prog): Removed.
(build_cloog_union_domain): New.
(generate_cloog_input): New.
(scop_to_clast): Use CloogInput instead of CloogProgram.
(print_generated_program): Adapt to new scop_to_clast() and do not
print the CloogProgram any more.
(create_params_index): Removed, functionality integrated in
add_names_to_union_domain().
(gloog): Adapt to new scop_to_clast().
* graphite-clast-to-gimple.h (scop_to_clast): Remove.
2012-01-11 Tobias Grosser <tobias@grosser.es>
* graphite-clast-to-gimple.c (clast_name_to_index,
clast_name_to_lb_ub, clast_name_to_gcc): Change types.
(clast_to_gcc_expression): Add clast_expr_name as a new
case. Do not assume a clast_expr_term points always to a
clast_expr_name.
(type_for_clast_term): Do not assume a clast_expr_term points always to
a clast_expr_name.
(type_for_clast_name): New.
(type_for_clast_expr): Add clast_expr_name as a new case.
2011-08-03 Sebastian Pop <sebpop@gmail.com>
* graphite-cloog-util.c (new_Cloog_Domain_from_ppl_Polyhedron,
new_Cloog_Scattering_from_ppl_Polyhedron,
new_Cloog_Domain_from_ppl_Pointset_Powerset): Remove ATTRIBUTE_UNUSED.
From-SVN: r189155
2012-07-02 13:33:21 +02:00
|
|
|
if test "${gcc_cv_cloog}" = no ; then
|
2010-11-11 22:33:24 +01:00
|
|
|
clooglibs=
|
|
|
|
clooginc=
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "${graphite_requested}" = yes \
|
|
|
|
&& test "x${clooglibs}" = x \
|
|
|
|
&& test "x${clooginc}" = x ; then
|
|
|
|
$1
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|