Commit 33ad93b9 by Richard Guenther Committed by Richard Biener

cloog.m4: Set up to work against ISL only.

2012-07-02  Richard Guenther  <rguenther@suse.de>
	Michael Matz  <matz@suse.de>
	Tobias Grosser <tobias@grosser.es>
	Sebastian Pop <sebpop@gmail.com>

	config/
	* cloog.m4: Set up to work against ISL only.
	* isl.m4: New file.

	* Makefile.def: Add ISL host module, remove PPL host module.
	Adjust ClooG host module to use the proper ISL.
	* Makefile.tpl: Pass ISL include flags instead of PPL ones.
	* configure.ac: Include config/isl.m4.  Add ISL host library,
	remove PPL.  Remove PPL configury, add ISL configury, adjust
	ClooG configury.
	* Makefile.in: Regenerated.
	* configure: Likewise.

	gcc/
	* Makefile.in: Remove PPL flags in favor of ISL ones.
	(BACKENDLIBS): Remove PPL libs.
	(INCLUDES): Remove PPL includes in favor of ISL ones.
	(graphite-clast-to-gimple.o): Remove graphite-dependences.h and
	graphite-cloog-compat.h dependencies.
	(graphite-dependences.o): Likewise.
	(graphite-poly.o): Likewise.
	* configure.ac: Declare ISL vars instead of PPL ones.
	* configure: Regenerated.
	* doc/install.texi: Replace PPL requirement documentation
	with ISL one.
	* graphite-blocking.c: Remove PPL code, add ISL equivalent.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-poly.h: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* graphite-scop-detection.c: Re-arrange includes.
	* graphite-cloog-util.c: Remove.
	* graphite-cloog-util.h: Likewise.
	* graphite-ppl.h: Likewise.
	* graphite-ppl.c: Likewise.
	* graphite-dependences.h: Likewise.

	libgomp/
	* testsuite/libgomp.graphite/force-parallel-4.c: Adjust.
	* testsuite/libgomp.graphite/force-parallel-5.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-7.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-8.c: Likewise.

Co-Authored-By: Michael Matz <matz@suse.de>
Co-Authored-By: Sebastian Pop <sebpop@gmail.com>
Co-Authored-By: Tobias Grosser <tobias@grosser.es>

From-SVN: r189156
parent 6886e444
2012-07-02 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
Tobias Grosser <tobias@grosser.es>
Sebastian Pop <sebpop@gmail.com>
* Makefile.def: Add ISL host module, remove PPL host module.
Adjust ClooG host module to use the proper ISL.
* Makefile.tpl: Pass ISL include flags instead of PPL ones.
* configure.ac: Include config/isl.m4. Add ISL host library,
remove PPL. Remove PPL configury, add ISL configury, adjust
ClooG configury.
* Makefile.in: Regenerated.
* configure: Likewise.
2012-07-02 Richard Guenther <rguenther@suse.de>
Merge from graphite branch
2011-07-21 Tobias Grosser <tobias@grosser.es>
......
......@@ -61,13 +61,15 @@ host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
host_modules= { module= mpc; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@';
no_install= true; };
host_modules= { module= ppl; lib_path=src/.libs; bootstrap=true;
extra_configure_flags='--disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/';
host_modules= { module= isl; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp';
extra_exports='CPPFLAGS="${CPPFLAGS}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS"; export LDFLAGS; ';
extra_make_flags='CPPFLAGS="${CPPFLAGS}" LDFLAGS="$$LDFLAGS"';
no_install= true; };
host_modules= { module= cloog; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-ppl';
extra_exports='CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}"; export CPPFLAGS; LDFLAGS="$$LDFLAGS ${HOST_PPLLIBS}"; export LDFLAGS; ';
extra_make_flags='CPPFLAGS="${CPPFLAGS} ${HOST_PPLINC}" LDFLAGS="$$LDFLAGS"';
extra_configure_flags='--disable-shared --with-gmp-library=$$r/$(HOST_SUBDIR)/gmp/.libs --with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-bits=gmp --with-isl=system';
extra_exports='CPPFLAGS="-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include ${CPPFLAGS}"; export CPPFLAGS; LDFLAGS="-L$$r/$(HOST_SUBDIR)/isl/.libs $$LDFLAGS"; export LDFLAGS; ';
extra_make_flags='CPPFLAGS="${CPPFLAGS}" LDFLAGS="$$LDFLAGS"';
no_install= true; };
host_modules= { module= libelf; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared';
......@@ -295,7 +297,6 @@ dependencies = { module=all-gcc; on=all-gmp; };
dependencies = { module=all-gcc; on=all-intl; };
dependencies = { module=all-gcc; on=all-mpfr; };
dependencies = { module=all-gcc; on=all-mpc; };
dependencies = { module=all-gcc; on=all-ppl; };
dependencies = { module=all-gcc; on=all-cloog; };
dependencies = { module=all-gcc; on=all-build-texinfo; };
dependencies = { module=all-gcc; on=all-build-bison; };
......@@ -332,9 +333,9 @@ dependencies = { module=all-utils; on=all-libiberty; };
dependencies = { module=configure-mpfr; on=all-gmp; };
dependencies = { module=configure-mpc; on=all-mpfr; };
dependencies = { module=configure-ppl; on=all-gmp; };
dependencies = { module=configure-ppl; on=all-mpfr; };
dependencies = { module=configure-cloog; on=all-ppl; };
dependencies = { module=configure-isl; on=all-gmp; };
dependencies = { module=configure-cloog; on=all-isl; };
dependencies = { module=configure-cloog; on=all-gmp; };
// Host modules specific to gdb.
dependencies = { module=configure-gdb; on=all-intl; };
......
......@@ -222,8 +222,7 @@ HOST_EXPORTS = \
HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \
PPLINC="$(HOST_PPLINC)"; export PPLINC; \
ISLINC="$(HOST_ISLINC)"; export ISLINC; \
CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \
CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \
LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
......@@ -313,9 +312,8 @@ NORMAL_TARGET_EXPORTS = \
HOST_GMPLIBS = @gmplibs@
HOST_GMPINC = @gmpinc@
# Where to find PPL
HOST_PPLLIBS = @ppllibs@
HOST_PPLINC = @pplinc@
# Where to find ISL
HOST_ISLINC = @islinc@
# Where to find CLOOG
HOST_CLOOGLIBS = @clooglibs@
......
2012-07-02 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
Tobias Grosser <tobias@grosser.es>
Sebastian Pop <sebpop@gmail.com>
* cloog.m4: Set up to work against ISL only.
* isl.m4: New file.
2012-05-29 Joseph Myers <joseph@codesourcery.com>
* mt-sde: Fix typos.
......
......@@ -63,6 +63,17 @@ AC_DEFUN([CLOOG_INIT_FLAGS],
if test "x${with_cloog_lib}" != x; then
clooglibs="-L$with_cloog_lib"
fi
dnl If no --with-cloog flag was specified and there is in-tree ClooG
dnl source, set up flags to use that.
if test "x${clooginc}" == x && test "x${clooglibs}" == x \
&& test -d ${srcdir}/cloog; then
echo FooBar
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -I'${srcdir}'/cloog/include '
fi
clooginc="-DCLOOG_INT_GMP ${clooginc}"
clooglibs="${clooglibs} -lcloog-isl ${isllibs}"
dnl Flags needed for CLOOG
AC_SUBST(clooglibs)
......@@ -89,63 +100,11 @@ AC_DEFUN([CLOOG_REQUESTED],
]
)
# _CLOOG_ORG_PROG_ISL ()
# ------------------
# Helper for detecting CLooG.org's ISL backend.
m4_define([_CLOOG_ORG_PROG_ISL],[AC_LANG_PROGRAM(
[#include "cloog/cloog.h" ],
[cloog_version ()])])
# CLOOG_FIND_FLAGS ()
# ------------------
# Detect the used CLooG-backend and set clooginc/clooglibs/cloog_org.
# Only look for the CLooG backend type specified in --enable-cloog-backend
AC_DEFUN([CLOOG_FIND_FLAGS],
[
AC_REQUIRE([CLOOG_INIT_FLAGS])
_cloog_saved_CFLAGS=$CFLAGS
_cloog_saved_CPPFLAGS=$CPPFLAGS
_cloog_saved_LDFLAGS=$LDFLAGS
_cloog_saved_LIBS=$LIBS
_cloogorginc="-DCLOOG_INT_GMP"
dnl clooglibs & clooginc may have been initialized by CLOOG_INIT_FLAGS.
CFLAGS="${CFLAGS} ${clooginc} ${gmpinc}"
CPPFLAGS="${CPPFLAGS} ${_cloogorginc}"
LDFLAGS="${LDFLAGS} ${clooglibs}"
AC_CACHE_CHECK([for installed CLooG ISL], [gcc_cv_cloog_type],
[LIBS="-lcloog-isl ${_cloog_saved_LIBS}"
AC_LINK_IFELSE([_CLOOG_ORG_PROG_ISL], [gcc_cv_cloog_type="ISL"],
[gcc_cv_cloog_type=no])])
case $gcc_cv_cloog_type in
"ISL")
clooginc="${clooginc} ${_cloogorginc}"
clooglibs="${clooglibs} -lcloog-isl -lisl"
cloog_org=yes
;;
*)
clooglibs=
clooginc=
cloog_org=
;;
esac
LIBS=$_cloog_saved_LIBS
CFLAGS=$_cloog_saved_CFLAGS
CPPFLAGS=$_cloog_saved_CPPFLAGS
LDFLAGS=$_cloog_saved_LDFLAGS
]
)
# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
# --------------------------------------------
# Helper for verifying CLooG's compile time version.
m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
[#include "cloog/cloog.h"],
[#include "cloog/version.h"],
[#if CLOOG_VERSION_MAJOR != $1 \
|| CLOOG_VERSION_MINOR != $2 \
|| CLOOG_VERSION_REVISION < $3
......@@ -158,14 +117,14 @@ m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
# REVISION.
AC_DEFUN([CLOOG_CHECK_VERSION],
[
AC_REQUIRE([CLOOG_FIND_FLAGS])
AC_REQUIRE([CLOOG_INIT_FLAGS])
if test "${ENABLE_CLOOG_CHECK}" = yes ; then
_cloog_saved_CFLAGS=$CFLAGS
_cloog_saved_LDFLAGS=$LDFLAGS
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${pplinc} ${gmpinc}"
LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${ppllibs}"
CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
AC_CACHE_CHECK([for version $1.$2.$3 of CLooG],
[gcc_cv_cloog],
......
......@@ -28,6 +28,7 @@ m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
m4_include([ltversion.m4])
m4_include([lt~obsolete.m4])
m4_include([config/isl.m4])
m4_include([config/cloog.m4])
AC_INIT(move-if-change)
......@@ -132,7 +133,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes"
# these libraries are used by various programs built for the host environment
#
host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc ppl cloog libelf libiconv"
host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr mpc isl cloog libelf libiconv"
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
......@@ -1517,107 +1518,23 @@ AC_ARG_WITH(boot-ldflags,
fi])
AC_SUBST(poststage1_ldflags)
# Check for PPL
ppllibs=
pplinc=
pwllib=
AC_ARG_WITH(ppl,
[AS_HELP_STRING([--with-ppl=PATH],
[specify prefix directory for the installed PPL package.
Equivalent to --with-ppl-include=PATH/include
plus --with-ppl-lib=PATH/lib])])
AC_ARG_WITH(ppl-include,
[AS_HELP_STRING([--with-ppl-include=PATH],
[specify directory for installed PPL include files])])
AC_ARG_WITH(ppl-lib,
[AS_HELP_STRING([--with-ppl-lib=PATH],
[specify directory for the installed PPL library])])
AC_ARG_ENABLE(ppl-version-check,
[AS_HELP_STRING([--disable-ppl-version-check],
[disable check for PPL version])])
case $with_ppl in
yes | no | "")
;;
*)
ppllibs="-L$with_ppl/lib"
pplinc="-I$with_ppl/include $pplinc"
if test -d "$with_ppl/lib" && test -d "$with_ppl/include"; then
with_ppl=yes
else
AC_MSG_ERROR([cannot find directories "$with_ppl/lib" or "$with_ppl/include"])
fi
;;
esac
if test x"$with_ppl_include" != x; then
pplinc="-I$with_ppl_include $pplinc"
with_ppl=yes
fi
if test "x$with_ppl_lib" != x; then
ppllibs="-L$with_ppl_lib"
with_ppl=yes
fi
if test x"$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
if test x"$enable_watchdog" = xyes; then
pwllib="-lpwl"
fi
ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/interfaces/C/'"$lt_cv_objdir"' -L$$r/$(HOST_SUBDIR)/ppl/src/'"$lt_cv_objdir"
pplinc='-I$$r/$(HOST_SUBDIR)/ppl/src -I$$r/$(HOST_SUBDIR)/ppl/interfaces/C '
enable_ppl_version_check=no
with_ppl=yes
fi
if test "x$with_ppl" != xno; then
if test "x$pwllib" = x; then
saved_LIBS="$LIBS"
LIBS="$LIBS $ppllibs -lstdc++ -lm"
AC_CHECK_LIB(pwl, PWL_handle_timeout, [pwllib="-lpwl"])
LIBS="$saved_LIBS"
fi
ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"
# Check for ISL
dnl Provide configure switches and initialize islinc & isllibs
dnl with user input.
ISL_INIT_FLAGS
if test "x$with_isl" != "xno"; then
dnl The minimal version of ISL required for Graphite.
ISL_CHECK_VERSION(0,10)
if test "$enable_ppl_version_check" != no; then
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pplinc $gmpinc"
AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL])
AC_TRY_COMPILE([#include "ppl_c.h"],[
#if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
choke me
#endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ])
CFLAGS="$saved_CFLAGS"
fi
dnl Only execute fail-action, if ISL has been requested.
ISL_IF_FAILED([
AC_MSG_ERROR([Unable to find a usable ISL. See config.log for details.])])
fi
# Flags needed for PPL
AC_SUBST(ppllibs)
AC_SUBST(pplinc)
# Check for CLOOG
dnl Provide configure switches and initialize clooginc & clooglibs
dnl with user input.
CLOOG_INIT_FLAGS
if test "x$with_ppl" = "xno"; then
dnl Only execute fail-action, if CLooG has been requested.
CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
if test "${graphite_requested}" = yes; then
AC_MSG_ERROR([Unable to find a usable PPL. See config.log for details.])
fi
with_cloog=no
fi
if test "x${with_cloog}" = x && test "x${with_cloog_include}" = x \
&& test "x${with_cloog_lib}" = x && 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 '
fi
if test "x$with_cloog" != "xno"; then
dnl The minimal version of CLooG required for Graphite.
dnl
......@@ -2684,7 +2601,7 @@ changequote(,)
changequote([,])
case $lib in
mpc | mpfr | gmp | ppl | cloog)
mpc | mpfr | gmp | cloog)
# If we're processing --with-$lib, --with-$lib-include or
# --with-$lib-lib, for one of the libs above, and target is
# different from host, don't pass the current argument to any
......@@ -3266,9 +3183,6 @@ case "$target" in
hppa*64*-*-hpux*) ;;
hppa*-*-hpux*) compare_exclusions="gcc/cc*-checksum\$(objext) | */libgcc/lib2funcs* | gcc/ada/*tools/*" ;;
esac
case " $configdirs " in
*" ppl "*) compare_exclusions="$compare_exclusions | ppl/src/ppl-config.o" ;;
esac
AC_SUBST(compare_exclusions)
AC_CONFIG_FILES([Makefile],
......
2012-07-02 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
Tobias Grosser <tobias@grosser.es>
Sebastian Pop <sebpop@gmail.com>
* Makefile.in: Remove PPL flags in favor of ISL ones.
(BACKENDLIBS): Remove PPL libs.
(INCLUDES): Remove PPL includes in favor of ISL ones.
(graphite-clast-to-gimple.o): Remove graphite-dependences.h and
graphite-cloog-compat.h dependencies.
(graphite-dependences.o): Likewise.
(graphite-poly.o): Likewise.
* configure.ac: Declare ISL vars instead of PPL ones.
* configure: Regenerated.
* doc/install.texi: Replace PPL requirement documentation
with ISL one.
* graphite-blocking.c: Remove PPL code, add ISL equivalent.
* graphite-clast-to-gimple.c: Likewise.
* graphite-dependences.c: Likewise.
* graphite-interchange.c: Likewise.
* graphite-poly.h: Likewise.
* graphite-poly.c: Likewise.
* graphite-sese-to-poly.c: Likewise.
* graphite.c: Likewise.
* graphite-scop-detection.c: Re-arrange includes.
* graphite-cloog-util.c: Remove.
* graphite-cloog-util.h: Likewise.
* graphite-ppl.h: Likewise.
* graphite-ppl.c: Likewise.
* graphite-dependences.h: Likewise.
2012-07-02 Richard Guenther <rguenther@suse.de>
Merge from graphite branch
2011-07-21 Tobias Grosser <tobias@grosser.es>
......
......@@ -325,9 +325,8 @@ ZLIBINC = @zlibinc@
GMPLIBS = @GMPLIBS@
GMPINC = @GMPINC@
# How to find PPL
PPLLIBS = @PPLLIBS@
PPLINC = @PPLINC@
# How to find ISL
ISLINC = @ISLINC@
# How to find CLOOG
CLOOGLIBS = @CLOOGLIBS@
......@@ -954,7 +953,6 @@ REAL_H = real.h $(MACHMODE_H)
IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
DBGCNT_H = dbgcnt.h dbgcnt.def
EBITMAP_H = ebitmap.h sbitmap.h
GRAPHITE_PPL_H = graphite-ppl.h $(TREE_H)
LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
$(CGRAPH_H) $(VEC_H) vecprim.h $(TREE_H) $(GIMPLE_H) \
$(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h
......@@ -1027,7 +1025,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \
$(LIBDECNUMBER) $(HOST_LIBS)
BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
$(ZLIB)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
......@@ -1059,7 +1057,7 @@ BUILD_ERRORS = build/errors.o
INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
-I$(srcdir)/../include @INCINTL@ \
$(CPPINC) $(GMPINC) $(DECNUMINC) \
$(PPLINC) $(CLOOGINC)
$(CLOOGINC) $(ISLINC)
.c.o:
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
......@@ -1248,11 +1246,9 @@ OBJS = \
graphite.o \
graphite-blocking.o \
graphite-clast-to-gimple.o \
graphite-cloog-util.o \
graphite-dependences.o \
graphite-interchange.o \
graphite-poly.o \
graphite-ppl.o \
graphite-scop-detection.o \
graphite-sese-to-poly.o \
gtype-desc.o \
......@@ -2539,37 +2535,30 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_PRETTY_PRINT_H
$(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) value-prof.h
graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \
$(DBGCNT_H) $(GRAPHITE_PPL_H) graphite-poly.h graphite-scop-detection.h \
$(DBGCNT_H) graphite-poly.h graphite-scop-detection.h \
graphite-clast-to-gimple.h graphite-sese-to-poly.h
graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
sese.h $(GRAPHITE_PPL_H) graphite-poly.h
sese.h graphite-poly.h
graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
$(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
$(GRAPHITE_PPL_H) graphite-poly.h graphite-clast-to-gimple.h \
graphite-dependences.h
graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h graphite-cloog-util.h
$(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \
graphite-poly.h graphite-clast-to-gimple.h
graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
sese.h $(GRAPHITE_PPL_H) graphite-poly.h graphite-dependences.h \
graphite-cloog-util.h
sese.h graphite-poly.h
graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
sese.h $(GRAPHITE_PPL_H) graphite-poly.h
sese.h graphite-poly.h
graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(GIMPLE_PRETTY_PRINT_H) \
$(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_PPL_H) graphite-poly.h \
graphite-dependences.h graphite-cloog-util.h
graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
graphite-cloog-util.h $(GRAPHITE_PPL_H)
$(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-poly.h
graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \
sese.h $(GRAPHITE_PPL_H) graphite-poly.h graphite-scop-detection.h
sese.h graphite-poly.h graphite-scop-detection.h
graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \
$(TREE_DATA_REF_H) domwalk.h sese.h $(GRAPHITE_PPL_H) graphite-poly.h \
$(TREE_DATA_REF_H) domwalk.h sese.h graphite-poly.h \
graphite-sese-to-poly.h
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
......
......@@ -604,8 +604,8 @@ enable_plugin
pluginlibs
CLOOGINC
CLOOGLIBS
PPLINC
PPLLIBS
ISLINC
ISLLIBS
GMPINC
GMPLIBS
target_cpu_default
......@@ -934,8 +934,8 @@ CPP
CXXCPP
GMPLIBS
GMPINC
PPLLIBS
PPLINC
ISLLIBS
ISLINC
CLOOGLIBS
CLOOGINC'
......@@ -1687,8 +1687,8 @@ Some influential environment variables:
CXXCPP C++ preprocessor
GMPLIBS How to link GMP
GMPINC How to find GMP include files
PPLLIBS How to link PPL
PPLINC How to find PPL include files
ISLLIBS How to link ISL
ISLINC How to find ISL include files
CLOOGLIBS How to link CLOOG
CLOOGINC How to find CLOOG include files
......
......@@ -4987,8 +4987,8 @@ fi
AC_ARG_VAR(GMPLIBS,[How to link GMP])
AC_ARG_VAR(GMPINC,[How to find GMP include files])
AC_ARG_VAR(PPLLIBS,[How to link PPL])
AC_ARG_VAR(PPLINC,[How to find PPL include files])
AC_ARG_VAR(ISLLIBS,[How to link ISL])
AC_ARG_VAR(ISLINC,[How to find ISL include files])
AC_ARG_VAR(CLOOGLIBS,[How to link CLOOG])
AC_ARG_VAR(CLOOGINC,[How to find CLOOG include files])
......
......@@ -362,12 +362,12 @@ 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 Parma Polyhedra Library (PPL) version 0.11
@item ISL Library version 0.10
Necessary to build GCC with the Graphite loop optimizations.
It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/}.
It can be downloaded from @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/}.
The @option{--with-ppl} configure option should be used if PPL is not
The @option{--with-isl} configure option should be used if ISL is not
installed in your default library search path.
@item CLooG 0.17.0
......@@ -1630,14 +1630,14 @@ a cross compiler, they will not be used to configure target libraries.
@itemx --with-cloog=@var{pathname}
@itemx --with-cloog-include=@var{pathname}
@itemx --with-cloog-lib=@var{pathname}
If you do not have PPL (the Parma Polyhedra Library) and the CLooG
If you do not have ISL and the CLooG
libraries installed in a standard location and you want to build GCC,
you can explicitly specify the directory where they are installed
(@samp{--with-ppl=@/@var{pplinstalldir}},
(@samp{--with-isl=@/@var{islinstalldir}},
@samp{--with-cloog=@/@var{clooginstalldir}}). The
@option{--with-ppl=@/@var{pplinstalldir}} option is shorthand for
@option{--with-ppl-lib=@/@var{pplinstalldir}/lib} and
@option{--with-ppl-include=@/@var{pplinstalldir}/include}. Likewise the
@option{--with-isl=@/@var{islinstalldir}} option is shorthand for
@option{--with-isl-lib=@/@var{islinstalldir}/lib} and
@option{--with-isl-include=@/@var{islinstalldir}/include}. Likewise the
@option{--with-cloog=@/@var{clooginstalldir}} option is shorthand for
@option{--with-cloog-lib=@/@var{clooginstalldir}/lib} and
@option{--with-cloog-include=@/@var{clooginstalldir}/include}. If these
......
/* Heuristics and transform for loop blocking and strip mining on
polyhedral representation.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@amd.com> and
Pranav Garg <pranav.garg2107@gmail.com>.
......@@ -20,7 +20,18 @@ 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/>. */
#include "config.h"
#ifdef HAVE_cloog
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
#include <isl/constraint.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#endif
#include "system.h"
#include "coretypes.h"
#include "tree-flow.h"
......@@ -31,8 +42,6 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#ifdef HAVE_cloog
#include "ppl_c.h"
#include "graphite-ppl.h"
#include "graphite-poly.h"
......@@ -92,65 +101,39 @@ along with GCC; see the file COPYING3. If not see
static void
pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride)
{
ppl_dimension_type iter, dim, strip;
ppl_Polyhedron_t res = PBB_TRANSFORMED_SCATTERING (pbb);
isl_space *d;
isl_constraint *c;
int iter, strip;
/* STRIP is the dimension that iterates with stride STRIDE. */
/* ITER is the dimension that enumerates single iterations inside
one strip that has at most STRIDE iterations. */
strip = time_depth;
iter = strip + 2;
psct_add_scattering_dimension (pbb, strip);
psct_add_scattering_dimension (pbb, strip + 1);
ppl_Polyhedron_space_dimension (res, &dim);
pbb->transformed = isl_map_insert_dims (pbb->transformed, isl_dim_out,
strip, 2);
/* Lower bound of the striped loop. */
{
ppl_Constraint_t new_cstr;
ppl_Linear_Expression_t expr;
ppl_new_Linear_Expression_with_dimension (&expr, dim);
ppl_set_coef (expr, strip, -1 * stride);
ppl_set_coef (expr, iter, 1);
ppl_new_Constraint (&new_cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
ppl_delete_Linear_Expression (expr);
ppl_Polyhedron_add_constraint (res, new_cstr);
ppl_delete_Constraint (new_cstr);
}
d = isl_map_get_space (pbb->transformed);
c = isl_inequality_alloc (isl_local_space_from_space (d));
c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, -stride);
c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, 1);
pbb->transformed = isl_map_add_constraint (pbb->transformed, c);
/* Upper bound of the striped loop. */
{
ppl_Constraint_t new_cstr;
ppl_Linear_Expression_t expr;
ppl_new_Linear_Expression_with_dimension (&expr, dim);
ppl_set_coef (expr, strip, stride);
ppl_set_coef (expr, iter, -1);
ppl_set_inhomogeneous (expr, stride - 1);
ppl_new_Constraint (&new_cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
ppl_delete_Linear_Expression (expr);
ppl_Polyhedron_add_constraint (res, new_cstr);
ppl_delete_Constraint (new_cstr);
}
d = isl_map_get_space (pbb->transformed);
c = isl_inequality_alloc (isl_local_space_from_space (d));
c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, stride);
c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, -1);
c = isl_constraint_set_constant_si (c, stride - 1);
pbb->transformed = isl_map_add_constraint (pbb->transformed, c);
/* Static scheduling for ITER level.
This is mandatory to keep the 2d + 1 canonical scheduling format. */
{
ppl_Constraint_t new_cstr;
ppl_Linear_Expression_t expr;
ppl_new_Linear_Expression_with_dimension (&expr, dim);
ppl_set_coef (expr, strip + 1, 1);
ppl_set_inhomogeneous (expr, 0);
ppl_new_Constraint (&new_cstr, expr, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_delete_Linear_Expression (expr);
ppl_Polyhedron_add_constraint (res, new_cstr);
ppl_delete_Constraint (new_cstr);
}
d = isl_map_get_space (pbb->transformed);
c = isl_equality_alloc (isl_local_space_from_space (d));
c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip + 1, 1);
pbb->transformed = isl_map_add_constraint (pbb->transformed, c);
}
/* Returns true when strip mining with STRIDE of the loop LST is
......
......@@ -21,8 +21,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GRAPHITE_CLAST_TO_GIMPLE_H
#define GCC_GRAPHITE_CLAST_TO_GIMPLE_H
#include "graphite-cloog-util.h"
extern CloogState *cloog_state;
/* Data structure for CLooG program representation. */
......
/* Gimple Represented as Polyhedra.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>
and Tobias Grosser <grosser@fim.uni-passau.de>.
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/>. */
#ifndef GRAPHITE_CLOOG_UTIL_H
#define GRAPHITE_CLOOG_UTIL_H
#include "cloog/cloog.h"
CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
int, CloogState *);
CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron
(ppl_const_Polyhedron_t, int, int, CloogState *);
CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset
(ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *);
void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
void openscop_print_polyhedron_matrix (FILE *, ppl_const_Polyhedron_t, int,
int, int, int);
void openscop_read_polyhedron_matrix (FILE *, ppl_Polyhedron_t *, int *, int *,
int *, int *);
extern int *openscop_read_N_int (FILE *, int);
#endif /* GRAPHITE_CLOOG_UTIL_H */
/* Graphite polyhedral representation.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Konrad Trifunovic <konrad.trifunovic@gmail.com>
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/>. */
#ifndef GCC_GRAPHITE_DEPENDENCES_H
#define GCC_GRAPHITE_DEPENDENCES_H
extern bool graphite_legal_transform (scop_p);
extern bool dependency_between_pbbs_p (poly_bb_p, poly_bb_p, int);
enum poly_dependence_kind {
unknown_dependence,
no_dependence,
has_dependence
};
/* Represents a Polyhedral Data Dependence Relation. */
typedef struct poly_ddr
{
/* Source and sink data references of the dependence. */
poly_dr_p source, sink;
/* Data dependence polyhedron. */
ppl_Pointset_Powerset_C_Polyhedron_t ddp;
enum poly_dependence_kind kind;
/* True when the dependence relation is for the original scattering. */
bool original_scattering_p;
} *poly_ddr_p;
#define PDDR_SOURCE(PDDR) (PDDR->source)
#define PDDR_SINK(PDDR) (PDDR->sink)
#define PDDR_DDP(PDDR) (PDDR->ddp)
#define PDDR_KIND(PDDR) (PDDR->kind)
#define PDDR_ORIGINAL_SCATTERING_P(PDDR) (PDDR->original_scattering_p)
extern int eq_poly_ddr_p (const void *, const void *);
extern hashval_t hash_poly_ddr_p (const void *);
extern void free_poly_ddr (void *);
extern void dot_deps (scop_p);
extern void dot_deps_stmt (scop_p);
extern void print_pddr (FILE *, poly_ddr_p);
extern void debug_pddr (poly_ddr_p);
#endif
/* Gimple Represented as Polyhedra.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>
and Tobias Grosser <grosser@fim.uni-passau.de>.
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/>. */
#ifndef GCC_GRAPHITE_PPL_H
#define GCC_GRAPHITE_PPL_H
#include "double-int.h"
#include "tree.h"
ppl_Polyhedron_t ppl_strip_loop (ppl_Polyhedron_t, ppl_dimension_type, int);
int ppl_lexico_compare_linear_expressions (ppl_Linear_Expression_t,
ppl_Linear_Expression_t);
void ppl_print_polyhedron_matrix (FILE *, ppl_const_Polyhedron_t);
void ppl_print_powerset_matrix (FILE *, ppl_Pointset_Powerset_C_Polyhedron_t);
void debug_ppl_polyhedron_matrix (ppl_Polyhedron_t);
void debug_ppl_powerset_matrix (ppl_Pointset_Powerset_C_Polyhedron_t);
void ppl_print_linear_expr (FILE *, ppl_Linear_Expression_t);
void debug_ppl_linear_expr (ppl_Linear_Expression_t);
void ppl_read_polyhedron_matrix (ppl_Polyhedron_t *, FILE *);
void ppl_insert_dimensions (ppl_Polyhedron_t, int, int);
void ppl_insert_dimensions_pointset (ppl_Pointset_Powerset_C_Polyhedron_t, int,
int);
void ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t, mpz_t);
void ppl_set_coef_gmp (ppl_Linear_Expression_t, ppl_dimension_type, mpz_t);
void ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
ppl_Linear_Expression_t, mpz_t);
void ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
ppl_Linear_Expression_t, mpz_t);
ppl_Constraint_t ppl_build_relation (int, int, int, int,
enum ppl_enum_Constraint_Type);
void debug_gmp_value (mpz_t);
bool ppl_powerset_is_empty (ppl_Pointset_Powerset_C_Polyhedron_t);
/* Assigns to RES the value of the INTEGER_CST T. */
static inline void
tree_int_to_gmp (tree t, mpz_t res)
{
double_int di = tree_to_double_int (t);
mpz_set_double_int (res, di, TYPE_UNSIGNED (TREE_TYPE (t)));
}
/* Converts a GMP constant VAL to a tree and returns it. */
static inline tree
gmp_cst_to_tree (tree type, mpz_t val)
{
tree t = type ? type : integer_type_node;
mpz_t tmp;
double_int di;
mpz_init (tmp);
mpz_set (tmp, val);
di = mpz_get_double_int (t, tmp, true);
mpz_clear (tmp);
return double_int_to_tree (t, di);
}
/* Set the inhomogeneous term of E to the integer X. */
static inline void
ppl_set_inhomogeneous (ppl_Linear_Expression_t e, int x)
{
mpz_t v;
mpz_init (v);
mpz_set_si (v, x);
ppl_set_inhomogeneous_gmp (e, v);
mpz_clear (v);
}
/* Set the inhomogeneous term of E to the tree X. */
static inline void
ppl_set_inhomogeneous_tree (ppl_Linear_Expression_t e, tree x)
{
mpz_t v;
mpz_init (v);
tree_int_to_gmp (x, v);
ppl_set_inhomogeneous_gmp (e, v);
mpz_clear (v);
}
/* Set E[I] to integer X. */
static inline void
ppl_set_coef (ppl_Linear_Expression_t e, ppl_dimension_type i, int x)
{
mpz_t v;
mpz_init (v);
mpz_set_si (v, x);
ppl_set_coef_gmp (e, i, v);
mpz_clear (v);
}
/* Set E[I] to tree X. */
static inline void
ppl_set_coef_tree (ppl_Linear_Expression_t e, ppl_dimension_type i, tree x)
{
mpz_t v;
mpz_init (v);
tree_int_to_gmp (x, v);
ppl_set_coef_gmp (e, i, v);
mpz_clear (v);
}
/* Sets RES to the min of V1 and V2. */
static inline void
value_min (mpz_t res, mpz_t v1, mpz_t v2)
{
if (mpz_cmp (v1, v2) < 0)
mpz_set (res, v1);
else
mpz_set (res, v2);
}
/* Sets RES to the max of V1 and V2. */
static inline void
value_max (mpz_t res, mpz_t v1, mpz_t v2)
{
if (mpz_cmp (v1, v2) < 0)
mpz_set (res, v2);
else
mpz_set (res, v1);
}
/* Builds a new identity map for dimension DIM. */
static inline ppl_dimension_type *
ppl_new_id_map (ppl_dimension_type dim)
{
ppl_dimension_type *map, i;
map = (ppl_dimension_type *) XNEWVEC (ppl_dimension_type, dim);
for (i = 0; i < dim; i++)
map[i] = i;
return map;
}
/* Builds an interchange of dimensions A and B in MAP. */
static inline void
ppl_interchange (ppl_dimension_type *map,
ppl_dimension_type a,
ppl_dimension_type b)
{
map[a] = b;
map[b] = a;
}
#endif
/* Detection of Static Control Parts (SCoP) for Graphite.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@amd.com> and
Tobias Grosser <grosser@fim.uni-passau.de>.
......@@ -20,6 +20,15 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#ifdef HAVE_cloog
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#endif
#include "system.h"
#include "coretypes.h"
#include "tree-flow.h"
......@@ -31,8 +40,6 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#ifdef HAVE_cloog
#include "ppl_c.h"
#include "graphite-ppl.h"
#include "graphite-poly.h"
#include "graphite-scop-detection.h"
......
/* Gimple Represented as Polyhedra.
Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>.
This file is part of GCC.
......@@ -33,6 +34,17 @@ along with GCC; see the file COPYING3. If not see
the functions that are used for transforming the code. */
#include "config.h"
#ifdef HAVE_cloog
#include <isl/set.h>
#include <isl/map.h>
#include <isl/options.h>
#include <isl/union_map.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#include <cloog/isl/cloog.h>
#endif
#include "system.h"
#include "coretypes.h"
#include "diagnostic-core.h"
......@@ -47,8 +59,6 @@ along with GCC; see the file COPYING3. If not see
#ifdef HAVE_cloog
#include "ppl_c.h"
#include "graphite-ppl.h"
#include "graphite-poly.h"
#include "graphite-scop-detection.h"
#include "graphite-clast-to-gimple.h"
......@@ -186,10 +196,8 @@ print_graphite_statistics (FILE* file, VEC (scop_p, heap) *scops)
/* Initialize graphite: when there are no loops returns false. */
static bool
graphite_initialize (void)
graphite_initialize (isl_ctx *ctx)
{
int ppl_initialized;
if (number_of_loops () <= 1
/* FIXME: This limit on the number of basic blocks of a function
should be removed when the SCOP detection is faster. */
......@@ -198,6 +206,7 @@ graphite_initialize (void)
if (dump_file && (dump_flags & TDF_DETAILS))
print_global_statistics (dump_file);
isl_ctx_free (ctx);
return false;
}
......@@ -205,10 +214,7 @@ graphite_initialize (void)
recompute_all_dominators ();
initialize_original_copy_tables ();
ppl_initialized = ppl_initialize ();
gcc_assert (ppl_initialized == 0);
cloog_state = cloog_state_malloc ();
cloog_state = cloog_isl_state_malloc (ctx);
if (dump_file && dump_flags)
dump_function_to_file (current_function_decl, dump_file, dump_flags);
......@@ -232,13 +238,14 @@ graphite_finalize (bool need_cfg_cleanup_p)
}
cloog_state_free (cloog_state);
ppl_finalize ();
free_original_copy_tables ();
if (dump_file && dump_flags)
print_loops (dump_file, 3);
}
isl_ctx *the_isl_ctx;
/* Perform a set of linear transforms on the loops of the current
function. */
......@@ -250,15 +257,19 @@ graphite_transform_loops (void)
bool need_cfg_cleanup_p = false;
VEC (scop_p, heap) *scops = NULL;
htab_t bb_pbb_mapping;
isl_ctx *ctx;
/* If a function is parallel it was most probably already run through graphite
once. No need to run again. */
if (parallelized_function_p (cfun->decl))
return;
if (!graphite_initialize ())
ctx = isl_ctx_alloc ();
isl_options_set_on_error(ctx, ISL_ON_ERROR_ABORT);
if (!graphite_initialize (ctx))
return;
the_isl_ctx = ctx;
build_scops (&scops);
if (dump_file && (dump_flags & TDF_DETAILS))
......@@ -272,6 +283,7 @@ graphite_transform_loops (void)
FOR_EACH_VEC_ELT (scop_p, scops, i, scop)
if (dbg_cnt (graphite_scop))
{
scop->ctx = ctx;
build_poly_scop (scop);
if (POLY_SCOP_P (scop)
......@@ -283,6 +295,8 @@ graphite_transform_loops (void)
htab_delete (bb_pbb_mapping);
free_scops (scops);
graphite_finalize (need_cfg_cleanup_p);
the_isl_ctx = NULL;
isl_ctx_free (ctx);
}
#else /* If Cloog is not available: #ifndef HAVE_cloog. */
......
2012-07-02 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
Tobias Grosser <tobias@grosser.es>
Sebastian Pop <sebpop@gmail.com>
* testsuite/libgomp.graphite/force-parallel-4.c: Adjust.
* testsuite/libgomp.graphite/force-parallel-5.c: Likewise.
* testsuite/libgomp.graphite/force-parallel-7.c: Likewise.
* testsuite/libgomp.graphite/force-parallel-8.c: Likewise.
2012-06-28 Andreas Schwab <schwab@linux-m68k.org>
* libgomp.texi: Include gpl_v3.texi instead of gpl.texi.
......
......@@ -47,6 +47,7 @@ int main(void)
}
/* Check that parallel code generation part make the right answer. */
/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
......
......@@ -31,7 +31,7 @@ int main(void)
}
/* Check that parallel code generation part make the right answer. */
/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
/* { dg-final { scan-tree-dump-times "loopfn.1" 5 "optimized" } } */
......
......@@ -2,29 +2,30 @@
int A[N+5][N+5][N+5];
int foo(void)
void abort (void);
int foo (void)
{
int i, j, k;
for (i = 0; i < N + 5; i++)
for (j = 0; j < N + 5; j++)
for (k = 0; k < N + 5; k++)
A[i][j][k] = i + j + k;
/* Loop i: carried no dependency. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
for (k = 0; k < N; k++)
A[k+1][j+2][i+1] = A[k][j][i+1];
for (i = 0; i < N; i++)
/* Loop j: carried no dependency. */
for (j = 0; j < N; j++)
/* Loop k: carreid no dependency. */
for (k = 0; k < N; k++)
A[i+1][j][k] = A[i][j][k+1];
return A[1][5][2];
}
int main(void)
int main (void)
{
foo();
if (5 != foo ())
abort ();
return 0;
}
......
......@@ -2,11 +2,20 @@
int x[N][N], y[N];
void abort (void);
int foo(void)
{
int i, j;
for (i = 0; i < N; i++)
y[i] = i;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
x[i][j] = i + j;
for (i = 0; i < N; i++)
{
y[i] = i;
......@@ -27,13 +36,16 @@ int foo(void)
int main(void)
{
foo();
if (168 != foo())
abort ();
return 0;
}
/* Check that parallel code generation part make the right answer. */
/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "3 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "5 loops carried no dependency" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
/* { dg-final { scan-tree-dump-times "loopfn.1" 5 "optimized" } } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment