backport: configure: Regenerate.

2008-09-02  Sebastian Pop  <sebastian.pop@amd.com>
	    Tobias Grosser  <grosser@fim.uni-passau.de>
	    Jan Sjodin  <jan.sjodin@amd.com>
	    Harsha Jagasia  <harsha.jagasia@amd.com>
	    Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
	    Konrad Trifunovic  <konrad.trifunovic@inria.fr>
	    Adrien Eliche  <aeliche@isty.uvsq.fr>

	Merge from graphite branch.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* configure.ac (host_libs): Add ppl and cloog.
	Add checks for PPL and CLooG.
	* Makefile.def (ppl, cloog): Added modules and dependences.
	* Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New.
	(HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New.

gcc/
	* graphite.c: New.
	* graphite.h: New.
	* tree-loop-linear.c (perfect_loop_nest_depth): Export.
	* doc/invoke.texi (-floop-block, -floop-interchange,
	-floop-strip-mine): Document new flags.
	* tree-into-ssa.c (gimple_vec): Moved...
	* tree-loop-distribution.c (rdg_component): Moved...
	* cfgloopmanip.c: Include tree-flow.h.
	(update_dominators_in_loop): New.
	(create_empty_if_region_on_edge): New.
	(create_empty_loop_on_edge): New.
	(loopify): Use update_dominators_in_loop.
	* tree-pass.h (pass_graphite_transforms): Declared.
	* configure: Regenerate.
	* tree-phinodes.c (make_phi_node): Export.
	(add_phi_node_to_bb): New, split from create_phi_node.
	* tree-chrec.c (for_each_scev_op): New.
	* tree-chrec.h (for_each_scev_op): Declared.
	* tree-ssa-loop-ivopts.c (get_phi_with_result): New.
	(remove_statement): Call get_phi_with_result.
	* config.in (HAVE_cloog): Undef.
	* gdbinit.in (pgg): New.
	* timevar.def (TV_GRAPHITE_TRANSFORMS): New.
	* tree-ssa-loop.c (graphite_transforms): New.
	(gate_graphite_transforms): New.
	(pass_graphite_transforms): New.
	* configure.ac (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC,
	HAVE_cloog): Defined.
	* tree-vectorizer.c (rename_variables_in_bb): Export.
	* tree-data-ref.c (dr_may_alias_p): Export.
	(stmt_simple_memref_p): New.
	(find_data_references_in_stmt): Export.
	(find_data_references_in_loop): Export.
	(create_rdg_edge_for_ddr): Initialize RDGE_RELATION.
	(create_rdg_edges_for_scalar): Initialize RDGE_RELATION.
	(create_rdg_vertices): Export.
	(build_empty_rdg): New.
	(build_rdg): Call build_empty_rdg.  Free dependence_relations.
	* tree-data-ref.h (rdg_component): ... here.
	(scop_p): New.
	(struct data_reference): Add a field scop.
	(DR_SCOP): New.
	(find_data_references_in_loop): Declared.
	(find_data_references_in_stmt): Declared.
	(create_rdg_vertices): Declared.
	(dr_may_alias_p): Declared.
	(stmt_simple_memref_p): Declared.
	(struct rdg_edge): Add a field ddr_p relation.
	(build_empty_rdg): Declared.
	* lambda.h (lambda_matrix): Declare a VEC of.
	(find_induction_var_from_exit_cond): Declared.
	(lambda_vector_compare): New.
	* common.opt (fgraphite, floop-strip-mine,
	floop-interchange, floop-block): New flags.
	* lambda-code.c (find_induction_var_from_exit_cond): Export.
	* cfgloop.c (is_loop_exit): New.
	* cfgloop.h (is_loop_exit): Declared.
	(create_empty_if_region_on_edge): Declared.
	(create_empty_loop_on_edge): Declared.
	* tree-flow.h (add_phi_node_to_bb): Declared.
	(make_phi_node): Declared.
	(rename_variables_in_bb): Declared.
	(perfect_loop_nest_depth): Declared.
	(graphite_transform_loops): Declared.
	* Makefile.in (cfgloopmanip.o): Depend on TREE_FLOW_H.
	(graphite.o-warn): Add -Wno-error.
	(PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): Declared.
	(LIBS): Add GMPLIBS, CLOOGLIBS, PPLLIBS.
	(INCLUDES): Add PPLINC, CLOOGINC.
	(OBJS-common): Add graphite.o.
	(graphite.o): Add rule.
	* gimple.h (gimple_vec): ... here.
	* tree-cfg.c (print_loops): Start printing at ENTRY_BLOCK_PTR.
	* passes.c (init_optimization_passes): Schedule 
	pass_graphite_transforms.

testsuite/

	* gcc.dg/graphite/scop-{0,1,2,3,4,5,6,7,8,9,
	10,11,12,13,14,15,16,17,18}.c: New.
	* gcc.dg/graphite/graphite.exp: New.
	* gcc.dg/graphite/scop-matmult.c: New.
	* gcc.dg/graphite/block-0.c: New.
	* lib/target-supports.exp (check_effective_target_fgraphite): New.
	* gfortran.dg/graphite/block-1.f90: New.
	* gfortran.dg/graphite/scop-{1,2}.f: New.
	* gfortran.dg/graphite/block-{1,3,4}.f90: New.
	* gfortran.dg/graphite/graphite.exp: New.


Co-Authored-By: Adrien Eliche <aeliche@isty.uvsq.fr>
Co-Authored-By: Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Co-Authored-By: Harsha Jagasia <harsha.jagasia@amd.com>
Co-Authored-By: Jan Sjodin <jan.sjodin@amd.com>
Co-Authored-By: Konrad Trifunovic <konrad.trifunovic@inria.fr>
Co-Authored-By: Tobias Grosser <grosser@fim.uni-passau.de>

From-SVN: r139893
This commit is contained in:
Sebastian Pop 2008-09-02 16:31:04 +00:00 committed by Sebastian Pop
parent 57b08d04c6
commit f8bf925265
68 changed files with 9508 additions and 108 deletions

View File

@ -1,3 +1,20 @@
2008-09-02 Sebastian Pop <sebastian.pop@amd.com>
Tobias Grosser <grosser@fim.uni-passau.de>
Jan Sjodin <jan.sjodin@amd.com>
Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Konrad Trifunovic <konrad.trifunovic@inria.fr>
Adrien Eliche <aeliche@isty.uvsq.fr>
Merge from graphite branch.
* configure: Regenerate.
* Makefile.in: Regenerate.
* configure.ac (host_libs): Add ppl and cloog.
Add checks for PPL and CLooG.
* Makefile.def (ppl, cloog): Added modules and dependences.
* Makefile.tpl (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): New.
(HOST_PPLLIBS, HOST_PPLINC, HOST_CLOOGLIBS, HOST_CLOOGINC): New.
2008-08-31 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* configure.ac (RPATH_ENVVAR): Use PATH on Windows.

View File

@ -68,6 +68,16 @@ host_modules= { module= mpfr; lib_path=.libs; bootstrap=true;
no_install= true;
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= ppl; lib_path=.libs; bootstrap=true;
extra_configure_flags='--disable-shared --with-libgmp-prefix=$$r/$(HOST_SUBDIR)/gmp/ --with-libgmpxx-prefix=$$r/$(HOST_SUBDIR)/gmp/';
no_install= true;
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
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-ppl=$$r/$(HOST_SUBDIR)/ppl/ --with-bits=gmp';
no_install= true;
host="none-${host_vendor}-${host_os}";
target="none-${host_vendor}-${host_os}"; };
host_modules= { module= gnuserv; };
host_modules= { module= gold; bootstrap=true; };
host_modules= { module= gprof; };
@ -295,6 +305,8 @@ dependencies = { module=all-gcc; on=all-libiberty; hard=true; };
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-ppl; };
dependencies = { module=all-gcc; on=all-cloog; };
dependencies = { module=all-gcc; on=all-build-texinfo; };
dependencies = { module=all-gcc; on=all-build-bison; };
dependencies = { module=all-gcc; on=all-build-byacc; };
@ -318,6 +330,9 @@ dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=configure-mpfr; on=all-gmp; };
dependencies = { module=configure-ppl; on=all-gmp; };
dependencies = { module=configure-ppl; on=all-mpfr; };
dependencies = { module=configure-cloog; on=all-ppl; };
// Host modules specific to gdb.
dependencies = { module=configure-gdb; on=all-intl; };

File diff suppressed because it is too large Load Diff

View File

@ -199,6 +199,10 @@ HOST_EXPORTS = \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
PPLLIBS="$(HOST_PPLLIBS)"; export PPLLIBS; \
PPLINC="$(HOST_PPLINC)"; export PPLINC; \
CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \
CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \
@if gcc-bootstrap
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
@endif gcc-bootstrap
@ -258,6 +262,14 @@ NORMAL_TARGET_EXPORTS = \
HOST_GMPLIBS = @gmplibs@
HOST_GMPINC = @gmpinc@
# Where to find PPL
HOST_PPLLIBS = @ppllibs@
HOST_PPLINC = @pplinc@
# Where to find CLOOG
HOST_CLOOGLIBS = @clooglibs@
HOST_CLOOGINC = @clooginc@
# ----------------------------------------------
# Programs producing files for the BUILD machine
# ----------------------------------------------

229
configure vendored
View File

@ -272,7 +272,7 @@ PACKAGE_STRING=
PACKAGE_BUGREPORT=
ac_unique_file="move-if-change"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPLEVEL_CONFIGURE_ARGUMENTS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR GCC_SHLIB_SUBDIR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TOPLEVEL_CONFIGURE_ARGUMENTS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc ppllibs pplinc clooglibs clooginc stage1_languages SYSROOT_CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET CFLAGS_FOR_TARGET CXXFLAGS_FOR_TARGET RPATH_ENVVAR GCC_SHLIB_SUBDIR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs AR_FOR_BUILD AS_FOR_BUILD CC_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD CXX_FOR_BUILD DLLTOOL_FOR_BUILD GCJ_FOR_BUILD GFORTRAN_FOR_BUILD LDFLAGS_FOR_BUILD LD_FOR_BUILD NM_FOR_BUILD RANLIB_FOR_BUILD WINDMC_FOR_BUILD WINDRES_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES WINDMC OBJCOPY OBJDUMP CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET WINDMC_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS'
ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag'
ac_pwd=`pwd`
@ -967,6 +967,16 @@ Optional Packages:
plus --with-gmp-lib=PATH/lib
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library
--with-ppl=PATH Specify prefix directory for the installed PPL package
Equivalent to --with-ppl-include=PATH/include
plus --with-ppl-lib=PATH/lib
--with-ppl-include=PATH Specify directory for installed PPL include files
--with-ppl-lib=PATH Specify the directory for the installed PPL library
--with-cloog=PATH Specify prefix directory for the installed CLOOG package
Equivalent to --with-cloog-include=PATH/include
plus --with-cloog-lib=PATH/lib
--with-cloog-include=PATH Specify directory for installed CLOOG include files
--with-cloog-lib=PATH Specify the directory for the installed CLOOG library
--with-build-sysroot=SYSROOT
use sysroot as the system root during the build
--with-debug-prefix-map='A=B C=D ...'
@ -1873,7 +1883,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix
# these libraries are used by various programs built for the host environment
#
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr"
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr ppl cloog"
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@ -4791,6 +4801,217 @@ fi
# Check for PPL
ppl_major_version=0
ppl_minor_version=10
ppllibs=
pplinc=
# Check whether --with-ppl or --without-ppl was given.
if test "${with_ppl+set}" = set; then
withval="$with_ppl"
fi;
# Check whether --with-ppl_include or --without-ppl_include was given.
if test "${with_ppl_include+set}" = set; then
withval="$with_ppl_include"
fi;
# Check whether --with-ppl_lib or --without-ppl_lib was given.
if test "${with_ppl_lib+set}" = set; then
withval="$with_ppl_lib"
fi;
if test "x$with_ppl" != x; then
ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
pplinc="-I$with_ppl/include $pplinc"
LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl_include" != x; then
pplinc="-I$with_ppl_include $pplinc"
fi
if test "x$with_ppl_lib" != x; then
ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '
pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include '
LIBS="$ppllibs $LIBS"
fi
# Flags needed for PPL
# Check for CLOOG
clooglibs=
clooginc=
# Check whether --with-cloog or --without-cloog was given.
if test "${with_cloog+set}" = set; then
withval="$with_cloog"
fi;
# Check whether --with-cloog_include or --without-cloog_include was given.
if test "${with_cloog_include+set}" = set; then
withval="$with_cloog_include"
fi;
# Check whether --with-cloog_lib or --without-cloog_lib was given.
if test "${with_cloog_lib+set}" = set; then
withval="$with_cloog_lib"
fi;
if test "x$with_cloog" != x; then
clooglibs="-L$with_cloog/lib -lcloog"
clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog_include" != x; then
clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
fi
if test "x$with_cloog_lib" != x; then
clooglibs="-L$with_cloog_lib -lcloog"
LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
LIBS="$clooglibs $LIBS"
fi
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pplinc $gmpinc"
echo "$as_me:$LINENO: checking for version $ppl_major_version.$ppl_minor_version of PPL" >&5
echo $ECHO_N "checking for version $ppl_major_version.$ppl_minor_version of PPL... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "ppl_c.h"
int
main ()
{
#if PPL_VERSION_MAJOR != $ppl_major_version || PPL_VERSION_MINOR != $ppl_minor_version
choke me
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; clooglibs= ; clooginc=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$saved_CFLAGS"
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
echo "$as_me:$LINENO: checking for correct version of CLooG" >&5
echo $ECHO_N "checking for correct version of CLooG... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "cloog/cloog.h"
int
main ()
{
#if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15
choke me
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; clooglibs= ; clooginc=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$saved_CFLAGS"
# Flags needed for CLOOG
# By default, C is the only stage 1 language.
stage1_languages=,c,
@ -12977,6 +13198,10 @@ s,@ac_ct_GNATMAKE@,$ac_ct_GNATMAKE,;t t
s,@do_compare@,$do_compare,;t t
s,@gmplibs@,$gmplibs,;t t
s,@gmpinc@,$gmpinc,;t t
s,@ppllibs@,$ppllibs,;t t
s,@pplinc@,$pplinc,;t t
s,@clooglibs@,$clooglibs,;t t
s,@clooginc@,$clooginc,;t t
s,@stage1_languages@,$stage1_languages,;t t
s,@SYSROOT_CFLAGS_FOR_TARGET@,$SYSROOT_CFLAGS_FOR_TARGET,;t t
s,@DEBUG_PREFIX_CFLAGS_FOR_TARGET@,$DEBUG_PREFIX_CFLAGS_FOR_TARGET,;t t

View File

@ -158,7 +158,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix
# these libraries are used by various programs built for the host environment
#
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr"
host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr ppl cloog"
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@ -1310,6 +1310,97 @@ fi
AC_SUBST(gmplibs)
AC_SUBST(gmpinc)
# Check for PPL
ppl_major_version=0
ppl_minor_version=10
ppllibs=
pplinc=
AC_ARG_WITH(ppl, [ --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, [ --with-ppl-include=PATH Specify directory for installed PPL include files])
AC_ARG_WITH(ppl_lib, [ --with-ppl-lib=PATH Specify the directory for the installed PPL library])
if test "x$with_ppl" != x; then
ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx"
pplinc="-I$with_ppl/include $pplinc"
LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl_include" != x; then
pplinc="-I$with_ppl_include $pplinc"
fi
if test "x$with_ppl_lib" != x; then
ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx"
LIBS="$ppllibs $LIBS"
fi
if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then
ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '
pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include '
LIBS="$ppllibs $LIBS"
fi
# Flags needed for PPL
AC_SUBST(ppllibs)
AC_SUBST(pplinc)
# Check for CLOOG
clooglibs=
clooginc=
AC_ARG_WITH(cloog, [ --with-cloog=PATH Specify prefix directory for the installed CLOOG package
Equivalent to --with-cloog-include=PATH/include
plus --with-cloog-lib=PATH/lib])
AC_ARG_WITH(cloog_include, [ --with-cloog-include=PATH Specify directory for installed CLOOG include files])
AC_ARG_WITH(cloog_lib, [ --with-cloog-lib=PATH Specify the directory for the installed CLOOG library])
if test "x$with_cloog" != x; then
clooglibs="-L$with_cloog/lib -lcloog"
clooginc="-I$with_cloog/include -DCLOOG_PPL_BACKEND "
LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog_include" != x; then
clooginc="-I$with_cloog_include -DCLOOG_PPL_BACKEND "
fi
if test "x$with_cloog_lib" != x; then
clooglibs="-L$with_cloog_lib -lcloog"
LIBS="$clooglibs $LIBS"
fi
if test "x$with_cloog$with_cloog_include$with_cloog_lib" = x && test -d ${srcdir}/cloog; then
clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/.libs -L$$r/$(HOST_SUBDIR)/cloog/_libs -lcloog '
clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -DCLOOG_PPL_BACKEND '
LIBS="$clooglibs $LIBS"
fi
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $pplinc $gmpinc"
AC_MSG_CHECKING([for version $ppl_major_version.$ppl_minor_version of PPL])
AC_TRY_COMPILE([#include "ppl_c.h"],[
#if PPL_VERSION_MAJOR != $ppl_major_version || PPL_VERSION_MINOR != $ppl_minor_version
choke me
#endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
CFLAGS="$saved_CFLAGS"
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $clooginc $gmpinc $pplinc"
AC_MSG_CHECKING([for correct version of CLooG])
AC_TRY_COMPILE([#include "cloog/cloog.h"],[
#if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 15
choke me
#endif
], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); clooglibs= ; clooginc= ])
CFLAGS="$saved_CFLAGS"
# Flags needed for CLOOG
AC_SUBST(clooglibs)
AC_SUBST(clooginc)
# By default, C is the only stage 1 language.
stage1_languages=,c,

View File

@ -183,6 +183,8 @@ dfp.o-warn = -Wno-error
bitmap.o-warn = -Wno-error
# dominance.c contains a -Wc++compat warning.
dominance.o-warn = -Wno-error
# graphite.c contains code calling cloog that has problems.
graphite.o-warn = -Wno-error
# All warnings have to be shut off in stage1 if the compiler used then
# isn't gcc; configure determines that. WARN_CFLAGS will be either
@ -281,6 +283,14 @@ ZLIBINC = @zlibinc@
GMPLIBS = @GMPLIBS@
GMPINC = @GMPINC@
# How to find PPL
PPLLIBS = @PPLLIBS@
PPLINC = @PPLINC@
# How to find CLOOG
CLOOGLIBS = @CLOOGLIBS@
CLOOGINC = @CLOOGINC@
CPPLIB = ../libcpp/libcpp.a
CPPINC = -I$(srcdir)/../libcpp/include
@ -891,7 +901,8 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \
$(GMPLIBS) $(CLOOGLIBS) $(PPLLIBS)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@ -920,7 +931,8 @@ BUILD_ERRORS = build/errors.o
# libintl.h will be found in ../intl if we are using the included libintl.
INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
-I$(srcdir)/../include @INCINTL@ \
$(CPPINC) $(GMPINC) $(DECNUMINC)
$(CPPINC) $(GMPINC) $(DECNUMINC) \
$(PPLINC) $(CLOOGINC)
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
@ -1094,6 +1106,7 @@ OBJS-common = \
global.o \
graph.o \
graphds.o \
graphite.o \
gtype-desc.o \
haifa-sched.o \
hooks.o \
@ -2340,6 +2353,10 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(TREE_DATA_REF_H) $(SCEV_H) tree-pass.h tree-chrec.h langhooks.h
graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) domwalk.h \
$(TREE_DATA_REF_H) $(SCEV_H) tree-pass.h tree-chrec.h graphite.h pointer-set.h
tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(OPTABS_H) $(TREE_H) $(RECOG_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \

View File

@ -1620,3 +1620,18 @@ single_exit (const struct loop *loop)
else
return NULL;
}
/* Returns true when BB has an edge exiting LOOP. */
bool
is_loop_exit (struct loop *loop, basic_block bb)
{
edge e;
edge_iterator ei;
FOR_EACH_EDGE (e, ei, bb->preds)
if (loop_exit_edge_p (loop, e))
return true;
return false;
}

View File

@ -228,6 +228,7 @@ extern int num_loop_insns (const struct loop *);
extern int average_num_loop_insns (const struct loop *);
extern unsigned get_loop_level (const struct loop *);
extern bool loop_exit_edge_p (const struct loop *, const_edge);
extern bool is_loop_exit (struct loop *, basic_block);
extern void mark_loop_exit_edges (void);
/* Loops & cfg manipulation. */
@ -284,6 +285,9 @@ extern bool can_duplicate_loop_p (const struct loop *loop);
#define DLTHE_FLAG_COMPLETTE_PEEL 4 /* Update frequencies expecting
a complete peeling. */
extern edge create_empty_if_region_on_edge (edge, tree);
extern struct loop *create_empty_loop_on_edge (edge, tree, tree, tree, tree,
tree *, struct loop *);
extern struct loop * duplicate_loop (struct loop *, struct loop *);
extern bool duplicate_loop_to_header_edge (struct loop *, edge,
unsigned, sbitmap, edge,

View File

@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfglayout.h"
#include "cfghooks.h"
#include "output.h"
#include "tree-flow.h"
static void duplicate_subloops (struct loop *, struct loop *);
static void copy_loops_to (struct loop **, int,
@ -466,6 +467,243 @@ scale_loop_frequencies (struct loop *loop, int num, int den)
free (bbs);
}
/* Recompute dominance information for basic blocks outside LOOP. */
static void
update_dominators_in_loop (struct loop *loop)
{
VEC (basic_block, heap) *dom_bbs = NULL;
sbitmap seen;
basic_block *body;
unsigned i;
seen = sbitmap_alloc (last_basic_block);
sbitmap_zero (seen);
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
SET_BIT (seen, body[i]->index);
for (i = 0; i < loop->num_nodes; i++)
{
basic_block ldom;
for (ldom = first_dom_son (CDI_DOMINATORS, body[i]);
ldom;
ldom = next_dom_son (CDI_DOMINATORS, ldom))
if (!TEST_BIT (seen, ldom->index))
{
SET_BIT (seen, ldom->index);
VEC_safe_push (basic_block, heap, dom_bbs, ldom);
}
}
iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false);
free (body);
free (seen);
VEC_free (basic_block, heap, dom_bbs);
}
/* Creates an if region as shown above. CONDITION is used to create
the test for the if.
|
| ------------- -------------
| | pred_bb | | pred_bb |
| ------------- -------------
| | |
| | | ENTRY_EDGE
| | ENTRY_EDGE V
| | ====> -------------
| | | cond_bb |
| | | CONDITION |
| | -------------
| V / \
| ------------- e_false / \ e_true
| | succ_bb | V V
| ------------- ----------- -----------
| | false_bb | | true_bb |
| ----------- -----------
| \ /
| \ /
| V V
| -------------
| | join_bb |
| -------------
| | exit_edge (result)
| V
| -----------
| | succ_bb |
| -----------
|
*/
edge
create_empty_if_region_on_edge (edge entry_edge, tree condition)
{
basic_block succ_bb, cond_bb, true_bb, false_bb, join_bb;
edge e_true, e_false, exit_edge;
gimple cond_stmt;
tree simple_cond;
gimple_stmt_iterator gsi;
succ_bb = entry_edge->dest;
cond_bb = split_edge (entry_edge);
/* Insert condition in cond_bb. */
gsi = gsi_last_bb (cond_bb);
simple_cond =
force_gimple_operand_gsi (&gsi, condition, true, NULL,
false, GSI_NEW_STMT);
cond_stmt = gimple_build_cond_from_tree (simple_cond, NULL_TREE, NULL_TREE);
gsi = gsi_last_bb (cond_bb);
gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
join_bb = split_edge (single_succ_edge (cond_bb));
e_true = single_succ_edge (cond_bb);
true_bb = split_edge (e_true);
e_false = make_edge (cond_bb, join_bb, 0);
false_bb = split_edge (e_false);
e_true->flags &= ~EDGE_FALLTHRU;
e_true->flags |= EDGE_TRUE_VALUE;
e_false->flags &= ~EDGE_FALLTHRU;
e_false->flags |= EDGE_FALSE_VALUE;
set_immediate_dominator (CDI_DOMINATORS, cond_bb, entry_edge->src);
set_immediate_dominator (CDI_DOMINATORS, true_bb, cond_bb);
set_immediate_dominator (CDI_DOMINATORS, false_bb, cond_bb);
set_immediate_dominator (CDI_DOMINATORS, join_bb, cond_bb);
exit_edge = single_succ_edge (join_bb);
if (single_pred_p (exit_edge->dest))
set_immediate_dominator (CDI_DOMINATORS, exit_edge->dest, join_bb);
return exit_edge;
}
/* create_empty_loop_on_edge
|
| ------------- ------------------------
| | pred_bb | | pred_bb |
| ------------- | IV_0 = INITIAL_VALUE |
| | ------------------------
| | ______ | ENTRY_EDGE
| | ENTRY_EDGE / V V
| | ====> | -----------------------------
| | | | IV_BEFORE = phi (IV_0, IV) |
| | | | loop_header |
| V | | IV_BEFORE <= UPPER_BOUND |
| ------------- | -----------------------\-----
| | succ_bb | | | \
| ------------- | | \ exit_e
| | V V---------
| | -------------- | succ_bb |
| | | loop_latch | ----------
| | |IV = IV_BEFORE + STRIDE
| | --------------
| \ /
| \ ___ /
Creates an empty loop as shown above, the IV_BEFORE is the SSA_NAME
that is used before the increment of IV. IV_BEFORE should be used for
adding code to the body that uses the IV. OUTER is the outer loop in
which the new loop should be inserted. */
struct loop *
create_empty_loop_on_edge (edge entry_edge,
tree initial_value,
tree stride, tree upper_bound,
tree iv,
tree *iv_before,
struct loop *outer)
{
basic_block loop_header, loop_latch, succ_bb, pred_bb;
struct loop *loop;
int freq;
gcov_type cnt;
gimple_stmt_iterator gsi;
bool insert_after;
gimple_seq stmts;
gimple cond_expr;
tree exit_test;
edge exit_e;
int prob;
tree upper_bound_gimplified;
gcc_assert (entry_edge && initial_value && stride && upper_bound && iv);
/* Create header, latch and wire up the loop. */
pred_bb = entry_edge->src;
loop_header = split_edge (entry_edge);
loop_latch = split_edge (single_succ_edge (loop_header));
succ_bb = single_succ (loop_latch);
make_edge (loop_header, succ_bb, 0);
redirect_edge_succ_nodup (single_succ_edge (loop_latch), loop_header);
/* Set immediate dominator information. */
set_immediate_dominator (CDI_DOMINATORS, loop_header, pred_bb);
set_immediate_dominator (CDI_DOMINATORS, loop_latch, loop_header);
set_immediate_dominator (CDI_DOMINATORS, succ_bb, loop_header);
/* Initialize a loop structure and put it in a loop hierarchy. */
loop = alloc_loop ();
loop->header = loop_header;
loop->latch = loop_latch;
add_loop (loop, outer);
/* TODO: Fix frequencies and counts. */
freq = EDGE_FREQUENCY (entry_edge);
cnt = entry_edge->count;
prob = REG_BR_PROB_BASE / 2;
scale_loop_frequencies (loop, REG_BR_PROB_BASE - prob, REG_BR_PROB_BASE);
/* Update dominators. */
update_dominators_in_loop (loop);
/* Construct IV code in loop. */
initial_value = force_gimple_operand (initial_value, &stmts, true, iv);
if (stmts)
{
gsi_insert_seq_on_edge (loop_preheader_edge (loop), stmts);
gsi_commit_edge_inserts ();
}
standard_iv_increment_position (loop, &gsi, &insert_after);
create_iv (initial_value, stride, iv, loop, &gsi, insert_after,
iv_before, NULL);
/* Modify edge flags. */
exit_e = single_exit (loop);
exit_e->flags = EDGE_LOOP_EXIT | EDGE_FALSE_VALUE;
single_pred_edge (loop_latch)->flags = EDGE_TRUE_VALUE;
gsi = gsi_last_bb (exit_e->src);
upper_bound_gimplified =
force_gimple_operand_gsi (&gsi, upper_bound, true, NULL,
false, GSI_NEW_STMT);
gsi = gsi_last_bb (exit_e->src);
cond_expr = gimple_build_cond
(LE_EXPR, *iv_before, upper_bound_gimplified, NULL_TREE, NULL_TREE);
exit_test = gimple_cond_lhs (cond_expr);
exit_test = force_gimple_operand_gsi (&gsi, exit_test, true, NULL,
false, GSI_NEW_STMT);
gimple_cond_set_lhs (cond_expr, exit_test);
gsi = gsi_last_bb (exit_e->src);
gsi_insert_after (&gsi, cond_expr, GSI_NEW_STMT);
return loop;
}
/* Make area between HEADER_EDGE and LATCH_EDGE a loop by connecting
latch to header and update loop tree and dominators
accordingly. Everything between them plus LATCH_EDGE destination must
@ -483,10 +721,6 @@ loopify (edge latch_edge, edge header_edge,
{
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
basic_block *body;
VEC (basic_block, heap) *dom_bbs;
unsigned i;
sbitmap seen;
struct loop *loop = alloc_loop ();
struct loop *outer = loop_outer (succ_bb->loop_father);
int freq;
@ -538,35 +772,7 @@ loopify (edge latch_edge, edge header_edge,
}
scale_loop_frequencies (loop, false_scale, REG_BR_PROB_BASE);
scale_loop_frequencies (succ_bb->loop_father, true_scale, REG_BR_PROB_BASE);
/* Update dominators of blocks outside of LOOP. */
dom_bbs = NULL;
seen = sbitmap_alloc (last_basic_block);
sbitmap_zero (seen);
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
SET_BIT (seen, body[i]->index);
for (i = 0; i < loop->num_nodes; i++)
{
basic_block ldom;
for (ldom = first_dom_son (CDI_DOMINATORS, body[i]);
ldom;
ldom = next_dom_son (CDI_DOMINATORS, ldom))
if (!TEST_BIT (seen, ldom->index))
{
SET_BIT (seen, ldom->index);
VEC_safe_push (basic_block, heap, dom_bbs, ldom);
}
}
iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false);
free (body);
free (seen);
VEC_free (basic_block, heap, dom_bbs);
update_dominators_in_loop (loop);
return loop;
}

View File

@ -547,6 +547,22 @@ Common Report Var(flag_gcse_after_reload) Optimization
Perform global common subexpression elimination after register allocation
has finished
fgraphite
Common Report Var(flag_graphite)
Enable in and out of Graphite representation
floop-strip-mine
Common Report Var(flag_loop_strip_mine) Optimization
Enable Loop Strip Mining transformation
floop-interchange
Common Report Var(flag_loop_interchange) Optimization
Enable Loop Interchange transformation
floop-block
Common Report Var(flag_loop_block) Optimization
Enable Loop Blocking transformation
fguess-branch-probability
Common Report Var(flag_guess_branch_prob) Optimization
Enable guessing of branch probabilities

View File

@ -1327,6 +1327,12 @@
#endif
/* Define if cloog is in use. */
#ifndef USED_FOR_TARGET
#undef HAVE_cloog
#endif
/* Define as const if the declaration of iconv() needs const. */
#ifndef USED_FOR_TARGET
#undef ICONV_CONST

70
gcc/configure vendored
View File

@ -458,7 +458,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC GRAPHITE LIBOBJS LTLIBOBJS'
ac_subst_files='language_hooks'
ac_pwd=`pwd`
@ -928,6 +928,22 @@ ac_env_GMPINC_set=${GMPINC+set}
ac_env_GMPINC_value=$GMPINC
ac_cv_env_GMPINC_set=${GMPINC+set}
ac_cv_env_GMPINC_value=$GMPINC
ac_env_PPLLIBS_set=${PPLLIBS+set}
ac_env_PPLLIBS_value=$PPLLIBS
ac_cv_env_PPLLIBS_set=${PPLLIBS+set}
ac_cv_env_PPLLIBS_value=$PPLLIBS
ac_env_PPLINC_set=${PPLINC+set}
ac_env_PPLINC_value=$PPLINC
ac_cv_env_PPLINC_set=${PPLINC+set}
ac_cv_env_PPLINC_value=$PPLINC
ac_env_CLOOGLIBS_set=${CLOOGLIBS+set}
ac_env_CLOOGLIBS_value=$CLOOGLIBS
ac_cv_env_CLOOGLIBS_set=${CLOOGLIBS+set}
ac_cv_env_CLOOGLIBS_value=$CLOOGLIBS
ac_env_CLOOGINC_set=${CLOOGINC+set}
ac_env_CLOOGINC_value=$CLOOGINC
ac_cv_env_CLOOGINC_set=${CLOOGINC+set}
ac_cv_env_CLOOGINC_value=$CLOOGINC
#
# Report the --help message.
@ -1117,6 +1133,10 @@ Some influential environment variables:
CPP 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
CLOOGLIBS How to link CLOOG
CLOOGINC How to find CLOOG include files
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@ -14721,13 +14741,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:14724: $ac_compile\"" >&5)
(eval echo "\"\$as_me:14744: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:14727: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:14747: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:14730: output\"" >&5)
(eval echo "\"\$as_me:14750: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@ -15782,7 +15802,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 15785 "configure"' > conftest.$ac_ext
echo '#line 15805 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -16402,11 +16422,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16405: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16425: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16409: \$? = $ac_status" >&5
echo "$as_me:16429: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16724,11 +16744,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16727: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16747: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16731: \$? = $ac_status" >&5
echo "$as_me:16751: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16829,11 +16849,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16832: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16852: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16836: \$? = $ac_status" >&5
echo "$as_me:16856: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -16884,11 +16904,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16887: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16907: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16891: \$? = $ac_status" >&5
echo "$as_me:16911: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -19681,7 +19701,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19684 "configure"
#line 19704 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -19781,7 +19801,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19784 "configure"
#line 19804 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -23997,6 +24017,21 @@ fi
if test "x${CLOOGLIBS}" != "x" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_cloog 1
_ACEOF
GRAPHITE=graphite.o
fi
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
@ -24825,6 +24860,11 @@ s,@fortran_target_objs@,$fortran_target_objs,;t t
s,@target_cpu_default@,$target_cpu_default,;t t
s,@GMPLIBS@,$GMPLIBS,;t t
s,@GMPINC@,$GMPINC,;t t
s,@PPLLIBS@,$PPLLIBS,;t t
s,@PPLINC@,$PPLINC,;t t
s,@CLOOGLIBS@,$CLOOGLIBS,;t t
s,@CLOOGINC@,$CLOOGINC,;t t
s,@GRAPHITE@,$GRAPHITE,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
/@language_hooks@/r $language_hooks

View File

@ -3883,6 +3883,15 @@ 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(CLOOGLIBS,[How to link CLOOG])
AC_ARG_VAR(CLOOGINC,[How to find CLOOG include files])
if test "x${CLOOGLIBS}" != "x" ; then
AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
fi
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)

View File

@ -338,6 +338,7 @@ Objective-C and Objective-C++ Dialects}.
-fira-coalesce -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-floop-block -floop-interchange -floop-strip-mine @gol
-fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
-fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
@ -6012,6 +6013,81 @@ at @option{-O} and higher.
Perform linear loop transformations on tree. This flag can improve cache
performance and allow further loop optimizations to take place.
@item -floop-interchange
Perform loop interchange transformations on loops. Interchanging two
nested loops switches the inner and outer loops. For example, given a
loop like:
@smallexample
DO J = 1, M
DO I = 1, N
A(J, I) = A(J, I) * C
ENDDO
ENDDO
@end smallexample
loop interchange will transform the loop as if the user had written:
@smallexample
DO I = 1, N
DO J = 1, M
A(J, I) = A(J, I) * C
ENDDO
ENDDO
@end smallexample
which can be beneficial when @code{N} is larger than the caches,
because in Fortran, the elements of an array are stored in memory
contiguously by column, and the original loop iterates over rows,
potentially creating at each access a cache miss. This optimization
applies to all the languages supported by GCC and is not limited to
Fortran.
@item -floop-strip-mine
Perform loop strip mining transformations on loops. Strip mining
splits a loop into two nested loops. The outer loop has strides
equal to the strip size and the inner loop has strides of the
original loop within a strip. For example, given a loop like:
@smallexample
DO I = 1, N
A(I) = A(I) + C
ENDDO
@end smallexample
loop strip mining will transform the loop as if the user had written:
@smallexample
DO II = 1, N, 4
DO I = II, min (II + 4, N)
A(I) = A(I) + C
ENDDO
ENDDO
@end smallexample
This optimization applies to all the languages supported by GCC and is
not limited to Fortran.
@item -floop-block
Perform loop blocking transformations on loops. Blocking strip mines
each loop in the loop nest such that the memory accesses of the
element loops fit inside caches. For example, given a loop like:
@smallexample
DO I = 1, N
DO J = 1, M
A(J, I) = B(I) + C(J)
ENDDO
ENDDO
@end smallexample
loop blocking will transform the loop as if the user had written:
@smallexample
DO II = 1, N, 64
DO JJ = 1, M, 64
DO I = II, min (II + 64, N)
DO J = JJ, min (JJ + 64, M)
A(J, I) = B(I) + C(J)
ENDDO
ENDDO
ENDDO
ENDDO
@end smallexample
which can be beneficial when @code{M} is larger than the caches,
because the innermost loop will iterate over a smaller amount of data
that can be kept in the caches. This optimization applies to all the
languages supported by GCC and is not limited to Fortran.
@item -fcheck-data-deps
@opindex fcheck-data-deps
Compare the results of several data dependence analyzers. This option

View File

@ -40,6 +40,15 @@ Print the tree that is $ in C syntax.
Works only when an inferior is executing.
end
define pgg
set debug_gimple_stmt ($)
end
document pgg
Print the Gimple statement that is $ in C syntax.
Works only when an inferior is executing.
end
define pgs
set debug_generic_stmt ($)
end

View File

@ -38,6 +38,12 @@ DEF_VEC_P(gimple_seq);
DEF_VEC_ALLOC_P(gimple_seq,gc);
DEF_VEC_ALLOC_P(gimple_seq,heap);
/* For each block, the PHI nodes that need to be rewritten are stored into
these vectors. */
typedef VEC(gimple, heap) *gimple_vec;
DEF_VEC_P (gimple_vec);
DEF_VEC_ALLOC_P (gimple_vec, heap);
enum gimple_code {
#define DEFGSCODE(SYM, STRING, STRUCT) SYM,
#include "gimple.def"

4806
gcc/graphite.c Normal file

File diff suppressed because it is too large Load Diff

516
gcc/graphite.h Normal file
View File

@ -0,0 +1,516 @@
/* Gimple Represented as Polyhedra.
Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>.
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/>. */
#include "tree-data-ref.h"
typedef struct graphite_bb *graphite_bb_p;
DEF_VEC_P(graphite_bb_p);
DEF_VEC_ALLOC_P (graphite_bb_p, heap);
DEF_VEC_P(scop_p);
DEF_VEC_ALLOC_P (scop_p, heap);
static inline int scop_nb_loops (scop_p scop);
static inline unsigned scop_nb_params (scop_p scop);
static inline bool scop_contains_loop (scop_p scop, struct loop *loop);
struct graphite_bb
{
basic_block bb;
scop_p scop;
/* The static schedule contains the textual order for every loop layer.
Example:
S0
for (i ...)
{
S1
for (j ...)
{
S2
S3
}
S4
}
S5
for (k ...)
{
S6
S7
for (l ...)
{
S8
}
S9
}
S10
Schedules:
| Depth
BB | 0 1 2
------------
S0 | 0
S1 | 1, 0
S2 | 1, 1, 0
S3 | 1, 1, 1
S4 | 1, 2
S5 | 2
S6 | 3, 0
S7 | 3, 1
S8 | 3, 2, 0
S9 | 3, 3
S10| 4
Normalization rules:
- One SCoP can never contain two bbs with the same schedule timestamp.
- All bbs at the same loop depth have a consecutive ordering (no gaps). */
lambda_vector static_schedule;
/* The iteration domain of this bb. It contains this columns:
- In/Eq: If this line is a equation or inequation.
- For every loop iterator one column.
- One column for every parameter in this SCoP.
- The constant column to add integers to the (in)equations.
Example:
for (i = a - 7*b + 8; i <= 3*a + 13*b + 20; i++)
for (j = 2; j <= 2*i + 5; j++)
for (k = 0; k <= 5; k++)
S (i,j,k)
Loop iterators: i, j, k
Parameters: a, b
(I)eq i j k a b 1
1 1 0 0 -1 7 -8 # i >= a - 7b + 8
1 -1 0 0 3 13 20 # i <= 3a + 13b + 20
1 0 1 0 0 0 -2 # j >= 2
1 2 -1 0 0 0 5 # j <= 2i + 5
1 0 0 1 0 0 0 # k >= 0
1 0 0 -1 0 0 5 # k <= 5
The number of loop iterators may change and is not connected to the
number of loops, that surrounded this bb in the gimple code. */
CloogMatrix *domain;
/* Lists containing the restrictions of the conditional statements
dominating this bb. This bb can only be executed, if all conditions
are true.
Example:
for (i = 0; i <= 20; i++)
{
A
if (2i <= 8)
B
}
So for B there is a additional condition (2i <= 8).
TODO: Add this restrictions to the domain matrix.
List of COND_EXPR and SWITCH_EXPR. A COND_EXPR is true only if the
corresponding element in CONDITION_CASES is not NULL_TREE. For a
SWITCH_EXPR the corresponding element in CONDITION_CASES is a
CASE_LABEL_EXPR. */
VEC (gimple, heap) *conditions;
VEC (gimple, heap) *condition_cases;
/* LOOPS contains for every column in the graphite domain the corresponding
gimple loop. If there exists no corresponding gimple loop LOOPS contains
NULL.
Example:
Original code:
for (i = 0; i <= 20; i++)
for (j = 5; j <= 10; j++)
A
Original domain:
(I)eq i j 1
1 1 0 0 # i >= 0
1 -1 0 20 # i <= 20
1 0 1 0 # j >= 0
1 0 -1 10 # j <= 10
Original loops vector:
0 1
Loop i Loop j
After some changes (Exchange i and j, strip-mine i):
Domain:
(I)eq j ii i k 1
1 0 0 1 0 0 # i >= 0
1 0 0 -1 0 20 # i <= 20
1 1 0 0 0 0 # j >= 0
1 -1 0 0 0 10 # j <= 10
1 0 -1 1 0 0 # ii <= i
1 0 1 -1 0 1 # ii + 1 >= i
1 0 -1 0 2 0 # ii <= 2k
1 0 1 0 -2 0 # ii >= 2k
Iterator vector:
0 1 2 3
Loop j NULL Loop i NULL
Means the original loop i is now at column two of the domain and
loop j in the original loop nest is now at column 0. Column 1 and
3 are emtpy. */
VEC (loop_p, heap) *loops;
lambda_vector compressed_alpha_matrix;
CloogMatrix *dynamic_schedule;
VEC (data_reference_p, heap) *data_refs;
};
#define GBB_BB(GBB) GBB->bb
#define GBB_SCOP(GBB) GBB->scop
#define GBB_STATIC_SCHEDULE(GBB) GBB->static_schedule
#define GBB_DATA_REFS(GBB) GBB->data_refs
#define GBB_ALPHA(GBB) GBB->compressed_alpha_matrix
#define GBB_DYNAMIC_SCHEDULE(GBB) GBB->dynamic_schedule
#define GBB_DOMAIN(GBB) GBB->domain
#define GBB_CONDITIONS(GBB) GBB->conditions
#define GBB_CONDITION_CASES(GBB) GBB->condition_cases
#define GBB_LOOPS(GBB) GBB->loops
/* Return the loop that contains the basic block GBB. */
static inline struct loop *
gbb_loop (struct graphite_bb *gbb)
{
return GBB_BB (gbb)->loop_father;
}
/* Calculate the number of loops around GB in the current SCOP. Only
works if GBB_DOMAIN is built. */
static inline int
gbb_nb_loops (const struct graphite_bb *gb)
{
scop_p scop = GBB_SCOP (gb);
if (GBB_DOMAIN (gb) == NULL)
return 0;
return GBB_DOMAIN (gb)->NbColumns - scop_nb_params (scop) - 2;
}
/* Returns the gimple loop, that corresponds to the loop_iterator_INDEX.
If there is no corresponding gimple loop, we return NULL. */
static inline loop_p
gbb_loop_at_index (graphite_bb_p gb, int index)
{
return VEC_index (loop_p, GBB_LOOPS (gb), index);
}
/* Returns the corresponding loop iterator index for a gimple loop. */
static inline int
gbb_loop_index (graphite_bb_p gb, loop_p loop)
{
int i;
loop_p l;
for (i = 0; VEC_iterate (loop_p, GBB_LOOPS (gb), i, l); i++)
if (loop == l)
return i;
gcc_unreachable();
}
struct loop_to_cloog_loop_str
{
unsigned int loop_num;
unsigned int loop_position; /* The column that represents this loop. */
CloogLoop *cloog_loop;
};
typedef struct name_tree
{
tree t;
const char *name;
struct loop* loop;
} *name_tree;
DEF_VEC_P(name_tree);
DEF_VEC_ALLOC_P (name_tree, heap);
/* A Single Entry, Single Exit region is a part of the CFG delimited
by two edges. */
typedef struct sese
{
edge entry, exit;
} *sese;
#define SESE_ENTRY(S) (S->entry)
#define SESE_EXIT(S) (S->exit)
/* A SCOP is a Static Control Part of the program, simple enough to be
represented in polyhedral form. */
struct scop
{
/* A SCOP is defined as a SESE region. */
sese region;
/* All the basic blocks in this scop. They have extra information
attached to them, in the graphite_bb structure. */
VEC (graphite_bb_p, heap) *bbs;
/* Set for a basic block index when it belongs to this SCOP. */
bitmap bbs_b;
lambda_vector static_schedule;
/* Parameters used within the SCOP. */
VEC (name_tree, heap) *params;
/* A collection of old induction variables*/
VEC (name_tree, heap) *old_ivs;
/* Loops completely contained in the SCOP. */
bitmap loops;
VEC (loop_p, heap) *loop_nest;
/* ??? It looks like a global mapping loop_id -> cloog_loop would work. */
htab_t loop2cloog_loop;
/* CLooG representation of this SCOP. */
CloogProgram *program;
};
#define SCOP_BBS(S) S->bbs
#define SCOP_BBS_B(S) S->bbs_b
#define SCOP_REGION(S) S->region
/* SCOP_ENTRY bb dominates all the bbs of the scop. SCOP_EXIT bb
post-dominates all the bbs of the scop. SCOP_EXIT potentially
contains non affine data accesses, side effect statements or
difficult constructs, and thus is not considered part of the scop,
but just a boundary. SCOP_ENTRY is considered part of the scop. */
#define SCOP_ENTRY(S) (SESE_ENTRY (SCOP_REGION (S))->dest)
#define SCOP_EXIT(S) (SESE_EXIT (SCOP_REGION (S))->dest)
#define SCOP_STATIC_SCHEDULE(S) S->static_schedule
#define SCOP_LOOPS(S) S->loops
#define SCOP_LOOP_NEST(S) S->loop_nest
#define SCOP_PARAMS(S) S->params
#define SCOP_OLDIVS(S) S->old_ivs
#define SCOP_PROG(S) S->program
#define SCOP_LOOP2CLOOG_LOOP(S) S->loop2cloog_loop
#define SCOP_LOOPS_MAPPING(S) S->loops_mapping
extern void debug_scop (scop_p, int);
extern void debug_scops (int);
extern void print_graphite_bb (FILE *, graphite_bb_p, int, int);
extern void debug_gbb (graphite_bb_p, int);
extern void dot_scop (scop_p);
extern void dot_all_scops (void);
extern void debug_clast_stmt (struct clast_stmt *);
extern void debug_loop_vec (graphite_bb_p gb);
extern void debug_oldivs (scop_p);
typedef VEC(name_tree, heap) **loop_iv_stack;
extern void loop_iv_stack_debug (loop_iv_stack);
/* Return the number of gimple loops contained in SCOP. */
static inline int
scop_nb_loops (scop_p scop)
{
return VEC_length (loop_p, SCOP_LOOP_NEST (scop));
}
/* Returns the number of parameters for SCOP. */
static inline unsigned
scop_nb_params (scop_p scop)
{
return VEC_length (name_tree, SCOP_PARAMS (scop));
}
/* Return the dimension of the domains for SCOP. */
static inline int
scop_dim_domain (scop_p scop)
{
return scop_nb_loops (scop) + scop_nb_params (scop) + 1;
}
/* Return the dimension of the domains for GB. */
static inline int
gbb_dim_domain (graphite_bb_p gb)
{
return scop_dim_domain (GBB_SCOP (gb));
}
/* Returns the dimensionality of a loop iteration domain for a given
loop, identified by LOOP_NUM, with respect to SCOP. */
static inline int
loop_domain_dim (unsigned int loop_num, scop_p scop)
{
struct loop_to_cloog_loop_str tmp, *slot;
htab_t tab = SCOP_LOOP2CLOOG_LOOP (scop);
tmp.loop_num = loop_num;
slot = (struct loop_to_cloog_loop_str *) htab_find (tab, &tmp);
/* The loop containing the entry of the scop is not always part of
the SCoP, and it is not registered in SCOP_LOOP2CLOOG_LOOP. */
if (!slot)
return scop_nb_params (scop) + 2;
return cloog_domain_dim (cloog_loop_domain (slot->cloog_loop)) + 2;
}
/* Returns the dimensionality of an enclosing loop iteration domain
with respect to enclosing SCoP for a given data reference REF. */
static inline int
ref_nb_loops (data_reference_p ref)
{
return loop_domain_dim (loop_containing_stmt (DR_STMT (ref))->num, DR_SCOP (ref));
}
/* Returns the dimensionality of a loop iteration vector in a loop
iteration domain for a given loop (identified by LOOP_NUM) with
respect to SCOP. */
static inline int
loop_iteration_vector_dim (unsigned int loop_num, scop_p scop)
{
return loop_domain_dim (loop_num, scop) - 2 - scop_nb_params (scop);
}
/* Checks, if SCOP contains LOOP. */
static inline bool
scop_contains_loop (scop_p scop, struct loop *loop)
{
return bitmap_bit_p (SCOP_LOOPS (scop), loop->num);
}
/* Returns the index of LOOP in the domain matrix for the SCOP. */
static inline int
scop_loop_index (scop_p scop, struct loop *loop)
{
unsigned i;
struct loop *l;
gcc_assert (scop_contains_loop (scop, loop));
for (i = 0; VEC_iterate (loop_p, SCOP_LOOP_NEST (scop), i, l); i++)
if (l == loop)
return i;
gcc_unreachable();
}
/* Return the index of innermost loop that contains the basic block
GBB. */
static inline int
gbb_inner_most_loop_index (scop_p scop, graphite_bb_p gb)
{
return scop_loop_index(scop, gbb_loop (gb));
}
/* Return the outermost loop that contains the loop LOOP. The outer
loops are searched until a sibling for the outer loop is found. */
static struct loop *
outer_most_loop_1 (scop_p scop, struct loop* loop, struct loop* current_outer)
{
return (!scop_contains_loop (scop, loop)) ? current_outer :
(loop->next != NULL) ? loop :
outer_most_loop_1 (scop, loop_outer (loop), loop);
}
/* Return the outermost loop that contains the loop LOOP. */
static struct loop *
outer_most_loop (scop_p scop, struct loop *loop)
{
return outer_most_loop_1 (scop, loop, NULL);
}
/* Return the index of the outermost loop that contains the basic
block BB. */
static inline int
gbb_outer_most_loop_index (scop_p scop, graphite_bb_p gb)
{
return scop_loop_index (scop, outer_most_loop (scop, gbb_loop (gb)));
}
/* Return the loop depth of LOOP in SCOP. */
static inline unsigned int
scop_gimple_loop_depth (scop_p scop, loop_p loop)
{
unsigned int depth = 0;
loop = loop_outer (loop);
while (scop_contains_loop (scop, loop))
{
depth++;
loop = loop_outer (loop);
}
return depth;
}
/* Associate a POLYHEDRON dependence description to two data
references A and B. */
struct data_dependence_polyhedron
{
struct data_reference *a;
struct data_reference *b;
bool reversed_p;
bool loop_carried; /*TODO:konrad get rid of this, make level signed */
signed level;
CloogDomain *polyhedron;
};
#define RDGE_DDP(E) ((struct data_dependence_polyhedron*) ((E)->data))
typedef struct data_dependence_polyhedron *ddp_p;
DEF_VEC_P(ddp_p);
DEF_VEC_ALLOC_P(ddp_p,heap);

View File

@ -147,7 +147,6 @@ static lambda_lattice lambda_lattice_new (int, int, struct obstack *);
static lambda_lattice lambda_lattice_compute_base (lambda_loopnest,
struct obstack *);
static tree find_induction_var_from_exit_cond (struct loop *);
static bool can_convert_to_perfect_nest (struct loop *);
/* Create a new lambda body vector. */
@ -1434,7 +1433,7 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
/* Given a LOOP, find the induction variable it is testing against in the exit
condition. Return the induction variable if found, NULL otherwise. */
static tree
tree
find_induction_var_from_exit_cond (struct loop *loop)
{
gimple expr = get_loop_exit_condition (loop);

View File

@ -39,6 +39,9 @@ DEF_VEC_ALLOC_P (lambda_vector_vec_p, heap);
all vectors are the same length). */
typedef lambda_vector *lambda_matrix;
DEF_VEC_P (lambda_matrix);
DEF_VEC_ALLOC_P (lambda_matrix, heap);
/* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE
matrix. Rather than use floats, we simply keep a single DENOMINATOR that
represents the denominator for every element in the matrix. */
@ -213,6 +216,7 @@ void lambda_loopnest_to_gcc_loopnest (struct loop *,
lambda_loopnest, lambda_trans_matrix,
struct obstack *);
void remove_iv (gimple);
tree find_induction_var_from_exit_cond (struct loop *);
static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
static inline void lambda_vector_mult_const (lambda_vector, lambda_vector, int, int);
@ -374,6 +378,33 @@ lambda_vector_matrix_mult (lambda_vector vect, int m, lambda_matrix mat,
dest[i] += mat[j][i] * vect[j];
}
/* Compare two vectors returning an integer less than, equal to, or
greater than zero if the first argument is considered to be respectively
less than, equal to, or greater than the second.
We use the lexicographic order. */
static inline int
lambda_vector_compare (lambda_vector vec1, int length1, lambda_vector vec2,
int length2)
{
int min_length;
int i;
if (length1 < length2)
min_length = length1;
else
min_length = length2;
for (i = 0; i < min_length; i++)
if (vec1[i] < vec2[i])
return -1;
else if (vec1[i] > vec2[i])
return 1;
else
continue;
return length1 - length2;
}
/* Print out a vector VEC of length N to OUTFILE. */

View File

@ -655,6 +655,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_check_data_deps);
NEXT_PASS (pass_loop_distribution);
NEXT_PASS (pass_linear_transform);
NEXT_PASS (pass_graphite_transforms);
NEXT_PASS (pass_iv_canon);
NEXT_PASS (pass_if_conversion);
NEXT_PASS (pass_vectorize);

View File

@ -1,3 +1,23 @@
2008-09-02 Sebastian Pop <sebastian.pop@amd.com>
Tobias Grosser <grosser@fim.uni-passau.de>
Jan Sjodin <jan.sjodin@amd.com>
Harsha Jagasia <harsha.jagasia@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
Konrad Trifunovic <konrad.trifunovic@inria.fr>
Adrien Eliche <aeliche@isty.uvsq.fr>
Merge from graphite branch.
* gcc.dg/graphite/scop-{0,1,2,3,4,5,6,7,8,9,
10,11,12,13,14,15,16,17,18}.c: New.
* gcc.dg/graphite/graphite.exp: New.
* gcc.dg/graphite/scop-matmult.c: New.
* gcc.dg/graphite/block-0.c: New.
* lib/target-supports.exp (check_effective_target_fgraphite): New.
* gfortran.dg/graphite/block-1.f90: New.
* gfortran.dg/graphite/scop-{1,2}.f: New.
* gfortran.dg/graphite/block-{1,3,4}.f90: New.
* gfortran.dg/graphite/graphite.exp: New.
2008-09-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37327

View File

@ -0,0 +1,25 @@
/* { dg-options "-O -floop-block -fdump-tree-graphite-all" } */
#define N 1000
int toto()
{
int j;
int i;
int a[N];
int b[N];
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[j] = a[i] + 1;
return a[0];
}
main()
{
return toto();
}
/* { dg-final { scan-tree-dump-times "Loop blocked" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,31 @@
/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
#define MAX 8192
int main()
{
int i, j;
int sum = 0;
int A[MAX * MAX];
int B[MAX * MAX];
for (i = 0; i < MAX; i++)
for (j = 0; j < MAX; j++)
{
A[i*MAX + j] = j;
B[i*MAX + j] = j;
}
for (i = 0; i < MAX; i++)
for (j = 0; j < MAX; j++)
A[i*MAX + j] += B[j*MAX + i];
for(i = 0; i < MAX; i++)
for(j = 0; j < MAX; j++)
sum += A[i*MAX + j];
return sum;
}
/* { dg-final { scan-tree-dump-times "Loop blocked" 3 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,48 @@
# Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
# This program 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 of the License, or
# (at your option) any later version.
#
# This program 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/>.
# GCC testsuite that uses the `dg.exp' driver.
# Load support procs.
load_lib gcc-dg.exp
if ![check_effective_target_fgraphite] {
return
}
# The default action for a test is 'compile'. Save current default.
global dg-do-what-default
set save-dg-do-what-default ${dg-do-what-default}
set dg-do-what-default compile
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
set DEFAULT_CFLAGS " -ansi -pedantic-errors"
}
# Initialize `dg'.
dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
# Clean up.
set dg-do-what-default ${save-dg-do-what-default}
# All done.
dg-finish

View File

@ -0,0 +1,24 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
int foo (void);
void bar (void);
int toto()
{
/* Scop 1. */
int i, j, k;
int a[100][100];
int b[100];
int N = foo ();
for (i = 0; i < 2*N+ 100; i++)
for (j = 0; j < 200; j++)
a[j][i] = a[j+1][10] + 2;
return a[3][5] + b[1];
/* End scop 1. */
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,33 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
b[i] = b[i-1] + 2;
bar ();
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
b[i] = a[i-1][i] + 2;
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,33 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
if (i * 2 == i + 8)
bar ();
else
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
a[i][i] = 2;
}
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-5] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,34 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i,j, b;
int a[100];
if (i == 20)
{
for (j = 0; j <= 20; j++)
a[j] = b + i;
b = 3;
bar();
}
else
{
if (i == 30)
{
for (j = 0; j <= 20; j++)
a[j] = b + i;
b = 5;
}
}
for (j = 0; j <= 20; j++)
a[j] = b + i;
return a[b];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,38 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i,j, b;
int a[100];
switch (i)
{
case 5:
for (j = 0; j <= 20; j++)
a[j] = b + i + 12;
break;
case 8:
for (j = 0; j <= 20; j++)
a[j] = b + i + 122;
break;
case 15:
for (j = 0; j <= 20; j++)
a[j] = b + i + 12;
break;
case 18:
for (j = 0; j <= 20; j++)
a[j] = b + i + 4;
break;
default:
for (j = 0; j <= 20; j++)
a[j] = b + i + 3;
}
return a[b];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 5" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,43 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i,j, b;
int a[100];
if (i == 20)
{
b = 3;
goto B;
}
else
{
if (i == 30)
{
a[i] = b;
for (j = 0; j <= 20; j++)
a[j] = b + i;
B:
for (j = 0; j <= 20; j++)
a[j+b] = b + i;
bar ();
}
else
{
a[i] = b + 3;
}
}
return a[b];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,27 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i,j, b;
int a[100];
for (j = 0; j <= 20; j++)
{
a[j] = b + i;
if (j * i == b)
break;
a[j+b] = b + i;
}
a[i] = b + 3;
return a[b];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,52 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
# define EXTERN(type, array) extern type array[]
typedef unsigned char uch;
typedef unsigned short ush;
EXTERN(uch, window);
EXTERN(ush, prev);
#ifndef WSIZE
# define WSIZE 0x8000
#endif
#define MIN_MATCH 3
#define MAX_MATCH 258
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
#define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
#define near
typedef unsigned IPos;
unsigned near max_chain_length;
extern unsigned near strstart;
unsigned int near prev_length;
#define NIL 0
unsigned near good_match;
int near nice_match;
#define WMASK (WSIZE-1)
int longest_match(IPos cur_match)
{
unsigned chain_length = max_chain_length;
register uch *scan = window + strstart;
register uch *match;
register int len;
int best_len = prev_length;
IPos limit = strstart > (IPos)MAX_DIST ? strstart - (IPos)MAX_DIST : NIL;
register uch *strend = window + strstart + MAX_MATCH;
register uch scan_end = scan[best_len];
if (prev_length >= good_match) {
}
do {
if (match[best_len] != scan_end ||
*++match != scan[1]) continue;
do {
} while (*++scan == *++match && *++scan == *++match &&
scan < strend);
len = MAX_MATCH - (int)(strend - scan);
if (len > best_len) {
best_len = len;
if (len >= nice_match) break;
}
} while ((cur_match = prev[cur_match & WMASK]) > limit
&& --chain_length != 0);
return best_len;
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,25 @@
/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
#define N 10000
void foo (int);
int test ()
{
int a[N][N];
int b[N][N];
unsigned i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[i][j] = i*j;
for (j = 1; j < N; j++)
for (i = 0; i < N; i++)
a[i][j] = a[i][j-1] + b[i][j];
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
foo (a[i][j]);
}
/* Interchange is legal for loops 0 and 1 of the first two SCoPs */
/* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,24 @@
/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
#define N 10000
void foo (int);
int test ()
{
int a[N][N];
unsigned i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[i][j] = i*j;
for (i = 1; i < N; i++)
for (j = 1; j < (N-1) ; j++)
a[i][j] = a[i-1][j+1] * a[i-1][j+1]/2;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
foo (a[i][j]);
}
/* Interchange is not legal for loops 0 and 1 of SCoP 2. */
/* { dg-final { scan-tree-dump-times "Interchange not valid for loops 0 and 1:" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,26 @@
/* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
#define N 24
#define M 1000
float A[1000][1000], B[1000][1000], C[1000][1000];
void test (void)
{
int i, j, k;
/* These loops contain too few iterations for being strip-mined by 64. */
for (i = 0; i < 24; i++)
for (j = 0; j < 24; j++)
for (k = 0; k < 24; k++)
A[i][j] += B[i][k] * C[k][j];
/* These loops should still be strip mined. */
for (i = 0; i < 1000; i++)
for (j = 0; j < 1000; j++)
for (k = 0; k < 1000; k++)
A[i][j] += B[i][k] * C[k][j];
}
/* { dg-final { scan-tree-dump-times "Strip Mining is not profitable" 3 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,41 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
for (k = 1; k < 100; k++)
a[j][k] = a[j+1][i-1] + 2;
b[i] = b[i-1] + 2;
bar ();
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
b[i] = b[i-1] + 2;
bar ();
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
b[i] = a[i-1][i] + 2;
for (j = 1; j < 100; j++)
a[j][i] = a[j+1][i-1] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 4" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,30 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 80; j++)
a[j][i] = a[j+1][2*i-1*j] + 12;
b[i] = b[i-1] + 10;
for (j = 1; j < 60; j++)
a[j][i] = a[j+1][i-1] + 8;
if (i == 23)
b[i] = a[i-1][i] + 6;
for (j = 1; j < 40; j++)
a[j][i] = a[j+1][i-1] + 4;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,31 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 80; j++)
a[j][i] = a[j+1][2*i-1*j] + 12;
b[i] = b[i-1] + 10;
for (j = 1; j < 60; j++)
a[j][i] = a[j+1][i-1] + 8;
bar ();
if (i == 23)
b[i] = a[i-1][i] + 6;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,37 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar ();
int toto()
{
int i,j, b;
int a[100];
if (i == 20)
{
for (j = 0; j <= 20; j++)
a[j] = b + i;
b = 3;
bar();
}
else
{
if (i == 30)
{
for (j = 0; j <= 20; j++)
a[j] = b + i;
b = 5;
}
else
{
for (j = 0; j <= 20; j++)
a[j] = b + i;
b = 8;
}
}
return a[b];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,33 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
if (i * 2 == i + 8)
b[i+k] = b[i+k-1] + 2;
else
{
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-1] + 2;
bar ();
}
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-5] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,33 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
if (i * 2 == i + 8)
{
bar ();
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
}
else
a[i][i] = 2;
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-5] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,33 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
int bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
if (i * 2 == i + 8)
{
for (j = 1; j < 100; j++)
if (bar ())
b[i+j] = b[i+j-1] + 2;
}
else
a[i][i] = 2;
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-5] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,29 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
void bar (void);
int toto()
{
int i, j, k;
int a[100][100];
int b[100];
for (i = 1; i < 100; i++)
{
for (j = 1; j < 100; j++)
b[i+j] = b[i+j-1] + 2;
if (i * 2 == i + 8)
bar ();
else
a[i][i] = 2;
for (k = 1; k < 100; k++)
b[i+k] = b[i+k-5] + 2;
}
return a[3][5] + b[1];
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,20 @@
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
float A[1000][1000], B[1000][1000], C[1000][1000];
/* Multiply two n x n matrices A and B and store the result in C. */
void matmult (int n)
{
int i,j,k;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = 0; k < n; k++)
A[i][j] += B[i][k] * C[k][j];
}
/* This one fails because the number of iterations cannot be
determined anymore for the outermost loop. */
/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */

View File

@ -0,0 +1,14 @@
! { dg-options "-O2 -floop-block -fdump-tree-graphite-all" }
subroutine matrix_multiply(a,b,c,n)
real(8), dimension(n,n) :: a,b,c
! The following code is disabled for the moment.
! c=0.d0
end subroutine matrix_multiply
! { dg-final { scan-tree-dump-times "Loop blocked" 2 "graphite" { xfail *-*-* } } }
! { dg-final { cleanup-tree-dump "graphite" } }

View File

@ -0,0 +1,22 @@
! { dg-options "-O2 -floop-block -fdump-tree-graphite-all" }
SUBROUTINE MATRIX_MUL_UNROLLED (A, B, C, L, M, N)
DIMENSION A(L,M), B(M,N), C(L,N)
DO 100 K = 1, N
DO 100 I = 1, L
C(I,K) = 0.
100 CONTINUE
DO 110 J = 1, M, 4
DO 110 K = 1, N
DO 110 I = 1, L
C(I,K) = C(I,K) + A(I,J) * B(J,K)
$ + A(I,J+1) * B(J+1,K) + A(I,J+2) * B(J+2,K)
$ + A(I,J+3) * B(J+3,K)
110 CONTINUE
RETURN
END
! { dg-final { scan-tree-dump-times "Loop blocked" 3 "graphite" { xfail { "*-*-*" } } } }
! { dg-final { cleanup-tree-dump "graphite" } }

View File

@ -0,0 +1,19 @@
! { dg-options "-O2 -floop-block -fdump-tree-graphite-all" }
subroutine matrix_multiply(a,b,c,n)
real(8), dimension(n,n) :: a,b,c
do i = 1,n
do j = 1,n
do k = 1,n
c(j,i) = c(j,i) + a(k,i) * b(j,k)
enddo
enddo
enddo
end subroutine matrix_multiply
! { dg-final { scan-tree-dump-times "Loop blocked" 2 "graphite" { xfail *-*-* } } }
! { dg-final { cleanup-tree-dump "graphite" } }

View File

@ -0,0 +1,22 @@
! { dg-options "-O2 -floop-block -fdump-tree-graphite-all" }
subroutine matrix_multiply(a,b,c,n)
real(8), dimension(n,n) :: a,b,c
! The following code is disabled for the moment.
! c=0.d0
do i = 1,n
do j = 1,n
do k = 1,n
c(j,i) = c(j,i) + a(k,i) * b(j,k)
enddo
enddo
enddo
end subroutine matrix_multiply
! { dg-final { scan-tree-dump-times "Loop blocked" 2 "graphite" { xfail *-*-* } } }
! { dg-final { cleanup-tree-dump "graphite" } }

View File

@ -0,0 +1,48 @@
# Copyright (C) 2008 Free Software Foundation, Inc.
# This program 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 of the License, or
# (at your option) any later version.
#
# This program 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/>.
# GCC testsuite that uses the `dg.exp' driver.
# Load support procs.
load_lib gfortran-dg.exp
if ![check_effective_target_fgraphite] {
return
}
# The default action for a test is 'compile'. Save current default.
global dg-do-what-default
set save-dg-do-what-default ${dg-do-what-default}
set dg-do-what-default compile
# If a testcase doesn't have special options, use these.
set DEFAULT_GRAPHITE_FLAGS ""
# Initialize `dg'.
dg-init
# Main loop.
gfortran-dg-runtest [lsort \
[glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] $DEFAULT_GRAPHITE_FLAGS
gfortran-dg-runtest [lsort \
[glob -nocomplain $srcdir/$subdir/g77/*.\[fF\] ] ] $DEFAULT_GRAPHITE_FLAGS
# Clean up.
set dg-do-what-default ${save-dg-do-what-default}
# All done.
dg-finish

View File

@ -0,0 +1,13 @@
C { dg-options "-O2 -fgraphite" }
dimension p1(2),t(6,4),b1(2),b2(2),al1(2),al2(2),g1(2),g2(2)
save
if(nlin.eq.0) then
do 20 l=1,2
ll=2*l
b2(l)=t(6-ll,ll-1)*t(6-ll,ll-1)+t(7-ll,ll-1)*t(7-ll,ll-1)
write(*,*) b2(l)
20 continue
endif
end

View File

@ -562,6 +562,15 @@ proc check_effective_target_tls_runtime {} {
}]
}
# Return 1 if compilation with -fgraphite is error-free for trivial
# code, 0 otherwise.
proc check_effective_target_fgraphite {} {
return [check_no_compiler_messages fgraphite object {
void foo (void) { }
} "-fgraphite"]
}
# Return 1 if compilation with -fopenmp is error-free for trivial
# code, 0 otherwise.

View File

@ -125,6 +125,7 @@ DEFTIMEVAR (TV_TREE_LOOP_UNSWITCH , "tree loop unswitching")
DEFTIMEVAR (TV_COMPLETE_UNROLL , "complete unrolling")
DEFTIMEVAR (TV_TREE_PARALLELIZE_LOOPS, "tree parallelize loops")
DEFTIMEVAR (TV_TREE_VECTORIZATION , "tree vectorization")
DEFTIMEVAR (TV_GRAPHITE_TRANSFORMS , "GRAPHITE loop transforms")
DEFTIMEVAR (TV_TREE_LINEAR_TRANSFORM , "tree loop linear")
DEFTIMEVAR (TV_TREE_LOOP_DISTRIBUTION, "tree loop distribution")
DEFTIMEVAR (TV_CHECK_DATA_DEPS , "tree check data dependences")

View File

@ -6140,7 +6140,7 @@ print_loops (FILE *file, int verbosity)
{
basic_block bb;
bb = BASIC_BLOCK (NUM_FIXED_BLOCKS);
bb = ENTRY_BLOCK_PTR;
if (bb && bb->loop_father)
print_loop_and_siblings (file, bb->loop_father, 0, verbosity);
}

View File

@ -1407,3 +1407,26 @@ scev_direction (const_tree chrec)
else
return EV_DIR_GROWS;
}
/* Iterates over all the components of SCEV, and calls CBCK. */
void
for_each_scev_op (tree *scev, bool (*cbck) (tree *, void *), void *data)
{
switch (TREE_CODE_LENGTH (TREE_CODE (*scev)))
{
case 3:
for_each_scev_op (&TREE_OPERAND (*scev, 2), cbck, data);
case 2:
for_each_scev_op (&TREE_OPERAND (*scev, 1), cbck, data);
case 1:
for_each_scev_op (&TREE_OPERAND (*scev, 0), cbck, data);
default:
cbck (scev, data);
break;
}
}

View File

@ -70,6 +70,7 @@ extern tree evolution_part_in_loop_num (tree, unsigned);
extern tree hide_evolution_in_other_loops_than_loop (tree, unsigned);
extern tree reset_evolution_in_loop (unsigned, tree, tree);
extern tree chrec_merge (tree, tree);
extern void for_each_scev_op (tree *, bool (*) (tree *, void *), void *);
/* Observers. */
extern bool eq_evolutions_p (const_tree, const_tree);

View File

@ -1224,7 +1224,7 @@ disjoint_objects_p (tree a, tree b)
/* Returns false if we can prove that data references A and B do not alias,
true otherwise. */
static bool
bool
dr_may_alias_p (const struct data_reference *a, const struct data_reference *b)
{
const_tree addr_a = DR_BASE_ADDRESS (a);
@ -3303,6 +3303,21 @@ access_functions_are_affine_or_constant_p (const struct data_reference *a,
return true;
}
/* Return true if we can create an affine data-ref for OP in STMT. */
bool
stmt_simple_memref_p (struct loop *loop, gimple stmt, tree op)
{
data_reference_p dr;
dr = create_data_ref (loop, op, stmt, true);
if (!access_functions_are_affine_or_constant_p (dr, loop))
return false;
free_data_ref (dr);
return true;
}
/* Initializes an equation for an OMEGA problem using the information
contained in the ACCESS_FUN. Returns true when the operation
succeeded.
@ -4069,9 +4084,9 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
/* Stores the data references in STMT to DATAREFS. If there is an unanalyzable
reference, returns false, otherwise returns true. NEST is the outermost
loop of the loop nest in that the references should be analyzed. */
loop of the loop nest in which the references should be analyzed. */
static bool
bool
find_data_references_in_stmt (struct loop *nest, gimple stmt,
VEC (data_reference_p, heap) **datarefs)
{
@ -4116,7 +4131,7 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt,
TODO: This function should be made smarter so that it can handle address
arithmetic as if they were array accesses, etc. */
static tree
tree
find_data_references_in_loop (struct loop *loop,
VEC (data_reference_p, heap) **datarefs)
{
@ -4644,6 +4659,7 @@ create_rdg_edge_for_ddr (struct graph *rdg, ddr_p ddr)
e->data = XNEW (struct rdg_edge);
RDGE_LEVEL (e) = level;
RDGE_RELATION (e) = ddr;
/* Determines the type of the data dependence. */
if (DR_IS_READ (dra) && DR_IS_READ (drb))
@ -4676,6 +4692,7 @@ create_rdg_edges_for_scalar (struct graph *rdg, tree def, int idef)
e = add_edge (rdg, idef, use);
e->data = XNEW (struct rdg_edge);
RDGE_TYPE (e) = flow_dd;
RDGE_RELATION (e) = NULL;
}
}
@ -4701,7 +4718,7 @@ create_rdg_edges (struct graph *rdg, VEC (ddr_p, heap) *ddrs)
/* Build the vertices of the reduced dependence graph RDG. */
static void
void
create_rdg_vertices (struct graph *rdg, VEC (gimple, heap) *stmts)
{
int i, j;
@ -4821,6 +4838,21 @@ hash_stmt_vertex_del (void *e)
free (e);
}
/* Build the Reduced Dependence Graph (RDG) with one vertex per
statement of the loop nest, and one edge per data dependence or
scalar dependence. */
struct graph *
build_empty_rdg (int n_stmts)
{
int nb_data_refs = 10;
struct graph *rdg = new_graph (n_stmts);
rdg->indices = htab_create (nb_data_refs, hash_stmt_vertex_info,
eq_stmt_vertex_info, hash_stmt_vertex_del);
return rdg;
}
/* Build the Reduced Dependence Graph (RDG) with one vertex per
statement of the loop nest, and one edge per data dependence or
scalar dependence. */
@ -4842,21 +4874,23 @@ build_rdg (struct loop *loop)
&dependence_relations);
if (!known_dependences_p (dependence_relations))
goto end_rdg;
{
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
VEC_free (gimple, heap, stmts);
return rdg;
}
stmts_from_loop (loop, &stmts);
rdg = new_graph (VEC_length (gimple, stmts));
rdg = build_empty_rdg (VEC_length (gimple, stmts));
rdg->indices = htab_create (nb_data_refs, hash_stmt_vertex_info,
eq_stmt_vertex_info, hash_stmt_vertex_del);
create_rdg_vertices (rdg, stmts);
create_rdg_edges (rdg, dependence_relations);
end_rdg:
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
VEC_free (gimple, heap, stmts);
return rdg;
}

View File

@ -96,6 +96,8 @@ struct dr_alias
bitmap vops;
};
typedef struct scop *scop_p;
/* Each vector of the access matrix represents a linear access
function for a subscript. First elements correspond to the
leftmost indices, ie. for a[i][j] the first vector corresponds to
@ -170,16 +172,20 @@ struct data_reference
/* Behavior of the memory reference in the innermost loop. */
struct innermost_loop_behavior innermost;
/* Decomposition to indices for alias analysis. */
/* Subscripts of this data reference. */
struct indices indices;
/* Alias information for the data reference. */
struct dr_alias alias;
/* The SCoP in which the data reference was analyzed. */
scop_p scop;
/* Matrix representation for the data access functions. */
struct access_matrix *access_matrix;
};
#define DR_SCOP(DR) (DR)->scop
#define DR_STMT(DR) (DR)->stmt
#define DR_REF(DR) (DR)->ref
#define DR_BASE_OBJECT(DR) (DR)->indices.base_object
@ -373,6 +379,8 @@ void dr_analyze_innermost (struct data_reference *);
extern bool compute_data_dependences_for_loop (struct loop *, bool,
VEC (data_reference_p, heap) **,
VEC (ddr_p, heap) **);
extern tree find_data_references_in_loop (struct loop *,
VEC (data_reference_p, heap) **);
extern void print_direction_vector (FILE *, lambda_vector, int);
extern void print_dir_vectors (FILE *, VEC (lambda_vector, heap) *, int);
extern void print_dist_vectors (FILE *, VEC (lambda_vector, heap) *, int);
@ -392,10 +400,18 @@ extern void free_dependence_relation (struct data_dependence_relation *);
extern void free_dependence_relations (VEC (ddr_p, heap) *);
extern void free_data_ref (data_reference_p);
extern void free_data_refs (VEC (data_reference_p, heap) *);
extern bool find_data_references_in_stmt (struct loop *, gimple,
VEC (data_reference_p, heap) **);
struct data_reference *create_data_ref (struct loop *, tree, gimple, bool);
bool find_loop_nest (struct loop *, VEC (loop_p, heap) **);
void compute_all_dependences (VEC (data_reference_p, heap) *,
VEC (ddr_p, heap) **, VEC (loop_p, heap) *, bool);
extern bool find_loop_nest (struct loop *, VEC (loop_p, heap) **);
extern void compute_all_dependences (VEC (data_reference_p, heap) *,
VEC (ddr_p, heap) **, VEC (loop_p, heap) *,
bool);
extern void create_rdg_vertices (struct graph *, VEC (gimple, heap) *);
extern bool dr_may_alias_p (const struct data_reference *,
const struct data_reference *);
extern bool stmt_simple_memref_p (struct loop *, gimple, tree);
/* Return true when the DDR contains two data references that have the
same access functions. */
@ -511,15 +527,21 @@ typedef struct rdg_edge
/* Type of the dependence. */
enum rdg_dep_type type;
/* Levels of the dependence: the depth of the loops that
carry the dependence. */
/* Levels of the dependence: the depth of the loops that carry the
dependence. */
unsigned level;
/* Dependence relation between data dependences, NULL when one of
the vertices is a scalar. */
ddr_p relation;
} *rdg_edge_p;
#define RDGE_TYPE(E) ((struct rdg_edge *) ((E)->data))->type
#define RDGE_LEVEL(E) ((struct rdg_edge *) ((E)->data))->level
#define RDGE_RELATION(E) ((struct rdg_edge *) ((E)->data))->relation
struct graph *build_rdg (struct loop *);
struct graph *build_empty_rdg (int);
void free_rdg (struct graph *);
/* Return the index of the variable VAR in the LOOP_NEST array. */
@ -561,7 +583,21 @@ void lambda_collect_parameters (VEC (data_reference_p, heap) *,
bool lambda_compute_access_matrices (VEC (data_reference_p, heap) *,
VEC (tree, heap) *, int);
/* In tree-data-refs.c */
/* In tree-data-ref.c */
void split_constant_offset (tree , tree *, tree *);
/* Strongly connected components of the reduced data dependence graph. */
typedef struct rdg_component
{
int num;
VEC (int, heap) *vertices;
} *rdgc;
DEF_VEC_P (rdgc);
DEF_VEC_ALLOC_P (rdgc, heap);
DEF_VEC_P (bitmap);
DEF_VEC_ALLOC_P (bitmap, heap);
#endif /* GCC_TREE_DATA_REF_H */

View File

@ -786,6 +786,8 @@ extern gimple get_single_def_stmt_with_phi (tree, gimple);
/* In tree-phinodes.c */
extern void reserve_phi_args_for_new_edge (basic_block);
extern void add_phi_node_to_bb (gimple phi, basic_block bb);
extern gimple make_phi_node (tree var, int len);
extern gimple create_phi_node (tree, basic_block);
extern void add_phi_arg (gimple, tree, edge);
extern void remove_phi_args (edge);
@ -1023,6 +1025,7 @@ bool gimple_duplicate_loop_to_header_edge (struct loop *, edge,
int);
struct loop *slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *, edge);
void rename_variables_in_loop (struct loop *);
void rename_variables_in_bb (basic_block bb);
struct loop *tree_ssa_loop_version (struct loop *, tree,
basic_block *);
tree expand_simple_operations (tree);
@ -1116,6 +1119,10 @@ bool sra_type_can_be_decomposed_p (tree);
/* In tree-loop-linear.c */
extern void linear_transform_loops (void);
extern unsigned perfect_loop_nest_depth (struct loop *);
/* In graphite.c */
extern void graphite_transform_loops (void);
/* In tree-data-ref.c */
extern void tree_check_data_deps (void);

View File

@ -130,12 +130,6 @@ static bitmap mem_syms_to_rename;
released after we finish updating the SSA web. */
static bitmap names_to_release;
/* For each block, the PHI nodes that need to be rewritten are stored into
these vectors. */
typedef VEC(gimple, heap) *gimple_vec;
DEF_VEC_P (gimple_vec);
DEF_VEC_ALLOC_P (gimple_vec, heap);
static VEC(gimple_vec, heap) *phis_to_rewrite;
/* The bitmap of non-NULL elements of PHIS_TO_REWRITE. */

View File

@ -710,17 +710,6 @@ rdg_flag_loop_exits (struct graph *rdg, bitmap loops, bitmap partition,
}
}
/* Strongly connected components of the reduced data dependence graph. */
typedef struct rdg_component
{
int num;
VEC (int, heap) *vertices;
} *rdgc;
DEF_VEC_P (rdgc);
DEF_VEC_ALLOC_P (rdgc, heap);
/* Flag all the nodes of RDG containing memory accesses that could
potentially belong to arrays already accessed in the current
PARTITION. */
@ -864,9 +853,6 @@ rdg_build_components (struct graph *rdg, VEC (int, heap) *starting_vertices,
BITMAP_FREE (saved_components);
}
DEF_VEC_P (bitmap);
DEF_VEC_ALLOC_P (bitmap, heap);
/* Aggregate several components into a useful partition that is
registered in the PARTITIONS vector. Partitions will be
distributed in different loops. */

View File

@ -272,7 +272,7 @@ try_interchange_loops (lambda_trans_matrix trans,
/* Return the number of nested loops in LOOP_NEST, or 0 if the loops
are not perfectly nested. */
static unsigned int
unsigned int
perfect_loop_nest_depth (struct loop *loop_nest)
{
struct loop *temp;

View File

@ -322,6 +322,7 @@ extern struct gimple_opt_pass pass_iv_canon;
extern struct gimple_opt_pass pass_scev_cprop;
extern struct gimple_opt_pass pass_empty_loop;
extern struct gimple_opt_pass pass_record_bounds;
extern struct gimple_opt_pass pass_graphite_transforms;
extern struct gimple_opt_pass pass_if_conversion;
extern struct gimple_opt_pass pass_loop_distribution;
extern struct gimple_opt_pass pass_vectorize;

View File

@ -202,10 +202,9 @@ ideal_phi_node_len (int len)
return new_len;
}
/* Return a PHI node with LEN argument slots for variable VAR. */
static gimple
gimple
make_phi_node (tree var, int len)
{
gimple phi;
@ -348,15 +347,12 @@ reserve_phi_args_for_new_edge (basic_block bb)
}
}
/* Adds PHI to BB. */
/* Create a new PHI node for variable VAR at basic block BB. */
gimple
create_phi_node (tree var, basic_block bb)
void
add_phi_node_to_bb (gimple phi, basic_block bb)
{
gimple_stmt_iterator gsi;
gimple phi = make_phi_node (var, EDGE_COUNT (bb->preds));
/* Add the new PHI node to the list of PHI nodes for block BB. */
if (phi_nodes (bb) == NULL)
set_phi_nodes (bb, gimple_seq_alloc ());
@ -367,6 +363,16 @@ create_phi_node (tree var, basic_block bb)
/* Associate BB to the PHI node. */
gimple_set_bb (phi, bb);
}
/* Create a new PHI node for variable VAR at basic block BB. */
gimple
create_phi_node (tree var, basic_block bb)
{
gimple phi = make_phi_node (var, EDGE_COUNT (bb->preds));
add_phi_node_to_bb (phi, bb);
return phi;
}

View File

@ -5021,18 +5021,38 @@ create_new_ivs (struct ivopts_data *data, struct iv_ca *set)
}
}
/* Returns the phi-node in BB with result RESULT. */
static gimple
get_phi_with_result (basic_block bb, tree result)
{
gimple_stmt_iterator i = gsi_start_phis (bb);
for (; !gsi_end_p (i); gsi_next (&i))
if (gimple_phi_result (gsi_stmt (i)) == result)
return gsi_stmt (i);
gcc_unreachable ();
return NULL;
}
/* Removes statement STMT (real or a phi node). If INCLUDING_DEFINED_NAME
is true, remove also the ssa name defined by the statement. */
static void
remove_statement (gimple stmt, bool including_defined_name)
{
gimple_stmt_iterator bsi = gsi_for_stmt (stmt);
if (gimple_code (stmt) == GIMPLE_PHI)
remove_phi_node (&bsi, including_defined_name);
{
gimple bb_phi = get_phi_with_result (gimple_bb (stmt),
gimple_phi_result (stmt));
gimple_stmt_iterator bsi = gsi_for_stmt (bb_phi);
remove_phi_node (&bsi, including_defined_name);
}
else
{
gimple_stmt_iterator bsi = gsi_for_stmt (stmt);
gsi_remove (&bsi, true);
release_defs (stmt);
}

View File

@ -287,6 +287,49 @@ struct gimple_opt_pass pass_linear_transform =
}
};
/* GRAPHITE optimizations. */
static unsigned int
graphite_transforms (void)
{
if (!current_loops)
return 0;
graphite_transform_loops ();
return 0;
}
static bool
gate_graphite_transforms (void)
{
/* Enable -fgraphite pass if any one of the graphite optimization flags
is turned on. */
if (flag_loop_block || flag_loop_interchange || flag_loop_strip_mine)
flag_graphite = 1;
return flag_graphite != 0;
}
struct gimple_opt_pass pass_graphite_transforms =
{
{
GIMPLE_PASS,
"graphite", /* name */
gate_graphite_transforms, /* gate */
graphite_transforms, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
TV_GRAPHITE_TRANSFORMS, /* tv_id */
PROP_cfg | PROP_ssa, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_verify_loops /* todo_flags_finish */
}
};
/* Check the correctness of the data dependence analyzers. */
static unsigned int

View File

@ -201,7 +201,7 @@ rename_use_op (use_operand_p op_p)
/* Renames the variables in basic block BB. */
static void
void
rename_variables_in_bb (basic_block bb)
{
gimple_stmt_iterator gsi;