]>
Commit | Line | Data |
---|---|---|
3c926509 MT |
1 | 2011-01-04 Jakub Jelinek <jakub@redhat.com> |
2 | ||
3 | * Makefile.in (BACKENDLIBS): Link against -ldl instead of | |
4 | -lcloog -lppl. | |
5 | (graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions. | |
6 | (GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New. | |
7 | (graphite*.o): Adjust dependencies. | |
8 | * graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and | |
9 | libppl symbols through pointers in cloog_pointers__ variable. | |
10 | * graphite.c (init_cloog_pointers): New function. | |
11 | (graphite_transform_loops): Call init_cloog_pointers. | |
12 | * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename | |
13 | stmt_for argument to stmt_fora. | |
14 | * graphite-poly.h: Include graphite-cloog-util.h. | |
15 | ||
16 | --- gcc/Makefile.in.jj 2011-01-03 13:44:14.163900902 +0100 | |
17 | +++ gcc/Makefile.in 2011-01-04 17:48:53.588775911 +0100 | |
4de56d3e | 18 | @@ -962,6 +962,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plug |
3c926509 MT |
19 | PLUGIN_H = plugin.h $(GCC_PLUGIN_H) |
20 | PLUGIN_VERSION_H = plugin-version.h configargs.h | |
21 | LIBFUNCS_H = libfuncs.h $(HASHTAB_H) | |
22 | +GRAPHITE_CLOOG_UTIL_H = graphite-cloog-util.h graphite-cloog-compat.h | |
23 | +GRAPHITE_POLY_H = graphite-poly.h $(GRAPHITE_CLOOG_UTIL_H) | |
24 | ||
25 | #\f | |
26 | # Now figure out from those variables how to compile and link. | |
4de56d3e | 27 | @@ -1016,7 +1018,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) |
3c926509 | 28 | # and the system's installed libraries. |
4de56d3e MT |
29 | LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \ |
30 | $(LIBDECNUMBER) $(HOST_LIBS) | |
3c926509 MT |
31 | -BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ |
32 | +BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl) $(PLUGINLIBS) $(HOST_LIBS) \ | |
33 | $(ZLIB) | |
34 | # Any system libraries needed just for GNAT. | |
35 | SYSLIBS = @GNAT_LIBEXC@ | |
4de56d3e | 36 | @@ -2602,40 +2604,40 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYS |
3c926509 MT |
37 | $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h |
38 | graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \ | |
39 | $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \ | |
40 | - $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \ | |
41 | + $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \ | |
42 | graphite-clast-to-gimple.h graphite-sese-to-poly.h | |
43 | graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \ | |
44 | coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ | |
45 | - sese.h graphite-ppl.h graphite-poly.h | |
46 | + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) | |
47 | graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \ | |
48 | $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ | |
49 | - $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \ | |
50 | - graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \ | |
51 | + $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \ | |
52 | + graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \ | |
53 | graphite-dependences.h graphite-cloog-compat.h | |
54 | graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \ | |
55 | - coretypes.h graphite-cloog-util.h graphite-cloog-compat.h | |
56 | + coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h | |
57 | graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \ | |
58 | coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ | |
59 | - sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \ | |
60 | - graphite-cloog-util.h | |
61 | + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \ | |
62 | + $(GRAPHITE_CLOOG_UTIL_H) | |
63 | graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \ | |
64 | coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ | |
65 | - sese.h graphite-ppl.h graphite-poly.h | |
66 | + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) | |
67 | graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \ | |
68 | coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ | |
69 | - sese.h graphite-ppl.h graphite-poly.h | |
70 | + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) | |
71 | graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ | |
72 | $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \ | |
73 | - $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \ | |
74 | - graphite-dependences.h graphite-cloog-util.h | |
75 | + $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ | |
76 | + graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H) | |
77 | graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ | |
78 | - graphite-cloog-util.h graphite-ppl.h | |
79 | + $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h | |
80 | graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \ | |
81 | coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \ | |
82 | - sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h | |
83 | + sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h | |
84 | graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \ | |
85 | $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \ | |
86 | - $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \ | |
87 | + $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ | |
88 | graphite-sese-to-poly.h | |
89 | tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ | |
90 | $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \ | |
4de56d3e | 91 | @@ -3454,6 +3456,15 @@ $(common_out_object_file): $(common_out_ |
3c926509 | 92 | $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ |
4de56d3e | 93 | $< $(OUTPUT_OPTION) |
3c926509 MT |
94 | |
95 | +graphite%.o : \ | |
96 | + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) | |
97 | +graphite.o : \ | |
98 | + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) | |
4de56d3e MT |
99 | +graphite%.o : \ |
100 | + ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) | |
101 | +graphite.o : \ | |
102 | + ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) | |
3c926509 MT |
103 | + |
104 | # Build auxiliary files that support ecoff format. | |
4de56d3e | 105 | mips-tfile: mips-tfile.o $(LIBDEPS) |
3c926509 MT |
106 | $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \ |
107 | --- gcc/graphite-cloog-compat.h.jj 2011-01-03 12:53:05.000000000 +0100 | |
108 | +++ gcc/graphite-cloog-compat.h 2011-01-04 17:34:09.857757544 +0100 | |
4de56d3e | 109 | @@ -272,4 +272,279 @@ static inline int cloog_matrix_nrows (Cl |
3c926509 MT |
110 | return m->NbRows; |
111 | } | |
112 | #endif /* CLOOG_ORG */ | |
113 | + | |
114 | +#include <dlfcn.h> | |
1f543606 MT |
115 | +#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11 |
116 | +#define DYNSYMS_PPL11 | |
117 | +#else | |
118 | +#define DYNSYMS_PPL11 \ | |
119 | + DYNSYM (ppl_new_PIP_Problem_from_constraints); \ | |
120 | + DYNSYM (ppl_PIP_Problem_is_satisfiable); \ | |
121 | + DYNSYM (ppl_delete_PIP_Problem); | |
122 | +#endif | |
3c926509 MT |
123 | +#define DYNSYMS \ |
124 | + DYNSYM (cloog_block_alloc); \ | |
125 | + DYNSYM (cloog_block_list_free); \ | |
126 | + DYNSYM (cloog_block_list_malloc); \ | |
127 | + DYNSYM (cloog_clast_create); \ | |
128 | + DYNSYM (cloog_clast_free); \ | |
129 | + DYNSYM (cloog_domain_free); \ | |
130 | + DYNSYM (cloog_domain_matrix2domain); \ | |
131 | + DYNSYM (cloog_initialize); \ | |
132 | + DYNSYM (cloog_loop_malloc); \ | |
133 | + DYNSYM (cloog_matrix_alloc); \ | |
134 | + DYNSYM (cloog_matrix_copy); \ | |
135 | + DYNSYM (cloog_matrix_free); \ | |
136 | + DYNSYM (cloog_matrix_print); \ | |
137 | + DYNSYM (cloog_names_malloc); \ | |
138 | + DYNSYM (cloog_names_scalarize); \ | |
139 | + DYNSYM (cloog_options_free); \ | |
140 | + DYNSYM (cloog_options_malloc); \ | |
141 | + DYNSYM (cloog_program_dump_cloog); \ | |
142 | + DYNSYM (cloog_program_extract_scalars); \ | |
143 | + DYNSYM (cloog_program_free); \ | |
144 | + DYNSYM (cloog_program_generate); \ | |
145 | + DYNSYM (cloog_program_malloc); \ | |
146 | + DYNSYM (cloog_program_print); \ | |
147 | + DYNSYM (cloog_program_scatter); \ | |
148 | + DYNSYM (cloog_statement_alloc); \ | |
149 | + DYNSYM (cloog_domain_union); \ | |
150 | + DYNSYM (cloog_matrix_read); \ | |
151 | + DYNSYM (cloog_new_pol); \ | |
152 | + DYNSYM (cloog_vector_gcd); \ | |
153 | + DYNSYM (ppl_finalize); \ | |
154 | + DYNSYM (ppl_assign_Coefficient_from_mpz_t); \ | |
155 | + DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \ | |
156 | + DYNSYM (ppl_Coefficient_to_mpz_t); \ | |
157 | + DYNSYM (ppl_Constraint_coefficient); \ | |
158 | + DYNSYM (ppl_Constraint_inhomogeneous_term); \ | |
159 | + DYNSYM (ppl_Constraint_space_dimension); \ | |
160 | + DYNSYM (ppl_Constraint_System_begin); \ | |
161 | + DYNSYM (ppl_Constraint_System_const_iterator_dereference); \ | |
162 | + DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \ | |
163 | + DYNSYM (ppl_Constraint_System_const_iterator_increment); \ | |
164 | + DYNSYM (ppl_Constraint_System_end); \ | |
165 | + DYNSYM (ppl_Constraint_System_insert_Constraint); \ | |
166 | + DYNSYM (ppl_Constraint_System_space_dimension); \ | |
167 | + DYNSYM (ppl_Constraint_type); \ | |
168 | + DYNSYM (ppl_delete_Coefficient); \ | |
169 | + DYNSYM (ppl_delete_Constraint); \ | |
170 | + DYNSYM (ppl_delete_Constraint_System_const_iterator); \ | |
171 | + DYNSYM (ppl_delete_Linear_Expression); \ | |
172 | + DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \ | |
173 | + DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \ | |
174 | + DYNSYM (ppl_delete_Polyhedron); \ | |
175 | + DYNSYM (ppl_Linear_Expression_add_to_coefficient); \ | |
176 | + DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \ | |
177 | + DYNSYM (ppl_Linear_Expression_coefficient); \ | |
178 | + DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \ | |
179 | + DYNSYM (ppl_Linear_Expression_space_dimension); \ | |
180 | + DYNSYM (ppl_new_Coefficient); \ | |
181 | + DYNSYM (ppl_new_Coefficient_from_mpz_t); \ | |
182 | + DYNSYM (ppl_new_Constraint); \ | |
183 | + DYNSYM (ppl_new_Constraint_System); \ | |
184 | + DYNSYM (ppl_new_Constraint_System_const_iterator); \ | |
185 | + DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \ | |
186 | + DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \ | |
187 | + DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \ | |
188 | + DYNSYM (ppl_new_Linear_Expression); \ | |
189 | + DYNSYM (ppl_new_Linear_Expression_from_Constraint); \ | |
190 | + DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \ | |
191 | + DYNSYM (ppl_new_Linear_Expression_with_dimension); \ | |
192 | + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \ | |
193 | + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \ | |
194 | + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \ | |
195 | + DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \ | |
196 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \ | |
197 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \ | |
198 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \ | |
199 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \ | |
200 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \ | |
201 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \ | |
202 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \ | |
203 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \ | |
204 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \ | |
205 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \ | |
206 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \ | |
207 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \ | |
208 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \ | |
209 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \ | |
210 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \ | |
211 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \ | |
212 | + DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \ | |
213 | + DYNSYM (ppl_Polyhedron_add_constraint); \ | |
214 | + DYNSYM (ppl_Polyhedron_add_constraints); \ | |
215 | + DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \ | |
216 | + DYNSYM (ppl_Polyhedron_get_constraints); \ | |
217 | + DYNSYM (ppl_Polyhedron_map_space_dimensions); \ | |
218 | + DYNSYM (ppl_Polyhedron_remove_space_dimensions); \ | |
219 | + DYNSYM (ppl_Polyhedron_space_dimension); \ | |
220 | + DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \ | |
221 | + DYNSYM (pprint); \ | |
222 | + DYNSYM (stmt_block); \ | |
223 | + DYNSYM (stmt_for); \ | |
224 | + DYNSYM (stmt_guard); \ | |
225 | + DYNSYM (stmt_root); \ | |
226 | + DYNSYM (stmt_user); \ | |
4de56d3e | 227 | + DYNSYM (stmt_ass); \ |
3c926509 MT |
228 | + DYNSYM (ppl_delete_Constraint_System); \ |
229 | + DYNSYM (ppl_initialize); \ | |
230 | + DYNSYM (ppl_new_Constraint_System_from_Constraint); \ | |
231 | + DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \ | |
232 | + DYNSYM (ppl_Polyhedron_affine_image); \ | |
1f543606 MT |
233 | + DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); \ |
234 | + DYNSYMS_PPL11 | |
4de56d3e | 235 | +extern struct cloog_pointers_s__ |
3c926509 MT |
236 | +{ |
237 | + bool inited; | |
238 | + void *h; | |
239 | +#define DYNSYM(x) __typeof (x) *p_##x | |
240 | + DYNSYMS | |
241 | +#undef DYNSYM | |
242 | +} cloog_pointers__; | |
243 | + | |
244 | +#define cloog_block_alloc (*cloog_pointers__.p_cloog_block_alloc) | |
245 | +#define cloog_block_list_free (*cloog_pointers__.p_cloog_block_list_free) | |
246 | +#define cloog_block_list_malloc (*cloog_pointers__.p_cloog_block_list_malloc) | |
247 | +#define cloog_clast_create (*cloog_pointers__.p_cloog_clast_create) | |
248 | +#define cloog_clast_free (*cloog_pointers__.p_cloog_clast_free) | |
249 | +#define cloog_domain_free (*cloog_pointers__.p_cloog_domain_free) | |
250 | +#define cloog_domain_matrix2domain (*cloog_pointers__.p_cloog_domain_matrix2domain) | |
251 | +#define cloog_initialize (*cloog_pointers__.p_cloog_initialize) | |
252 | +#ifndef CLOOG_ORG | |
253 | +#undef cloog_loop_malloc | |
254 | +#define cloog_loop_malloc(STATE) (*cloog_pointers__.p_cloog_loop_malloc) () | |
255 | +#else | |
256 | +#define cloog_loop_malloc (*cloog_pointers__.p_cloog_loop_malloc) | |
257 | +#endif | |
258 | +#define cloog_matrix_alloc (*cloog_pointers__.p_cloog_matrix_alloc) | |
259 | +#define cloog_matrix_copy (*cloog_pointers__.p_cloog_matrix_copy) | |
260 | +#define cloog_matrix_free (*cloog_pointers__.p_cloog_matrix_free) | |
261 | +#define cloog_matrix_print (*cloog_pointers__.p_cloog_matrix_print) | |
262 | +#define cloog_names_malloc (*cloog_pointers__.p_cloog_names_malloc) | |
263 | +#define cloog_names_scalarize (*cloog_pointers__.p_cloog_names_scalarize) | |
264 | +#define cloog_options_free (*cloog_pointers__.p_cloog_options_free) | |
265 | +#ifndef CLOOG_ORG | |
266 | +#undef cloog_options_malloc | |
267 | +#define cloog_options_malloc(STATE) (*cloog_pointers__.p_cloog_options_malloc) () | |
268 | +#undef cloog_program_dump_cloog | |
269 | +#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST) \ | |
270 | + (*cloog_pointers__.p_cloog_program_dump_cloog) (DUMPFILE, PROGRAM) | |
271 | +#undef cloog_program_extract_scalars | |
272 | +#define cloog_program_extract_scalars(PROG, SCATT, OPT) \ | |
273 | + (*cloog_pointers__.p_cloog_program_extract_scalars) (PROG, SCATT) | |
274 | +#else | |
275 | +#define cloog_options_malloc (*cloog_pointers__.p_cloog_options_malloc) | |
276 | +#define cloog_program_dump_cloog (*cloog_pointers__.p_cloog_program_dump_cloog) | |
277 | +#define cloog_program_extract_scalars (*cloog_pointers__.p_cloog_program_extract_scalars) | |
278 | +#endif | |
279 | +#define cloog_program_free (*cloog_pointers__.p_cloog_program_free) | |
280 | +#define cloog_program_generate (*cloog_pointers__.p_cloog_program_generate) | |
281 | +#define cloog_program_malloc (*cloog_pointers__.p_cloog_program_malloc) | |
282 | +#define cloog_program_print (*cloog_pointers__.p_cloog_program_print) | |
283 | +#ifndef CLOOG_ORG | |
284 | +#undef cloog_program_scatter | |
285 | +#define cloog_program_scatter(PROG, SCATT, OPT) \ | |
286 | + (*cloog_pointers__.p_cloog_program_scatter) (PROG, SCATT) | |
287 | +#undef cloog_statement_alloc | |
288 | +#define cloog_statement_alloc(STATE, INDEX) \ | |
289 | + (*cloog_pointers__.p_cloog_statement_alloc) (INDEX) | |
290 | +#else | |
291 | +#define cloog_program_scatter (*cloog_pointers__.p_cloog_program_scatter) | |
292 | +#define cloog_statement_alloc (*cloog_pointers__.p_cloog_statement_alloc) | |
293 | +#endif | |
294 | +#define cloog_domain_union (*cloog_pointers__.p_cloog_domain_union) | |
295 | +#define cloog_matrix_read (*cloog_pointers__.p_cloog_matrix_read) | |
296 | +#define cloog_new_pol (*cloog_pointers__.p_cloog_new_pol) | |
297 | +#define cloog_vector_gcd (*cloog_pointers__.p_cloog_vector_gcd) | |
298 | +#define ppl_finalize (*cloog_pointers__.p_ppl_finalize) | |
299 | +#define ppl_assign_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_assign_Coefficient_from_mpz_t) | |
300 | +#define ppl_assign_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_assign_Linear_Expression_from_Linear_Expression) | |
301 | +#define ppl_Coefficient_to_mpz_t (*cloog_pointers__.p_ppl_Coefficient_to_mpz_t) | |
302 | +#define ppl_Constraint_coefficient (*cloog_pointers__.p_ppl_Constraint_coefficient) | |
303 | +#define ppl_Constraint_inhomogeneous_term (*cloog_pointers__.p_ppl_Constraint_inhomogeneous_term) | |
304 | +#define ppl_Constraint_space_dimension (*cloog_pointers__.p_ppl_Constraint_space_dimension) | |
305 | +#define ppl_Constraint_System_begin (*cloog_pointers__.p_ppl_Constraint_System_begin) | |
306 | +#define ppl_Constraint_System_const_iterator_dereference (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_dereference) | |
307 | +#define ppl_Constraint_System_const_iterator_equal_test (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_equal_test) | |
308 | +#define ppl_Constraint_System_const_iterator_increment (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_increment) | |
309 | +#define ppl_Constraint_System_end (*cloog_pointers__.p_ppl_Constraint_System_end) | |
310 | +#define ppl_Constraint_System_insert_Constraint (*cloog_pointers__.p_ppl_Constraint_System_insert_Constraint) | |
311 | +#define ppl_Constraint_System_space_dimension (*cloog_pointers__.p_ppl_Constraint_System_space_dimension) | |
312 | +#define ppl_Constraint_type (*cloog_pointers__.p_ppl_Constraint_type) | |
313 | +#define ppl_delete_Coefficient (*cloog_pointers__.p_ppl_delete_Coefficient) | |
314 | +#define ppl_delete_Constraint (*cloog_pointers__.p_ppl_delete_Constraint) | |
315 | +#define ppl_delete_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_delete_Constraint_System_const_iterator) | |
316 | +#define ppl_delete_Linear_Expression (*cloog_pointers__.p_ppl_delete_Linear_Expression) | |
317 | +#define ppl_delete_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron) | |
318 | +#define ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron_iterator) | |
319 | +#define ppl_delete_Polyhedron (*cloog_pointers__.p_ppl_delete_Polyhedron) | |
320 | +#define ppl_Linear_Expression_add_to_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_add_to_coefficient) | |
321 | +#define ppl_Linear_Expression_add_to_inhomogeneous (*cloog_pointers__.p_ppl_Linear_Expression_add_to_inhomogeneous) | |
322 | +#define ppl_Linear_Expression_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_coefficient) | |
323 | +#define ppl_Linear_Expression_inhomogeneous_term (*cloog_pointers__.p_ppl_Linear_Expression_inhomogeneous_term) | |
324 | +#define ppl_Linear_Expression_space_dimension (*cloog_pointers__.p_ppl_Linear_Expression_space_dimension) | |
325 | +#define ppl_new_Coefficient (*cloog_pointers__.p_ppl_new_Coefficient) | |
326 | +#define ppl_new_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_new_Coefficient_from_mpz_t) | |
327 | +#define ppl_new_Constraint (*cloog_pointers__.p_ppl_new_Constraint) | |
328 | +#define ppl_new_Constraint_System (*cloog_pointers__.p_ppl_new_Constraint_System) | |
329 | +#define ppl_new_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_new_Constraint_System_const_iterator) | |
330 | +#define ppl_new_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_C_Polyhedron) | |
331 | +#define ppl_new_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_space_dimension) | |
332 | +#define ppl_new_C_Polyhedron_recycle_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_recycle_Constraint_System) | |
333 | +#define ppl_new_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression) | |
334 | +#define ppl_new_Linear_Expression_from_Constraint (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Constraint) | |
335 | +#define ppl_new_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Linear_Expression) | |
336 | +#define ppl_new_Linear_Expression_with_dimension (*cloog_pointers__.p_ppl_new_Linear_Expression_with_dimension) | |
337 | +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron) | |
338 | +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron) | |
339 | +#define ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension) | |
340 | +#define ppl_new_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_iterator) | |
341 | +#define ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_constraint) | |
342 | +#define ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed) | |
343 | +#define ppl_Pointset_Powerset_C_Polyhedron_difference_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_difference_assign) | |
344 | +#define ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_intersection_assign) | |
345 | +#define ppl_Pointset_Powerset_C_Polyhedron_is_empty (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_is_empty) | |
346 | +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_begin) | |
347 | +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference) | |
348 | +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_end (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_end) | |
349 | +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test) | |
350 | +#define ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_increment) | |
351 | +#define ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions) | |
352 | +#define ppl_Pointset_Powerset_C_Polyhedron_maximize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_maximize) | |
353 | +#define ppl_Pointset_Powerset_C_Polyhedron_minimize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_minimize) | |
354 | +#define ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions) | |
355 | +#define ppl_Pointset_Powerset_C_Polyhedron_size (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_size) | |
356 | +#define ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_space_dimension) | |
357 | +#define ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign) | |
358 | +#define ppl_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Polyhedron_add_constraint) | |
359 | +#define ppl_Polyhedron_add_constraints (*cloog_pointers__.p_ppl_Polyhedron_add_constraints) | |
360 | +#define ppl_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Polyhedron_add_space_dimensions_and_embed) | |
361 | +#define ppl_Polyhedron_get_constraints (*cloog_pointers__.p_ppl_Polyhedron_get_constraints) | |
362 | +#define ppl_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_map_space_dimensions) | |
363 | +#define ppl_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_remove_space_dimensions) | |
364 | +#define ppl_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Polyhedron_space_dimension) | |
365 | +#define ppl_subtract_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_subtract_Linear_Expression_from_Linear_Expression) | |
366 | +#define pprint (*cloog_pointers__.p_pprint) | |
367 | +#define stmt_block (*cloog_pointers__.p_stmt_block) | |
368 | +#define stmt_for (*cloog_pointers__.p_stmt_for) | |
369 | +#define stmt_guard (*cloog_pointers__.p_stmt_guard) | |
370 | +#define stmt_root (*cloog_pointers__.p_stmt_root) | |
371 | +#define stmt_user (*cloog_pointers__.p_stmt_user) | |
4de56d3e | 372 | +#define stmt_ass (*cloog_pointers__.p_stmt_ass) |
3c926509 MT |
373 | +#define ppl_delete_Constraint_System (*cloog_pointers__.p_ppl_delete_Constraint_System) |
374 | +#define ppl_initialize (*cloog_pointers__.p_ppl_initialize) | |
375 | +#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint) | |
376 | +#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System) | |
377 | +#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image) | |
1f543606 MT |
378 | +#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron) |
379 | +#if !(PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11) | |
380 | +#define ppl_new_PIP_Problem_from_constraints (*cloog_pointers__.p_ppl_new_PIP_Problem_from_constraints) | |
381 | +#define ppl_PIP_Problem_is_satisfiable (*cloog_pointers__.p_ppl_PIP_Problem_is_satisfiable) | |
382 | +#define ppl_delete_PIP_Problem (*cloog_pointers__.p_ppl_delete_PIP_Problem) | |
383 | +#endif | |
3c926509 MT |
384 | + |
385 | +#define cloog_finalize (*cloog_pointers__.p_ppl_finalize) | |
386 | + | |
387 | + | |
388 | #endif /* GRAPHITE_CLOOG_COMPAT_H */ | |
389 | --- gcc/graphite.c.jj 2011-01-03 12:53:05.194056513 +0100 | |
390 | +++ gcc/graphite.c 2011-01-04 16:18:32.385007767 +0100 | |
1f543606 MT |
391 | @@ -56,6 +56,35 @@ along with GCC; see the file COPYING3. |
392 | ||
393 | CloogState *cloog_state; | |
3c926509 MT |
394 | |
395 | +__typeof (cloog_pointers__) cloog_pointers__; | |
396 | + | |
397 | +static bool | |
398 | +init_cloog_pointers (void) | |
399 | +{ | |
400 | + void *h; | |
401 | + | |
402 | + if (cloog_pointers__.inited) | |
403 | + return cloog_pointers__.h != NULL; | |
404 | + h = dlopen ("libcloog.so.0", RTLD_LAZY); | |
405 | + cloog_pointers__.h = h; | |
406 | + if (h == NULL) | |
407 | + return false; | |
408 | +#define DYNSYM(x) \ | |
409 | + do \ | |
410 | + { \ | |
411 | + union { __typeof (cloog_pointers__.p_##x) p; void *q; } u; \ | |
412 | + u.q = dlsym (h, #x); \ | |
413 | + if (u.q == NULL) \ | |
414 | + return false; \ | |
415 | + cloog_pointers__.p_##x = u.p; \ | |
416 | + } \ | |
417 | + while (0) | |
418 | + DYNSYMS | |
419 | +#undef DYNSYM | |
420 | + return true; | |
421 | +} | |
422 | + | |
423 | + | |
424 | /* Print global statistics to FILE. */ | |
425 | ||
426 | static void | |
1f543606 | 427 | @@ -201,6 +230,12 @@ graphite_initialize (void) |
3c926509 MT |
428 | return false; |
429 | } | |
430 | ||
431 | + if (!init_cloog_pointers ()) | |
432 | + { | |
433 | + sorry ("Graphite loop optimizations cannot be used"); | |
434 | + return false; | |
435 | + } | |
436 | + | |
437 | scev_reset (); | |
438 | recompute_all_dominators (); | |
439 | initialize_original_copy_tables (); | |
440 | --- gcc/graphite-clast-to-gimple.c.jj 2011-01-03 12:53:05.000000000 +0100 | |
441 | +++ gcc/graphite-clast-to-gimple.c 2011-01-04 16:29:55.738007463 +0100 | |
4de56d3e | 442 | @@ -836,7 +836,7 @@ clast_get_body_of_loop (struct clast_stm |
3c926509 MT |
443 | from STMT_FOR. */ |
444 | ||
445 | static tree | |
4de56d3e MT |
446 | -type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) |
447 | +type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip) | |
3c926509 | 448 | { |
4de56d3e MT |
449 | mpz_t bound_one, bound_two; |
450 | tree lb_type, ub_type; | |
451 | @@ -844,8 +844,8 @@ type_for_clast_for (struct clast_for *st | |
452 | mpz_init (bound_one); | |
453 | mpz_init (bound_two); | |
454 | ||
455 | - lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two); | |
456 | - ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two); | |
457 | + lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two); | |
458 | + ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two); | |
459 | ||
460 | mpz_clear (bound_one); | |
461 | mpz_clear (bound_two); | |
3c926509 MT |
462 | --- gcc/graphite-poly.h.jj 2011-01-03 12:53:05.000000000 +0100 |
463 | +++ gcc/graphite-poly.h 2011-01-04 17:35:53.308788629 +0100 | |
464 | @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. | |
465 | #ifndef GCC_GRAPHITE_POLY_H | |
466 | #define GCC_GRAPHITE_POLY_H | |
467 | ||
468 | +#include "graphite-cloog-util.h" | |
469 | + | |
470 | typedef struct poly_dr *poly_dr_p; | |
471 | DEF_VEC_P(poly_dr_p); | |
472 | DEF_VEC_ALLOC_P (poly_dr_p, heap); |