You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

474 lines
22 KiB

--- gcc/Makefile.in.jj 2012-12-13 17:09:20.000000000 +0100
+++ gcc/Makefile.in 2012-12-14 11:45:22.585670055 +0100
@@ -1022,7 +1022,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# and the system's installed libraries.
LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
$(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
-BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
+BACKENDLIBS = $(if $(CLOOGLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
$(ZLIB)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
@@ -3442,6 +3442,15 @@ $(common_out_object_file): $(common_out_
$(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(OPTS_H) $(TM_H) $(TM_P_H) $(MACHMODE_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
$< $(OUTPUT_OPTION)
+
+graphite%.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite.o : \
+ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
+graphite%.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
+graphite.o : \
+ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS))
#
# Generate header and source files from the machine description,
# and compile them.
--- gcc/graphite-poly.h.jj 2012-12-13 11:31:27.000000000 +0100
+++ gcc/graphite-poly.h 2012-12-14 13:41:41.970800726 +0100
@@ -22,6 +22,369 @@ along with GCC; see the file COPYING3.
#ifndef GCC_GRAPHITE_POLY_H
#define GCC_GRAPHITE_POLY_H
+#include <isl/aff.h>
+#include <isl/schedule.h>
+#include <isl/ilp.h>
+#include <isl/flow.h>
+#include <isl/options.h>
+#include <cloog/isl/cloog.h>
+#include <dlfcn.h>
+#define DYNSYMS \
+ DYNSYM (clast_pprint); \
+ DYNSYM (cloog_clast_create_from_input); \
+ DYNSYM (cloog_clast_free); \
+ DYNSYM (cloog_domain_from_isl_set); \
+ DYNSYM (cloog_input_alloc); \
+ DYNSYM (cloog_isl_state_malloc); \
+ DYNSYM (cloog_options_free); \
+ DYNSYM (cloog_options_malloc); \
+ DYNSYM (cloog_scattering_from_isl_map); \
+ DYNSYM (cloog_state_free); \
+ DYNSYM (cloog_union_domain_add_domain); \
+ DYNSYM (cloog_union_domain_alloc); \
+ DYNSYM (cloog_union_domain_set_name); \
+ DYNSYM (isl_aff_add_coefficient_si); \
+ DYNSYM (isl_aff_add_constant); \
+ DYNSYM (isl_aff_free); \
+ DYNSYM (isl_aff_get_coefficient); \
+ DYNSYM (isl_aff_get_space); \
+ DYNSYM (isl_aff_mod); \
+ DYNSYM (isl_aff_set_coefficient_si); \
+ DYNSYM (isl_aff_set_constant_si); \
+ DYNSYM (isl_aff_zero_on_domain); \
+ DYNSYM (isl_band_free); \
+ DYNSYM (isl_band_get_children); \
+ DYNSYM (isl_band_get_partial_schedule); \
+ DYNSYM (isl_band_has_children); \
+ DYNSYM (isl_band_list_free); \
+ DYNSYM (isl_band_list_get_band); \
+ DYNSYM (isl_band_list_get_ctx); \
+ DYNSYM (isl_band_list_n_band); \
+ DYNSYM (isl_band_member_is_zero_distance); \
+ DYNSYM (isl_band_n_member); \
+ DYNSYM (isl_basic_map_add_constraint); \
+ DYNSYM (isl_basic_map_project_out); \
+ DYNSYM (isl_basic_map_universe); \
+ DYNSYM (isl_constraint_set_coefficient); \
+ DYNSYM (isl_constraint_set_coefficient_si); \
+ DYNSYM (isl_constraint_set_constant); \
+ DYNSYM (isl_constraint_set_constant_si); \
+ DYNSYM (isl_ctx_alloc); \
+ DYNSYM (isl_ctx_free); \
+ DYNSYM (isl_equality_alloc); \
+ DYNSYM (isl_id_alloc); \
+ DYNSYM (isl_id_copy); \
+ DYNSYM (isl_id_free); \
+ DYNSYM (isl_inequality_alloc); \
+ DYNSYM (isl_local_space_copy); \
+ DYNSYM (isl_local_space_free); \
+ DYNSYM (isl_local_space_from_space); \
+ DYNSYM (isl_local_space_range); \
+ DYNSYM (isl_map_add_constraint); \
+ DYNSYM (isl_map_add_dims); \
+ DYNSYM (isl_map_align_params); \
+ DYNSYM (isl_map_apply_range); \
+ DYNSYM (isl_map_copy); \
+ DYNSYM (isl_map_dim); \
+ DYNSYM (isl_map_dump); \
+ DYNSYM (isl_map_equate); \
+ DYNSYM (isl_map_fix_si); \
+ DYNSYM (isl_map_flat_product); \
+ DYNSYM (isl_map_flat_range_product); \
+ DYNSYM (isl_map_free); \
+ DYNSYM (isl_map_from_basic_map); \
+ DYNSYM (isl_map_from_pw_aff); \
+ DYNSYM (isl_map_from_union_map); \
+ DYNSYM (isl_map_get_ctx); \
+ DYNSYM (isl_map_get_space); \
+ DYNSYM (isl_map_get_tuple_id); \
+ DYNSYM (isl_map_insert_dims); \
+ DYNSYM (isl_map_intersect); \
+ DYNSYM (isl_map_intersect_domain); \
+ DYNSYM (isl_map_intersect_range); \
+ DYNSYM (isl_map_is_empty); \
+ DYNSYM (isl_map_lex_ge); \
+ DYNSYM (isl_map_lex_le); \
+ DYNSYM (isl_map_n_out); \
+ DYNSYM (isl_map_range); \
+ DYNSYM (isl_map_set_tuple_id); \
+ DYNSYM (isl_map_universe); \
+ DYNSYM (isl_options_set_on_error); \
+ DYNSYM (isl_options_set_schedule_fuse); \
+ DYNSYM (isl_options_set_schedule_max_constant_term); \
+ DYNSYM (isl_options_set_schedule_maximize_band_depth); \
+ DYNSYM (isl_printer_free); \
+ DYNSYM (isl_printer_print_aff); \
+ DYNSYM (isl_printer_print_constraint); \
+ DYNSYM (isl_printer_print_map); \
+ DYNSYM (isl_printer_print_set); \
+ DYNSYM (isl_printer_to_file); \
+ DYNSYM (isl_pw_aff_add); \
+ DYNSYM (isl_pw_aff_alloc); \
+ DYNSYM (isl_pw_aff_copy); \
+ DYNSYM (isl_pw_aff_eq_set); \
+ DYNSYM (isl_pw_aff_free); \
+ DYNSYM (isl_pw_aff_from_aff); \
+ DYNSYM (isl_pw_aff_ge_set); \
+ DYNSYM (isl_pw_aff_gt_set); \
+ DYNSYM (isl_pw_aff_is_cst); \
+ DYNSYM (isl_pw_aff_le_set); \
+ DYNSYM (isl_pw_aff_lt_set); \
+ DYNSYM (isl_pw_aff_mod); \
+ DYNSYM (isl_pw_aff_mul); \
+ DYNSYM (isl_pw_aff_ne_set); \
+ DYNSYM (isl_pw_aff_nonneg_set); \
+ DYNSYM (isl_pw_aff_set_tuple_id); \
+ DYNSYM (isl_pw_aff_sub); \
+ DYNSYM (isl_pw_aff_zero_set); \
+ DYNSYM (isl_schedule_free); \
+ DYNSYM (isl_schedule_get_band_forest); \
+ DYNSYM (isl_set_add_constraint); \
+ DYNSYM (isl_set_add_dims); \
+ DYNSYM (isl_set_apply); \
+ DYNSYM (isl_set_coalesce); \
+ DYNSYM (isl_set_copy); \
+ DYNSYM (isl_set_dim); \
+ DYNSYM (isl_set_fix_si); \
+ DYNSYM (isl_set_free); \
+ DYNSYM (isl_set_from_cloog_domain); \
+ DYNSYM (isl_set_get_space); \
+ DYNSYM (isl_set_get_tuple_id); \
+ DYNSYM (isl_set_intersect); \
+ DYNSYM (isl_set_is_empty); \
+ DYNSYM (isl_set_max); \
+ DYNSYM (isl_set_min); \
+ DYNSYM (isl_set_nat_universe); \
+ DYNSYM (isl_set_project_out); \
+ DYNSYM (isl_set_set_tuple_id); \
+ DYNSYM (isl_set_universe); \
+ DYNSYM (isl_space_add_dims); \
+ DYNSYM (isl_space_alloc); \
+ DYNSYM (isl_space_copy); \
+ DYNSYM (isl_space_dim); \
+ DYNSYM (isl_space_domain); \
+ DYNSYM (isl_space_find_dim_by_id); \
+ DYNSYM (isl_space_free); \
+ DYNSYM (isl_space_from_domain); \
+ DYNSYM (isl_space_get_tuple_id); \
+ DYNSYM (isl_space_params_alloc); \
+ DYNSYM (isl_space_range); \
+ DYNSYM (isl_space_set_alloc); \
+ DYNSYM (isl_space_set_dim_id); \
+ DYNSYM (isl_space_set_tuple_id); \
+ DYNSYM (isl_union_map_add_map); \
+ DYNSYM (isl_union_map_align_params); \
+ DYNSYM (isl_union_map_apply_domain); \
+ DYNSYM (isl_union_map_apply_range); \
+ DYNSYM (isl_union_map_compute_flow); \
+ DYNSYM (isl_union_map_copy); \
+ DYNSYM (isl_union_map_empty); \
+ DYNSYM (isl_union_map_flat_range_product); \
+ DYNSYM (isl_union_map_foreach_map); \
+ DYNSYM (isl_union_map_free); \
+ DYNSYM (isl_union_map_from_map); \
+ DYNSYM (isl_union_map_get_ctx); \
+ DYNSYM (isl_union_map_get_space); \
+ DYNSYM (isl_union_map_gist_domain); \
+ DYNSYM (isl_union_map_gist_range); \
+ DYNSYM (isl_union_map_intersect_domain); \
+ DYNSYM (isl_union_map_is_empty); \
+ DYNSYM (isl_union_map_subtract); \
+ DYNSYM (isl_union_map_union); \
+ DYNSYM (isl_union_set_add_set); \
+ DYNSYM (isl_union_set_compute_schedule); \
+ DYNSYM (isl_union_set_copy); \
+ DYNSYM (isl_union_set_empty); \
+ DYNSYM (isl_union_set_from_set); \
+ DYNSYM (stmt_ass); \
+ DYNSYM (stmt_block); \
+ DYNSYM (stmt_for); \
+ DYNSYM (stmt_guard); \
+ DYNSYM (stmt_root); \
+ DYNSYM (stmt_user);
+extern struct cloog_pointers_s__
+{
+ bool inited;
+ void *h;
+#define DYNSYM(x) __typeof (x) *p_##x
+ DYNSYMS
+#undef DYNSYM
+} cloog_pointers__;
+
+#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc)
+#define clast_pprint (*cloog_pointers__.p_clast_pprint)
+#define cloog_clast_create_from_input (*cloog_pointers__.p_cloog_clast_create_from_input)
+#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free)
+#define cloog_domain_from_isl_set (*cloog_pointers__.p_cloog_domain_from_isl_set)
+#define cloog_input_alloc (*cloog_pointers__.p_cloog_input_alloc)
+#define cloog_isl_state_malloc (*cloog_pointers__.p_cloog_isl_state_malloc)
+#define cloog_options_free (*cloog_pointers__.p_cloog_options_free)
+#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc)
+#define cloog_scattering_from_isl_map (*cloog_pointers__.p_cloog_scattering_from_isl_map)
+#define cloog_state_free (*cloog_pointers__.p_cloog_state_free)
+#define cloog_union_domain_add_domain (*cloog_pointers__.p_cloog_union_domain_add_domain)
+#define cloog_union_domain_alloc (*cloog_pointers__.p_cloog_union_domain_alloc)
+#define cloog_union_domain_set_name (*cloog_pointers__.p_cloog_union_domain_set_name)
+#define isl_aff_add_coefficient_si (*cloog_pointers__.p_isl_aff_add_coefficient_si)
+#define isl_aff_add_constant (*cloog_pointers__.p_isl_aff_add_constant)
+#define isl_aff_free (*cloog_pointers__.p_isl_aff_free)
+#define isl_aff_get_coefficient (*cloog_pointers__.p_isl_aff_get_coefficient)
+#define isl_aff_get_space (*cloog_pointers__.p_isl_aff_get_space)
+#define isl_aff_mod (*cloog_pointers__.p_isl_aff_mod)
+#define isl_aff_set_coefficient_si (*cloog_pointers__.p_isl_aff_set_coefficient_si)
+#define isl_aff_set_constant_si (*cloog_pointers__.p_isl_aff_set_constant_si)
+#define isl_aff_zero_on_domain (*cloog_pointers__.p_isl_aff_zero_on_domain)
+#define isl_band_free (*cloog_pointers__.p_isl_band_free)
+#define isl_band_get_children (*cloog_pointers__.p_isl_band_get_children)
+#define isl_band_get_partial_schedule (*cloog_pointers__.p_isl_band_get_partial_schedule)
+#define isl_band_has_children (*cloog_pointers__.p_isl_band_has_children)
+#define isl_band_list_free (*cloog_pointers__.p_isl_band_list_free)
+#define isl_band_list_get_band (*cloog_pointers__.p_isl_band_list_get_band)
+#define isl_band_list_get_ctx (*cloog_pointers__.p_isl_band_list_get_ctx)
+#define isl_band_list_n_band (*cloog_pointers__.p_isl_band_list_n_band)
+#define isl_band_member_is_zero_distance (*cloog_pointers__.p_isl_band_member_is_zero_distance)
+#define isl_band_n_member (*cloog_pointers__.p_isl_band_n_member)
+#define isl_basic_map_add_constraint (*cloog_pointers__.p_isl_basic_map_add_constraint)
+#define isl_basic_map_project_out (*cloog_pointers__.p_isl_basic_map_project_out)
+#define isl_basic_map_universe (*cloog_pointers__.p_isl_basic_map_universe)
+#define isl_constraint_set_coefficient (*cloog_pointers__.p_isl_constraint_set_coefficient)
+#define isl_constraint_set_coefficient_si (*cloog_pointers__.p_isl_constraint_set_coefficient_si)
+#define isl_constraint_set_constant (*cloog_pointers__.p_isl_constraint_set_constant)
+#define isl_constraint_set_constant_si (*cloog_pointers__.p_isl_constraint_set_constant_si)
+#define isl_ctx_alloc (*cloog_pointers__.p_isl_ctx_alloc)
+#define isl_ctx_free (*cloog_pointers__.p_isl_ctx_free)
+#define isl_equality_alloc (*cloog_pointers__.p_isl_equality_alloc)
+#define isl_id_alloc (*cloog_pointers__.p_isl_id_alloc)
+#define isl_id_copy (*cloog_pointers__.p_isl_id_copy)
+#define isl_id_free (*cloog_pointers__.p_isl_id_free)
+#define isl_inequality_alloc (*cloog_pointers__.p_isl_inequality_alloc)
+#define isl_local_space_copy (*cloog_pointers__.p_isl_local_space_copy)
+#define isl_local_space_free (*cloog_pointers__.p_isl_local_space_free)
+#define isl_local_space_from_space (*cloog_pointers__.p_isl_local_space_from_space)
+#define isl_local_space_range (*cloog_pointers__.p_isl_local_space_range)
+#define isl_map_add_constraint (*cloog_pointers__.p_isl_map_add_constraint)
+#define isl_map_add_dims (*cloog_pointers__.p_isl_map_add_dims)
+#define isl_map_align_params (*cloog_pointers__.p_isl_map_align_params)
+#define isl_map_apply_range (*cloog_pointers__.p_isl_map_apply_range)
+#define isl_map_copy (*cloog_pointers__.p_isl_map_copy)
+#define isl_map_dim (*cloog_pointers__.p_isl_map_dim)
+#define isl_map_dump (*cloog_pointers__.p_isl_map_dump)
+#define isl_map_equate (*cloog_pointers__.p_isl_map_equate)
+#define isl_map_fix_si (*cloog_pointers__.p_isl_map_fix_si)
+#define isl_map_flat_product (*cloog_pointers__.p_isl_map_flat_product)
+#define isl_map_flat_range_product (*cloog_pointers__.p_isl_map_flat_range_product)
+#define isl_map_free (*cloog_pointers__.p_isl_map_free)
+#define isl_map_from_basic_map (*cloog_pointers__.p_isl_map_from_basic_map)
+#define isl_map_from_pw_aff (*cloog_pointers__.p_isl_map_from_pw_aff)
+#define isl_map_from_union_map (*cloog_pointers__.p_isl_map_from_union_map)
+#define isl_map_get_ctx (*cloog_pointers__.p_isl_map_get_ctx)
+#define isl_map_get_space (*cloog_pointers__.p_isl_map_get_space)
+#define isl_map_get_tuple_id (*cloog_pointers__.p_isl_map_get_tuple_id)
+#define isl_map_insert_dims (*cloog_pointers__.p_isl_map_insert_dims)
+#define isl_map_intersect (*cloog_pointers__.p_isl_map_intersect)
+#define isl_map_intersect_domain (*cloog_pointers__.p_isl_map_intersect_domain)
+#define isl_map_intersect_range (*cloog_pointers__.p_isl_map_intersect_range)
+#define isl_map_is_empty (*cloog_pointers__.p_isl_map_is_empty)
+#define isl_map_lex_ge (*cloog_pointers__.p_isl_map_lex_ge)
+#define isl_map_lex_le (*cloog_pointers__.p_isl_map_lex_le)
+#define isl_map_n_out (*cloog_pointers__.p_isl_map_n_out)
+#define isl_map_range (*cloog_pointers__.p_isl_map_range)
+#define isl_map_set_tuple_id (*cloog_pointers__.p_isl_map_set_tuple_id)
+#define isl_map_universe (*cloog_pointers__.p_isl_map_universe)
+#define isl_options_set_on_error (*cloog_pointers__.p_isl_options_set_on_error)
+#define isl_options_set_schedule_fuse (*cloog_pointers__.p_isl_options_set_schedule_fuse)
+#define isl_options_set_schedule_max_constant_term (*cloog_pointers__.p_isl_options_set_schedule_max_constant_term)
+#define isl_options_set_schedule_maximize_band_depth (*cloog_pointers__.p_isl_options_set_schedule_maximize_band_depth)
+#define isl_printer_free (*cloog_pointers__.p_isl_printer_free)
+#define isl_printer_print_aff (*cloog_pointers__.p_isl_printer_print_aff)
+#define isl_printer_print_constraint (*cloog_pointers__.p_isl_printer_print_constraint)
+#define isl_printer_print_map (*cloog_pointers__.p_isl_printer_print_map)
+#define isl_printer_print_set (*cloog_pointers__.p_isl_printer_print_set)
+#define isl_printer_to_file (*cloog_pointers__.p_isl_printer_to_file)
+#define isl_pw_aff_add (*cloog_pointers__.p_isl_pw_aff_add)
+#define isl_pw_aff_alloc (*cloog_pointers__.p_isl_pw_aff_alloc)
+#define isl_pw_aff_copy (*cloog_pointers__.p_isl_pw_aff_copy)
+#define isl_pw_aff_eq_set (*cloog_pointers__.p_isl_pw_aff_eq_set)
+#define isl_pw_aff_free (*cloog_pointers__.p_isl_pw_aff_free)
+#define isl_pw_aff_from_aff (*cloog_pointers__.p_isl_pw_aff_from_aff)
+#define isl_pw_aff_ge_set (*cloog_pointers__.p_isl_pw_aff_ge_set)
+#define isl_pw_aff_gt_set (*cloog_pointers__.p_isl_pw_aff_gt_set)
+#define isl_pw_aff_is_cst (*cloog_pointers__.p_isl_pw_aff_is_cst)
+#define isl_pw_aff_le_set (*cloog_pointers__.p_isl_pw_aff_le_set)
+#define isl_pw_aff_lt_set (*cloog_pointers__.p_isl_pw_aff_lt_set)
+#define isl_pw_aff_mod (*cloog_pointers__.p_isl_pw_aff_mod)
+#define isl_pw_aff_mul (*cloog_pointers__.p_isl_pw_aff_mul)
+#define isl_pw_aff_ne_set (*cloog_pointers__.p_isl_pw_aff_ne_set)
+#define isl_pw_aff_nonneg_set (*cloog_pointers__.p_isl_pw_aff_nonneg_set)
+#define isl_pw_aff_set_tuple_id (*cloog_pointers__.p_isl_pw_aff_set_tuple_id)
+#define isl_pw_aff_sub (*cloog_pointers__.p_isl_pw_aff_sub)
+#define isl_pw_aff_zero_set (*cloog_pointers__.p_isl_pw_aff_zero_set)
+#define isl_schedule_free (*cloog_pointers__.p_isl_schedule_free)
+#define isl_schedule_get_band_forest (*cloog_pointers__.p_isl_schedule_get_band_forest)
+#define isl_set_add_constraint (*cloog_pointers__.p_isl_set_add_constraint)
+#define isl_set_add_dims (*cloog_pointers__.p_isl_set_add_dims)
+#define isl_set_apply (*cloog_pointers__.p_isl_set_apply)
+#define isl_set_coalesce (*cloog_pointers__.p_isl_set_coalesce)
+#define isl_set_copy (*cloog_pointers__.p_isl_set_copy)
+#define isl_set_dim (*cloog_pointers__.p_isl_set_dim)
+#define isl_set_fix_si (*cloog_pointers__.p_isl_set_fix_si)
+#define isl_set_free (*cloog_pointers__.p_isl_set_free)
+#define isl_set_from_cloog_domain (*cloog_pointers__.p_isl_set_from_cloog_domain)
+#define isl_set_get_space (*cloog_pointers__.p_isl_set_get_space)
+#define isl_set_get_tuple_id (*cloog_pointers__.p_isl_set_get_tuple_id)
+#define isl_set_intersect (*cloog_pointers__.p_isl_set_intersect)
+#define isl_set_is_empty (*cloog_pointers__.p_isl_set_is_empty)
+#define isl_set_max (*cloog_pointers__.p_isl_set_max)
+#define isl_set_min (*cloog_pointers__.p_isl_set_min)
+#define isl_set_nat_universe (*cloog_pointers__.p_isl_set_nat_universe)
+#define isl_set_project_out (*cloog_pointers__.p_isl_set_project_out)
+#define isl_set_set_tuple_id (*cloog_pointers__.p_isl_set_set_tuple_id)
+#define isl_set_universe (*cloog_pointers__.p_isl_set_universe)
+#define isl_space_add_dims (*cloog_pointers__.p_isl_space_add_dims)
+#define isl_space_alloc (*cloog_pointers__.p_isl_space_alloc)
+#define isl_space_copy (*cloog_pointers__.p_isl_space_copy)
+#define isl_space_dim (*cloog_pointers__.p_isl_space_dim)
+#define isl_space_domain (*cloog_pointers__.p_isl_space_domain)
+#define isl_space_find_dim_by_id (*cloog_pointers__.p_isl_space_find_dim_by_id)
+#define isl_space_free (*cloog_pointers__.p_isl_space_free)
+#define isl_space_from_domain (*cloog_pointers__.p_isl_space_from_domain)
+#define isl_space_get_tuple_id (*cloog_pointers__.p_isl_space_get_tuple_id)
+#define isl_space_params_alloc (*cloog_pointers__.p_isl_space_params_alloc)
+#define isl_space_range (*cloog_pointers__.p_isl_space_range)
+#define isl_space_set_alloc (*cloog_pointers__.p_isl_space_set_alloc)
+#define isl_space_set_dim_id (*cloog_pointers__.p_isl_space_set_dim_id)
+#define isl_space_set_tuple_id (*cloog_pointers__.p_isl_space_set_tuple_id)
+#define isl_union_map_add_map (*cloog_pointers__.p_isl_union_map_add_map)
+#define isl_union_map_align_params (*cloog_pointers__.p_isl_union_map_align_params)
+#define isl_union_map_apply_domain (*cloog_pointers__.p_isl_union_map_apply_domain)
+#define isl_union_map_apply_range (*cloog_pointers__.p_isl_union_map_apply_range)
+#define isl_union_map_compute_flow (*cloog_pointers__.p_isl_union_map_compute_flow)
+#define isl_union_map_copy (*cloog_pointers__.p_isl_union_map_copy)
+#define isl_union_map_empty (*cloog_pointers__.p_isl_union_map_empty)
+#define isl_union_map_flat_range_product (*cloog_pointers__.p_isl_union_map_flat_range_product)
+#define isl_union_map_foreach_map (*cloog_pointers__.p_isl_union_map_foreach_map)
+#define isl_union_map_free (*cloog_pointers__.p_isl_union_map_free)
+#define isl_union_map_from_map (*cloog_pointers__.p_isl_union_map_from_map)
+#define isl_union_map_get_ctx (*cloog_pointers__.p_isl_union_map_get_ctx)
+#define isl_union_map_get_space (*cloog_pointers__.p_isl_union_map_get_space)
+#define isl_union_map_gist_domain (*cloog_pointers__.p_isl_union_map_gist_domain)
+#define isl_union_map_gist_range (*cloog_pointers__.p_isl_union_map_gist_range)
+#define isl_union_map_intersect_domain (*cloog_pointers__.p_isl_union_map_intersect_domain)
+#define isl_union_map_is_empty (*cloog_pointers__.p_isl_union_map_is_empty)
+#define isl_union_map_subtract (*cloog_pointers__.p_isl_union_map_subtract)
+#define isl_union_map_union (*cloog_pointers__.p_isl_union_map_union)
+#define isl_union_set_add_set (*cloog_pointers__.p_isl_union_set_add_set)
+#define isl_union_set_compute_schedule (*cloog_pointers__.p_isl_union_set_compute_schedule)
+#define isl_union_set_copy (*cloog_pointers__.p_isl_union_set_copy)
+#define isl_union_set_empty (*cloog_pointers__.p_isl_union_set_empty)
+#define isl_union_set_from_set (*cloog_pointers__.p_isl_union_set_from_set)
+#define stmt_ass (*cloog_pointers__.p_stmt_ass)
+#define stmt_block (*cloog_pointers__.p_stmt_block)
+#define stmt_for (*cloog_pointers__.p_stmt_for)
+#define stmt_guard (*cloog_pointers__.p_stmt_guard)
+#define stmt_root (*cloog_pointers__.p_stmt_root)
+#define stmt_user (*cloog_pointers__.p_stmt_user)
+
typedef struct poly_dr *poly_dr_p;
typedef struct poly_bb *poly_bb_p;
--- gcc/graphite.c.jj 2012-12-13 11:31:00.000000000 +0100
+++ gcc/graphite.c 2012-12-14 13:40:44.155136961 +0100
@@ -66,6 +66,34 @@ along with GCC; see the file COPYING3.
CloogState *cloog_state;
+__typeof (cloog_pointers__) cloog_pointers__;
+
+static bool
+init_cloog_pointers (void)
+{
+ void *h;
+
+ if (cloog_pointers__.inited)
+ return cloog_pointers__.h != NULL;
+ h = dlopen ("libcloog-isl.so.4", RTLD_LAZY);
+ cloog_pointers__.h = h;
+ if (h == NULL)
+ return false;
+#define DYNSYM(x) \
+ do \
+ { \
+ union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \
+ u.q = dlsym (h, #x); \
+ if (u.q == NULL) \
+ return false; \
+ cloog_pointers__.p_##x = u.p; \
+ } \
+ while (0)
+ DYNSYMS
+#undef DYNSYM
+ return true;
+}
+
/* Print global statistics to FILE. */
static void
@@ -264,6 +292,15 @@ graphite_transform_loops (void)
if (parallelized_function_p (cfun->decl))
return;
+ if (number_of_loops () <= 1)
+ return;
+
+ if (!init_cloog_pointers ())
+ {
+ sorry ("Graphite loop optimizations cannot be used");
+ return;
+ }
+
ctx = isl_ctx_alloc ();
isl_options_set_on_error(ctx, ISL_ON_ERROR_ABORT);
if (!graphite_initialize (ctx))
--- gcc/graphite-clast-to-gimple.c.jj 2012-12-13 11:31:27.000000000 +0100
+++ gcc/graphite-clast-to-gimple.c 2012-12-14 13:27:47.196519858 +0100
@@ -910,7 +910,7 @@ compute_bounds_for_loop (struct clast_fo
from STMT_FOR. */
static tree
-type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip)
+type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip)
{
mpz_t bound_one, bound_two;
tree lb_type, ub_type;
@@ -918,8 +918,8 @@ type_for_clast_for (struct clast_for *st
mpz_init (bound_one);
mpz_init (bound_two);
- lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two);
- ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two);
+ lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two);
+ ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two);
mpz_clear (bound_one);
mpz_clear (bound_two);