OSDN Git Service

2009-08-05 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / ChangeLog.graphite
1 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2
3         * ChangeLog.graphite: Fix indenting, white spaces and 80 columns.
4         * graphite-blocking.c: Same.
5         * graphite-clast-to-gimple.c: Same.
6         * graphite-dependences.c: Same.
7         * graphite-poly.c: Same.
8         * graphite-poly.h: Same.
9         * graphite-ppl.c: Same.
10         * graphite-scop-detection.c: Same.
11         * graphite-sese-to-poly.c: Same.
12         * graphite.c: Same.
13
14 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
15
16         * graphite-sese-to-poly.c (loop_entry_phi_arg): New.
17         (remove_simple_copy_phi): New.
18         (remove_invariant_phi): New.
19         (simple_copy_phi_p): New.
20         (reduction_phi_p): New.
21         (gsi_for_ssa_name_def): New.
22         (insert_out_of_ssa_copy): New.
23         (insert_out_of_ssa_copy_on_edge): New.
24         (create_zero_dim_array): New.
25         (scalar_close_phi_node_p): New.
26         (rewrite_close_phi_out_of_ssa): New.
27         (rewrite_phi_out_of_ssa): New.
28         (rewrite_reductions_out_of_ssa): New.
29         (build_poly_scop): Call rewrite_reductions_out_of_ssa.
30
31         * testsuite/gcc.dg/graphite/id-11.c: New.
32         * testsuite/gcc.dg/graphite/id-15.c: New.
33         * testsuite/gcc.dg/graphite/interchange-1.c: Un-XFAIL.
34         * testsuite/gcc.dg/graphite/interchange-2.c: Un-XFAIL.
35         * testsuite/gcc.dg/graphite/interchange-3.c: Un-XFAIL.
36         * testsuite/gcc.dg/graphite/interchange-4.c: Un-XFAIL.
37         * testsuite/gcc.dg/graphite/interchange-7.c: Un-XFAIL.
38         * testsuite/gcc.dg/graphite/scop-matmult.c: Un-XFAIL.
39         * testsuite/gfortran.dg/graphite/id-13.f: New.
40         * testsuite/gfortran.dg/graphite/id-5.f: New.
41
42 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
43
44         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not
45         check that nb_reductions_in_loop is zero.
46         * graphite-scop-detection.c (harmful_stmt_in_bb): Don't filter out
47         reduction phi nodes.
48         (nb_reductions_in_loop): Removed.
49         (graphite_can_represent_loop): Do not call nb_reductions_in_loop.
50         * graphite-sese-to-poly.c (phi_node_is_iv): Removed.
51         (bb_contains_non_iv_scalar_phi_nodes): Removed.
52         (scop_contains_non_iv_scalar_phi_nodes): Removed.
53         (build_poly_scop): Do not call scop_contains_non_iv_scalar_phi_nodes.
54
55 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
56
57         * graphite-clast-to-gimple.c (build_cloog_prog): Do not code generate
58         statements that have an empty iteration domain.
59         * testsuite/gfortran.dg/graphite/id-16.f: New.
60
61 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
62
63         * tree-scalar-evolution.c (instantiate_scev_1): Return
64         chrec_dont_know when the result is not above instantiate_below.
65         * graphite-scop-detection.c (scopdet_basic_block_info): Fix formatting.
66         * graphite-sese-to-poly.c (create_linear_expr_from_tree): Assert that
67         the tree has a known scalar evolution.
68         * testsuite/gfortran.dg/graphite/id-14.f: New.
69         * testsuite/gfortran.dg/graphite/id-15.f: New.
70
71 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
72
73         * sese.c (rename_variables_in_stmt): Pass in an extra parameter
74         insert_gsi.
75         (rename_variables): Keep inserting renames after the ones already
76         inserted.
77
78 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
79
80         * graphite-sese-to-poly.c (compare_bb_depths): New.
81         (graphite_sort_dominated_info): New.
82         (build_scop_bbs_1): Call graphite_sort_dominated_info.
83         (build_scop_scattering): Fix comment.
84
85 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
86
87         * graphite.c (graphite_finalize): Call print_loops instead of
88         dump_function_to_file.
89         * testsuite/gcc.dg/graphite/graphite.exp: Fix formatting.
90         * testsuite/gcc.dg/graphite/pr35356-1.c: New.  Look for the number of
91         loops generated in the graphite output file.
92         * testsuite/gcc.dg/graphite/pr35356-2.c: New.
93         * testsuite/gcc.dg/graphite/pr35356-3.c: New.  XFAILed for now.
94         * testsuite/gfortran.dg/graphite/id-12.f: New.
95
96 2009-07-24  Li Feng  <nemokingdom@gmail.com>
97
98         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-8.c:
99         Remove 2 XFAIL.
100
101 2009-07-24  Li Feng  <nemokingdom@gmail.com>
102             Tobias Grosser  <grosser@fim.uni-passau.de>
103
104         * graphite-sese-to-poly.c (pdr_add_alias_set): Use data reference's
105         alias set number build alias in ACCESSES polyhedron.
106         (build_alias_set_for_drs): New.
107         (build_pbb_drs): Added build_alias_set_for_drs.
108         * graphite-dependences.c (poly_drs_may_alias_p): New.
109         (graphite_carried_dependence_level_k): Check alias information
110         before building polyhedron.
111
112 2009-07-24  Tobias Grosser  <grosser@fim.uni-passau.de>
113
114         * Makefile.in (lambda-code.o): Fix formatting.
115
116 2009-07-24  Tobias Grosser  <grosser@fim.uni-passau.de>
117
118         * Merge from mainline (r149350-149952)
119
120 2009-07-18  Tobias Grosser  <grosser@fim.uni-passau.de>
121
122         * graphite-poly.c (apply_poly_transforms): Move strip_mine
123         before interchange to prepare for loop blocking.
124
125 2009-07-18  Tobias Grosser  <grosser@fim.uni-passau.de>
126
127         * graphite-poly.c (apply_poly_transforms): Add checks after every
128         transformation.
129         * graphite-sese-to-poly.c (build_poly_scop): Remove check, as already
130         done in apply_poly_transforms.
131
132 2009-07-17  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
133
134         * graphite-dependences.c (build_lexicographically_gt_constraint):
135         Replace RES parameter with *RES.
136         (dependence_polyhedron_1): Pass an address of the parameter RES
137         instead of value of RES.
138
139 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
140
141         * graphite.c (graphite_finalize): Fix comment.
142         (graphite_transform_loops): Reset scev info after code generation
143         of each scop.
144
145 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
146
147         * graphite.c (graphite_finalize): Call scev_reset.
148
149 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
150
151         * graphite-clast-to-gimple.c (compute_cloog_iv_types): Do not create
152         GBB_CLOOG_IV_TYPES hash table twice.
153         * graphite-sese-to-poly.c (free_gimple_bb): Call free_data_refs.
154         (add_condition_to_domain): Clear GMP values.
155
156 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
157
158         * graphite-dependences.c: Fix formatting.
159         * graphite-poly.c (free_poly_dr): Also free PDR_DATA_CONTAINER.
160         (pbb_number_of_iterations): Free ppl_Linear_Expression.
161         * graphite-sese-to-poly.c: Fix formatting.
162         * graphite.c (graphite_transform_loops): Create the hash table
163         after the early return.
164
165 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
166
167         * testsuite/gcc.dg/graphite/id-14.c: New.
168         * testsuite/gcc.dg/graphite/pr40157.c: New.
169         * testsuite/gfortran.dg/graphite/id-11.f: New.
170
171 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
172
173         * graphite-sese-to-poly.c (nb_pbbs_in_loops): New.
174         (build_poly_scop): Return false when there are no pbbs within
175         loops to avoid to pass to cloog scops with no loops.
176
177 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
178
179         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Avoid
180         useless test "i % 2".
181         (build_pbb_scattering_polyhedrons): Fix formatting.
182         (build_poly_dr): Same.
183         * graphite.c (graphite_transform_loops): Restructure.
184
185 2009-07-14  Razya Ladelsky  <razya@il.ibm.com>
186
187         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Remove
188         reduction_list parameter.
189         (rewrite_all_phi_nodes_with_iv): Same.
190         (canonicalize_loop_ivs): Same.
191         * tree-parloops.c (struct brli): Removed.
192         (build_reduction_list_info): Removed.
193         (build_new_reduction): New.
194         (analyze_reduction_list): Removed.
195         (gather_scalar_reductions): Find reductions instead of phi
196         nodes that can't be canonicalized.
197         (try_create_reduction_list): Remove reduction_list parameter.
198         (gen_parallel_loop): Same.
199         (parallelize_loops): Remove analyze_reductions variable,
200         initialization and free.
201         Change reduction_list htab initialization to reduction_info
202         elements instead of ssa names.
203         Call try_create_reduction_list and gen_parallel_loop without
204         analyzed_reduction argument.
205         * graphite-clast-to-gimple (graphite_loop_normal_form): Call
206         canonicalize_loop_ivs with one less argument.
207         * tree-flow.h (canonicalize_loop_ivs): Remove one argument.
208
209 2009-07-14  Konrad Trifunovic <konrad.trifunovic@gmail.com>
210
211         * graphite-dependences.c (new_poly_dr_pair): New.
212         (dependence_polyhedron): Renamed into dependence_polyhedron_1.
213         (new_poly_dr_pair): New.
214         (eq_poly_dr_pair_p): New.
215         (hash_poly_dr_pair_p): New.
216         * graphite-dependences.h (struct poly_dr_pair): New.
217         (eq_poly_dr_pair_p): Declared.
218         (hash_poly_dr_pair_p): Declared.
219         * graphite-poly.c (new_scop): Initialize SCOP_ORIGINAL_PDR_PAIRS.
220         (free_scop): Free SCOP_ORIGINAL_PDR_PAIRS.
221         * graphite-poly.h (struct scop): Add original_pdr_pairs field.
222         * Makefile.in (graphite-poly.o): Add dependence on
223         graphite-dependences.h.
224
225 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
226
227         * graphite-scop-detection.c (graphite_can_represent_scev): Do not let
228         polynomials of degree > 1 pass to Graphite.
229         * tree-chrec.c (scev_is_linear_expression): Call
230         evolution_function_is_affine_multivariate_p.
231         * testsuite/gfortran.dg/graphite/id-10.f90: New.
232
233 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
234
235         * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop):
236         Instantiate scevs varying in outer loops.
237         * testsuite/gfortran.dg/graphite/id-9.f: Correct testcase.
238
239 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
240
241         * graphite-sese-to-poly.c (build_loop_iteration_domains): Do not insert
242         redundant constraint.
243
244 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
245
246         * testsuite/gcc.dg/graphite/graphite.exp: Fix comments.
247         * testsuite/gfortran.dg/graphite/graphite.exp: Trigger actions
248         based on the file names as in the C testsuite.
249         * testsuite/gfortran.dg/graphite/block-1.f90: Fix patterns.
250         * testsuite/gfortran.dg/graphite/block-2.f: Same.
251         * testsuite/gfortran.dg/graphite/block-3.f90: Same.
252         * testsuite/gfortran.dg/graphite/block-4.f90: Same.
253         * testsuite/gfortran.dg/graphite/id-1.f90: Same.
254         * testsuite/gfortran.dg/graphite/id-2.f90: Same.
255         * testsuite/gfortran.dg/graphite/id-3.f90: Same.
256         * testsuite/gfortran.dg/graphite/id-4.f90: Same.
257         * testsuite/gfortran.dg/graphite/id-6.f: Same.
258         * testsuite/gfortran.dg/graphite/id-9.f: Same.
259         * testsuite/gfortran.dg/graphite/interchange-1.f: Same.
260         * testsuite/gfortran.dg/graphite/interchange-2.f: Same.
261         * testsuite/gfortran.dg/graphite/scop-1.f: Same.
262
263 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
264
265         * sese.c (expand_scalar_variables_call): New.
266         (expand_scalar_variables_ssa_name): Handle calls in expander.
267
268 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
269
270         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-6.c:
271         Expect to see the pattern twice.
272         * testsuite/gcc.dg/graphite/interchange-0.c: Un-XFAIL.
273         * testsuite/gcc.dg/graphite/interchange-5.c: Same.
274         * testsuite/gcc.dg/graphite/interchange-6.c: Same.
275
276 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
277
278         * testsuite/gcc.dg/graphite/id-10.c: New.
279         * testsuite/gcc.dg/graphite/id-12.c: New.
280         * testsuite/gfortran.dg/graphite/id-7.f: New.
281         * testsuite/gfortran.dg/graphite/id-8.f: New.
282
283 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
284
285         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Fix division by
286         zero.
287
288 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
289
290         * sese.c (rename_variables_in_stmt): Call fold_convert during renaming.
291
292 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
293
294         * sese.c (expand_scalar_variables_stmt): Avoid unnecessary expansion.
295
296 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
297
298         * graphite-sese-to-poly.c (pdr_add_memory_accesses): Fix order of
299         building PDR subscripts.
300
301 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
302
303         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Fix the
304         computation of array sizes.
305
306 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
307
308         * graphite-sese-to-poly.c (add_param_constraints): Disabled.
309
310 2009-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
311
312         * graphite-dependences.c (map_into_dep_poly, map_dr_into_dep_poly,
313         build_pairwise_constraint, dr_equality_constraints,
314         build_pairwise_scheduling_equality,
315         build_pairwise_scheduling_inequality, lexicographically_gt_p,
316         build_lexicographically_gt_constraint, dependence_polyhedron,
317         graphite_legal_transform_dr, graphite_carried_dependence_level_k):
318         Move from NNC_Polyhedron to C_Polyhedron.
319         * graphite-interchange.c (compute_array_size_poly,
320         gather_access_strides): Dito.
321         * graphite-poly.c (apply_poly_transforms, new_poly_dr, free_poly_bb,
322         free_scop, pbb_number_of_iterations): Dito.
323         * graphite-poly.h (struct poly_dr, pdr_nb_subscripts, struct poly_bb,
324         pbb_dim_iter_domain, struct scop): Dito.
325         * graphite-ppl.c (new_Constraint_System_from_Cloog_Matrix,
326         new_Cloog_Domain_from_ppl_Polyhedron,
327         new_Cloog_Domain_from_ppl_Pointset_Powerset, ppl_set_coef_gmp,
328         ppl_insert_dimensions_pointset, ppl_insert_dimensions_pointset,
329         ppl_strip_loop, ppl_strip_loop, ppl_print_polyhedron_matrix,
330         ppl_print_powerset_matrix, debug_ppl_polyhedron_matrix,
331         debug_ppl_powerset_matrix, ppl_read_polyhedron_matrix): Dito.
332         * graphite-ppl.h (ppl_Pointset_Powerset_C_Polyhedron_t,
333         new_C_Polyhedron_from_Cloog_Matrix, ppl_print_powerset_matrix,
334         debug_ppl_powerset_matrix, ppl_insert_dimensions_pointset): Dito.
335         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons,
336         build_loop_iteration_domains, ppl_constraint_type_from_tree_code,
337         add_condition_to_domain, add_condition_to_pbb, build_scop_context,
338         build_scop_iteration_domain, build_poly_dr): Dito
339
340 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
341
342         * testsuite/gcc.dg/graphite/graphite.exp: Added a rule to execute
343         run-id-*.c files.
344         * testsuite/gcc.dg/graphite/run-id-1.c: New.
345
346 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
347
348         * graphite-sese-to-poly.c (build_loop_iteration_domains): Add the
349         positivity constraint on the symbolic number of iterations.
350
351 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
352
353         * graphite-sese-to-poly.c (build_loop_iteration_domains): Rewrite.
354
355 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
356             Tobias Grosser  <grosser@fim.uni-passau.de>
357
358         * graphite-clast-to-gimple.c (build_scop_context): Removed.
359         (build_cloog_prog): Directly use SCOP_CONTEXT.
360         * graphite-poly.c (new_scop): Initialize SCOP_CONTEXT.
361         (free_scop): Free SCOP_CONTEXT.
362         (print_scop_context): New.
363         (print_scop): Call print_scop_context.
364         (debug_scop_context): New.
365         * graphite-poly.h (print_scop_context, debug_scop_context): Declared.
366         (struct scop): Added field context.
367         (SCOP_CONTEXT): New.
368         * graphite-sese-to-poly.c (add_param_constraints): New.
369         (build_scop_context): New.
370         (build_poly_scop): Call build_scop_context.
371
372 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
373
374         * graphite-clast-to-gimple.c (gmp_cst_to_tree): Moved...
375         * graphite-ppl.c (ppl_set_inhomogeneous_gmp, ppl_set_coef_gmp): New.
376         (ppl_set_inhomogeneous, ppl_set_coef): Moved...
377         * graphite-ppl.h: Include double-int.h and tree.h.
378         (ppl_set_inhomogeneous_gmp, ppl_set_coef_gmp): Declared.
379         (ppl_set_inhomogeneous, ppl_set_coef): ...here.
380         (gmp_cst_to_tree): ...here.  Reimplemented using mpz_get_double_int.
381         (tree_int_to_gmp, ppl_set_inhomogeneous_tree, ppl_set_coef_tree): New.
382
383 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
384
385         * graphite-clast-to-gimple.c (clast_to_gcc_expression_red): Generate
386         POINTER_PLUS_EXPR for pointer types.
387         (clast_to_gcc_expression): Same.
388
389 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
390
391         * graphite-poly.c (print_scattering_function): Early return when
392         PBB_TRANSFORMED_SCATTERING is not initialized.
393         (print_pbb_domain): Early return when PBB_DOMAIN is not initialized.
394
395 2009-07-08  Sebastian Pop  <sebastian.pop@amd.com>
396
397         * tree-parloops.c (analyze_reduction_list): Remove unused variable
398         to fix bootstrap.
399
400 2009-07-08  Razya Ladelsky  <razya@il.ibm.com>
401
402         * tree-parloops.c (analyze_reduction_list): Change return
403         value to void.
404         (try_create_reduction_list): Move the call to
405         analyze_reduction_list to the beginining.
406         Call reduction_phi with analyzed_reductions as argument
407         instead of reduction_list.
408
409 2009-07-08  Tobias Grosser  <grosser@fim.uni-passau.de>
410
411         *  Merge from mainline (r148296:149346)
412
413 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
414
415         * graphite-scop-detection.c (graphite_can_represent_init): New.
416         (graphite_can_represent_scev): Call graphite_can_represent_init:
417         check that the initial value does not contain multiplications of
418         parameters.
419         (stmt_has_simple_data_refs_p): New.
420         (stmt_simple_for_scop_p): Call stmt_simple_for_scop_p.
421         (is_simple_operand): Fix formatting.
422         * graphite-sese-to-poly.c (try_generate_gimple_bb): Fix formatting.
423
424 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
425
426         * testsuite/gcc.dg/graphite/id-13.c: New.
427         * graphite-sese-to-poly.c (graphite_stmt_p): Do not call
428         analyze_scalar_evolution, use scalar_evolution_in_region.
429         (scan_tree_for_params_right_scev): Add extra assert.
430         (parameter_index_in_region_1): Split from parameter_index_in_region.
431         (idx_record_params): Use scalar_evolution_in_region.
432         (find_params_in_bb): Same.
433         (find_scop_parameters): Same.
434         (build_loop_iteration_domains): Same.
435         (create_linear_expr_from_tree): Same.
436         * sese.c (scalar_evolution_in_region): New.
437         * sese.h (scalar_evolution_in_region): Declared.
438         (defined_in_sese_p): New.
439         * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop): Not
440         static anymore.
441         * tree-scalar-evolution.h (compute_overall_effect_of_inner_loop):
442         Declared.
443
444 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
445
446         * Makefile.in: Replace dependences on tree-chrec.h with SCEV_H.
447         TREE_DATA_REF_H also implies SCEV_H.
448
449 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
450
451         * graphite-poly.c (print_scop_params): New.
452         (print_scop): Call print_scop_params.
453         (debug_scop_params): New.
454         * graphite-poly.h (print_scop_params, debug_scop_params): Declared.
455
456 2009-07-07  Li Feng  <nemokingdom@gmail.com>
457
458         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-4.c: New.
459         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-5.c: New.
460         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-6.c: New.
461         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-7.c: New.
462         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-8.c: New.
463         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-9.c: New.
464
465 2009-07-07  Li Feng  <nemokingdom@gmail.com>
466
467         * graphite-clast-to-gimple.c (mark_loops_parallel): Dump information
468         for dependency checking part.
469         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-1.c: Add
470         tests for dependency checking.
471         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-2.c: Ditto.
472         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-3.c: Ditto.
473         * testsuite/gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: Add
474         flag -fdump-tree-graphite-all for autopar testsuites.
475
476 2009-07-06  Sebastian Pop  <sebastian.pop@amd.com>
477
478         * Makefile.in (tree-ssa-loop-manip.o): Depends on langhooks.h.
479         * tree-parloops.c (rewrite_phi_with_iv, rewrite_all_phi_nodes_with_iv,
480         canonicalize_loop_ivs): Moved...
481         * tree-ssa-loop-manip.c: ... here.  Include langhooks.h.
482
483 2009-07-06  Sebastian Pop  <sebastian.pop@amd.com>
484
485         * tree-parloops.c (try_create_reduction_list): Pass an extra
486         argument analyzed_reductions.  Call analyze_reduction_list.
487         (gen_parallel_loop): Do not call analyze_reduction_list.
488         (parallelize_loops): Init and finalize analyzed_reductions.
489
490 2009-07-06  Li Feng  <nemokingdom@gmail.com>
491
492         * testsuite/gcc.dg/graphite/graphite_autopar/graphite_autopar.exp:
493         Added flag -fno-loop-strip-mine for autopar testcase.
494
495 2009-07-04  Li Feng  <nemokingdom@gmail.com>
496
497         * graphite-dependences.c (graphite_carried_dependence_level_k): Use
498         transformed scattering dimension instead of unmatch orignal when
499         calling dependence_polyhedron.
500
501 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
502
503         * opts.c (decode_options): Enable flag_loop_strip_mine at -O2.
504
505 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
506
507         * graphite-poly.c (pbb_number_of_iterations): Check for returned
508         value 1 from ppl_Pointset_Powerset_NNC_Polyhedron_maximize.
509
510 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
511
512         * graphite-blocking.c (pbb_strip_mine_profitable_p): New.
513         (pbb_do_strip_mine): Call pbb_strip_mine_profitable_p.
514         * graphite-poly.c (pbb_number_of_iterations): New.
515         * graphite-poly.h (pbb_number_of_iterations): Declared.
516         (pbb_iterator_dim, pbb_parameter_dim): New.
517
518 2009-06-29  Sebastian Pop  <sebastian.pop@amd.com>
519
520         * graphite-clast-to-gimple.c (graphite_create_new_loop): Revert the
521         last commit on type of lower and upper bound of loops.
522
523 2009-06-29  Li Feng  <nemokingdom@gmail.com>
524
525         * Makefile.in (graphite-clast-to-gimple.o): Added dependence on
526         graphite-dependences.h.
527         * graphite-clast-to-gimple.c (new_bb_pbb_def): New.
528         (mark_bb_with_pbb): New.
529         (get_stmtfor_depth): New.
530         (find_pbb_via_hash): New.
531         (dependency_in_loop_p): New.
532         (mark_loops_parallel): New.
533         (free_aux_in_new_loops): New.
534         (translate_clast): Add parameter BB_PBB_MAPPING.  Mark newly created
535         bb with it's relevant pbb. Mark newly created loops.  Remove mark
536         innermost loop parallel without checking.
537         (gloog): Add parameter BB_PBB_MAPPING.
538         * graphite-clast-to-gimple.h (struct bb_pbb_def): New.
539         (gloog): Change declaration.
540         (mark_loop_parallel): Make extern.
541         (free_aux_in_new_loops): Declare.
542         (bb_pbb_map_hash): New.
543         (eq_bb_pbb_map): New.
544         * graphite.c (graphite_transform_loops): Added BB_PBB_MAPPING. Trigger
545         auto parallelization when flag_graphite_force_parallel is set.
546         (graphite_finalize): Added free_aux_in_new_loops.
547         * tree-parloops.c (parallelize_loops): Only generate parallel code for
548         the innermost loop that marked parallel.  Use
549         flag_graphite_force_parallel instead of loop->can_be_parallel.
550         (loop_parallel_p): Move inner most checking out of function.
551
552 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
553
554         * graphite-clast-to-gimple.c (graphite_create_new_loop): Make the
555         type of lower and upper bound of loops signed long int.
556
557 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
558
559         * cfgloopmanip.c (create_empty_loop_on_edge): Gimplify the loop exit
560         expression outside the loop.
561
562 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
563
564         * gcc.dg/graphite/interchange-8.c: New.
565
566 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
567
568         * gcc.dg/graphite/interchange-0.c: XFailed.
569         * gcc.dg/graphite/interchange-5.c: XFailed.
570         * gcc.dg/graphite/interchange-6.c: XFailed.
571
572 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
573
574         * graphite-interchange.c (compute_array_size_poly): The end of the
575         recursion should return 1.
576
577 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
578
579         * graphite-interchange.c (compute_array_size_cstr): Allow the
580         subscript multiplier to be -1.
581         (compute_array_size): Use PDR_DATA_CONTAINER and not PDR_ACCESSES.
582         * graphite-poly.c (new_poly_dr): Takes an extra argument for the
583         data_container.  Initializes PDR_DATA_CONTAINER.
584         (print_pdr_access_layout): New.
585         (print_pdr): Call print_pdr_access_layout.  Print PDR_DATA_CONTAINER.
586         * graphite-poly.h (struct poly_dr): Adjust comment.  Add a new field
587         data_container.
588         (PDR_DATA_CONTAINER): New.
589         (new_poly_dr): Update declaration.
590         * graphite-sese-to-poly.c (pdr_add_data_dimensions): New.
591         (build_poly_dr): Call pdr_add_data_dimensions.
592
593 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
594
595         * graphite-poly.h (struct poly_dr): Fix comment.
596         * graphite-sese-to-poly.c (pdr_add_alias_set): New.
597         (pdr_add_memory_accesses): New.
598         (build_poly_dr): Call pdr_add_memory_accesses and pdr_add_alias_set.
599
600 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
601
602         * graphite-poly.c (print_pdrs, debug_pdrs): New.
603         (print_pbb): Add call to print_pdrs.
604         * graphite-poly.h (print_pdrs, debug_pdrs): Declared.
605
606 2009-06-24  Konrad Trifunovic <konrad.trifunovic@gmail.com>
607             Li Feng <nemokingdom@gmail.com>
608
609         * graphite-dependences.c (graphite_carried_dependence_level_k): New.
610         (dependency_between_pbbs_p): New.
611         (lexicographically_gt_p): Assure !empty_p before polyhedron
612         intersection assign.
613         (build_lexicographically_gt_constraint): Correct lexicographically
614         judging.
615         * graphite-dependences.h: New.
616         * Makefile.in (graphite-dependences.o): Add graphite-dependences.h.
617
618 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
619
620         * graphite-clast-to-gimple.c (print_clast_stmt): New.
621         (gloog): Print to dump_file the generated clast.
622         * graphite-clast-to-gimple.h (print_clast_stmt): Declared.
623         * graphite-interchange.c (pbb_do_interchange): Fix dump formatting.
624
625 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
626
627         * graphite-poly.c (extend_scattering): Increment
628         PBB_NB_LOCAL_VARIABLES by the number of added dimensions.
629
630 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
631
632         * graphite-interchange.c (compute_array_size_poly): Added exit of
633         recursion condition.  Continue iterating even after the first equality.
634         (compute_array_size): Same.
635
636 2009-06-24  Li Feng  <nemokingdom@gmail.com>
637
638         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-1.c: Update
639         -fdump-tree-final_cleanup to -fdump-tree-optimized.
640         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-2.c: Ditto.
641         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-3.c: Ditto.
642         * testsuite/gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: Ditto.
643
644 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
645
646         * sese.c (expand_scalar_variables_stmt): Expand scalar variables
647         only when the use verifies is_gimple_reg.
648
649 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
650
651         * graphite-clast-to-gimple.c (build_cloog_prog): Fix memory corruption.
652         Allocate scaldims after call to unify_scattering_dimensions.
653
654 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
655
656         * graphite-clast-to-gimple.c (translate_clast): Fix memory leak.
657
658 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
659             Albert Cohen  <albert.cohen@inria.fr>
660
661         * graphite-blocking.c (pbb_strip_mine_loop_depth): Do not use local
662         variables for the strip mining.
663
664 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
665             Pranav Garg  <pranav.garg2107@gmail.com>
666
667         * Makefile.in (OBJS-common): Added graphite-blocking.o.
668         (graphite-sese-to-poly.o): Moved down to be in lexicographical order.
669         (graphite-blocking.o): New rule.
670         (graphite-poly.o, graphite-ppl.o): Moved to be in lexicographical order.
671         * graphite-blocking.c: New.
672         * graphite-poly.c (apply_poly_transforms): Call scop_do_strip_mine for
673         flag_loop_strip_mine.
674         (psct_scattering_dim_for_loop_depth): New.
675         * graphite-poly.h (scop_do_strip_mine): Declared.
676         (psct_add_local_variable): Increment PBB_NB_LOCAL_VARIABLES.
677         * tree-ssa-loop.c (gate_graphite_transforms): Do not fail when using
678         flag_loop_strip_mine.
679
680 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
681
682         * graphite-poly.c (extend_scattering): Avoid initializing and freeing
683         a GMP value and a PPL coefficient at each iteration of a loop.
684
685 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
686
687         * graphite-dependences.c (dependence_polyhedron): Do not use
688         pbb_nb_scattering_dims anymore.  Use pbb_nb_scattering_orig and
689         pbb_nb_scattering_transform.
690         (graphite_legal_transform_dr): Same.
691         * graphite-poly.c (extend_scattering): Same.
692         (unify_scattering_dimensions): Same.
693         (print_scattering_function): Same.
694         (new_poly_bb): Initialize PBB_NB_SCATTERING_TRANSFORM and
695         PBB_NB_LOCAL_VARIABLES.
696         * graphite-poly.h (pbb_nb_scattering): Removed declaration.
697         (struct poly_bb): Added nb_local_variables and nb_scattering_transform.
698         (PBB_NB_LOCAL_VARIABLES, PBB_NB_SCATTERING_TRANSFORM): New.
699         (pbb_nb_scattering_orig, pbb_nb_scattering_transform): New.
700         (pbb_nb_scattering_dims, pbb_nb_scattering): Removed.
701         (pbb_nb_scattering_transform): New.
702         (pbb_nb_local_vars): Return PBB_NB_LOCAL_VARIABLES.
703         (psco_scattering_dim): Add assert on parameters.
704         (psct_scattering_dim): Same.
705         (psct_scattering_dim_for_loop_depth): Declared.
706         (psct_local_var_dim): New.
707         (psco_iterator_dim, psco_parameter_dim): Add assert on parameters.
708         (psct_iterator_dim, psct_parameter_dim): Same.  To maintain the
709         correct layout, call pbb_nb_local_vars.
710         (psct_add_local_variable, psct_add_scattering_dimension): New.
711         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons):
712         Initialize PBB_NB_SCATTERING_TRANSFORM.
713
714 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
715
716         * graphite-ppl.c (set_inhomogeneous): Renamed ppl_set_inhomogeneous.
717         (set_coef): Renamed ppl_set_coef.
718         * graphite-ppl.h (ppl_set_inhomogeneous, ppl_set_coef): Declared.
719
720 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
721
722         * graphite-dependences.c (build_pairwise_scheduling_inequality): Don't
723         test a boolean against 1.
724         * graphite-interchange.c (pbb_interchange_loop_depths): Do not build
725         a new polyhedron for the PBB_TRANSFORMED_SCATTERING.
726         (pbb_do_interchange): Returns true when a transform has been performed.
727         (scop_do_interchange): Same.
728         * graphite-poly.c (apply_poly_transforms): Use the return value of
729         scop_do_interchange.
730         * graphite-poly.h (scop_do_interchange): Update declaration.
731
732 2009-06-23  Tobias Grosser  <grosser@fim.uni-passau.de>
733
734         * graphite-clast-to-gimple.c (gloog): Reset loop->aux right
735         after last use.
736         * sese.c (sese_reset_aux_in_loops): New.
737         * sese.h (sese_reset_aux_in_loops): New.
738
739 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
740
741         * graphite-sese-to-poly.c (scan_tree_for_params_int): Pass in the
742         multiplier and multiply the constant by the multiplier.
743         (scan_tree_for_params): Bound the multiplier to its MULT_EXPR.
744         (build_poly_dr): Do not use the multiplier to define the subscript.
745
746 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
747
748         * graphite-poly.c (new_poly_dr): Pass an extra argument for the
749         compiler's data reference.  Initialize PDR_CDR.
750         (print_pdr): Call dump_data_reference.
751         * graphite-poly.h (struct poly_dr): Rename black_box into pbb.
752         Add compiler_dr field.
753         (PDR_BB): Renamed PDR_PBB.
754         (PDR_CDR): New.
755         * graphite-sese-to-poly.c (build_poly_dr): Pass to new_poly_dr
756         GCC's data reference representation.
757         * tree-data-ref.c (debug_data_references, debug_data_reference): New.
758         * tree-data-ref.h (debug_data_references, debug_data_reference): Decl.
759
760 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
761
762         * graphite-poly.c (print_scattering_function): Also print the layout.
763         * graphite-poly.h (pbb_nb_local_vars): New.
764
765 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
766
767         * graphite-poly.c (print_pbb_domain): Also print the layout names.
768
769 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
770
771         * graphite-poly.c (print_pdr, debug_pdr): New.
772         * graphite-poly.h (print_pdr, debug_pdr): Declared.
773         (PDR_BASE): Removed.
774
775 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
776
777         * gcc/testsuite/gcc.dg/graphite/interchange-{1..7}.c: New avatars of
778         ltrans-{1..6,8}.c.
779
780 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
781
782         * graphite-interchange.c (compute_subscript): Allow also -1 in the
783         subscript identification column.
784         (pbb_do_interchange): Print to dump_file that some loops "will be
785         interchanged".  Rely on that chain of characters in the testcases.
786         * gcc.dg/graphite/interchange-0.c: New.
787         * gcc.dg/graphite/graphite.exp: Iterate over the testsuite
788         interchange-*.c files and compile them with -floop-interchange.
789
790 2009-06-18  Pranav Garg  <pranav.garg2107@gmail.com>
791
792         * graphite-interchange.c (interchange_profitable_p): Renamed
793         pbb_interchange_profitable_p.
794
795 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
796             Harsha Jagasia  <harsha.jagasia@amd.com>
797             Pranav Garg  <pranav.garg2107@gmail.com>
798
799         * graphite-interchange.c (interchange_profitable_p): Make static.
800         (pbb_interchange_loop_depths, pbb_do_interchange,
801         scop_do_interchange): New.
802         * graphite-poly.c (apply_poly_transforms): Call scop_do_interchange
803         for flag_loop_interchange.
804         * graphite-poly.h (scop_do_interchange): Declared.
805         * tree-ssa-loop.c (gate_graphite_transforms): Do not fail when
806         flag_loop_interchange is used.
807
808 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
809
810         * graphite-dependences.c (dependence_polyhedron): Update use of
811         pbb_nb_scattering_dims.
812         * graphite-poly.h (pbb_nb_scattering_dims): Do not pass SCOP.
813         (pbb_nb_scattering): Update use of pbb_nb_scattering_dims.
814         (psco_scattering_dim, psct_scattering_dim, psco_iterator_dim,
815         psct_iterator_dim, psco_parameter_dim, psct_parameter_dim): New.
816
817 2009-06-16  Sebastian Pop  <sebastian.pop@amd.com>
818
819         * graphite.c: Cleanup foo.
820
821 2009-06-16  Sebastian Pop  <sebastian.pop@amd.com>
822
823         * Merge from mainline (r143684:148293).
824         * Disabled libpcp until it gets fixed.
825
826 2009-06-05  Sebastian Pop  <sebastian.pop@amd.com>
827             Harsha Jagasia  <harsha.jagasia@amd.com>
828
829         * graphite-interchange.c: New.
830         * Makefile.in (graphite-interchange.o): New.
831         * graphite-poly.h (interchange_profitable_p): Declared.
832         * graphite-ppl.h (value_max): New.
833
834 2009-06-04  Sebastian Pop  <sebastian.pop@amd.com>
835
836         * graphite-dependences.c (dependence_polyhedron): Use pdr_dim.
837         * graphite-poly.h: Fix some comments.
838         (pdr_dim): New.
839         (pdr_scop): New.
840
841 2009-06-04  Sebastian Pop  <sebastian.pop@amd.com>
842
843         * graphite-poly.h
844         (pdr_accessp_nb_subscripts): Renamed pdr_nb_subscripts.
845         (pdr_accessp_nb_iterators): Renamed pdr_dim_iter_domain.
846         (pdr_accessp_nb_params): Renamed pdr_nb_params.
847         (pdr_accessp_alias_set_dim): Renamed pdr_alias_set_dim.
848         (pdr_accessp_subscript_dim): Renamed pdr_subscript_dim.
849         (pdr_accessp_iterator_dim): Renamed pdr_iterator_dim.
850         (pdr_accessp_param_dim): Renamed pdr_parameter_dim.
851         (pbb_nb_loops): Renamed pbb_dim_iter_domain.
852         * graphite-clast-to-gimple.c: Same.
853         * graphite-dependences.c: Same.
854         * graphite-poly.c: Same.
855         * graphite-sese-to-poly.c: Same.
856
857 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
858
859         * graphite-clast-to-gimple.c (build_iv_mapping): Insert full
860         expressions for an IV rename, as returned by clast_to_gcc_expression.
861         (copy_renames): Rename new_name to expr.
862         * sese.c (debug_rename_elt): Same.
863         (get_rename): Same.
864         (set_rename): Same.
865         (sese_adjust_liveout_phis): Call force_gimple_operand before using
866         the information from the rename map.
867         (rename_variables_in_stmt): Same.
868         (add_loop_exit_phis): Rename new_name to expr.
869         (insert_loop_close_phis): Same.
870         (add_guard_exit_phis): Same.  Call force_gimple_operand.
871         * sese.h (struct rename_map_elt): Rename new_name to expr.
872         (new_rename_map_elt): Same.
873
874 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
875
876         * graphite-clast-to-gimple.c (build_iv_mapping): Use set_rename.
877         * sese.c (set_rename): Make it extern.
878         * sese.h (set_rename): Declared.
879
880 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
881
882         * graphite-poly.c (extend_scattering): Free values.
883         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Pointset_Powerset):
884         Free iterators.
885         (ppl_print_powerset_matrix): Same.
886         * graphite-scop-detection.c (free_scops_1): New.
887         (limit_scops): Call free_scops_1.
888         * graphite-sese-to-poly.c (build_scop_bbs_1): Free dom.
889         (build_poly_dr): Free PPL coefficients.
890         * tree-parloops.c (rewrite_all_phi_nodes_with_iv): Free bbs.
891
892 2009-06-02  Sebastian Pop  <sebastian.pop@amd.com>
893
894         * graphite-dependences.c: New.
895         * graphite-data-ref.c: Removed.
896         * graphite-data-ref.h: Removed.
897         * Makefile.in (graphite-data-ref.o): Removed.
898         (graphite-dependences.o): Added.
899         * graphite-clast-to-gimple.c: Remove dependence on graphite-data-ref.h.
900         * graphite-poly.c: Same.
901         Move the data dependence testing to graphite-dependences.c.
902
903 2009-05-19  Tobias Grosser  <grosser@fim.uni-passau.de>
904
905         * graphite-scop-detection.c (graphite_can_represent_loop): Renamed
906         from graphite_cannot_represent_loop. Code refactored.
907         (scopdet_basic_block_info): Call graphite_can_represent_loop.
908
909 2009-05-17  Li Feng  <nemokingdom@gmail.com>
910
911         * testsuite/gcc.dg/graphite/graphite_autopar/graphite_autopar.exp:
912         Cover all the testcases (not only the filtered ones).
913
914 2009-05-17  Tobias Grosser  <grosser@fim.uni-passau.de>
915
916         * graphite-scop-detection.c (stmt_simple_for_scop_p): Remove
917         unnecessary check. Update comments. Move check for REAL_TYPE here.
918         (harmful_stmt_in_bb): Remove checks for conditions. This is already
919         done in (stmt_simple_for_scop_p).
920
921 2009-05-14 Tobias Grosser  <grosser@fim.uni-passau.de>
922
923         * graphite.c (print_global_statistics): New.
924         (print_graphite_scop_statistic): New.
925         (print_graphite_statistics): New.
926         (graphite_initialize, graphite_transform_loops): Print statistics.
927         * graphite-scop-detection (build_scops): Print statistics.
928         (print_graphite_scop_statistics): New.
929         (print_graphite_statistics): New.
930
931 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
932
933         * graphite-clast-to-gimple.c (struct clast_name_index): Removed.
934         (debug_clast_name_index): Removed.
935         (debug_clast_name_indexes_1): Removed.
936         (debug_clast_name_indexes): Removed.
937         (clast_name_index_elt_info): Removed.
938         (eq_clast_name_indexes): Removed.
939         (clast_name_to_index): Removed.
940         (new_clast_name_index): Removed.
941         (save_clast_name_index): Removed.
942         (save_var_name): Moved...
943         (init_sese_params_index): Removed.
944         (clast_name_to_gcc): Remove use of name_tree.
945         (initialize_cloog_names): Same.
946         (gloog): Do not call init_sese_params_index.
947         * graphite-sese-to-poly.c (save_var_name): ...here.
948         (parameter_index_in_region): New.
949         * sese.c (new_sese): Initialize SESE_PARAMS_NAMES.
950         (parameter_index_in_region): Removed.
951         (is_parameter): Remove use of name_tree.
952         * sese.h (struct name_tree): Removed.
953         (struct sese): Remove use of name_tree.  New field params_names.
954         (SESE_PARAMS_NAMES): New.
955         (SESE_PARAMS): Remove duplicate.
956         (parameter_index_in_region): Removed.
957         (sese_nb_params): Remove use of name_tree.
958         (struct clast_name_index): New.
959         (new_clast_name_index): New.
960         (clast_name_to_index): New.
961         (save_clast_name_index): New.
962         (debug_clast_name_index): New.
963         (debug_clast_name_indexes_1): New.
964         (debug_clast_name_indexes): New.
965         (clast_name_index_elt_info): New.
966         (eq_clast_name_indexes): New.
967
968 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
969
970         * graphite-clast-to-gimple.c (compute_cloog_iv_types_1): Call
971         pbb_to_depth_to_oldiv.  Remove call to oldiv_for_loop.
972         (graphite_loop_normal_form): Do not pass region.  Do not
973         initialize SESE_OLDIVS.
974         (build_graphite_loop_normal_form): Update call to
975         graphite_loop_normal_form.
976         * sese.c (debug_oldivs): Removed.
977         (new_sese): Do not initialize SESE_OLDIVS.
978         (free_sese): Do not free SESE_OLDIVS.
979         (oldiv_for_loop): Removed.
980         * sese.h (struct sese): Remove old_ivs.
981         (SESE_OLDIVS): Removed.
982         (oldiv_for_loop): Removed.
983
984 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
985
986         * graphite-clast-to-gimple.c (clast_name_to_gcc): Pass newivs,
987         remove ivstack.  Remove call to loop_iv_stack_get_iv_from_name,
988         replaced by a call to newivs_to_depth_to_newiv.
989         (clast_to_gcc_expression): Pass newivs, remove ivstack.
990         (clast_to_gcc_expression_red): Same.
991         (gcc_type_for_clast_expr): Same.
992         (gcc_type_for_clast_eq): Same.
993         (graphite_translate_clast_equation): Same.
994         (graphite_create_guard_cond_expr): Same.
995         (graphite_create_new_guard): Same.
996         (graphite_create_new_loop): Same.
997         (build_iv_mapping): Same.
998         (translate_clast): Same.
999         (gloog): Same.
1000         (loop_iv_stack_patch_for_consts): Removed.  *
1001         sese.c (iv_stack_entry_is_constant): Removed.
1002         (iv_stack_entry_is_iv): Removed.
1003         (loop_iv_stack_push_iv): Removed.
1004         (loop_iv_stack_insert_constant): Removed.
1005         (loop_iv_stack_pop): Removed.
1006         (loop_iv_stack_get_iv): Removed.
1007         (loop_iv_stack_get_iv_from_name): Removed.
1008         (debug_loop_iv_stack): Removed.
1009         (free_loop_iv_stack): Removed.
1010         (loop_iv_stack_remove_constants): Removed.  *
1011         sese.h (iv_stack_entry_kind): Removed.
1012         (iv_stack_entry_data_union): Removed.
1013         (iv_stack_entry_struct): Removed.
1014         (iv_stack_entry_p): Removed.
1015         (debug_oldivs, debug_loop_iv_stack, loop_iv_stack_insert_constant,
1016         loop_iv_stack_get_iv_from_name, loop_iv_stack_push_iv,
1017         loop_iv_stack_get_iv, loop_iv_stack_remove_constants,
1018         loop_iv_stack_pop, free_loop_iv_stack): Removed.
1019         (gbb_loop_at_index): Fix indenting.
1020         (gbb_loop_index): Removed.
1021
1022 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1023
1024         * graphite-clast-to-gimple.c (clast_name_to_gcc): Do not use strcmp.
1025         Call clast_name_to_index.
1026
1027 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1028
1029         * graphite-clast-to-gimple.c (clast_name_to_gcc): Pass region,
1030         do not pass params.  Get params from SESE_PARAMS.
1031         (clast_to_gcc_expression): Same.
1032         (clast_to_gcc_expression_red): Same.
1033         (gcc_type_for_clast_eq): Same.
1034         (graphite_translate_clast_equation): Same.
1035         (graphite_create_new_loop): Same.
1036         * sese.c (rename_variables_in_stmt): Fix comment.
1037
1038 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1039
1040         * graphite-clast-to-gimple.c (graphite_create_new_loop): Pass
1041         newivs_index.
1042         Call save_clast_name_index.
1043         (translate_clast): Pass newivs_index.
1044         (gloog): Create and free newivs_index.
1045
1046 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1047
1048         * graphite-clast-to-gimple.c (clast_name_index): New structure.
1049         (clast_name_index_p): New type.
1050         (debug_clast_name_index): New.
1051         (debug_clast_name_indexes_1): New.
1052         (debug_clast_name_indexes): New.
1053         (clast_name_index_elt_info): New.
1054         (eq_clast_name_indexes): New.
1055         (clast_name_to_index): New.
1056         (new_clast_name_index): New.
1057         (save_clast_name_index): New.
1058         (init_sese_params_index): New.
1059         (gloog): Call init_sese_params_index.
1060         * graphite-clast-to-gimple.h (debug_clast_name_indexes): Declared.
1061         * sese.c (new_sese): Initialize SESE_PARAMS_INDEX.
1062         (free_sese): Free SESE_PARAMS_INDEX.
1063         * sese.h (struct sese): Add params_index.
1064         (SESE_PARAMS_INDEX): New.
1065
1066 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1067
1068         * graphite-clast-to-gimple.c (newivs_to_depth_to_newiv): New.
1069         (graphite_create_new_loop): Pass the newivs vector.  Push the
1070         newly created IV to newivs.
1071         (translate_clast): Pass the newivs vector.
1072         (gloog): Create and destroy the newivs vector.
1073
1074 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
1075
1076         * graphite-clast-to-gimple.c (pbb_to_depth_to_oldiv): New.
1077         (graphite_loop_normal_form): Initialize loop->aux with the unique
1078         IV that has been created.
1079
1080 2009-05-13 Tobias Grosser  <grosser@fim.uni-passau.de>
1081
1082         * tree-chrec.c (evolution_function_right_is_integer_cst): Allow
1083         scev with parameters in the base part. They where forbidden
1084         exidently.
1085
1086 2009-05-11  Li Feng  <nemokingdom@gmail.com>
1087
1088         * testsuite/gcc.dg/graphite/graphite.exp: Set different default
1089         compile options by file names.
1090         * testsuite/gcc.dg/graphite/block{0-6}.c: Remove dg-option line.
1091         * testsuite/gcc.dg/graphite/id-{1-9}.c: Ditto.
1092         * testsuite/gcc.dg/graphite/scop-{0-20}.c: Ditto.
1093         * testsuite/gcc.dg/graphite/scop-matmult.c: Ditto.
1094
1095 2009-05-08  Li Feng <nemokingdom@gmail.com>
1096
1097         * testsuite/gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: New.
1098         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-1.c: New.
1099         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-2.c: New.
1100         * testsuite/gcc.dg/graphite/graphite_autopar/force-parallel-3.c: New.
1101
1102 2009-05-07  Tobias Grosser  <grosser@fim.uni-passau.de>
1103
1104         * graphite-scop-detection (build_scops_1): Fix little bug introduced
1105         by final cleanup.
1106
1107 2009-05-07  Tobias Grosser  <grosser@fim.uni-passau.de>
1108
1109         * graphite-scop-detection.c (graphite_can_represent_scev): Only
1110         allow integer constant strides.
1111         (graphite_can_represent_expr): Depend on outermost_loop.
1112         (stmt_simple_memref_p, graphite_cannot_represent_loop,
1113         harmful_stmt_in_bb, is_simple_operand, stmt_simple_for_scop_p,
1114         build_scops_1): Same.
1115         (scopdet_basic_block_info): Same and insert layered SCoP
1116         detection.
1117         (try_generate_gimple_bb): Cleanup.
1118         (build_scops): Enable data references.
1119
1120         * testsuite/gcc.dg/graphite/id-5.c: New.
1121         * testsuite/gcc.dg/graphite/id-9.c: New.
1122         * tree-chrec.c (evolution_function_right_is_integer_cst): New.
1123         * tree-chrec.h (evolution_function_right_is_integer_cst): New.
1124
1125 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
1126
1127         * sese.c (expand_scalar_variables_ssa_name): Only build expressions,
1128         that we have not yet built for this SCoP.
1129
1130 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
1131
1132         * sese.c (expand_scalar_variables_expr): Fix expand_scalar_variables
1133         for complex numbers.
1134
1135 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
1136
1137         * graphite-ppl.c: Fix build if cloog is not available.
1138
1139 2009-05-04  Li Feng  <nemokingdom@gmail.com>
1140
1141         * tree-parloops.c (loop_parallel_p): Remove construction of
1142         NITER and REDUCTION_LIST.
1143         (try_get_loop_niter): New.
1144         (try_create_reduction_list): New.
1145         (parallelize_loops): Bypass the failed checkings in autopar
1146         when can_be_parallel in loop structure is set to true.
1147
1148 2009-05-01  Tobias Grosser  <grosser@fim.uni-passau.de>
1149
1150         * testsuite/gcc.dg/graphite/id-6.c: Update testcase.
1151         * testsuite/gcc.dg/graphite/scop-3.c: Dito.
1152
1153 2009-05-01  Tobias Grosser  <grosser@fim.uni-passau.de>
1154
1155         * graphite-scop-detection.c (stmt_simple_for_scop_p):
1156         Enable EQ_EXPR and NE_EXPR again.
1157
1158 2009-04-30  Tobias Grosser  <grosser@fim.uni-passau.de>
1159
1160         * graphite-scop-detection.c (graphite_can_represent_scev):
1161         Add check if scev is affine multivariate.
1162         (harmful_stmt_in_bb): Check if we can represent the conditions.
1163         (scopdet_basic_block_info (basic_block bb, VEC): Pass the loop to
1164         harmful_stmt_in_bb.
1165         * testsuite/gcc.dg/graphite/id-7.c: New.
1166
1167 2009-04-30  Tobias Grosser  <grosser@fim.uni-passau.de>
1168
1169         * graphite-sese-to-poly.c (bb_contains_non_iv_scalar_phi_nodes):
1170         Check all bbs in region, not only the bbs that are represented in
1171         GRAPHITE.
1172         (build_poly_scop): Add newline.
1173         * testsuite/gcc.dg/graphite/id-8.c: New.
1174
1175 2009-04-30  Li Feng  <nemokingdom@gmail.com>
1176
1177         * cfgloop.c (alloc_loop): Initialize can_be_parallel to false
1178         when loop initialize.
1179         * cfgloop.h (struct loop): Introduce flag can_be_parallel.
1180         * common.opt: Declare flag_graphite_force_parallel.
1181         * graphite-clast-to-gimple.c (translate_clast): Mark the innermost
1182         loop parallel.
1183         * graphite-poly.c (apply_poly_transforms): Introduce
1184         flag_graphite_force_parallel.
1185         * tree-ssa-loop.c (gate_graphite_transforms): ditto.
1186         * toplev.c (process_options): ditto and replace a not correctly
1187         encoded space.
1188
1189 2009-04-30  Li Feng  <nemokingdom@gmail.com>
1190
1191         * graphite-clast-to-gimple.c (loop_iv_stack_patch_for_consts):
1192         Change the call of gbb_loop_at_index and/or gbb_loop_index due
1193         to the redefinition.
1194         (compute_cloog_iv_types_1): ditto.
1195         (build_iv_mapping): ditto.
1196         * graphite-sese-to-poly.c (new_gimple_bb): Remove GBB_LOOPS related
1197         initialization.
1198         (free_gimple_bb): Removed GBB_LOOPS related free part.
1199         (build_bb_loops): Removed.
1200         * sese.h (struct gimple_bb): Removed loops.
1201         (GBB_LOOPS): Removed.
1202         (gbb_loop_at_index): Instead of using GBB_LOOPS, we use sese instead.
1203         (gbb_loop_index): ditto.
1204
1205 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
1206
1207         * graphite-scop-detection.c (graphite_can_represent_scev): Do not
1208         allow non constant strides.
1209         * testsuite/gcc.dg/graphite/scop-20.c: New.
1210
1211 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1212
1213         * graphite-scop-detection.c (dot_all_scops): Fix system call
1214         return value warning.
1215         (dot_scop): Same.
1216
1217 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1218
1219         * testsuite/gcc.dg/graphite/id-6.c: Fix pattern.
1220         * testsuite/gcc.dg/graphite/scop-3.c: Same.
1221
1222 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1223
1224         * graphite-poly.c (map_into_dep_poly, map_dr_into_dep_poly,
1225         build_pairwise_constraint, dr_equality_constraints,
1226         build_pairwise_scheduling_equality,
1227         build_pairwise_scheduling_inequality, lexicographically_gt_p,
1228         build_lexicographically_gt_constraint, dependence_polyhedron,
1229         graphite_legal_transform_dr, graphite_legal_transform_bb,
1230         graphite_legal_transform): New.
1231         * graphite-poly.h (graphite_legal_transform): Declared.
1232         * graphite-sese-to-poly.c (build_poly_scop): Call to
1233         graphite_legal_transform is disabled for the moment.
1234
1235 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1236
1237         * graphite-poly.h (pbb_nb_scattering_dims): New.
1238         (pbb_nb_scattering): Use it.
1239
1240 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1241
1242         * graphite-ppl.c (ppl_insert_dimensions_pointset): Add
1243         Pointset_Powerset version of ppl_insert_dimensions.
1244         * graphite-ppl.h (ppl_insert_dimensions_pointset): Declared.
1245
1246 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1247
1248         * graphite-ppl.c (ppl_insert_dimensions): Fix formatting.
1249
1250 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1251
1252         * graphite-poly.h: Fix comment.
1253
1254 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
1255
1256         * graphite-sese-to-poly.c (build_poly_dr): Fix data ref multiplier.
1257
1258 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
1259
1260         * sese.c (expand_scalar_variables_stmt): Only iterate over the old
1261         statements.
1262
1263 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
1264
1265         * graphite-sese-to-poly.c (var_used_in_not_loop_header_phi_node): New.
1266         (graphite_stmt_p): Represent bbs necessary to build the phi nodes of
1267         conditions.
1268
1269 2009-04-20  Sebastian Pop  <sebastian.pop@amd.com>
1270
1271         * graphite-scop-detection.c (stmt_simple_for_scop_p): Do not
1272         handle EQ_EXPR and NE_EXPR.
1273
1274 2009-04-17  Tobias Grosser  <grosser@fim.uni-passau.de>
1275
1276         * graphite-poly.h (poly_dr): Fix comment.
1277
1278 2009-04-09  Sebastian Pop  <sebastian.pop@amd.com>
1279             Tobias Grosser  <grosser@fim.uni-passau.de>
1280
1281         * graphite-poly.c (new_poly_bb): Do not initialize PBB_DOMAIN
1282         with a zero dimension polyhedron.
1283         (find_scop_parameters): Move the call to scop_set_nb_params here.
1284         (build_loop_iteration_domains): Store in loop->aux the iteration
1285         domain polyhedron.
1286         (build_scop_iteration_domain): Fix PBB_DOMAIN for bbs not surrounded
1287         by any loop in scop.
1288         (build_poly_scop): Do not call scop_set_nb_params.
1289
1290 2009-04-09  Sebastian Pop  <sebastian.pop@amd.com>
1291             Tobias Grosser  <grosser@fim.uni-passau.de>
1292
1293         * graphite-sese-to-poly.c (add_condition_to_pbb): Pass code to
1294         add_condition_to_domain not GT_EXPR.
1295
1296 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
1297
1298         * graphite-ppl.c (debug_ppl_powerset_matrix): New.
1299         * graphite-ppl.h (debug_ppl_powerset_matrix): New.
1300         * graphite-sese-to-poly.c (add_condition_to_pbb): Use
1301         upper_bound_assign to calculate unions.
1302         * testsuite/gcc.dg/graphite/id-6.c: New.
1303
1304 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
1305
1306         * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Do not
1307         handle abnormal edges.
1308
1309 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
1310
1311         * graphite-poly.c (new_poly_dr, free_poly_dr): New.
1312         (free_poly_bb): Also free poly_drs.
1313         * graphite-poly.h (new_poly_dr, free_poly_dr): New.
1314         (poly_dr): Polyhedron to Pointset_Powerset.
1315         (pdr_accessp_nb_subscripts): Same.
1316         * graphite-sese-to-poly.c (build_poly_dr): Same. And actually build
1317         poly_drs.
1318
1319 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1320
1321         * graphite-clast-to-gimple.c (initialize_cloog_names): Change cloog
1322         names into more meaningful names.
1323
1324 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1325
1326         * testsuite/gfortran.dg/graphite/interchange-1.c: New.
1327         * testsuite/gfortran.dg/graphite/interchange-2.c: New.
1328
1329 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1330
1331         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not build
1332         the reduction_list.
1333         * tree-parloops.c (rewrite_phi_with_iv): New.
1334         (rewrite_all_phi_nodes_with_iv): New.
1335         (canonicalize_loop_ivs): Call them.
1336
1337 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1338
1339         * graphite-sese-to-poly.c (try_generate_gimple_bb): Use
1340         graphite_find_data_references_in_stmt.
1341         * tree-data-ref.c (graphite_find_data_references_in_stmt): New.
1342         * tree-data-ref.h (graphite_find_data_references_in_stmt): Declared.
1343
1344 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1345
1346         * sese.c (add_loop_exit_phis): Don't fail on non SSA_NAME renames.
1347
1348 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1349
1350         * graphite-sese-to-poly.c (build_scop_bbs_1): Use bb_in_sese_p
1351         instead of bb_in_region.
1352         (flag_bb_in_region): Same.  Renamed flag_bb_in_sese.
1353         (build_sese_conditions): Use flag_bb_in_sese.
1354         * sese.c (register_bb_in_sese): Removed.
1355         (new_sese): Remove initialization of SESE_REGION_BBS.
1356         (free_sese): Do not free SESE_REGION_BBS.
1357         * sese.h (struct sese): Remove field region_basic_blocks.
1358         (SESE_REGION_BBS): Removed.
1359         (bb_in_sese_p): Implement in function of bb_in_region.
1360
1361 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
1362
1363         * graphite-scop-detection.c (limit_scops): Deal only with single exit
1364         loops.
1365
1366 2009-04-08  Tobias Grosser  <grosser@fim.uni-passau.de>
1367
1368         * graphite-scop-detection.c (stmt_simple_for_scop_p): Allow NE_EXPR
1369         and EQ_EXPR.
1370         * graphite-sese-to-poly.c (create_linear_expr_from_tree): New.
1371         (add_condition_to_domain): New.
1372         (add_condition_to_pbb): New.
1373         (add_conditions_to_domain): Cleanup and handle of NE_EXPR and EQ_EXPR.
1374         * testsuite/gcc.dg/graphite/scop-3.c: Update number of detected SCoPs.
1375
1376 2009-04-08  Tobias Grosser  <grosser@fim.uni-passau.de>
1377
1378         * graphite-clast-to-gimple.c (build_cloog_prog): ppl_Polyhedron ->
1379         ppl_Pointset_Powerset.
1380         * graphite-poly.c (new_poly_bb, free_poly_bb): Same.
1381         * graphite-poly.h (poly_bb): poly_bb.domain Same.
1382         (pbb_nb_loops): Same.
1383         * graphite-sese-to-poly.c (build_loop_iteration_domains,
1384         add_conditions_to_domain): Same.
1385         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Pointset_Powerset): New.
1386         (ppl_print_polyhedron_matrix): ppl_Polyhedron_t ->
1387         ppl_const_Polyhedron_t.
1388         (ppl_print_powerset_matrix): New.
1389         * graphite-ppl.h (new_Cloog_Domain_from_ppl_Pointset_Powerset,
1390         ppl_print_powerset_matrix): New.
1391         (ppl_print_polyhedron_matrix): Updated.
1392
1393 2009-04-07  Sebastian Pop  <sebastian.pop@amd.com>
1394
1395         * tree-scalar-evolution.c (analyze_scalar_evolution_1): Fix comment.
1396
1397 2009-04-07  Sebastian Pop  <sebastian.pop@amd.com>
1398
1399         * graphite-poly.c (extend_scattering): Fix indenting.  Free cstr.
1400         (print_iteration_domains, debug_iteration_domain,
1401         debug_iteration_domains): New.
1402         * graphite-poly.h (print_iteration_domains, debug_iteration_domain,
1403         debug_iteration_domains): Declared.
1404         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Fix
1405         indenting.
1406
1407 2009-04-03  Tobias Grosser  <grosser@fim.uni-passau.de>
1408             Sebastian Pop  <sebastian.pop@amd.com>
1409
1410         * graphite-poly.h (print_iteration_domain): New.
1411         * graphite-sese-to-poly.c (add_conditions_to_domain): Fixed bug.
1412         (build_sese_conditions_1, build_sese_conditions_after,
1413         build_sese_conditions_before): New.
1414         (build_sese_conditions): Rewritten.
1415
1416 2009-04-03  Sebastian Pop  <sebastian.pop@amd.com>
1417             Tobias Grosser  <grosser@fim.uni-passau.de>
1418
1419         Cleanup of code generation liveouts.
1420         * graphite-clast-to-gimple.c (translate_clast): Use a single
1421         rename_map instead of one per translated statement.
1422         Do not use SESE_LIVEOUT_RENAMES.
1423         (graphite_loop_normal_form): Do not use SESE_REDUCTION_LIST.
1424         (gloog): Do not use SESE_LIVEOUT_RENAMES.
1425         * graphite-scop-detection.c (harmful_stmt_in_bb): Return the close
1426         phi node of a reduction: when a loop contains a reduction used outside
1427         the loop, there should be a scalar close phi node on the exit block.
1428         * sese.c (new_sese): Do not initialize SESE_LIVEOUT,
1429         SESE_LIVEOUT_RENAMES, and SESE_REDUCTION_LIST.
1430         (free_sese): Do not free them.
1431         (sese_build_liveouts_use): Do not use them.
1432         (sese_build_liveouts_bb): Same.
1433         (sese_build_liveouts): Same.
1434         (sese_insert_phis_for_liveouts): Same.
1435         (sese_adjust_phis_for_liveouts): Same.  Renamed sese_adjust_liveout_phis.
1436         (defined_in_loop_p): New.
1437         (alive_after_loop): New.
1438         (close_phi_not_yet_inserted_p): New.
1439         (struct alep, alep_p): New.
1440         (add_loop_exit_phis): Remove from the rename_map all the names defined
1441         in the code generated loop.
1442         (insert_loop_close_phis): Traverse the rename_map passed to it.
1443         Don't use SESE_LIVEOUT_RENAMES.
1444         (default_liveout_before_guard): Renamed default_before_guard.
1445         (insert_guard_phis): Do not use SESE_LIVEOUT_RENAMES.
1446         (graphite_copy_stmts_from_block): Do not directly call set_rename.
1447         (register_sese_liveout_renames): Removed.
1448         (copy_bb_and_scalar_dependences): Do not call it.
1449         * sese.h (struct sese): Removed fields: liveout, liveout_renames, and
1450         reduction_list.
1451         (SESE_LIVEOUT): Removed.
1452         (SESE_LIVEOUT_RENAMES): Removed.
1453         (SESE_REDUCTION_LIST): Removed.
1454         (sese_build_liveouts): Removed.
1455         (sese_adjust_phis_for_liveouts): Renamed sese_adjust_liveout_phis.
1456         (insert_loop_close_phis): Pass a htab_t instead of a sese.
1457         (insert_guard_phis): Same.
1458         (rename_map_elt): Declare a VEC of them.
1459         * tree-parloops.c (canonicalize_loop_ivs): reduction_list contains
1460         trees not pointers to trees.
1461
1462         Rewrite in canonical close SSA form:
1463         * graphite-scop-detection.c (contains_only_close_phi_nodes): New.
1464         (limit_scops): Close the scop after the block containing the close phi
1465         nodes.
1466         (canonicalize_loop_closed_ssa): New.
1467         (canonicalize_loop_closed_ssa_form): New.
1468         (build_scops): Call canonicalize_loop_closed_ssa_form.
1469
1470         * graphite-sese-to-poly.c: Fix typos.
1471
1472 2009-04-03  Sebastian Pop  <sebastian.pop@amd.com>
1473
1474         * graphite-poly.c (print_scattering_function, print_pbb_domain):
1475         Extended.
1476         (dump_gbb_conditions, dump_gbb_cases, print_iteration_domain): New.
1477         (print_pbb): Add conditions.
1478
1479 2009-04-01  Tobias Grosser  <grosser@fim.uni-passau.de>
1480             Sebastian Pop  <sebastian.pop@amd.com>
1481
1482         * graphite-scop-detection.c (bb_in_sd_region): Use bb_in_region.
1483         * graphite-sese-to-poly.c (all_non_dominated_preds_marked_p): New.
1484         (build_scop_bbs_1): New.
1485         (build_scop_bbs): Rewrite.
1486         * sese.h (bb_in_region): New.
1487
1488 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
1489
1490         * graphite-poly.c (new_poly_bb, free_poly_bb): Initialize/free
1491         poly_drs vector.
1492         (print_scop): Style.
1493         * graphite-poly.h (poly_bb): Add drs vector.
1494         (PBB_DRS): Add accessor.
1495         * graphite-sese-to-poly.c (build_poly_dr): New.
1496         (build_pbb_drs, build_scop_drs): New.
1497         (build_poly_scop): call build_scop_drs (Disabled at the moment).
1498
1499 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
1500
1501         * tree-ssa-loop.c: Include forgotten toplev.h
1502
1503 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
1504
1505         * graphite-poly.c: (apply_poly_transforms): sorry -> gcc_unreachable.
1506         * testsuite/gcc.dg/graphite/pr37883.c: Remove -floop-*
1507         * testsuite/gcc.dg/graphite/pr37928.c: Same
1508         * testsuite/gcc.dg/graphite/pr38409.c: Same
1509         * testsuite/gcc.dg/graphite/pr38498.c: Same
1510         * testsuite/gcc.dg/graphite/pr38559.c: Same
1511         * testsuite/gcc.dg/graphite/pr39335.c: Same
1512         * testsuite/gcc.dg/graphite/pr39335_1.c: Same
1513         * testsuite/gfortran.dg/graphite/block-2.f: Same
1514         * tree-ssa-loop.c (gate_graphite_transforms): Always fail if called
1515         with -floop-*.
1516
1517 2009-03-28  Tobias Grosser  <grosser@fim.uni-passau.de>
1518
1519         * graphite-sese-to-poly.c (ref_nb_loops, build_access_matrix_with_af,
1520         build_access_matrix, build_scop_data_accesses): Remove access function
1521         building. (We get a new version soon).
1522         (build_bb_loops, scan_tree_for_params_right_scev): Update.
1523         * sese.h (nb_loops_around_loop_in_sese): Remove.
1524         (sese_loop_depth): Do not use SESE_LOOP_NEST any more.
1525
1526 2009-03-27  Tobias Grosser  <grosser@fim.uni-passau.de>
1527             Sebastian Pop  <sebastian.pop@amd.com>
1528
1529         * graphite-scop-detection.c (struct scopdet_info): Rename last
1530         field to exit.
1531         (scopdet_basic_block_info, build_scops_1): Don't use
1532         CDI_POST_DOMINATORS.  CDI_POST_DOMINATORS should never be used.
1533
1534 2009-03-26  Tobias Grosser  <grosser@fim.uni-passau.de>
1535             Sebastian Pop  <sebastian.pop@amd.com>
1536
1537         * graphite-clast-to-gimple.c (gloog): Call sese_build_liveouts.
1538         * sese.c (sese_build_liveouts_use): Renamed from
1539         sese_build_livein_liveouts_use. Remove liveins.
1540         (sese_build_liveouts_bb): Renamed from sese_build_livein_liveouts_bb.
1541         Call sese_build_liveouts_use.
1542         (sese_build_liveouts): Renamed from sese_build_livein_liveouts.
1543         Call sese_build_liveouts_bb.
1544         (new_sese, free_sese): Remove liveins.
1545         (sese_add_exit_phis_var): Deleted.
1546         (sese_insert_phis_for_liveouts): Call sese_add_exit_phis_edge
1547         directly.
1548         (graphite_copy_stmts_from_block): Remove SESE_NUM_VER.
1549
1550         * sese.h (sese): Remove num_ver and livein.
1551         (SESE_LIVEIN, SESE_LIVEIN_VER, SESE_NUM_VER): Removed.
1552
1553 2009-03-25  Tobias Grosser  <grosser@fim.uni-passau.de>
1554
1555         * graphite-sese-to-poly.c (build_scop_scattering): Fix compile.
1556
1557 2009-03-25  Tobias Grosser  <grosser@fim.uni-passau.de>
1558
1559         * graphite-sese-to-poly.c (compare_prefix_loops): Removed.
1560         (build_scop_scattering): Do not use compare_prefix_loops any more.
1561         (nb_common_loops): New.
1562
1563 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1564
1565         * sese.c (get_new_name_from_old_name): Renamed get_rename.
1566         (register_old_and_new_names): Renamed set_rename.
1567
1568 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1569
1570         * graphite-scop-detection.h (nb_reductions_in_loop): Revert removal
1571         of the decl from the previous commit.
1572
1573 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1574
1575         * graphite-scop-detection.c (dot_scop): New.
1576         * graphite-scop-detection.h (dot_scop): Declared.
1577
1578 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1579
1580         * graphite-sese-to-poly.c (compare_prefix_loops): Fix compare.
1581
1582 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1583
1584         * cfgloopmanip.c (create_empty_loop_on_edge): Generate the loop exit
1585         condition at the end of the loop.
1586         * graphite.c (graphite_initialize, graphite_finalize): Print to
1587         dump_file the compiled function.
1588         * graphite-clast-to-gimple.c (graphite_create_new_loop): Update use
1589         of create_empty_loop_on_edge.
1590         (translate_clast): Update the code generation of loops for the new
1591         shape of loops.
1592         * cfgloop.h (create_empty_loop_on_edge): Update declaration.
1593
1594 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
1595
1596         Reverted the patch from 2009-03-19.
1597
1598 2009-03-19  Tobias Grosser  <grosser@fim.uni-passau.de>
1599
1600         * graphite-poly.c (new_poly_bb, free_poly_bb): Initialize/free
1601         poly_drs vector.
1602         (print_scop): Style.
1603         * graphite-poly.h (poly_bb): Add drs vector.
1604         (PBB_DRS): Add accessor.
1605         * graphite-sese-to-poly.c (ref_nb_loops): Remove.
1606         (build_access_matrix_with_af, build_access_matrix,
1607         build_scop_data_accesses): Delete.
1608         (build_poly_dr): New.
1609         (build_pbb_drs, build_scop_drs): New.
1610         (build_poly_scop): call build_scop_drs.
1611
1612 2009-03-13  Sebastian Pop  <sebastian.pop@amd.com>
1613
1614         * graphite-scop-detection.c (dot_all_scops_1): Close the table
1615         once per basic block.
1616
1617 2009-03-13  Tobias Grosser  <grosser@fim.uni-passau.de>
1618
1619         * graphite-scop-detection.c (graphite_can_represent_scev): New.
1620         (graphite_can_represent_expr): Renamed from loop_affine_expr
1621         and enhanced.
1622         (stmt_simple_for_scop_p): Call graphite_can_represent_expr.
1623         (graphite_cannot_represent_loop): Add scop_entry to parameters.
1624         (scopdet_basic_block_info): Actually define entry_block.
1625         (stmt_simple_memref_p): Moved here from ...
1626
1627         * tree-data-ref.c (stmt_simple_memref_p): here.
1628         * tree-data-ref.h (stmt_simple_memref_p): Removed.
1629
1630 2009-03-13  Tobias Grosser  <grosser@fim.uni-passau.de>
1631
1632         * testsuite/gcc.dg/graphite/id-4.c: New.
1633
1634 2009-03-12  Sebastian Pop  <sebastian.pop@amd.com>
1635
1636         * sese.c (expand_scalar_variables_expr): Handle tcc_comparison.
1637         (register_old_and_new_names): Update the content of the map.
1638         When there was already a rename_map_elt in the map at that
1639         location, free it.
1640         (copy_bb_and_scalar_dependences): Do rename_variables after
1641         expand_scalar_variables.
1642         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
1643         of the map.  When there was already a rename_map_elt in the
1644         map at that location, free it.
1645         (translate_clast): Pass the rename_map.  Do not initialize and free
1646         a rename_map per stmt_user.
1647         (gloog): Initialize and free one rename_map and pass it to
1648         translate_clast.
1649
1650 2009-03-12  Sebastian Pop  <sebastian.pop@amd.com>
1651
1652         * sese.c (expand_scalar_variables_stmt,
1653         expand_scalar_variables_ssa_name): Add a gimple_stmt_iterator
1654         parameter.
1655         (expand_scalar_variables_expr): Handle REALPART_EXPR and IMAGPART_EXPR.
1656         (expand_scalar_variables): Pass to expand_scalar_variables_stmt
1657         the gimple_stmt_iterator of the statement to be expanded.
1658         * graphite-scop-detection.c (is_simple_operand): Do handle
1659         REALPART_EXPR.
1660
1661 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
1662
1663         * graphite-scop-detection.c (is_simple_operand): Do not handle
1664         REALPART_EXPR.
1665         * testsuite/gcc.dg/graphite/id-2.c: New.
1666
1667         * graphite-sese-to-poly.c (build_bb_loops,
1668         add_value_to_dim, scan_tree_for_params_right_scev,
1669         scan_tree_for_params_int, scan_tree_for_params, idx_record_params,
1670         find_params_in_bb, build_loop_iteration_domains,
1671         add_conditions_to_domain): Remove subtract.
1672
1673 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
1674
1675         * graphite-clast-to-gimple.c (loop_iv_stack_patch_for_consts,
1676         build_iv_mapping, compute_cloog_iv_types_1, build_cloog_prog):
1677         pbb_loop_at_index -> gbb_loop_at_index.
1678         * graphite-poly.c (new_poly_bb, new_scop): New accessors.
1679         (debug_loop_vec): Delete.
1680         * graphite-poly.h (poly_bb, scop): Change black_box and region to void
1681         pointer.  Move LOOPS to gimple_bb_p and insert nb_params.
1682         (PBB_LOOPS): Removed.
1683         (PBB_BLACK_BOX): Insert cast.
1684         (pbb_set_black_box): New setter.
1685         (pbb_loop_at_index, pbb_loop_index): Removed.
1686         (scop_set_region, scop_set_nb_params): New.
1687         * graphite-sese-to-poly.c (new_gimple_bb, free_gimple_bb,
1688         build_scop_scattering, build_bb_loops): Add GBB_LOOPS.
1689         (build_poly_scop): Use scop_set_nb_params.
1690         * sese.h (gimple_bb): Add LOOPS.
1691         (GBB_LOOPS, gbb_loop_index, gbb_loop_at_index): New.
1692
1693 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
1694
1695         Revert previous commit.
1696
1697 2009-03-11  Sebastian Pop  <sebastian.pop@amd.com>
1698
1699         * sese.c (expand_scalar_variables_expr): Handle tcc_comparison.
1700         (register_old_and_new_names): Update the content of the map.
1701         When there was already a rename_map_elt in the map at that
1702         location, free it.
1703         (copy_bb_and_scalar_dependences): Do rename_variables after
1704         expand_scalar_variables.
1705         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
1706         of the map.  When there was already a rename_map_elt in the
1707         map at that location, free it.
1708         (translate_clast): Pass the rename_map.  Do not initialize and free
1709         a rename_map per stmt_user.
1710         (gloog): Initialize and free one rename_map and pass it to
1711         translate_clast.
1712
1713 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
1714
1715         Remove forgotten line in revert.
1716
1717 2009-03-11  Sebastian Pop  <sebastian.pop@amd.com>
1718
1719         Revert previous commit.
1720
1721 2009-03-10  Sebastian Pop  <sebastian.pop@amd.com>
1722
1723         * sese.c (register_old_and_new_names): Update the content
1724         of the map.  When there was already a rename_map_elt in the
1725         map at that location, free it.
1726         (copy_bb_and_scalar_dependences): Do rename_variables after
1727         expand_scalar_variables.
1728         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
1729         of the map.  When there was already a rename_map_elt in the
1730         map at that location, free it.
1731         (translate_clast): Pass the rename_map.  Do not initialize and free
1732         a rename_map per stmt_user.
1733         (gloog): Initialize and free one rename_map and pass it to
1734         translate_clast.
1735
1736 2009-03-10  Sebastian Pop  <sebastian.pop@amd.com>
1737
1738         * graphite-clast-to-gimple.c (translate_clast): context_loop
1739         is never NULL.
1740
1741 2009-03-10  Tobias Grosser  <grosser@fim.uni-passau.de>
1742             Sebastian Pop  <sebastian.pop@amd.com>
1743
1744         * graphite-ppl.c (ppl_insert_dimensions): Fix stupid mistake
1745         of the use of ppl_Polyhedron_map_space_dimensions.
1746
1747 2009-03-10  Tobias Grosser  <grosser@fim.uni-passau.de>
1748             Sebastian Pop  <sebastian.pop@amd.com>
1749
1750         * graphite-poly.c (unify_scattering_dimensions): Fix types.
1751         * graphite-poly.h (poly_dr_p, poly_dr, POLY_DR_TYPE, PDR_BB,
1752         PDR_TYPE, PDR_ACCESSES, pdr_accessp_nb_subscripts,
1753         pdr_accessp_nb_iterators, pdr_accessp_nb_params,
1754         pdr_accessp_alias_set_dim, pdr_accessp_subscript_dim,
1755         pdr_accessp_iterator_dim, pdr_accessp_param_dim,
1756         pbb_nb_params): New.
1757         (pbb_nb_loops, pbb_nb_scattering, scop_nb_params,
1758         nb_loops_around_pbb): Adapt return types.
1759
1760 2009-03-09  Tobias Grosser  <grosser@fim.uni-passau.de>
1761
1762         * Makefile.in (graphite.o, graphite-sese-to-poly.o,
1763         graphite-clast-to-gimple.o,  graphite-data-ref.o,
1764         graphite-scop-detection.o, graphite-poly.o): Add
1765         more headers.
1766
1767 2009-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
1768
1769         * Makefile.in (graphite.o, graphite-sese-to-poly.o,
1770         graphite-clast-to-gimple.o,  graphite-data-ref.o,
1771         graphite-scop-detection.o, graphite-poly.o): Add graphite-poly.h.
1772
1773 2009-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
1774
1775         * testsuite/gcc.dg/graphite/pr37485.c: Remove -floop-block
1776         * testsuite/gcc.dg/graphite/pr37828.c: Same.
1777         * testsuite/gcc.dg/graphite/pr37684.c: Same.
1778         * testsuite/gcc.dg/graphite/block-0.c: Same.
1779         * testsuite/gcc.dg/graphite/block-1.c: Same.
1780         * testsuite/gcc.dg/graphite/block-2.c: Same.
1781         * testsuite/gcc.dg/graphite/block-3.c: Same.
1782         * testsuite/gcc.dg/graphite/block-4.c: Same.
1783         * testsuite/gcc.dg/graphite/block-5.c: Same.
1784         * testsuite/gcc.dg/graphite/block-6.c: Same.
1785         * testsuite/gfortran.dg/graphite/pr38083.f90: Same.
1786         * testsuite/gfortran.dg/graphite/block-1.f90: Same.
1787         * testsuite/gfortran.dg/graphite/block-3.f90: Same.
1788         * testsuite/gfortran.dg/graphite/pr37852.f90: Same.
1789         * testsuite/gfortran.dg/graphite/block-4.f90: Same.
1790         * testsuite/gfortran.dg/graphite/pr37980.f90: Same.
1791         * testsuite/gfortran.dg/graphite/pr38953.f90: Same.
1792         * testsuite/gfortran.dg/graphite/pr37857.f90: Same.
1793         * opts.c: Remove -floop-block from -O2.
1794         * graphite-poly.c: Fail if -floop-block -floop-interchange or
1795         -floop-strip-mine are used.
1796
1797 2009-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
1798             Sebastian Pop  <sebastian.pop@amd.com>
1799
1800         * graphite-clast-to-gimple.c (build_cloog_prog): Unify scattering
1801         dimensions.
1802         * graphite-poly.c (pbb_compare, graphite_sort_pbbs,
1803         graphite_trans_bb_move_loop, graphite_trans_bb_strip_mine,
1804         strip_mine_profitable_p, is_interchange_valid,
1805         graphite_trans_bb_block, graphite_trans_loop_block,
1806         graphite_trans_scop_block): Temporary removed.
1807         (extend_scattering, unify_scattering_dimensions): New.
1808         (print_scattering_function, graphite_read_transforms):
1809         PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
1810         (graphite_generate_scattering_fns): Removed.
1811         (apply_poly_transforms): Cleanup.
1812         (free_poly_bb): Add PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
1813         (schedule_to_scattering): Moved.
1814         (PBB_STATIC_SCHEDULE, PBB_SCATTERING): Removed.
1815         (PBB_ORIGINAL_SCATTERING, PBB_TRANSFORMED_SCATTERING): New.
1816         (pbb_nb_scattering): New.
1817         (SCOP_ENTRY, SCOP_EXIT, SCOP_REGION_BBS, SCOP_DEP_GRAPH, SCOP_PARAMS,
1818         SCOP_LOOP_NEST, SCOP_PARAMS, SCOP_OLDIVS, SCOP_LIVEOUT_RENAMES):
1819         Removed.
1820         * graphite-ppl.c (ppl_insert_dimensions): Extended and renamed from
1821         shift_poly.
1822         (ppl_strip_loop): PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
1823         * graphite-scop-detection.c (dot_all_scops_1):  PBB_SCATTERING
1824         -> PBB_TRANSFORMED_SCATTERING.
1825         * graphite-sese-to-poly.c (build_scop_bbs): Remove region.
1826         (build_pbb_scattering_polyhedron): Moved from schedule_to_scattering.
1827         (build_scop_scattering): Renamed from build_scop_canonical_schedules.
1828         (check_poly_representation): Do not return bool.
1829         (graphite_transform_loops): Reformat.
1830         * sese.h (SESE_ENTRY_BB, SESE_EXIT_BB): New.
1831
1832 2009-03-04  Sebastian Pop  <sebastian.pop@amd.com>
1833
1834         * graphite-poly.c (print_pbb_domain, print_pbb, print_scop,
1835         debug_pbb_domain, debug_pbb, debug_scop): New.
1836         * graphite-poly.h (print_pbb_domain, print_pbb, print_scop,
1837         debug_pbb_domain, debug_pbb, debug_scop): Declared.
1838
1839 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
1840
1841         PR middle-end/39335
1842         * tree-parloops.c (canonicalize_loop_ivs): Call fold_convert
1843         when the type precision of the induction variable should be
1844         larger than the type precision of nit.
1845         (gen_parallel_loop): Update use of canonicalize_loop_ivs.
1846         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Same.
1847         * tree-flow.h (canonicalize_loop_ivs): Update declaration.
1848
1849         * testsuite/gcc.dg/graphite/pr39335_1.c: New.
1850         * testsuite/gcc.dg/graphite/pr39335.c: New.
1851
1852 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
1853
1854         * tree-parloops.c (canonicalize_loop_ivs): reduction_list contains
1855         SSA_NAMES not struct reduction_info.
1856
1857 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
1858
1859         * sese.c (expand_scalar_variables_expr): Handle ADDR_EXPR.
1860
1861 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
1862             Tobias Grosser  <grosser@fim.uni-passau.de>
1863
1864         * sese.c (new_sese): Initialize SESE_REDUCTION_LIST.
1865         (free_sese): Free SESE_REDUCTION_LIST.
1866         * sese.h (struct sese): Add field reduction_list.
1867         (SESE_REDUCTION_LIST): New.
1868         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Call
1869         canonicalize_loop_ivs on SESE_REDUCTION_LIST.
1870
1871 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
1872             Tobias Grosser  <grosser@fim.uni-passau.de>
1873
1874         * tree-flow.h (gather_scalar_reductions): Use struct loop * instead
1875         of loop_p.
1876
1877 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
1878             Tobias Grosser  <grosser@fim.uni-passau.de>
1879
1880         * tree-parloops.c (struct brli, build_reduction_list_info,
1881         analyze_reduction_list, gather_scalar_reductions): New.
1882         (loop_parallel_p): Build a reduction list containing only
1883         PHI_RESULT SSA_NAMEs: call gather_scalar_reductions.
1884         (gen_parallel_loop): Call the analysis analyze_reduction_list.
1885         (parallelize_loops): Now reduction_list is a htab_t of SSA_NAMEs.
1886         * tree-flow.h (gather_scalar_reductions): Declared.
1887
1888 2009-02-26  Sebastian Pop  <sebastian.pop@amd.com>
1889
1890         PR middle-end/39308
1891         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not call
1892         number_of_iterations_exit from a gcc_assert.
1893
1894 2009-02-25  Sebastian Pop  <sebastian.pop@amd.com>
1895             Jan Sjodin  <jan.sjodin@amd.com>
1896
1897         * output.h (graphite_out_file, graphite_in_file): Declared.
1898         * toplev.c (graphite_out_file, graphite_in_file): New.
1899         (init_asm_output): Initialize graphite_in_file and graphite_out_file.
1900         * graphite-clast-to-gimple.c (build_cloog_prog): Read PBB_SCATTERING.
1901         Don't call schedule_to_scattering.
1902         * common.opt (fgraphite-write, fgraphite-read): New.
1903         * graphite-poly.c: Include output.h.
1904         (print_scattering_function, print_scattering_functions,
1905         debug_scattering_function, debug_scattering_functions,
1906         graphite_write_transforms, graphite_read_transforms,
1907         graphite_generate_scattering_fns): New.
1908         (apply_poly_transforms): Do not apply transform if flag_graphite_read.
1909         Call graphite_generate_scattering_fns, graphite_write_transforms,
1910         graphite_read_transforms.
1911         (new_poly_bb): Initialize PBB_SCATTERING.
1912         (free_poly_bb): Free PBB_SCATTERING.
1913         (schedule_to_scattering): Does not return, initialize PBB_SCATTERING.
1914         * graphite-poly.h (struct poly_bb): Add field scattering.
1915         (PBB_SCATTERING): New.
1916         (print_scattering_function, print_scattering_functions,
1917         debug_scattering_function, debug_scattering_functions): Declared.
1918         * graphite-ppl.c (cloog_matrix_to_ppl_constraint): Matrices contain
1919         GMP values, not integers!
1920         (ppl_print_polyhedron_matrix, debug_ppl_polyhedron_matrix,
1921         ppl_read_polyhedron_matrix): New.
1922         * graphite-ppl.h (ppl_print_polyhedron_matrix,
1923         debug_ppl_polyhedron_matrix,
1924         ppl_read_polyhedron_matrix): Declared.
1925         * Makefile.in (graphite-poly.o): Depends on output.h.
1926
1927 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1928             Tobias Grosser  <grosser@fim.uni-passau.de>
1929
1930         Revert this change:
1931         * graphite-scop-detection.c (stmt_simple_for_scop_p): Analyze
1932         scalar evolutions in the scop_entry->loop_father.
1933
1934 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1935             Tobias Grosser  <grosser@fim.uni-passau.de>
1936
1937         * graphite.h (ref_nb_loops): Remove declaration.
1938         (struct gimple_bb, gimple_bb_p, GBB_BB, GBB_DATA_REFS, GBB_CONDITIONS,
1939         GBB_CONDITION_CASES, GBB_CLOOG_IV_TYPES, gbb_loop, print_gimple_bb,
1940         debug_gbb): Moved to sese.h.
1941         * sese.h: As said.
1942
1943 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1944             Tobias Grosser  <grosser@fim.uni-passau.de>
1945
1946         * graphite-data-ref.[ch]: Disable.
1947
1948 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1949             Tobias Grosser  <grosser@fim.uni-passau.de>
1950
1951         * graphite-scop-detection.c (stmt_simple_for_scop_p): Analyze
1952         scalar evolutions in the scop_entry->loop_father.
1953
1954 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1955
1956         * graphite-scop-detection.c (nb_reductions_in_loop): Moved here...
1957         (graphite_cannot_represent_loop_niter): Renamed
1958         graphite_cannot_represent_loop.  Call nb_reductions_in_loop.
1959         (limit_scops): build_sese_loop_nests does not return a bool.
1960         * graphite-scop-detection.h (nb_reductions_in_loop): Declared.
1961         * sese.c (nb_reductions_in_loop): ... from here.
1962         (graphite_loop_normal_form): ... from here.
1963         (sese_record_loop): Does not fail, so does not return a bool.
1964         (build_sese_loop_nests): Same.
1965         * sese.h (build_sese_loop_nests): Update declaration.
1966         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Moved here...
1967         (build_graphite_loop_normal_form): New.
1968         (gloog): Call build_graphite_loop_normal_form.
1969         * graphite-sese-to-poly.c (build_poly_scop): Don't fail on
1970         build_sese_loop_nests.
1971
1972         * testsuite/gcc.dg/graphite/id-1.c: New.
1973
1974 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
1975             Tobias Grosser  <grosser@fim.uni-passau.de>
1976
1977         * graphite-sese-to-poly.c (scan_tree_for_params): Remove REAL_CST.
1978         The SCoP detection fix is sufficient.
1979
1980 2009-02-21  Sebastian Pop  <sebastian.pop@amd.com>
1981
1982         PR tree-optimization/39260
1983         * graphite-scop-detection.c (harmful_stmt_in_bb): Stop a SCoP when
1984         the basic block contains a condition with a real type.
1985         * graphite-sese-to-poly.c (scan_tree_for_params): Handle REAL_CST.
1986
1987         * gcc.dg/graphite/pr39260.c: New.
1988
1989 2009-02-21  Sebastian Pop  <sebastian.pop@amd.com>
1990
1991         * graphite-poly.c: Inlcude params.h.
1992         (graphite_trans_loop_block): Use PARAM_LOOP_BLOCK_TILE_SIZE for
1993         the size of a tile.
1994         * Makefile.in (graphite-poly.o): Depend on PARAMS_H.
1995         * params.def (PARAM_LOOP_BLOCK_TILE_SIZE): Define.
1996
1997 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
1998             Tobias Grosser  <grosser@fim.uni-passau.de>
1999
2000         * graphite-scop-detection.c (dot_all_scops_1,
2001         dot_all_scops): Moved here.
2002         * graphite-scop-detection.h (dot_all_scops): Declared here.
2003         * graphite.c (graphite_initialize, graphite_finalize): New.
2004         (graphite_transform_loops): Cleaned up.
2005         * sese.c (debug_oldivs): Moved here.
2006         * graphite-poly.c (graphite_apply_transformations): Renamed
2007         apply_poly_transforms.
2008         (debug_loop_vec): Moved here.
2009         * graphite-sese-to-poly.c (build_bb_loops, build_sese_conditions_1,
2010         scop_contains_non_iv_scalar_phi_nodes, build_sese_conditions,
2011         find_scop_parameters, build_scop_iteration_domain,
2012         add_conditions_to_constraints, build_scop_canonical_schedules,
2013         build_scop_data_accesses): Now static.
2014         (build_poly_scop, check_poly_representation): New.
2015
2016 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
2017
2018         * graphite.c (graphite_stmt_p, new_gimple_bb, free_gimple_bb,
2019         remove_gbbs_in_scop, free_scops, try_generate_gimple_bb,
2020         build_scop_bbs, ref_nb_loops, compare_prefix_loops,
2021         build_scop_canonical_schedules, build_bb_loops, add_value_to_dim,
2022         scan_tree_for_params_right_scev, scan_tree_for_params_int,
2023         scan_tree_for_params, struct irp_data, dx_record_params,
2024         find_params_in_bb, find_scop_parameters, gbb_from_bb,
2025         build_loop_iteration_domains, add_conditions_to_domain,
2026         phi_node_is_iv, bb_contains_non_iv_scalar_phi_nodes,
2027         scop_contains_non_iv_scalar_phi_nodes, build_sese_conditions_1,
2028         build_sese_conditions, add_conditions_to_constraints,
2029         build_scop_iteration_domain, build_access_matrix_with_af,
2030         build_access_matrix,
2031         build_scop_data_accesses): Moved to graphite-sese-to-poly.c.
2032
2033         * graphite-sese-to-poly.c: New.
2034         * graphite-sese-to-poly.h: New.
2035
2036         * Makefile.in: Add new rule for graphite-sese-to-poly.o.
2037
2038 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
2039
2040         * graphite.c: Split graphite code generation to a new file.
2041         (graphite_verify, gmp_cst_to_tree, clast_name_to_gcc,
2042         max_precision_type, clast_to_gcc_expression_red,
2043         clast_to_gcc_expression, gcc_type_for_clast_expr,
2044         gcc_type_for_clast_eq, loop_iv_stack_patch_for_consts,
2045         graphite_translate_clast_equation, graphite_create_guard_cond_expr,
2046         graphite_create_new_guard, clast_get_body_of_loop,
2047         gcc_type_for_cloog_iv, gcc_type_for_iv_of_clast_loop,
2048         graphite_create_new_loop, build_iv_mapping, copy_renames,
2049         translate_clast, find_cloog_iv_in_expr, compute_cloog_iv_types_1,
2050         compute_cloog_iv_types, free_scattering, save_var_name,
2051         initialize_cloog_names, build_scop_context, build_cloog_prog,
2052         set_cloog_options, debug_clast_stmt, scop_to_clast,
2053         print_generated_program, debug_generated_program,
2054         gloog): Moved to graphite-clast-to-gimple.c.
2055
2056         (struct cloog_prog_clast): Moved to graphite-clast-to-gimple.h.
2057
2058         (iv_stack_entry_is_constant, iv_stack_entry_is_iv,
2059         loop_iv_stack_push_iv, loop_iv_stack_insert_constant,
2060         loop_iv_stack_pop, loop_iv_stack_get_iv,
2061         loop_iv_stack_get_iv_from_name, debug_loop_iv_stack,
2062         free_loop_iv_stack, loop_iv_stack_remove_constants,
2063         debug_rename_elt, debug_rename_map_1, debug_rename_map,
2064         rename_map_elt_info, eq_rename_map_elts, debug_ivtype_elt,
2065         debug_ivtype_map_1, debug_ivtype_map, ivtype_map_elt_info,
2066         eq_ivtype_map_elts, sese_add_exit_phis_edge,
2067         sese_add_exit_phis_var, sese_insert_phis_for_liveouts,
2068         get_vdef_before_sese, sese_adjust_vphi,
2069         get_new_name_from_old_name, sese_adjust_phis_for_liveouts,
2070         oldiv_for_loop, rename_variables_in_stmt, is_parameter,
2071         is_iv, expand_scalar_variables_ssa_name,
2072         expand_scalar_variables_expr, expand_scalar_variables_stmt,
2073         expand_scalar_variables, rename_variables, remove_condition,
2074         get_true_edge_from_guard_bb, get_false_edge_from_guard_bb,
2075         add_loop_exit_phis, insert_loop_close_phis, struct igp,
2076         default_liveout_before_guard, add_guard_exit_phis,
2077         insert_guard_phis, register_old_and_new_names,
2078         graphite_copy_stmts_from_block, register_sese_liveout_renames,
2079         copy_bb_and_scalar_dependences, outermost_loop_in_sese,
2080         if_region_set_false_region, create_if_region_on_edge,
2081         move_sese_in_condition): Moved to sese.c.
2082
2083         (nb_loops_around_loop_in_sese, struct ifsese, if_region_entry,
2084         if_region_exit, if_region_get_condition_block,
2085         struct rename_map_elt, new_rename_map_elt, enum iv_stack_entry_kind,
2086         union iv_stack_entry_data_union, struct iv_stack_entry_struct,
2087         iv_stack_entry_p, loop_iv_stack, struct ivtype_map_elt,
2088         ivtype_map_elt, new_ivtype_map_elt,
2089         recompute_all_dominators): Moved to sese.h.
2090
2091         * graphite-clast-to-gimple.c: New.
2092         * graphite-clast-to-gimple.h: New.
2093         * Makefile.in: Add new rule for graphite-clast-to-gimple.o.
2094         * sese.c: Modified as said above.
2095         * sese.h: Same.
2096
2097 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
2098
2099         * graphite.c: Split scop detection to a new file.
2100         (enum gbb_type, gbb_type, get_bb_type, struct sd_region_p, sd_region,
2101         move_sd_regions, loop_affine_expr, exclude_component_ref,
2102         is_simple_operand, stmt_simple_for_scop_p, harmful_stmt_in_bb,
2103         graphite_cannot_represent_loop_niter, struct scopdet_info,
2104         scopdet_basic_block_info, build_scops_1, bb_in_sd_region,
2105         find_single_entry_edge, find_single_exit_edge,
2106         create_single_entry_edge, sd_region_without_exit,
2107         create_single_exit_edge, unmark_exit_edges, mark_exit_edges,
2108         create_sese_edges, build_graphite_scops, limit_scops, build_scops):
2109         Moved to graphite-scop-detection.c.
2110
2111         * graphite-scop-detection.c: New.
2112         * graphite-scop-detection.h: New.
2113         * Makefile.in: Add new rule for graphite-scop-detection.o.
2114
2115         * sese.c: Include tree-chrec.h, tree-data-ref.h, and
2116         tree-scalar-evolution.h.
2117         (nb_reductions_in_loop, graphite_loop_normal_form, sese_record_loop,
2118         build_sese_loop_nests): Moved here from graphite.c.
2119         (param_index): Renamed parameter_index_in_region.
2120
2121 2009-02-18  Tobias Grosser  <grosser@fim.uni-passau.de>
2122             Sebastian Pop  <sebastian.pop@amd.com>
2123
2124         * gcc.dg/graphite/block-0.c: Expected to fail now.
2125         * gcc.dg/graphite/block-1.c: Same.
2126         * gcc.dg/graphite/block-5.c: Same.
2127         * gcc.dg/graphite/block-6.c: Same.
2128
2129 2009-02-18  Tobias Grosser  <grosser@fim.uni-passau.de>
2130             Sebastian Pop  <sebastian.pop@amd.com>
2131
2132         * graphite.h: Separate from graphite_bb_p the polyhedral
2133         representation in poly_bb_p and the GCC specifics in gimple_bb_p.
2134         (struct data_dependence_polyhedron, RDGE_DDP, ddp_p): Moved to
2135         graphite-data-ref.h.
2136         (struct poly_bb, PBB_SCOP, PBB_STATIC_SCHEDULE, PBB_DOMAIN,
2137         PBB_BLACK_BOX, PBB_LOOPS, pbb_nb_loops, pbb_loop_at_index,
2138         pbb_loop_index, struct scop, SCOP_BBS, SCOP_REGION, SCOP_ENTRY,
2139         SCOP_EXIT, SCOP_REGION_BBS, SCOP_DEP_GRAPH, SCOP_PARAMS,
2140         SCOP_LOOP_NEST, SCOP_PARAMS, SCOP_OLDIVS, SCOP_LIVEOUT_RENAMES,
2141         scop_nb_params): Moved to graphite-poly.h.
2142         * graphite-data-ref.c: Same.
2143         * graphite-data-ref.h: New.
2144         * graphite.c: Same.
2145         (pbb_compare, graphite_sort_pbbs, graphite_trans_bb_move_loop,
2146         graphite_trans_bb_strip_mine, strip_mine_profitable_p,
2147         is_interchange_valid, graphite_trans_bb_block,
2148         graphite_trans_loop_block, scop_max_loop_depth,
2149         graphite_trans_scop_block, graphite_apply_transformations,
2150         new_poly_bb, free_poly_bb, new_scop, free_scop): Moved to
2151         graphite-poly.c.
2152         * graphite-poly.h: New.
2153         * graphite-poly.c: New.
2154         * Makefile.in (OBJS-common): Add graphite-poly.o.
2155         (graphite-poly.o): New rule.
2156         * tree-data-ref.h (struct data_reference): Remove unused scop field.
2157         (DR_SCOP): Removed.
2158
2159 2009-02-18  Sebastian Pop  <sebastian.pop@amd.com>
2160             Tobias Grosser  <grosser@fim.uni-passau.de>
2161
2162         * graphite.c: Replace gb -> gbb.
2163         * graphite.h: Same.
2164         * graphite-data-ref.c: Same.
2165
2166 2009-02-18  Sebastian Pop  <sebastian.pop@amd.com>
2167             Tobias Grosser  <grosser@fim.uni-passau.de>
2168
2169         * Makefile.in (OBJS-commmon): Add sese.o.
2170         (sese.o): New.
2171         (graphite.o): Add sese.h.
2172         * graphite.c (bb_in_ss_p, loop_in_sese_p,
2173         sese_build_livein_liveouts_use, sese_build_livein_liveouts_bb,
2174         sese_build_livein_liveouts, register_bb_in_sese, new_sese, free_sese):
2175         Move to sese.
2176         (block_before_scop): Add missing return.
2177         (new_scop, free_scop): Remove SESE data structures.
2178         (scop_record_loop, scan_tree_for_params, find_params_in_bb,
2179         find_scop_parameters, build_loop_iteration_domains,
2180         add_conditions_to_domain, register_scop_liveout_renames,
2181         copy_bb_and_scalar_dependences): Scop -> SESE.
2182
2183         (add_conditions_to_domain): SCoP -> SESE and remove check
2184         (scop_contains_non_iv_scalar_phi_nodes): New.
2185         (build_scop_conditions_1, build_scop_conditions): Remove check for
2186         non iv scalar phi nodes.
2187         (print_scop_statistics): New.
2188         (graphite_transform_loops): Cleanup.
2189
2190         * graphite.h: Move to sese & cleanup.
2191         * sese.c: New.
2192         * sese.h: New.
2193
2194 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2195             Tobias Grosser  <grosser@fim.uni-passau.de>
2196
2197         * graphite.c (build_scop_conditions_1): Conditions are only
2198         at the end of a basic block.
2199
2200 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2201             Tobias Grosser  <grosser@fim.uni-passau>
2202
2203         * graphite.h (struct graphite_bb): Remove compressed_alpha_matrix
2204         field.
2205         (GBB_ALPHA): Removed.
2206
2207 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2208             Tobias Grosser  <grosser@fim.uni-passau.de>
2209
2210         * graphite-data-ref.c (graphite_test_dependence): Don't use
2211         GBB_DYNAMIC_SCHEDULE.
2212         * graphite.c (new_graphite_bb): Same.
2213         (free_graphite_bb): Same.
2214         (build_scop_dynamic_schedules): Removed.
2215         (graphite_transform_loops): Don't call it.
2216         * graphite.h (struct graphite_bb): Remove dynamic_schedule field.
2217         (GBB_DYNAMIC_SCHEDULE): Removed.
2218
2219 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2220             Tobias Grosser  <grosser@fim.uni-passau.de>
2221
2222         * graphite.c (schedule_to_scattering): Don't use CloogMatrix.
2223         (print_graphite_bb): Same.
2224         (build_cloog_prog): Same.
2225
2226 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2227             Tobias Grosser  <grosser@fim.uni-passau.de>
2228
2229         * graphite.c (build_cloog_prog): Don't use CloogMatrix.
2230
2231 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2232             Tobias Grosser  <grosser@fim.uni-passau.de>
2233
2234         * graphite.c (build_scop_context): Don't use CloogMatrix.
2235         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Polyhedron): New.
2236         * graphite-ppl.h (new_Cloog_Domain_from_ppl_Polyhedron): Declared.
2237
2238 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2239             Tobias Grosser  <grosser@fim.uni-passau.de>
2240
2241         * graphite.h (struct scop): Move params, old_ivs, loops, loop_nest,
2242         liveout_renames, add_params fields...
2243         (struct sese): ... here.
2244         (SESE_PARAMS, SESE_LOOPS, SESE_LOOP_NEST, SESE_ADD_PARAMS,
2245         SESE_PARAMS, SESE_OLDIVS, SESE_LIVEOUT_RENAMES): New.
2246
2247 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2248             Tobias Grosser  <grosser@fim.uni-passau.de>
2249
2250         * graphite.c (print_scop): Do not print the CLooG program.
2251         (new_scop, free_scop, initialize_cloog_names, build_scop_context,
2252         build_cloog_prog, gloog): Don't use SCOP_PROG.
2253         (find_transform): Renamed scop_to_clast.
2254         (print_generated_program, debug_generated_program): New.
2255         (graphite_transform_loops): Adapt to new interface.
2256         * graphite.h (struct scop): Remove program field.
2257         (SCOP_PROG): Removed.
2258         (print_generated_program, debug_generated_program): Declared.
2259
2260 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
2261
2262         * graphite-data-ref.c (schedule_precedes_p, schedule_same_p): New.
2263         (statement_precedes_p): Use schedule_same_p and schedule_precedes_p.
2264         * graphite.c (gbb_compare, schedule_to_scattering, print_graphite_bb,
2265         free_graphite_bb, build_scop_canonical_schedules,
2266         graphite_trans_bb_strip_mine, graphite_trans_scop_block): Static
2267         schedules are now represented using a ppl_Linear_Expression_t.
2268         * graphite.h (struct graphite_bb): Same.
2269         * graphite-ppl.c (ppl_lexico_compare_linear_expressions): New.
2270         * graphite-ppl.h (ppl_lexico_compare_linear_expressions): Declared.
2271
2272 2009-02-15  Sebastian Pop  <sebastian.pop@amd.com>
2273
2274         * graphite.c: Free local memory.
2275         * graphite-ppl.c: Same.
2276
2277 2009-02-15  Sebastian Pop  <sebastian.pop@amd.com>
2278
2279         * graphite.c (const_column_index, get_first_matching_sign_row_index,
2280         get_lower_bound_row, get_upper_bound_row, copy_constraint,
2281         swap_constraint_variables, scale_constraint_variable): Removed.
2282         (graphite_trans_bb_strip_mine): Remove pong.
2283         * graphite-ppl.c: Include missing header files.
2284         (set_inhomogeneous, set_coef, shift_poly, ppl_strip_loop): New.
2285         * graphite-ppl.h (ppl_strip_loop): Declared.
2286         * Makefile.in (graphite-ppl.o): Adjust dependences.
2287
2288 2009-02-14  Sebastian Pop  <sebastian.pop@amd.com>
2289
2290         * graphite.c (build_loop_iteration_domains): Remove ping pong.
2291         (build_scop_iteration_domain): Same.
2292
2293 2009-02-13  Sebastian Pop  <sebastian.pop@amd.com>
2294
2295         * graphite.c (scan_tree_for_params, add_conditions_to_domain): Remove
2296         ping pong.
2297         (add_value_to_dim, scan_tree_for_params_right_scev,
2298         scan_tree_for_params_int): New.
2299         * graphite-ppl.c (oppose_constraint): New.
2300         (insert_constraint_into_matrix): Implement missing cases.
2301         * graphite-ppl.h (insert_constraint_into_matrix): Declared.
2302
2303 2009-02-13  Sebastian Pop  <sebastian.pop@amd.com>
2304
2305         * graphite.c (graphite_trans_bb_move_loop): Remove ping pong,
2306         use ppl_move_dimension.
2307
2308 2009-02-12  Sebastian Pop  <sebastian.pop@amd.com>
2309
2310         * graphite-data-ref.c: Domains are now ppl_Polyhedra_t.
2311         * graphite.c: Same.
2312         * graphite.h: Same.
2313         * graphite-ppl.c: Same.
2314         * graphite-ppl.h: Same.
2315
2316 2009-02-12  Sebastian Pop  <sebastian.pop@amd.com>
2317
2318         Revert last 3 commits.
2319
2320 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
2321
2322         * graphite.c (scan_tree_for_params, add_conditions_to_domain): Remove
2323         ping pong.
2324         (add_value_to_dim, scan_tree_for_params_right_scev,
2325         scan_tree_for_params_int): New.
2326         * graphite-ppl.c (oppose_constraint): New.
2327         (insert_constraint_into_matrix): Implement missing cases.
2328         * graphite-ppl.h (insert_constraint_into_matrix): Declared.
2329
2330 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
2331
2332         * graphite.c (graphite_trans_bb_move_loop): Remove unused variables.
2333
2334 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
2335             Tobias Grosser  <grosser@fim.uni-passau.de>
2336
2337         * graphite.c (graphite_trans_bb_move_loop): Remove ping pong,
2338         use ppl_move_dimension.
2339         * graphite-ppl.c (ppl_move_dimension): New.
2340         * graphite-ppl.h (ppl_move_dimension): Declared.
2341
2342 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
2343
2344         * graphite.c: Do not include cloog/cloog.h.
2345         (print_graphite_bb): Remove ping pong, call PPL print function.
2346
2347 2009-02-10  Tobias Grosser  <grosser@fim.uni-passau.de>
2348
2349         * Makefile.in (OBJS-common): Add graphite-ppl.o.
2350         (graphite.o): Add dependence on graphite-ppl.h.
2351         (graphite-ppl.o): New.
2352         (graphite-data-ref.c): Ping pong between PPL data structures
2353         and matrices.
2354         * graphite-ppl.c: New.
2355         * graphite-ppl.h: New.
2356         * graphite.c: Include graphite-ppl.h.
2357         (print_graphite_bb, add_conditions_to_domain, build_cloog_prog,
2358         graphite_trans_bb_move_loop, graphite_trans_bb_strip_mine):
2359         Ping pong between PPL data structures and matrices.
2360         (new_graphite_bb): Create a PPL constraint system.
2361         Call ppl_delete_Constraint_System instead of cloog_matrix_free.
2362         (build_loop_iteration_domains): Use PPL functions.
2363         * graphite.h: Include graphite-ppl.h.  Fix comments.
2364         (graphite_bb): Use a ppl_Constraint_System_t instead of
2365         CloogMatrix for representing the domain.
2366         (scop): Remove static_schedule.
2367         (gbb_nb_loops): Ping pong between PPL data structures and matrices.
2368
2369 2009-02-06  Sebastian Pop  <sebastian.pop@amd.com>
2370
2371         * graphite.c: Fix some comments.
2372
2373 2009-02-05  Sebastian Pop  <sebastian.pop@amd.com>
2374
2375         PR middle-end/38953
2376         * graphite.c (if_region_set_false_region): After moving a region
2377         in the false branch of a condition, remove the empty dummy
2378         basic block.
2379         (gloog): Remove wrong fix for PR38953.
2380
2381 2009-02-03  Tobias Grosser  <grosser@fim.uni-passau.de>
2382
2383         * graphite.c (bb_in_sese_p, sese_build_livein_liveouts_use,
2384         sese_build_livein_liveouts_bb, sese_build_livein_liveouts,
2385         register_bb_in_sese, new_sese, free_sese): Moved.
2386         (dot_scop_1, build_scop_loop_nests, build_loop_iteration_domains,
2387         outermost_loop_in_scop, build_scop_iteration_domain,
2388         expand_scalar_variables_ssa_name, get_vdef_before_scop,
2389         limit_scops): Use bb_in_sese_p instead of bb_in_scop_p.
2390         Use loop_in_sese_p instead of loop_in_scop_p.
2391         (new_graphite_bb, new_scop, gloog): Do not initialize SCOP_BBS_B.
2392         (free_scop): Do not free SCOP_BBS_B.
2393         (nb_loops_around_loop_in_scop, nb_loops_around_gb,
2394         ref_nb_loops): Moved here...
2395         * graphite.h (ref_nb_loops): ... from here.
2396         (struct scop): Remove bbs_b bitmap.
2397         (SCOP_BBS_B, bb_in_scop_p, loop_in_scop_p): Removed.
2398         * testsuite/gcc.dg/graphite/scop-19.c: New
2399
2400 2009-02-03  Tobias Grosser  <grosser@fim.uni-passau.de>
2401
2402         * graphite.c (scopdet_basic_block_info): Fix bug in scop
2403         detection.
2404
2405 2009-01-30  Tobias Grosser  <grosser@fim.uni-passau.de>
2406
2407         * graphite.c (new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
2408         eq_loop_to_cloog_loop): Remove.
2409         (new_scop, free_scop): Remove SCOP_LOOP2CLOOG_LOOP.
2410         * graphite.h (struct scop): Remove loop2cloog_loop.
2411         (loop_domain_dim, loop_iteration_vector_dim): Remove.
2412
2413 2009-01-30  Tobias Grosser  <grosser@fim.uni-passau.de>
2414
2415         * opts.c (decode_options): Only add graphite options to O2
2416         if we compile with graphite enabled.
2417
2418 2009-01-26  Sebastian Pop  <sebastian.pop@amd.com>
2419
2420         * Merge from mainline (r143163:143684).
2421
2422 2009-01-26  Sebastian Pop  <sebastian.pop@amd.com>
2423
2424         * graphite.c (debug_value): Removed.
2425         * graphite.h (debug_value): Removed.
2426
2427 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
2428
2429         * passes.c (init_optimization_passes): Do not call pass_copy_prop
2430         after graphite: pass_copy_prop does not maintain a proper loop closed
2431         SSA form.  pass_copy_prop should be fixed.
2432
2433 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
2434
2435         * graphite.c (scop_adjust_phis_for_liveouts): Fix warning.
2436
2437 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
2438
2439         * graphite.c (graphite_verify): Add a call to verify_loop_closed_ssa.
2440         (gloog): Split the exit of the scop when the scop exit is a loop exit.
2441         (graphite_transform_loops): Only call cleanup_tree_cfg if gloog
2442         changed the CFG.
2443
2444 2009-01-20  Sebastian Pop  <sebastian.pop@amd.com>
2445
2446         * graphite.c (gloog): Return true when code gen succeeded.
2447         (graphite_transform_loops): Do not call cleanup_tree_cfg if
2448         the code of the function did not changed.  After cleanup_tree_cfg
2449         call rewrite_into_loop_closed_ssa to maintain the loop closed ssa
2450         form.
2451
2452 2009-01-19  Sebastian Pop  <sebastian.pop@amd.com>
2453
2454         * graphite.c (stmt_simple_for_scop_p): Also handle cases when
2455         gimple_call_lhs is NULL.
2456
2457 2009-01-16  Sebastian Pop  <sebastian.pop@amd.com>
2458             Tobias Grosser  <tobi.grosser@amd.com>
2459
2460         * graphite.c (graphite_trans_scop_block): Do not block single
2461         nested loops.
2462
2463 2009-01-15  Sebastian Pop  <sebastian.pop@amd.com>
2464             Tobias Grosser  <tobi.grosser@amd.com>
2465
2466         * graphite.c (build_scop_canonical_schedules): Start schedules at
2467         zero.
2468
2469 2009-01-15  Sebastian Pop  <sebastian.pop@amd.com>
2470             Tobias Grosser  <tobi.grosser@amd.com>
2471
2472         * graphite.c (compare_prefix_loops): New.
2473         (build_scop_canonical_schedules): Rewritten.
2474         (graphite_transform_loops): Move build_scop_canonical_schedules
2475         after build_scop_iteration_domain.
2476
2477 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
2478             Tobias Grosser  <tobi.grosser@amd.com>
2479
2480         * graphite.c (add_conditions_to_domain): Add the loops to
2481         the dimension of the iteration domain.  Do copy the domain
2482         only when it exists.
2483         (build_scop_conditions_1): Do not call add_conditions_to_domain.
2484         (add_conditions_to_constraints): New.
2485         (can_generate_code_stmt, can_generate_code): Removed.
2486         (gloog): Do not call can_generate_code.
2487         (graphite_transform_loops): Call add_conditions_to_constraints
2488         after building the iteration domain.
2489
2490 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
2491             Tobias Grosser  <tobi.grosser@amd.com>
2492             Jan Sjodin  <jan.sjodin@amd.com>
2493
2494         * graphite.c (scan_tree_for_params): On substractions negate
2495         all the coefficients of the term.
2496         (clast_to_gcc_expression_red): New.  Handle reduction expressions
2497         of more than two operands.
2498         (clast_to_gcc_expression): Call clast_to_gcc_expression_red.
2499         (get_vdef_before_scop): Handle also the case of default definitions.
2500
2501 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
2502
2503         PR middle-end/38431
2504         * graphite.c (get_vdef_before_scop, scop_adjust_vphi): New.
2505         (scop_adjust_phis_for_liveouts): Call scop_adjust_vphi.
2506         (gloog): Do not call cleanup_tree_cfg.
2507         (graphite_transform_loops): Call cleanup_tree_cfg after all
2508         scops have been code generated.
2509
2510 2009-01-13  Sebastian Pop  <sebastian.pop@amd.com>
2511
2512         * passes.c (init_optimization_passes): Schedule after
2513         graphite transforms pass_copy_prop, pass_dce_loop and pass_lim.
2514
2515 2009-01-13  Sebastian Pop  <sebastian.pop@amd.com>
2516
2517         * graphite.c (expand_scalar_variables_stmt): Do not pass loop_p.
2518         Fix comment.
2519         (expand_scalar_variables_ssa_name): Do not pass loop_p.  Fix comment.
2520         Set the type of an expression to the type of its assign statement.
2521         (expand_scalar_variables_expr):  Do not pass loop_p.
2522         Fix comment.  Stop recursion on tcc_constant or tcc_declaration.
2523         (copy_bb_and_scalar_dependences): Do not pass loop_p.
2524         (translate_clast): Update call to copy_bb_and_scalar_dependences.
2525
2526 2009-01-11  Sebastian Pop  <sebastian.pop@amd.com>
2527
2528         * graphite.c (expand_scalar_variables_ssa_name): Set the type of
2529         an expression to the gimple_expr_type of its assign statement.
2530         (expand_scalar_variables_expr): Stop recursion on tcc_constant
2531         or tcc_declaration.
2532
2533 2009-01-11  Sebastian Pop  <sebastian.pop@amd.com>
2534
2535         PR tree-optimization/38786
2536         * testsuite/gcc.dg/graphite/pr38786.c: New.
2537         * graphite.c (expand_scalar_variables_ssa_name): New, outlined from
2538         the SSA_NAME case of expand_scalar_variables_expr.
2539         (expand_scalar_variables_expr): Also gather the scalar computation
2540         used to index the memory access.
2541         (expand_scalar_variables_stmt): Pass to expand_scalar_variables_expr
2542         the gimple_stmt_iterator where it inserts new code.
2543
2544 2009-01-10  Sebastian Pop  <sebastian.pop@amd.com>
2545
2546         * testsuite/gcc.dg/graphite/block-3.c: Fix compile error on 32bit.
2547
2548 2009-01-10  Sebastian Pop  <sebastian.pop@amd.com>
2549
2550         * opts.c (decode_options): Enable flag_graphite_identity and
2551         flag_loop_block in -O2 and above.
2552
2553 2009-01-08  Sebastian Pop  <sebastian.pop@amd.com>
2554
2555         * libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class:
2556         Fix merge problem: replace with the file from trunk.
2557
2558 2009-01-08  Sebastian Pop  <sebastian.pop@amd.com>
2559
2560         * Merge from mainline (r141727:143163).
2561
2562 2009-01-07  Sebastian Pop  <sebastian.pop@amd.com>
2563             Jan Sjodin  <jan.sjodin@amd.com>
2564
2565         PR tree-optimization/38559
2566         * testsuite/gcc.dg/graphite/pr38559.c: New.
2567
2568         * graphite.c (debug_value, copy_constraint,
2569         swap_constraint_variables, scale_constraint_variable, ): New.
2570         (get_lower_bound, get_upper_bound): Removed.
2571         (graphite_trans_bb_strip_mine): Clean up this code that works
2572         only for constant number of iterations.  Fully copy upper and
2573         lower bound constraints, not only the constant part of them.
2574         * graphite.h (debug_value): Declared.
2575
2576 2009-01-06  Jan Sjodin  <jan.sjodin@amd.com>
2577
2578         PR tree-optimization/38492
2579         PR tree-optimization/38498
2580         * tree-check.c (operator_is_linear, scev_is_linear_expression): New.
2581         * tree-chrec.h (scev_is_linear_expression): Declared.
2582         * graphite.c (graphite_cannot_represent_loop_niter): New.
2583         (scopdet_basic_block_info): Call graphite_cannot_represent_loop_niter.
2584         (graphite_loop_normal_form): Use gcc_assert.
2585         (scan_tree_for_params): Use CASE_CONVERT.
2586         (phi_node_is_iv, bb_contains_non_iv_scalar_phi_nodes): New.
2587         (build_scop_conditions_1): Call bb_contains_non_iv_scalar_phi_nodes.
2588         Use gcc_assert.  Discard scops that contain unhandled cases.
2589         (build_scop_conditions): Return a boolean status for unhandled cases.
2590         (strip_mine_profitable_p): Print the loop number, not its depth.
2591         (is_interchange_valid): Pass the depth of the loop nest, don't
2592         recompute it wrongly.
2593         (graphite_trans_bb_block): Same.
2594         (graphite_trans_bb_block): Print tentative of loop blocking.
2595         (graphite_trans_scop_block): Do not print that the loop has been
2596         blocked.
2597         (graphite_transform_loops): Do not handle scops that contain condition
2598         scalar phi nodes.
2599
2600         * testsuite/gcc.dg/graphite/pr38500.c: Fixed warning as committed
2601         in trunk.
2602         * testsuite/gcc.dg/graphite/block-0.c: Update test.
2603         * testsuite/gcc.dg/graphite/block-1.c: Same.
2604         * testsuite/gcc.dg/graphite/block-2.c: Remove xfail and test for
2605         blocking.
2606         * testsuite/gcc.dg/graphite/block-4.c: Remove test for strip mine.
2607         * testsuite/gcc.dg/graphite/block-3.c: New.
2608         * testsuite/gcc.dg/graphite/pr38498.c: New.
2609
2610 2008-12-22  Harsha Jagasia  <harsha.jagasia@amd.com>
2611
2612         PR tree-optimization/38510
2613         * gcc.dg/graphite/pr38510.c: New.
2614         * graphite.c (recompute_all_dominators): Call mark_irreducible_loops.
2615           (translate_clast): Call recompute_all_dominators before
2616           graphite_verify.
2617           (gloog): Call recompute_all_dominators before graphite_verify.
2618
2619 2008-12-12  Sebastian Pop  <sebastian.pop@amd.com>
2620
2621         PR tree-optimization/38492
2622         * graphite.c (rename_map_elt, debug_rename_elt,
2623         debug_rename_map_1, debug_rename_map, new_rename_map_elt,
2624         rename_map_elt_info, eq_rename_map_elts,
2625         get_new_name_from_old_name, bb_in_sese_p): Moved around.
2626         (sese_find_uses_to_rename_use): Renamed sese_build_livein_liveouts_use.
2627         (sese_find_uses_to_rename_bb): Renamed sese_build_livein_liveouts_bb.
2628         (sese_build_livein_liveouts): New.
2629         (new_sese, free_sese): New.
2630         (new_scop): Call new_sese.
2631         (free_scop): Call free_sese.
2632         (rename_variables_from_edge, rename_phis_end_scop): Removed.
2633         (register_old_new_names): Renamed register_old_and_new_names.
2634         (register_scop_liveout_renames, add_loop_exit_phis,
2635         insert_loop_close_phis, struct igp,
2636         default_liveout_before_guard, add_guard_exit_phis,
2637         insert_guard_phis, copy_renames): New.
2638         (translate_clast): Call insert_loop_close_phis and insert_guard_phis.
2639         (sese_add_exit_phis_edge): Renamed scop_add_exit_phis_edge.
2640         (rewrite_into_sese_closed_ssa): Renamed scop_insert_phis_for_liveouts.
2641         (scop_adjust_phis_for_liveouts): New.
2642         (gloog): Call scop_adjust_phis_for_liveouts.
2643
2644         * graphite.h (struct sese): Documented.  Added fields liveout,
2645         num_ver and livein.
2646         (SESE_LIVEOUT, SESE_LIVEIN, SESE_LIVEIN_VER, SESE_NUM_VER): New.
2647         (new_sese, free_sese, sese_build_livein_liveouts): Declared.
2648         (struct scop): Added field liveout_renames.
2649         (SCOP_LIVEOUT_RENAMES): New.
2650
2651 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
2652
2653         PR tree-optimization/38409
2654         * gcc.dg/graphite/pr38409.c: New.
2655         * graphite.c (nb_reductions_in_loop): Use simple_iv.
2656
2657 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
2658
2659         * graphite.c (gcc_type_for_cloog_iv): By default return
2660         integer_type_node.
2661         (graphite_create_new_loop): Don't fold_convert the already
2662         fold_convert-ed expression.
2663
2664 2008-12-11  Harsha Jagasia  <harsha.jagasia@amd.com>
2665
2666         PR tree-optimization/38446
2667         * gcc.dg/graphite/pr38446.c: New.
2668         * graphite.c (register_bb_in_sese): New.
2669         (bb_in_sese_p): Check if bb belongs to sese region by explicitly
2670         looking at the bbs in the region.
2671         * graphite.h (sese): Add region_basic_blocks pointer set to
2672         structure and initialize at the time of defining new scop.
2673
2674 2008-12-11  Tobias Grosser  <grosser@fim.uni-passau.de>
2675
2676         * graphite.c (new_graphite_bb): Initialize GBB_STATIC_SCHEDULE.
2677         (find_params_in_bb): Do not free data refs.
2678         (free_graphite_bb): Add FIXME on disabled free_data_refs.
2679
2680 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
2681
2682         * testsuite/gcc.dg/graphite/scop-16.c: Test only scop specific info.
2683         * testsuite/gcc.dg/graphite/scop-17.c: Same.
2684         * testsuite/gcc.dg/graphite/block-5.c: New.
2685         * testsuite/gcc.dg/graphite/block-6.c: New.
2686         * testsuite/gcc.dg/graphite/pr37485.c: Clean dump file after.
2687         * testsuite/gcc.dg/graphite/pr37684.c: Same.
2688         * testsuite/gcc.dg/graphite/block-2.c: Same.
2689
2690         * graphite.c (struct ivtype_map_elt): New.
2691         (debug_ivtype_elt, debug_ivtype_map_1, debug_ivtype_map,
2692         new_ivtype_map_elt, ivtype_map_elt_info, eq_ivtype_map_elts,
2693         gcc_type_for_cloog_iv): New.
2694         (loop_iv_stack_patch_for_consts): Use the type of the induction
2695         variable from the original loop, except for the automatically
2696         generated loops, i.e., in the case of a strip-mined loop, in
2697         which case there is no original loop: in that case just use
2698         integer_type_node.
2699         (new_graphite_bb): Initialize GBB_CLOOG_IV_TYPES.
2700         (free_graphite_bb): Free GBB_CLOOG_IV_TYPES.
2701         (clast_name_to_gcc): Accept params to be NULL.
2702         (clast_to_gcc_expression): Take an extra parameter for the type.
2703         Convert to that type all the expressions built by this function.
2704         (gcc_type_for_clast_expr, gcc_type_for_clast_eq): New.
2705         (graphite_translate_clast_equation): Compute the type of the
2706         clast_equation before translating its LHS and RHS.
2707         (clast_get_body_of_loop, gcc_type_for_iv_of_clast_loop): New.
2708         (graphite_create_new_loop): Compute the type of the induction
2709         variable before translating the lower and upper bounds and before
2710         creating the induction variable.
2711         (rename_variables_from_edge, rename_phis_end_scop): New.
2712         (copy_bb_and_scalar_dependences): Call rename_phis_end_scop.
2713         (sese_add_exit_phis_edge): Do not use integer_zero_node.
2714         (find_cloog_iv_in_expr, compute_cloog_iv_types_1,
2715         compute_cloog_iv_types): New.
2716         (gloog): Call compute_cloog_iv_types before starting the
2717         translation of the clast.
2718
2719         * graphite.h (struct graphite_bb): New field cloog_iv_types.
2720         (GBB_CLOOG_IV_TYPES): New.
2721         (debug_ivtype_map): Declared.
2722         (oldiv_for_loop): New.
2723
2724 2008-12-10  Tobias Grosser  <grosser@fim.uni-passau.de>
2725
2726         PR middle-end/38459
2727         * graphite.c (new_scop): Initialize SCOP_ADD_PARAMS.
2728         (param_index): Assert if parameter is not know after parameter
2729         detection.
2730         (find_params_in_bb): Detect params directly in GBB_CONDITIONS.
2731         (find_scop_parameters): Mark, that we have finished parameter
2732         detection.
2733         (graphite_transform_loops): Move condition detection before parameter
2734         detection.
2735         * graphite.h (struct scop): Add SCOP_ADD_PARAMS.
2736         * testsuite/gfortran.dg/graphite/pr38459.f90: New.
2737
2738 2008-12-09  Tobias Grosser  <grosser@fim.uni-passau.de>
2739
2740         * graphite.c (graphite_transform_loops): Always call find_transform ()
2741         in ENABLE_CHECKING.  So we test these code paths, even if we do not
2742         generate code.
2743
2744 2008-12-09  Tobias Grosser  <grosser@fim.uni-passau.de>
2745
2746         * graphite.c (print_graphite_bb): Fix printing to file != dump_file.
2747         (print_scop): Ditto.
2748
2749 2008-12-08  Tobias Grosser  <grosser@fim.uni-passau.de>
2750
2751         PR middle-end/38084
2752         Fix testsuite/gfortran.dg/graphite/id-3.f90.
2753         * graphite.c (scopdet_basic_block_info): Fix bug that found some
2754         regions more than once.
2755
2756 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
2757
2758         Fix testsuite/gfortran.dg/graphite/id-4.f90.
2759         * graphite.c (scan_tree_for_params): Do not compute the multiplicand
2760         when not needed.
2761
2762 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
2763
2764         Fix testsuite/gfortran.dg/graphite/id-1.f90.
2765         * graphite.c (gmp_cst_to_tree): Pass the type in parameter.
2766         (loop_iv_stack_patch_for_consts): Update use of gmp_cst_to_tree.
2767         (max_precision_type): New.
2768         (value_clast): Removed.
2769         (clast_to_gcc_expression): Be more careful to types of expressions.
2770         Use max_precision_type and update use of gmp_cst_to_tree.
2771         (graphite_translate_clast_equation): Use max_precision_type.
2772         (graphite_create_guard_cond_expr): Do not use integer_type_node,
2773         use the type of the condition.
2774         (graphite_create_new_loop): Do not use integer_type_node, use the
2775         max_precision_type of lb and ub.
2776
2777 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
2778
2779         * graphite.c (build_scops_1): Initialize open_scop.exit
2780         and sinfo.last.
2781
2782 2008-12-02  Sebastian Pop  <sebastian.pop@amd.com>
2783
2784         * testsuite/gcc.dg/graphite/pr38084.c: New.
2785         * testsuite/gfortran.dg/graphite/id-1.f90: New.
2786         * testsuite/gfortran.dg/graphite/id-2.f90: New.
2787         * testsuite/gfortran.dg/graphite/id-3.f90: New.
2788         * testsuite/gfortran.dg/graphite/id-4.f90: New.
2789         * testsuite/gfortran.dg/graphite/pr37857.f90: New.
2790
2791 2008-12-02  Sebastian Pop  <sebastian.pop@amd.com>
2792             Jan Sjodin  <jan.sjodin@amd.com>
2793             Harsha Jagasia  <harsha.jagasia@amd.com>
2794
2795         PR middle-end/37852
2796         PR middle-end/37883
2797         PR middle-end/37928
2798         PR middle-end/37980
2799         PR middle-end/38038
2800         PR middle-end/38039
2801         PR middle-end/38073
2802         PR middle-end/38083
2803         PR middle-end/38125
2804
2805         * testsuite/gcc.dg/graphite/pr38073.c: New.
2806         * testsuite/gcc.dg/graphite/pr37928.c: New.
2807         * testsuite/gcc.dg/graphite/pr37883.c: New.
2808         * testsuite/gcc.dg/graphite/pr38125.c: New.
2809         * testsuite/gfortran.dg/graphite/pr38083.f90: New.
2810         * testsuite/gfortran.dg/graphite/pr37852.f90: New.
2811         * testsuite/gfortran.dg/graphite/pr37980.f90: New.
2812
2813         * testsuite/gcc.dg/graphite/scop-18.c: Remove reduction, test for
2814         the number of detected scops.  Copy exact same test for loop
2815         blocking...
2816         * testsuite/gcc.dg/graphite/block-1.c: Fix the number of expected
2817         loops to be blocked as reductions are not handled.
2818         * testsuite/gcc.dg/graphite/block-4.c: ...here.  New.
2819
2820         * tree-phinodes.c (remove_phi_nodes): New, extracted from...
2821         * tree-cfg.c (remove_phi_nodes_and_edges_for_unreachable_block):
2822         ...here.
2823         * tree-flow.h (remove_phi_nodes, canonicalize_loop_ivs): Declared.
2824         * Makefile.in (graphite.o): Depend on value-prof.h.
2825         (graphite.o-warn): Removed -Wno-error.
2826         * tree-parloops.c (canonicalize_loop_ivs): Allow reduction_list
2827         to be a NULL pointer.  Call update_stmt.  Return the newly created
2828         cannonical induction variable.
2829
2830         * graphite.h (debug_rename_map): Declared.  Fix some comments.
2831
2832         * graphite.c: Reimplement the code generation from graphite to gimple.
2833         Include value-prof.h.
2834         (loop_iv_stack_get_iv): Do not return NULL for constant substitutions.
2835         (get_old_iv_from_ssa_name): Removed.
2836         (graphite_stmt_p): New.
2837         (new_graphite_bb): Test for useful statements before building a
2838         graphite statement for the basic block.
2839         (free_graphite_bb): Do not free GBB_DATA_REFS: this is a bug
2840         in free_data_ref that calls BITMAP_FREE (DR_VOPS (dr)) without
2841         reason.
2842         (recompute_all_dominators, graphite_verify,
2843         nb_reductions_in_loop, graphite_loop_normal_form): New.
2844         (scop_record_loop): Call graphite_loop_normal_form.
2845         (build_scop_loop_nests): Iterate over all the blocks of the
2846         function instead of relying on the incomplete information from
2847         SCOP_BBS.  Return the success of the operation.
2848         (find_params_in_bb): Use the data from GBB_DATA_REFS.
2849         (add_bb_domains): Removed.
2850         (build_loop_iteration_domains): Don't call add_bb_domains.
2851         Add the iteration domain only to the basic blocks that have been
2852         translated to graphite.
2853         (build_scop_conditions_1): Add constraints only if the basic
2854         block have been translated to graphite.
2855         (build_scop_data_accesses): Completely disabled until data
2856         dependence is correctly implemented.
2857         (debug_rename_elt, debug_rename_map_1, debug_rename_map): New.
2858         (remove_all_edges_1, remove_all_edges): Removed.
2859         (get_new_name_from_old_name): New.
2860         (graphite_rename_variables_in_stmt): Renamed
2861         rename_variables_in_stmt.  Call get_new_name_from_old_name.
2862         Use replace_exp and update_stmt.
2863         (is_old_iv): Renamed is_iv.
2864         (expand_scalar_variables_stmt): Extra parameter for renaming map.
2865         Use replace_exp and update_stmt.
2866         (expand_scalar_variables_expr): Same.  Use the map to get the
2867         new names for the renaming of induction variables and for the
2868         renaming of variables after a basic block has been copied.
2869         (expand_scalar_variables): Same.
2870         (graphite_rename_variables): Renamed rename_variables.
2871         (move_phi_nodes): Removed.
2872         (get_false_edge_from_guard_bb): New.
2873         (build_iv_mapping): Do not insert the induction variable of a
2874         loop in the renaming iv map if the basic block does not belong
2875         to that loop.
2876         (register_old_new_names, graphite_copy_stmts_from_block,
2877         copy_bb_and_scalar_dependences): New.
2878         (translate_clast): Heavily reimplemented: copy basic blocks,
2879         do not move them.  Finally, in call cleanup_tree_cfg in gloog.
2880         At each translation step call graphite_verify ensuring the
2881         consistency of the SSA, loops and dominators information.
2882         (collect_virtual_phis, find_vdef_for_var_in_bb,
2883         find_vdef_for_var_1, find_vdef_for_var,
2884         patch_phis_for_virtual_defs): Removed huge hack.
2885         (mark_old_loops, remove_dead_loops, skip_phi_defs,
2886         collect_scop_exit_phi_args, patch_scop_exit_phi_args,
2887         gbb_can_be_ignored, scop_remove_ignoreable_gbbs, ): Removed.
2888         (remove_sese_region, ifsese, if_region_entry, if_region_exit,
2889         if_region_get_condition_block, if_region_set_false_region,
2890         create_if_region_on_edge, move_sese_in_condition, bb_in_sese_p,
2891         sese_find_uses_to_rename_use, sese_find_uses_to_rename_bb,
2892         sese_add_exit_phis_edge, sese_add_exit_phis_var,
2893         rewrite_into_sese_closed_ssa): New.
2894         (gloog): Remove dead code.  Early return if code cannot be
2895         generated.  Call cleanup_tree_cfg once the scop has been code
2896         generated.
2897         (graphite_trans_scop_block, graphite_trans_loop_block): Do not
2898         block loops with less than two loops.
2899         (graphite_apply_transformations): Remove the call to
2900         scop_remove_ignoreable_gbbs.
2901         (limit_scops): When build_scop_loop_nests fails, continue on
2902         the next scop.  Fix open_scop.entry.
2903         (graphite_transform_loops): Call recompute_all_dominators: force the
2904         recomputation of correct CDI_DOMINATORS and CDI_POST_DOMINATORS.
2905         Call initialize_original_copy_tables and free_original_copy_tables
2906         to be able to copy basic blocks during code generation.
2907         When build_scop_loop_nests fails, continue on next scop.
2908         (value_clast): New union.
2909         (clast_to_gcc_expression): Fix type cast warning.
2910
2911 2008-11-09  Sebastian Pop  <sebastian.pop@amd.com>
2912
2913         * Merge from mainline (r140838:141727).
2914
2915 2008-11-05  Tobias Grosser  <grosser@fim.uni-passau.de>
2916
2917         PR middle-end/37833
2918
2919         * graphite.c (scan_tree_for_params): Add POINTER_PLUS_EXPR.
2920
2921 2008-11-05  Tobias Grosser  <grosser@fim.uni-passau.de>
2922
2923         PR middle-end/37943
2924
2925         * graphite.c (scopdet_basic_block_info): Fix loops with multiple
2926         exits and conditions.
2927         * testsuite/gcc.dg/graphite/pr37943.c: New.
2928
2929 2008-10-23  Tobias Grosser  <grosser@fim.uni-passau.de>
2930
2931         PR middle-end/37886
2932         * graphite.c (gloog): Replace EXIT_BLOCK_PTR with scop exit.
2933
2934 2008-10-23  Tobias Grosser  <grosser@fim.uni-passau.de>
2935
2936         * doc/invoke.texi: Fix spaces.
2937
2938 2008-10-22  Sebastian Pop  <sebastian.pop@amd.com>
2939
2940         PR tree-optimization/37891
2941         Reverted last commit.
2942         * graphite.c (create_single_entry_edge): Set
2943         EDGE_IRREDUCIBLE_LOOP and BB_IRREDUCIBLE_LOOP.
2944
2945 2008-10-21  Sebastian Pop  <sebastian.pop@amd.com>
2946             Mitul Thakkar  <mitul.thakkar@amd.com>
2947
2948         * graphite.c (create_single_entry_edge): Set
2949         EDGE_IRREDUCIBLE_LOOP and BB_IRREDUCIBLE_LOOP.
2950
2951 2008-10-16  Tobias Grosser  <grosser@fim.uni-passau.de>
2952
2953         * doc/invoke.texi: Add -fgraphite-identity.
2954         * graphite.c (graphite_apply_transformations): Check for
2955         -fgraphite-identity.
2956         * toplev.c (process_options): Add flag_graphite_identity.
2957         * tree-ssa-loop.c: Add flag_graphite_identity.
2958
2959 2008-10-14  Sebastian Pop  <sebastian.pop@amd.com>
2960
2961         Undo changes from 2008-10-02:
2962         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Convert
2963         operand type when copying the operand to a variable of different type.
2964         * cfgloopmanip.c (create_empty_loop_on_edge): Write exit condition
2965         with the IV name after increment.
2966
2967 2008-10-14  Sebastian Pop  <sebastian.pop@amd.com>
2968             Harsha Jagasia  <harsha.jagasia@amd.com>
2969
2970         PR tree-optimization/37828
2971         * testsuite/gcc.dg/graphite/pr37828.c: New.
2972         * graphite.c (graphite_trans_loop_block): Do not loop block
2973         single nested loops.
2974
2975 2008-10-09  Harsha Jagasia  <harsha.jagasia@amd.com>
2976             Sebastian Pop  <sebastian.pop@amd.com>
2977
2978         * graphite.c (struct rename_map_elt, new_rename_map_elt,
2979         rename_map_elt_info, eq_rename_map_elts): New.
2980         (graphite_rename_ivs_stmt): Renamed graphite_rename_variables_in_stmt.
2981         (expand_scalar_variables_expr): Change parameters.
2982         (expand_scalar_variables_stmt): Same.
2983         (expand_scalar_variables): Same.
2984         (graphite_rename_ivs): Rename graphite_rename_variables.
2985         (build_iv_mapping): New.
2986         (translate_clast): Call build_iv_mapping.
2987         * graphite.h (gbb_p): New name.
2988
2989 2008-10-03  Harsha Jagasia  <harsha.jagasia@amd.com>
2990
2991         PR tree-optimization/37684
2992         * gcc.dg/graphite/pr37684.c: New.
2993         * graphite.c (exclude_component_ref): New.
2994         (is_simple_operand): Call exclude_component_ref.
2995
2996 2008-10-02  Jan Sjodin  <jan.sjodin@amd.com>
2997             Harsha Jagasia  <harsha.jagasia@amd.com>
2998
2999         PR tree-optimization/37485
3000         * gcc.dg/graphite/block-2.c: New
3001         * graphite.c (gmp_cst_to_tree): Moved.
3002         (iv_stack_entry_is_constant): New.
3003         (iv_stack_entry_is_iv): New.
3004         (loop_iv_stack_push): Renamed to loop_iv_stack_push_iv.
3005         (loop_iv_stack_insert_constant): New.
3006         (loop_iv_stack_pop): Use new datatpype.
3007         (loop_iv_stack_get_iv): Same.
3008         (loop_iv_stack_get_iv_from_name): Same.
3009         (loop_iv_stack_debug): Renamed to debug_loop_iv_stack.
3010         (loop_iv_stack_patch_for_consts): New.
3011         (loop_iv_stack_remove_constants): New.
3012         (graphite_create_new_loop): Use loop_iv_stack_push_iv.
3013         (translate_clast): Call loop_iv_stack_patch_for_consts and
3014         loop_iv_stack_remove_constants.
3015         (gloog): Use new datatype.  Redirect construction edge to end
3016         block to avoid accidental deletion.
3017         * graphite.h (enum iv_stack_entry_kind): New.  Tag for data in
3018         iv stack entry.
3019         (union iv_stack_entry_data): New.  Data in iv stack entry.
3020         (struct iv_stack_entry): New.  Datatype for iv stack entries.
3021
3022 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
3023
3024         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Convert
3025         operand type when copying the operand to a variable of different type.
3026
3027 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
3028
3029         * cfgloopmanip.c (create_empty_loop_on_edge): Write exit condition
3030         with the IV name after increment.
3031
3032 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
3033
3034         * Merge from mainline (r140164:140838).
3035
3036 2008-09-10  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
3037
3038         * graphite-data-ref.c: New.
3039         * graphite.c (print_scop): Also dump the dependence graph.
3040         (bb_in_scop_p, loop_in_scop_p, nb_loops_around_gb): Moved...
3041         (new_scop): Initialize SCOP_DEP_GRAPH.
3042         (build_scop_dynamic_schedules): New.
3043         (build_access_matrix_with_af): Fixed column numbering.
3044         (graphite_transform_loops): Call build_scop_dynamic_schedules.
3045         * graphite.h: Add ifndef/define guards against multiple inclusion.
3046         (struct scop): Add dep_graph field.
3047         (SCOP_DEP_GRAPH): Defined.
3048         (ref_nb_loops): Fixed and moved to other position.
3049         (bb_in_scop_p, loop_in_scop_p, nb_loops_around_gb): ... here.
3050         (nb_loops_around_loop_in_scop): New.
3051         (graphite_dump_dependence_graph): Declared.
3052         (graphite_build_rdg_all_levels): Declared.
3053         (graphite_test_dependence): Declared.
3054         * Makefile.in (graphite-data-ref.o): New target.
3055
3056 2008-09-09  Sebastian Pop  <sebastian.pop@amd.com>
3057
3058         * Merge from mainline (139870:140164).
3059
3060 2008-09-01  Sebastian Pop  <sebastian.pop@amd.com>
3061
3062         * Merge from mainline (138275:139870).
3063         * testsuite/gcc.dg/graphite/scop-matmult.c: XFailed as one of
3064         the commits from trunk broke the niter detection.
3065
3066 2008-09-01  Sebastian Pop  <sebastian.pop@amd.com>
3067
3068         * graphite.c: Add more documentation.  Fix formatting.
3069         (debug_loop_vec, debug_oldivs, loop_iv_stack,
3070         loop_iv_stack_debug): Moved...
3071         (schedule_to_scattering): Move before use.
3072         (dot_all_scops): Include in "#if 0" the code for system
3073         call dotty.
3074
3075         * graphite.h: (debug_loop_vec, debug_oldivs, loop_iv_stack,
3076         loop_iv_stack_debug): ...here.
3077
3078 2008-08-29  Jan Sjodin  <jan.sjodin@amd.com>
3079
3080         * tree-phinodes.c (make_phi_node): Extern.
3081         (add_phi_node_to_bb): New.
3082         (create_phi_node): Call add_phi_node_to_bb.
3083         * tree-ssa-loop-ivopts.c (get_phi_with_result): New.
3084         (remove_statement): Handle case where stored phi was updated
3085         and is no longer the same.
3086         * graphite.c (is_parameter): New.
3087         (is_old_iv): New.
3088         (expand_scalar_variables_expr): New.
3089         (expand_scalar_variables_stmt): New.
3090         (expand_scalar_variables): New.
3091         (move_phi_nodes): Create new phi instead of moving old one.
3092         (translate_clast): Call expand_scalar_variables.
3093         (find_vdef_for_var_in_bb): Also scan regular definitions.
3094         (skip_phi_defs): New.
3095         (collect_scop_exit_phi_args): New.
3096         (patch_scop_exit_phi_args): New.
3097         (gloog): Patch phis after scop.
3098         * tree-flow.h: (add_phi_node_to_bb): Declared.
3099         (make_phi_node): Declared.
3100
3101 2008-08-26  Sebastian Pop  <sebastian.pop@amd.com>
3102
3103         * graphite.c (end_scop): Split the entry of the scop when it
3104         is the header of the loop in which the scop is ending.
3105         (build_scops_1, limit_scops): Update uses of end_scop.
3106
3107 2008-08-26  Sebastian Pop  <sebastian.pop@amd.com>
3108
3109         * graphite.c (dot_all_scops_1): Do not fail on uninitialized
3110         SCOP_ENTRY or SCOP_EXIT.
3111
3112 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3113
3114         * graphite.c (get_construction_edge): Removed.
3115         (gloog): Construction edge is the scop entry edge.
3116
3117 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3118
3119         * graphite.c (can_generate_for_scop): Removed.
3120         (gloog): Do not call it.
3121
3122 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3123
3124         * graphite.c (new_scop): Entry of a scop is an edge.
3125         Initialize SESE region.
3126         (free_scop): Free SESE region.
3127         (build_scops_1, scopdet_bb_info): Work on edges, not on bbs.
3128         (split_difficult_bb): New, split from end_scop.
3129         (end_scop): Exit of a scop is an edge.
3130         (build_scop_bbs): Never check CDI_POST_DOMINATORS: this info is
3131         not automatically updated and thus is always wrong.
3132         * graphite.h (struct sese): New.
3133         (SESE_ENTRY): New.
3134         (SESE_EXIT): New.
3135         (struct scop): New field for a SESE region.  Remove entry, exit.
3136         (SCOP_ENTRY, SCOP_EXIT): Update definitions to match same
3137         semantics as before.  Moved comment around.
3138
3139 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
3140             Sebastian Pop  <sebastian.pop@amd.com>
3141
3142         * graphite.c (graphite_transform_loops): Always enable gloog
3143         and find_transform when ENABLE_CHECKING.
3144
3145 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3146
3147         * graphite.c (graphite_transform_loops): Move pretty printer
3148         of SCOPs before doing any transform.  Remove call to print_scops
3149         and dot_all_scops_1.
3150
3151 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3152
3153         * graphite.c (dump_gbb_conditions): Don't try to print NULL pointers.
3154         (print_graphite_bb): Same.
3155
3156 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3157
3158         * graphite.c (dot_all_scops_1): Cleanup.
3159         (move_scops): Fix comment.
3160
3161 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
3162
3163         * graphite.c (build_scop_bbs): Revert commit 139355:
3164
3165         2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3166                     Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3167
3168                 * graphite.c (build_scop_bbs): Factor up code.
3169
3170 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
3171
3172         * graphite.c (gloog): Update dominator info.
3173
3174 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
3175
3176         * graphite.c (remove_cond_exprs): Do not fail on empty bbs.
3177
3178 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
3179
3180         * graphite.c (new_graphite_bb): Remove GBB_INDEX_TO_NUM_MAP
3181         initialization.
3182         (free_graphite_bb): Remove GBB_INDEX_TO_NUM_MAP free.
3183         (translate_clast): Correct formatting.
3184         * graphite.h (struct num_map): Removed.
3185         (struct graphite_bb): Remove num_map field.
3186         (GBB_INDEX_TO_NUM_MAP): Removed.
3187
3188 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
3189
3190         * graphite.c (build_access_matrix_with_af): Fix comments.
3191         (build_scop_data_accesses): Same.
3192
3193 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
3194
3195         * graphite.c (build_scop_data_accesses): Don't construct
3196         access matrices.  Add a FIXME and an assert condition that
3197         should pass when the access matrices will be needed.
3198
3199 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
3200
3201         * tree-data-ref.c (stmt_simple_memref_p): Don't call
3202         really_constant_p.
3203         * graphite.c (build_graphite_bb): Renamed new_graphite_bb.
3204         Moved close by free_graphite_bb.
3205         (free_graphite_bb): Call free_data_refs.  Reset bb->aux.
3206         (new_scop): Move close by free_scop.
3207         (graphite_transform_loops): Avoid linear scan to reset bb->aux.
3208
3209 2008-08-22  Jan Sjodin  <jan.sjodin@amd.com>
3210
3211         * cfgloopmanip.c (create_empty_if_region_on_edge): New.
3212         * graphite.c (clast_to_gcc_expression): Call gmp_cst_to_tree
3213         instead of recursive call.
3214         (graphite_translate_clast_equation): New.
3215         (graphite_create_guard_cond_expr): New.
3216         (graphite_create_new_guard): New.
3217         (get_stack_index_from_iv): Removed.
3218         (graphite_rename_ivs_stmt): Use gbb_loop_index.
3219         (get_true_edge_from_guard_bb): New.
3220         (translate_clast): Handle stmt_guard in clast.
3221         (get_construction_edge): Allow construction edge detection for
3222         a scope entry with multiple predecessors if one predecessor is
3223         the immediate dominator of scope entry.
3224         (can_generate_code_stmt): Enable code generation for clast_guard.
3225         (gloog): Use correct context loop.  Removed check for post dominators.
3226         * cfgloop.h (create_empty_if_region_on_edge): Declared.
3227
3228 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
3229
3230         * graphite.c (remove_dead_loops): Document better which
3231         loops are removed.
3232
3233 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
3234
3235         * Makefile.in: Rename POLYLIBLIBS and POLYLIBINC to PPLLIBS
3236         and PPLINC.
3237         (graphite.o): Also depends on pointer-set.h.
3238
3239 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
3240
3241         * graphite.c (scop_record_loop): Fix compile warning.
3242
3243 2008-08-21  Harsha Jagasia  <harsha.jagasia@amd.com>
3244             Sebastian Pop  <sebastian.pop@amd.com>
3245
3246         * graphite.c (scop_record_loop): DECL_NAME can be NULL.
3247
3248 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
3249
3250         * graphite.c (build_graphite_bb): Initialize bb->aux to
3251         point to the graphite_bb_p.
3252         (graphite_bb_from_bb): Renamed gbb_from_bb; returns the
3253         content of bb->aux.
3254         (add_bb_domains): Does not use the scop parameter.
3255         (graphite_transform_loops): Clean bb->aux at the end.
3256
3257 2008-08-20  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3258             Sebastian Pop  <sebastian.pop@amd.com>
3259
3260         * testsuite/lib/target-supports.exp
3261         (check_effective_target_fgraphite): New.
3262
3263         * testsuite/gcc.dg/graphite/graphite.exp: Early exit when
3264         check_effective_target_fgraphite returns false.
3265         Set dg-do-what-default to compile.
3266         (scan-graphite-dump-times): Removed.
3267         * testsuite/gfortran.dg/graphite/graphite.exp: Same.
3268
3269         * testsuite/gcc.dg/graphite/scop-0.c: Do not use "dg-do compile".
3270         Use scan-tree-dump-times instead of scan-graphite-dump-times.
3271         * testsuite/gcc.dg/graphite/scop-1.c: Same.
3272         * testsuite/gcc.dg/graphite/scop-2.c: Same.
3273         * testsuite/gcc.dg/graphite/scop-3.c: Same.
3274         * testsuite/gcc.dg/graphite/scop-4.c: Same.
3275         * testsuite/gcc.dg/graphite/scop-5.c: Same.
3276         * testsuite/gcc.dg/graphite/scop-6.c: Same.
3277         * testsuite/gcc.dg/graphite/scop-7.c: Same.
3278         * testsuite/gcc.dg/graphite/scop-8.c: Same.
3279         * testsuite/gcc.dg/graphite/scop-9.c: Same.
3280         * testsuite/gcc.dg/graphite/scop-10.c: Same.
3281         * testsuite/gcc.dg/graphite/scop-11.c: Same.
3282         * testsuite/gcc.dg/graphite/scop-12.c: Same.
3283         * testsuite/gcc.dg/graphite/scop-13.c: Same.
3284         * testsuite/gcc.dg/graphite/scop-matmult.c: Same.
3285         * testsuite/gcc.dg/graphite/scop-14.c: Same.
3286         * testsuite/gcc.dg/graphite/scop-15.c: Same.
3287         * testsuite/gcc.dg/graphite/block-0.c: Same.
3288         * testsuite/gcc.dg/graphite/scop-16.c: Same.
3289         * testsuite/gcc.dg/graphite/block-1.c: Same.
3290         * testsuite/gcc.dg/graphite/scop-17.c: Same.
3291         * testsuite/gcc.dg/graphite/scop-18.c: Same.
3292         * testsuite/gfortran.dg/graphite/block-1.f90: Same.
3293         * testsuite/gfortran.dg/graphite/scop-1.f: Same.
3294         * testsuite/gfortran.dg/graphite/block-2.f: Same.
3295
3296 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3297
3298         * graphite.c: Fix some XXX comments.
3299         (build_scop_dynamic_schedules): Removed.
3300
3301 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3302
3303         * graphite.h (scop_max_loop_depth): Moved...
3304         * graphite.c (scop_max_loop_depth): ...here.
3305         (remove_all_edges_1): New.
3306         (remove_all_edges): Factored code.
3307         (remove_cond_exprs): Check only the last statement for
3308         a GIMPLE_COND expression.
3309
3310 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3311
3312         * graphite.c (scan_tree_for_params): Early return when the
3313         expression is a chrec_dont_know.  Handle case NEGATE_EXPR.
3314         (find_scop_parameters): Factor out code.
3315         (graphite_trans_bb_strip_mine): Remove dead code.
3316
3317 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3318
3319         * graphite.c (clast_to_gcc_expression, graphite_create_new_loop,
3320         graphite_trans_bb_move_loop): Factor asserts.
3321         (gloog): Perform sanity checks only for ENABLE_CHECKING.
3322         Do not call calculate_dominance_info and estimate_bb_frequencies.
3323
3324 2008-08-20  Jan Sjodin  <jan.sjodin@amd.com>
3325
3326         * graphite.c (create_loops_mapping, free_loops_mapping,
3327         create_loops_mapping_num, debug_loop_mapping_1,
3328         debug_loop_mapping, graphite_loops_mapping_max_loop_num,
3329         get_loop_mapping_for_num, graphite_loops_mapping_add_child,
3330         graphite_loops_mapping_add_child_num,
3331         graphite_loops_mapping_insert_child,
3332         graphite_loops_mapping_parent, get_loop_mapped_depth_for_num,
3333         get_loop_mapped_depth, split_loop_mapped_depth_for_num,
3334         loop_mapped_depth_split_loop, swap_loop_mapped_depth_for_num,
3335         create_num_from_index, get_num_from_index,
3336         swap_loop_mapped_depth): Removed.
3337         (new_scop): Do not initialize SCOP_LOOPS_MAPPING.
3338         (free_scop): Do not call free_loops_mapping.
3339         (graphite_get_new_iv_stack_index_from_old_iv): Renamed
3340         get_stack_index_from_iv.  Use GBB_LOOPS instead of calling
3341         get_loop_mapped_depth.
3342         (graphite_trans_bb_move_loop): Do not update the loop mapping.
3343         (graphite_trans_bb_strip_mine): Same.
3344         * graphite.h (graphite_loops_mapping, graphite_loop_node): Removed.
3345         (struct scop): Remove field loops_mapping.
3346
3347 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3348             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3349
3350         * graphite.c (scop_record_loop): Factor out one level of the
3351         condition by early return.
3352         (build_scop_loop_nests): Format following FSF coding style.
3353         (build_scop_dynamic_schedules): Factor out code.
3354         (scopdet_bb_info): Reindent.  Default case should not be reachable.
3355
3356 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3357             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3358
3359         * graphite.c (loop_affine_expr): Check for DECL_P or struct
3360         assignments that are not handled as simple operands for now.
3361
3362 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3363             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3364
3365         * graphite.c (build_scop_bbs): Factor up code.
3366
3367 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3368             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3369
3370         * graphite.c (stmt_simple_for_scop_p): Factor code out
3371         of the loop.
3372         (enum gbb_type): New.  Group all the GBB_* types under it.
3373         (is_loop_exit): Moved...
3374         (end_scop): Enable BB spliting.
3375         * cfgloop.c (is_loop_exit): ...here.  Reimplemented.
3376         * cfgloop.h (is_loop_exit): Declared.
3377
3378 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3379
3380         * doc/invoke.texi: Remove strides from examples containing
3381         DO loops when the strides are equal to 1.
3382
3383 2008-08-20  Harsha Jagasia  <harsha.jagasia@amd.com>
3384             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3385
3386         * graphite.c (graphite_trans_scop_block): Or the result with
3387         the result from graphite_trans_loop_block.
3388         * testsuite/gcc.dg/graphite/block-1.c: New.
3389         * testsuite/gfortran.dg/graphite/block-1.f90: New.
3390         * testsuite/gfortran.dg/graphite/block-2.f: New.
3391
3392 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3393
3394         * graphite.c (graphite_transform_loops): Call cloog_initialize
3395         and cloog_finalize.
3396
3397 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3398
3399         * tree-data-ref.c) (stmt_simple_memref_p): New.
3400         * tree-data-ref.h (stmt_simple_memref_p): Declared.
3401         * graphite.c (stmt_simple_memref_for_scop_p): Removed.
3402         (is_simple_operand): Call stmt_simple_memref_p.
3403
3404         * testsuite/gcc.dg/graphite/scop-matmult.c: Updated for not
3405         using pointer arithmetic, as this is optimized by PRE and
3406         makes the code too difficult to analyze.
3407
3408         * testsuite/gcc.dg/graphite/scop-18.c: Same.
3409
3410 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
3411
3412         * gdbinit.in (pgg): New.
3413
3414 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
3415
3416         * graphite.c (graphite_trans_loop_block): Fix warning.
3417
3418 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
3419
3420         * graphite.c (graphite_trans_loop_block): Fix my merge error.
3421
3422 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
3423
3424         * graphite.c (graphite_trans_bb_block): Remove check for
3425         flag_loop_strip_mine, flag_loop_block, flag_loop_interchange.
3426         Check if loop blocking is profitable for every loop, before applying
3427         the changes.
3428         (graphite_apply_transformations): Call graphite_trans_bb_block only,
3429         if flag_loop_block is set.
3430
3431 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
3432
3433         * graphite.c: Add some more documentation for the loop
3434         mapping.
3435
3436 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
3437
3438         * Makefile.in (tree-data-ref.o): Remove dependence on graphite.h.
3439         * graphite.c: Format on less than 80 columns.
3440         * graphite.h: Same.
3441
3442 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
3443
3444         * cfgloopmanip.c (loopify): Use update_dominators_in_loop.
3445
3446 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
3447
3448         * doc/invoke.texi (floop-block, floop-strip-mine,
3449         floop-interchange): Update documentation with examples.
3450
3451 2008-08-13  Sebastian Pop  <sebastian.pop@amd.com>
3452
3453         * cfgloopmanip.c (create_empty_loop_on_edge): Don't call
3454         add_referenced_var.
3455         * graphite.c (graphite_create_new_loop): Call add_referenced_var.
3456
3457 2008-08-13  Sebastian Pop  <sebastian.pop@amd.com>
3458
3459         * cfgloopmanip.c (create_empty_loop_on_edge): Improve documentation.
3460         Factor gcc_asserts into a single one.  Use force_gimple_operand_gsi.
3461         * tree-scalar-evolution.c: Revert useless changes.
3462         * tree-phinodes.c: Same.
3463         * cfghooks.c: Same.
3464         * vec.h: Same.
3465         * tree-vectorizer.h: Same.
3466         * tree-flow.h: Same.
3467         * tree-cfg.c: Same.
3468         * common.opt (fgraphite): Update documentation.
3469
3470 2008-08-12  Harsha Jagasia  <harsha.jagasia@amd.com>
3471
3472         * doc/invoke.texi (-floop-block, -floop-strip-mine,
3473         -floop-interchange): Add more text for explaining what each of these
3474         flags is doing.
3475         * tree-into-ssa.c (gimple_vec): Moved to...
3476         * graphite.c: Include gimple.h.
3477         (gimple_vec): Moved to...
3478         (del_loop_to_cloog_loop): Removed.
3479         (loop_affine_expr): Do not call create_data_ref when the
3480         operand is a constant.
3481         (new_scop): Use free instead of del_loop_to_cloog_loop.
3482         * Makefile.in (graphite.o): Depend on GIMPLE_H.
3483         * gimple.h (gimple_vec): ... here.
3484
3485 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3486
3487         * graphite.c (scopdet_bb_info): Only allow loops with known number of
3488         latch executions.
3489         (build_loop_iteration_domains): Fail, if latch executions unknown.
3490
3491 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3492
3493         * graphite.c (add_conditions_to_domain): New.
3494         (build_scop_conditions_1): Call add_conditions_to_domain.
3495         (set_cloog_options): Allow to disable optimizations.
3496
3497 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3498
3499         * graphite.c (find_params_in_bb): Look for parameters in conditions.
3500         Do not use walk_dominator_tree.
3501         (find_scop_parameters): Do not use walk_dominator_tree.
3502
3503 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3504
3505         * graphite.c (scan_tree_for_params) Add / Subtract inequality.
3506         (idx_record_params): Adapt.
3507         * graphite.h (scop_gimple_loop_depth): New.
3508
3509 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3510
3511         * graphite.c (build_scop_dynamic_schedules): Remove value_init.
3512         (scan_tree_for_params): Remove value_init.
3513         (build_scop_context): Remove value_init.
3514         (build_loop_iteration_domains): Remove value_init.
3515         (schedule_to_scattering): Remove value_init.
3516         (graphite_trans_bb_strip_mine): Remove value_init.
3517
3518 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3519
3520         * gcc/graphite.c (limit_scops): New.
3521         (graphite_transform_loops): Add limit SCoPs.
3522         * gcc/testsuite/gcc.dg/graphite/scop-0.c: Update number of SCoPs.
3523         * gcc/testsuite/gcc.dg/graphite/scop-1.c: Update number of SCoPs.
3524         * gcc/testsuite/gcc.dg/graphite/scop-10.c: Update number of SCoPs.
3525         * gcc/testsuite/gcc.dg/graphite/scop-11.c: Update number of SCoPs.
3526         * gcc/testsuite/gcc.dg/graphite/scop-12.c: Update number of SCoPs.
3527         * gcc/testsuite/gcc.dg/graphite/scop-13.c: Update number of SCoPs.
3528         * gcc/testsuite/gcc.dg/graphite/scop-14.c: Update number of SCoPs.
3529         * gcc/testsuite/gcc.dg/graphite/scop-15.c: Update number of SCoPs.
3530         * gcc/testsuite/gcc.dg/graphite/scop-16.c: Update number of SCoPs.
3531         Change loop numbers.
3532         * gcc/testsuite/gcc.dg/graphite/scop-17.c: Update number of SCoPs.
3533         Change loop numbers.
3534         * gcc/testsuite/gcc.dg/graphite/scop-18.c: Update number of SCoPs.
3535         * gcc/testsuite/gcc.dg/graphite/scop-2.c: Update number of SCoPs.
3536         * gcc/testsuite/gcc.dg/graphite/scop-3.c: Update number of SCoPs.
3537         * gcc/testsuite/gcc.dg/graphite/scop-4.c: Update number of SCoPs.
3538         * gcc/testsuite/gcc.dg/graphite/scop-5.c: Update number of SCoPs.
3539         * gcc/testsuite/gcc.dg/graphite/scop-6.c: Update number of SCoPs.
3540         * gcc/testsuite/gcc.dg/graphite/scop-7.c: Update number of SCoPs.
3541         * gcc/testsuite/gcc.dg/graphite/scop-8.c: Update number of SCoPs.
3542         * gcc/testsuite/gcc.dg/graphite/scop-9.c: Update number of SCoPs.
3543         * gcc/testsuite/gcc.dg/graphite/scop-matmult.c: Update number of SCoPs.
3544
3545 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3546
3547         * graphite.c (graphite_transform_loops): Call always find_transform.
3548
3549 2008-08-08  Tobias Grosser  <grosser@fim.uni-passau.de>
3550
3551         * graphite.c (free_loops_mapping): New.
3552         (stmt_simple_for_scop_p): Fix typo.
3553         (stmt_simple_for_scop_p): Fix tuples functions, that
3554         broke polyhedron.
3555         (free_graphite_bb): Fix some memleaks.
3556         (free_scop): Fix some memleaks.
3557         (scopdet_bb_info): Do not forget some tmp SCoPs.
3558         (find_params_in_bb): Fix some memleaks.
3559         (clast_to_gcc_expression): Fix warning.
3560
3561 2008-08-07  Tobias Grosser  <grosser@fim.uni-passau.de>
3562
3563         * testsuite/gcc.dg/graphite/scop-16.c: Fix for 32bit.
3564         * testsuite/gcc.dg/graphite/scop-17.c: Fix for 32bit.
3565
3566 2008-08-04  Sebastian Pop  <sebastian.pop@amd.com>
3567
3568         * tree-ssa-loop.c (tree-ssa-loop.o): Do not include toplev.h.
3569         Move code ifdef-ed HAVE_cloog...
3570         * graphite.c: Include toplev.h.
3571         ... here.
3572         * Makefile.in (OBJS-common): Always build graphite.o.
3573         (BACKEND): Remove @GRAPHITE@.
3574         (tree-ssa-loop.o): Do not depend on TOPLEV_H.
3575         (graphite.o): Depend on TOPLEV_H.
3576
3577 2008-08-04  Sebastian Pop  <sebastian.pop@amd.com>
3578
3579         * Makefile.in (tree-ssa-loop.o): Depend on TOPLEV_H.
3580         Remove typo left from polylib to ppl conversion.
3581         * graphite.c (graphite_transforms): Use sorry instead of fatal.
3582
3583 2008-08-03  Sebastian Pop  <sebastian.pop@amd.com>
3584
3585         * toplev.c (process_options): Move the graphite loop optimization
3586         flags...
3587         * tree-ssa-loop.c (graphite_transforms): ... here.
3588         When not configured with CLooG, print to dump_file that
3589         Graphite transforms were not performed.
3590         * testsuite/gcc.dg/graphite/graphite.exp (scan-graphite-dump-times):
3591         New.
3592         * testsuite/gcc.dg/graphite/*.c: Updated all testcases to use
3593         scan-graphite-dump-times.
3594
3595 2008-08-03  Sebastian Pop  <sebastian.pop@amd.com>
3596
3597         * graphite.c (dot_scop, dot_all_scops): Do not call system.
3598         Do not open /tmp/scop.dot and /tmp/allscops.dot.
3599
3600 2008-08-02  Sebastian Pop  <sebastian.pop@amd.com>
3601             Jan Sjodin  <jan.sjodin@amd.com>
3602
3603         * configure: Regenerated.
3604         * omp-low.c (expand_omp_sections): Remove now unused code.
3605         * config.in (HAVE_polylib): Removed.
3606         * configure.ac (HAVE_polylib, POLYLIBLIBS, POLYLIBINC): Removed.
3607         (PPLLIBS, PPLINC): Added.
3608         * graphite.c: Replace unsigned with int wherever possible.
3609         Don't access Cloog's data structures, but use accessor functions.
3610         Clast's stmt->type is now implemented as a vtable: change the
3611         switches of stmt->type into ifs.
3612         (polylib/polylibgmp.h): Don't include.
3613         (initialize_dependence_polyhedron,
3614         initialize_data_dependence_polyhedron, is_empty_polyhedron,
3615         statement_precedes_p, test_dependence, build_rdg_all_levels,
3616         dump_dependence_graph): Removed until this code is cleaned up
3617         or ported to Cloog.
3618         * Makefile.in (POLYLIBLIBS): Renamed PPLLIBS.
3619         (POLYLIBINC): Renamed PPLINC.
3620
3621 2008-08-01  Harsha Jagasia  <harsha.jagasia@amd.com>
3622             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3623             Jan Sjodin  <jan.sjodin@amd.com>
3624
3625         Finish the merge and tuplification of graphite.
3626
3627 2008-07-24  Sebastian Pop  <sebastian.pop@amd.com>
3628             Jan Sjodin  <jan.sjodin@amd.com>
3629
3630         Partial merge from mainline (138072:138275).
3631         * graphite.c still has to be tuplified.
3632
3633 2008-07-29  Jan Sjodin  <jan.sjodin@amd.com>
3634
3635         * graphite.c (graphite_loops_mapping_max_loop_num): New.
3636         (create_num_from_index): New.
3637         (get_num_from_index): Also pass in the graphite BB.
3638         (free_graphite_bb): Free GBB_INDEX_TO_NUM_MAP.
3639         (build_graphite_bb): Initialize GBB_INDEX_TO_NUM_MAP.
3640         (graphite_trans_bb_strip_mine): Call create_num_from_index.
3641         (is_interchange_valid): Return false when failing.
3642         * graphite.h (struct num_map): New.
3643         (struct graphite_bb): New field num_map.
3644         (GBB_LOOPS_MAPPING): Renamed GBB_INDEX_TO_NUM_MAP.
3645
3646 2008-07-29  Tobias Grosser  <grosser@fim.uni-passau.de>
3647
3648         * graphite.c (dump_gbb_conditions): Print also conditions like
3649         "if (a)".  Remove dublicated code and use print_generic_expr ().
3650         (stmt_simple_for_scop_p): Only allow conditions we can handle
3651         {<, <=, >, >=}.
3652
3653 2008-07-25  Jan Sjodin  <jan.sjodin@amd.com>
3654
3655         * graphite.h (struct scop): Removed new_ivs field.
3656         (SCOP_NEWIVS): Deleted.
3657         * graphite.c (new_scop, free_scop, clast_name_to_gcc,
3658         clast_to_gcc_expression, graphite_create_new_loop):
3659         Removed use of new_ivs.
3660
3661 2008-07-25  Jan Sjodin  <jan.sjodin@amd.com>
3662
3663         * graphite.c (debug_oldivs, debug_loop_vec, create_loops_mapping,
3664         create_loops_mapping_num, debug_loop_mapping_1): New.
3665         (debug_loop_mapping): Call debug_loop_mapping_1.
3666         (get_loop_mapping_for_num,
3667         graphite_loops_mapping_add_child,
3668         graphite_loops_mapping_add_child_num,
3669         graphite_loops_mapping_insert_child,
3670         graphite_loops_mapping_parent,
3671         split_loop_mapped_depth_for_num,
3672         loop_mapped_depth_split_loop): New.
3673         (increment_loop_mapped_depths): Removed.
3674         (swap_loop_mapped_depth_for_num): Reimplemented.
3675         (new_scop): Call create_loops_mapping.
3676         (scop_record_loop): Call graphite_loops_mapping_insert_child.
3677         (translate_clast): Pass the old loop father in parameter, and pass
3678         it to get_old_iv_from_ssa_name.
3679         (remove_edges_around_useless_blocks, can_generate_code_stmt,
3680         can_generate_code, can_generate_for_scop): New.
3681         (graphite_trans_bb_block): Returns false when it fails to transform.
3682         * graphite.h (graphite_loop_node, graphite_loops_mapping): New.
3683
3684 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
3685
3686         Reverted all the changes related to the streamization and
3687         loop fusion.
3688         These changes are now tracked in the streamization branch.
3689
3690 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
3691             Jan Sjodin  <jan.sjodin@amd.com>
3692
3693         * graphite.c (gbb_compare): Correctly constify.
3694         (gbb_can_be_ignored): Indent.
3695         (graphite_trans_scop_swap_1and2): Add legality check.
3696         Remove dead FIXMEs.
3697
3698 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
3699
3700         Remove fallouts from "Reverted the Condate changes".
3701         * tree.h: Remove unused decl.
3702         * testsuite/gcc.dg/tree-checker: Same.
3703         * timevar.def: Remove counter.
3704
3705 2008-07-24  Sebastian Pop  <sebastian.pop@amd.com>
3706
3707         * Merge from mainline (135673:138072).
3708
3709         Reverted the MIRO changes (from 2008-04-05) that are now
3710         tracked in the miro branch.
3711         * tree-bounds.c: Removed.
3712         * tree-bounds.h: Removed.
3713
3714         Reverted the Condate changes (from 2006-07-04, 2007-03-20) that
3715         are now tracked in the condate branch.
3716         * tree-check.c: Removed.
3717         * tree-match.c: Removed.
3718         * condate.y: Removed.
3719
3720 2008-07-24  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3721
3722         * common.opt: New user flag -floop-block, -floop-strip-mine
3723         and -floop-interchange.
3724         * toplev.c (process_options): Enable -fgraphite pass if any one of the
3725         graphite loop optimization flags is turned on.
3726         * graphite.c (graphite_apply_transformations): Add flag_loop_block,
3727         flag_loop_strip_mine and flag_loop_interchange checks before
3728         optimizations.
3729         * doc/invoke.texi: Remove -fgraphite and add -floop-block,
3730         -floop-strip-mine and -floop-interchange.
3731         * testsuite/gcc.dg/graphite/block-0.c: Add -floop-block and remove
3732         -fgraphite.
3733         * testsuite/gcc.dg/graphite/scop-16.c: Ditto.
3734         * testsuite/gcc.dg/graphite/scop-17.c: Ditto.
3735         * testsuite/gcc.dg/graphite/scop-18.c: Ditto.
3736
3737 2008-07-23  Jan Sjodin  <jan.sjodin@amd.com>
3738             Sebastian Pop  <sebastian.pop@amd.com>
3739
3740         * cfgloopmanip.c (update_dominators_in_loop): Make it static.
3741         (create_empty_loop_on_edge): More fixes.
3742         * tree-phinodes.c (resize_phi_node): Extern.
3743         (unlink_phi_node, move_phi_node): New split from remove_phi_node.
3744         * cfghooks.c (update_dominator_information): New split from
3745         split_edge.
3746         * tree-vectorizer.c (rename_variables_in_bb): Extern.
3747         * tree-dfa.c (collect_dfa_stats): Start walking the CFG on the
3748         successor of the function entry block.
3749
3750         * graphite.c: Include pointer-set.h.
3751         (debug_loop_mapping, increment_loop_mapped_depths,
3752         get_loop_mapped_depth_for_num, get_loop_mapped_depth,
3753         set_loop_mapped_depth_for_num, set_loop_mapped_depth,
3754         swap_loop_mapped_depth_for_num, get_num_from_index,
3755         swap_loop_mapped_depth, loop_iv_stack_debug,
3756         loop_iv_stack_push, loop_iv_stack_pop, loop_iv_stack_get_iv,
3757         loop_iv_stack_get_iv_from_name, loop_iv_stack_debug,
3758         get_old_iv_from_ssa_name): New.
3759         (new_scop): Initialize SCOP_LOOPS_MAPPING.
3760         (free_scop): Free SCOP_LOOPS_MAPPING.
3761         (scop_record_loop): Record old ivs.
3762         (create_var_name): Removed.
3763         (initialize_cloog_names): Allocate double space in case strip mine
3764         applies to all loops once.
3765         (clast_name_to_gcc): Look up in the map ivstack passed in parameter.
3766         (clast_to_gcc_expression): Same.  Implement more clast to gimple
3767         translation.
3768         (graphite_create_new_loop): Pass in ivstack.
3769         (remove_all_edges): Pass in the construction_edge.
3770         (graphite_remove_iv): Removed.
3771         (graphite_rename_ivs, graphite_rename_ivs_stmt,
3772         remove_cond_exprs): Rewritten.
3773         (move_phi_nodes): New.
3774         (disconnect_virtual_phi_nodes, disconnect_cond_expr): Removed.
3775         (translate_clast): Pass in ivstack.  Rewrite some cases.
3776         (set_cloog_options, debug_clast_stmt): New.
3777         (find_transform): Use set_cloog_options.
3778         (outermost_loop_layer): Removed.
3779         (get_construction_edge, collect_virtual_phis, find_vdef_for_var_in_bb,
3780         find_vdef_for_var_1, find_vdef_for_var, patch_phis_for_virtual_defs,
3781         mark_old_loops, remove_dead_loops): New.
3782         (gloog): Rewritten.
3783         (graphite_trans_bb_move_loop): Call swap_loop_mapped_depth.
3784         (const_column_index, get_first_matching_sign_row_index,
3785         get_lower_bound_row, get_upper_bound_row, get_lower_bound,
3786         get_upper_bound): New.
3787         (graphite_trans_bb_strip_mine): Also update the iv map.
3788
3789         * graphite.h (graphite_loops_mapping, GBB_LOOPS_MAPPING): New.
3790         (struct name_tree): Add a loop field.
3791         (struct scop): Add a graphite_loops_mapping field.
3792         (SCOP_LOOPS_MAPPING): New.
3793         (debug_clast_stmt): Declare.
3794         * lambda.h (find_induction_var_from_exit_cond): Declare.
3795         (lambda-code.c): (find_induction_var_from_exit_cond): Extern.
3796         * cfgloop.h (update_dominators_in_loop): Removed declaration.
3797         (create_empty_loop_on_edge): Updated.
3798         * tree-flow.h (remove_bb, resize_phi_node, move_phi_node,
3799         rename_variables_in_bb): Declare.
3800         * tree-cfg.c (remove_bb): Extern.
3801
3802         * testsuite/gcc.dg/graphite/block-0.c: New.
3803
3804 2008-07-21  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
3805             Sebastian Pop  <sebastian.pop@amd.com>
3806
3807         * graphite.c (strip_mine_profitable_p): New.
3808         (graphite_trans_bb_block): Disable strip mining if not profitable.
3809
3810         * testsuite/gcc.dg/graphite/scop-18.c: New.
3811         * testsuite/gcc.dg/graphite/scop-17.c: Fixed.
3812         * testsuite/gcc.dg/graphite/scop-16.c: Fixed.
3813
3814 2008-07-17  Harsha Jagasia  <harsha.jagasia@amd.com>
3815             Jan Sjodin  <jan.sjodin@amd.com>
3816             Sebastian Pop  <sebastian.pop@amd.com>
3817
3818         * graphite.c (is_interchange_valid): New.
3819         (graphite_trans_bb_block): Check loop nest of basic block for legality
3820         of interchange.
3821
3822         * graphite.h (gbb_inner_most_loop_index, outer_most_loop_1,
3823         outer_most_loop, gbb_outer_most_loop_index): New.
3824
3825         * tree-loop-linear.c (perfect_loop_nest_depth): Remove static.
3826         * tree-flow.h (perfect_loop_nest_depth): Declare as extern.
3827         * testsuite/gcc.dg/graphite/scop-16.c: New.
3828         * testsuite/gcc.dg/graphite/scop-17.c: New.
3829
3830 2008-07-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3831
3832         * graphite.c (scop_remove_ignoreable_gbbs): Also update bitmap.
3833         (graphite_trans_scop_block): Ignore SCoPs without bbs.
3834
3835 2008-07-11  Tobias Grosser  <grosser@fim.uni-passau.de>
3836
3837         * graphite.c (new_scop): Initialize SCOP_EXIT.
3838         (scopdet_info): Add.
3839         (scopdet_bb_info): Rename from is_bb_addable. Cleanup, bugfixes.
3840         (build_scops_1): Cleanup, bugfixes.
3841         (build_scops): Cleanup.
3842
3843         * testsuite/gcc.dg/graphite/scop-matmult.c: Remove duplicated code.
3844         * testsuite/gcc.dg/graphite/scop-15.c: Add SCoP numbers.
3845
3846 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
3847
3848         * testsuite/gfortran.dg/graphite/scop-1.f: Update to reduced test case.
3849
3850         * testsuite/gfortran.dg/graphite/graphite.exp: Use
3851         DEFAULT_GRAPHITE_FLAGS.
3852
3853         * testsuite/gcc.dg/graphite/scop-15.c: Update to reduced test case.
3854
3855 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
3856
3857         * graphite.c (scan_tree_for_params): Do not assert any more if
3858         MULT_EXPR parameter is negative.
3859
3860         * testsuite/gfortran.dg/graphite/scop-1.f: New.
3861
3862         * testsuite/gfortran.dg/graphite/graphite.exp: New.
3863
3864         * testsuite/gcc.dg/graphite/scop-15.c: New.
3865
3866 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
3867
3868         * graphite.c (is_bb_addable): Fix segfault in spec gzip and reformat.
3869
3870 2008-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
3871
3872         * graphite.c (graphite_trans_bb_swap_loops): Rename from
3873         graphite_swap_loops.
3874         (graphite_trans_bb_move_loop): New.
3875         (graphite_trans_bb_strip_mine): Rename from graphite_strip_mine_loop.
3876         (graphite_trans_bb_block): New.
3877         (graphite_trans_loop_block): New.
3878         (graphite_trans_scop_swap_1and2): Rename from
3879         graphite_trans_swap_1and2.
3880         (graphite_trans_scop_strip): Rename from graphite_trans_strip.
3881         (graphite_trans_scop_block): New.
3882         (graphite_apply_transformations): Rename from
3883         graphite_transformations.
3884
3885         * testsuite/gcc.dg/graphite/scop-matmult.c: New.
3886
3887 2008-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
3888
3889         * graphite.c (gbb_compare): New.
3890         (graphite_sort_gbbs): New.
3891         (gbb_can_be_ignored): New.
3892         (scop_remove_ignoreable_gbbs): New.
3893         (graphite_transformations): Cleanup and add
3894         scop_remove_ignoreable_gbbs.
3895         * lambda.h (lambda_vector_compare): New.
3896
3897 2008-07-09  Tobias Grosser  <grosser@fim.uni-passau.de>
3898
3899         * graphite.c (print_graphite_bb): Correct printing of static schedule.
3900         (graphite_swap_loops): int -> unsigned
3901         (graphite_strip_mine_loop): int -> unsigned, Fix SCHEDULE
3902         (graphite_transformations): New.
3903         (graphite_transform_loops): Move to graphite_transformations.
3904         * graphite.h (gbb_nb_loops): Return unsigned.
3905
3906 2008-07-04  Tobias Grosser  <grosser@fim.uni-passau.de>
3907
3908         * graphite.c (scan_tree_for_params): Fix insertion of parameters into
3909         the domain matrix.  This makes scop-0.c work again.
3910
3911 2008-06-20  Richard Guenther  <rguenther@suse.de>
3912
3913         * graphite.h: Adjust copyright to GPLv3.
3914         * graphite.c: Likewise.
3915         (stmt_simple_memref_for_scop_p): Split out from ...
3916         (stmt_simple_for_scop_p): ... here.  Fix handling of calls
3917         and simplify.
3918         (get_bb_type): Optimize.
3919         (is_pred): Remove.
3920         (is_bb_addable): Fix memleak, replace is_pred call with
3921         single_pred.
3922         (build_scops): Use current_loops.
3923         (param_index): Fix memleak.
3924
3925 2008-06-20  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
3926
3927         * graphite.c: Fix formatting.
3928
3929 2008-06-19  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
3930
3931         * graphite.c (new_scop): Memory allocation for SCOP_{NEWIVS, OLDIVS}.
3932         (free_scop): Memory deallocation for SCOP_NEWIVS, SCOP_OLDIVS.
3933         (create_var_name, save_var_name): Newly defined functions.
3934         (initialize_cloog_names): Part of the code factored out to
3935         save_var_name.
3936         (clast_to_gcc_expression): Now handles the case of clast_red_sum
3937         in clast_reduction statement.
3938         (graphite_create_new_loop): Now takes a new parameter
3939         for outer_loop.
3940         (translate_clast): Now also takes the context_loop and bb_exit
3941         parameters. Rewritten the code so that it creates a gimple code
3942         inside the given context.
3943         (outermost_loop_layer, graphite_remove_iv, graphite_rename_ivs,
3944         remove_cond_expr, disconnect_cond_expr,
3945         disconnect_virtual_phi_nodes): Newly defined functions.
3946         * graphite.h (struct scop): added old_ivs vector.
3947         SCOP_OLDIVS: New macro.
3948
3949 2008-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3950
3951         * cfgloopmanip.c: Add missing function comments, fix formatting.
3952
3953 2008-06-18  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
3954
3955         * cfgloopmanip.c (update_dominators_in_loop): Defined.
3956         (create_empty_loop_on_edge): Defined.
3957         * tree-parloops.c (canonicalize_loop_ivs): Returns tree
3958         instead of void.
3959         * cfgloop.h (create_empty_loop_on_edge): Declared as extern.
3960         (update_dominators_in_loop): Declared as extern
3961         * tree-flow.h (canonicalize_loop_ivs): Declared as extern.
3962
3963 2008-06-16  Tobias Grosser  <grosser@fim.uni-passau.de>
3964
3965         * graphite.c (print_graphite_bb): Allow changing number of loops
3966         in SCoP domain.
3967         (initialize_cloog_names): Allow changing number of loops.
3968         (build_cloog_prog): Simplify.
3969         (find_transform): Enable cloog option --strides.
3970         (graphite_swap_loops): New.
3971         (graphite_strip_mine_loop): New.
3972         (graphite_trans_swap_1and2): New.
3973         (graphite_trans_strip): New.
3974         (graphite_transform_loops): Add graphite_trans_strip.
3975         * graphite.h (scop_max_loop_depth): New.
3976
3977 2008-06-15  Tobias Grosser  <grosser@fim.uni-passau.de>
3978
3979         * graphite.c (build_scop_iteration_domain): Remove forgotten
3980         line. (Fixes compile)
3981
3982 2008-06-15  Tobias Grosser  <grosser@fim.uni-passau.de>
3983
3984         * graphite.c (print_graphite_bb): Add output of GBB_LOOPS.
3985         (build_graphite_bb): Add GBB_LOOPS and GBB_DOMAIN and reorder.
3986         (build_bb_loops): New.
3987         (graphite_transform_loops): Add build_bb_loops.
3988         (schedule_to_scattering): Use gbb_nb_loops to support changing loop
3989         numbers.
3990         * graphite.h (graphite_bb): Add loops.
3991         (gbb_nb_loops): New.
3992         (gbb_loop_at_index): New.
3993         (gbb_loop_index): New.
3994         (nb_params_in_scop): Renamed to scop_nb_params. Updated all functions
3995         using nb_params_in_scop.
3996
3997 2008-06-14  Tobias Grosser  <grosser@fim.uni-passau.de>
3998
3999         * graphite.c (print_graphite_bb): Adapt to minimized schedule.
4000         (build_scop_canonical_schedules): Build minimized schedule.
4001         (schedule_to_scattering): Adapt to minimized schedule.
4002         * graphite.h (graphite_bb): Add/Update descriptions.
4003
4004 2008-06-14  Adrien Eliche  <aeliche@isty.uvsq.fr>
4005             Tobias Grosser  <grosser@fim.uni-passau.de>
4006
4007         * graphite.c (print_graphite_bb): Add condition printing.
4008         (dump_value): New.
4009         (dump_gbb_conditions): New.
4010         (build_scop_conditions_1): New.
4011         (build_scop_conditions): New.
4012         * graphite.h (graphite_bb): Add conditions.
4013
4014 2008-06-14  Tobias Grosser  <grosser@fim.uni-passau.de>
4015
4016         * graphite.c (print_graphite_bb):
4017         (free_graphite_bb): New.
4018         (free_scop): Free bbs.
4019         (get_bb_type): Free doms.
4020         (build_scop_context): Free context matrix.
4021         (build_loop_iteration_domains): Remove unused code.
4022         (build_cloog_prog): Free scattering function and blocklist.
4023         (find_transform): Free options.
4024
4025 2008-06-13  Tobias Grosser  <grosser@fim.uni-passau.de>
4026
4027         * graphite.c (loop_body_to_cloog_stmts): Rename to add_bb_domains.
4028         Remove unnecessery cloog data structures. Make a copy of the domain
4029         (setup_cloog_loop): Rename to build_loop_iteration_domains. Remove
4030         unnecessary cloog data structures. Fix memory leaks. Remove insert
4031         into SCOP_LOOP2CLOOG_LOOP as the inserted CloogLoops will never be
4032         used.
4033         (build_scop_iteration_domain): Remove unnecessary cloog
4034         data structures.  Fix memory leaks.
4035         (graphite_transform_loops): Disable build_scop_dynamic_schedules as it
4036         uses SCOP_LOOP2CLOOG_LOOP, that is at the moment not working.
4037
4038 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
4039
4040         * graphite.c (find_scop_params): Remove initialize_cloog_names.
4041
4042 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
4043
4044         * graphite.c (end_scop): Style fix.
4045         (schedule_to_scattering): Style and comment fix.
4046
4047 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
4048         * graphite.c (print_graphite_bb): Fix definiton of
4049         schedule_to_scattering.
4050         (initialize_cloog_names): Change nb_scattdims to max loop
4051         depth in SCoP.
4052         (schedule_to_scattering): Take parameter for number of scattering
4053         dimensions.
4054         (build_cloog_prog): Only build as much scattering dimensions as
4055         necessary.
4056
4057 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
4058
4059         * graphite.c (end_scop): Disable bb splitting. Fixes SIGSEGV
4060         in polyhedron/aermod.f90.
4061
4062 2008-06-11  Tobias Grosser  <grosser@fim.uni-passau.de>
4063             Dwarak Rajagopal  <dwarak.rajagopal@amd.com>
4064             Harsha Jagasia  <harsha.jagasia@amd.com>
4065
4066         * graphite.c (is_bb_addable): Fix segfault.
4067
4068 2008-06-10  Tobias Grosser  <grosser@fim.uni-passau.de>
4069
4070         * graphite.c (is_bb_addable): Fix memory leak, handling of loops
4071         with multiple exits and conditional handling in edge cases.
4072         (is_loop_exit): Fix memory leak. (Forgotten in last commit)
4073
4074         * testsuite/gcc.dg/graphite/scop-14.c: New.
4075
4076 2008-06-06  Tobias Grosser  <grosser@fim.uni-passau.de>
4077             Adrien Eliche  <aeliche@isty.uvsq.fr>
4078
4079         * graphite.c (is_bb_addable): Add more comments and enhance
4080         readablity of the source code. Fix memory leak.
4081         (is_loop_exit): Fix memory leak.
4082
4083 2008-06-05  Tobias Grosser  <grosser@fim.uni-passau.de>
4084
4085         * graphite.c (first_loop_in_scop): Deleted.
4086         (setup_cloog_loop): Only walk the loop chain for inner loops.
4087         (build_scop_iteration_domain): Execute setup_cloog_loop for
4088         all loops in the first layer.
4089
4090 2008-06-05  Tobias Grosser  <grosser@fim.uni-passau.de>
4091
4092         * graphite.c (scan_tree_for_params): Change the way params are
4093         added to be indepenent of the number of loops.
4094         (setup_cloog_loop): Revert to short matrix format. Fix parameter
4095         handling.
4096         (build_cloog_prog): Revert to short matrix format.
4097
4098 2008-06-05  Sebastian Pop  <sebastian.pop@amd.com>
4099             Dwarak Rajagopal <dwarak.rajagopal@amd.com>
4100
4101         * tree-loop-fusion.c (fuse_loops): Fix uninitialized variable
4102         warning.
4103
4104 2008-06-05  Sebastian Pop  <sebastian.pop@amd.com>
4105
4106         * graphite.c (nb_data_refs_in_scop): New.
4107         (graphite_transform_loops): Print more stats: number of
4108         loops, basic blocks and data references per scop.
4109
4110 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
4111             Jan Sjodin  <jan.sjodin@amd.com>
4112
4113         * graphite.c (loop_affine_expr, idx_record_params,
4114         find_scop_parameters, setup_cloog_loop): Use instantiate_scev
4115         instead of instantiate_parameters.
4116
4117 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
4118
4119         * graphite.c (schedule_to_scattering): Fix scattering dimensions,
4120         add support for parameters, add STATIC_SCHEDULE at the right places,
4121         cleanup.
4122
4123 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
4124
4125         * graphite.c (build_scop_loop_nests): Only add the loops, that
4126         are contained completely in the SCoP.
4127         (build_cloog_prog): Disable scattering, until schedule_to_scattering
4128         and the domains are fixed.
4129         (build_scop_canonical_schedules): Add support for bbs not contained
4130         in any SCoP.
4131
4132 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
4133
4134         * graphite.h (scop_contains_loop): Update comments to match
4135         the actual behavior.
4136         (scop_contains_loop): New.
4137         * graphite.c (schedule_to_scattering): Use scop_contains_loop.
4138
4139 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
4140
4141         * graphite.c (get_bb_type): On function body, i.e. loop_0,
4142         don't mark blocks as GBB_LOOP_SING_EXIT_HEADER, mark them
4143         as GBB_COND_HEADER.
4144
4145 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
4146             Tobias Grosser  <grosser@fim.uni-passau.de>
4147
4148         * graphite.c (graphite_transform_loops): Early return when
4149         there are no loops in the function.
4150
4151 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
4152             Jan Sjodin  <jan.sjodin@amd.com>
4153
4154         * graphite.c (scan_tree_for_params, setup_cloog_loop): Compute the
4155         offset of the last loop.
4156         (setup_cloog_loop): Copy the entire outer constraint matrix.
4157
4158 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
4159             Jan Sjodin  <jan.sjodin@amd.com>
4160
4161         * graphite.c (stmt_in_scop_p, function_parameter_p,
4162         invariant_in_scop_p): Removed.
4163         (scan_tree_for_params): Can be used with no constraint
4164         matrix for gathering parameters.
4165         (idx_record_params): Don't use idx_record_param, instead use
4166         scan_tree_for_params.
4167         (find_scop_parameters): Same.
4168         (setup_cloog_loop, build_scop_iteration_domain, build_cloog_prog):
4169         Fix the size of loop domains.
4170         (schedule_to_scattering): Exit when the outer loop is not in scop.
4171         (find_transform): Enable build_cloog_prog.
4172
4173 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
4174             Jan Sjodin  <jan.sjodin@amd.com>
4175
4176         * graphite.c (schedule_to_scattering): Make scattering domains
4177         uniformly of the same size, as required by CLooG 0.14.0 and before.
4178
4179 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
4180             Jan Sjodin  <jan.sjodin@amd.com>
4181
4182         * graphite.c (schedule_to_scattering): Rewrite, correct the
4183         translation of the scheduling function to scattering.
4184         (build_cloog_prog): Call schedule_to_scattering only once.
4185         * graphite.h (scop_loop_index): Do not fail for loops not
4186         in the scop: return -1.
4187
4188 2008-05-30 Tobias Grosser  <grosser@fim.uni-passau.de>
4189
4190         * graphite.c (build_graphite_bb): Initialize GBB_DOMAIN.
4191         (loop_body_to_cloog_stmts): Export GBB_DOMAIN.
4192         (setup_cloog_loop): Export GBB_DOMAIN.
4193         (build_cloog_prog): New.  Create new CLOOG_PROG, which should be
4194         able to rebuild the original control flow.
4195         * graphite.h (graphite_bb): Add domain field and access macro.
4196         (GBB_DOMAIN): New.
4197
4198 2008-05-30  Sebastian Pop  <sebastian.pop@amd.com>
4199
4200         * graphite.c (debug_gbb): New.
4201         (print_scop, build_graphite_bb): Use SCOP_BBS.
4202         (build_scop_bbs): Reimplemented.
4203         (dfs_bb_in_scop_p): Removed.
4204         (build_scop_loop_nests): Reorder loops inserted in
4205         SCOP_LOOP_NEST: outer loops should come first.
4206         (build_scop_canonical_schedules): Reinitialize at zero
4207         the components of the SCOP_STATIC_SCHEDULE for the loops
4208         that have already been parsed.
4209
4210         * graphite.h (debug_gbb): Declared.
4211
4212 2008-05-30  Sebastian Pop  <sebastian.pop@amd.com>
4213             Jan Sjodin  <jan.sjodin@amd.com>
4214
4215         * graphite.c (create_empty_loop): Renamed graphite_create_new_loop.
4216         (graphite_loop_to_gcc_loop): Removed.
4217         (remove_all_edges): New.
4218         (graphite_stmt_to_gcc_stmt): Renamed translate_clast.
4219         (gloog): Remove useless code.
4220
4221 2008-05-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4222
4223         * graphite.c (get_bb_type): Reworked. We distinguish between
4224         loops with one or multiple exits.
4225         (is_loop_exit): New.
4226         (is_pred): New.
4227         (is_bb_addable): Rework condition handling, now support for case
4228         case statements and loops with multiple exits.
4229
4230         * testsuite/gcc.dg/graphite/scop-11.c: New.
4231         * testsuite/gcc.dg/graphite/scop-12.c: New.
4232         * testsuite/gcc.dg/graphite/scop-13.c: New.
4233
4234 2008-05-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4235
4236         * graphite.c (dot_all_scops_1): Fix some colors. Reuse colors, if
4237         we have too many colors.
4238
4239 2008-05-22  Sandeep Maram <smaram_b04@iiita.ac.in>
4240
4241         * doc/invoke.texi (-ftree-loop-fusion): Document.
4242         * tree-pass.h (pass_loop_fusion): Declared.
4243         * tree-loop-fusion.c: New.
4244         * timevar.def (TV_TREE_LOOP_FUSION): Declared.
4245         * tree-data-ref.c (find_data_references_in_loop): Make extern.
4246         * tree-data-ref.h (find_data_references_in_loop): Declared.
4247         * common.opt (ftree-loop-fusion): Declared.
4248         * Makefile.in (tree-loop-fusion.o): Added rule and to OBJS-common.
4249
4250 2008-05-21  Sebastian Pop  <sebastian.pop@amd.com>
4251
4252         * graphite.c (build_access_matrix): Fix typo from the merge.
4253
4254 2008-05-20  Sebastian Pop  <sebastian.pop@amd.com>
4255
4256         * Merge from mainline (130800:135673).
4257
4258 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
4259
4260         * graphite.c (end_scop): The exit of the scop is not part of the scop.
4261         Update dominators after splitting.
4262
4263 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
4264
4265         * graphite.c (is_bb_addable): Return the harmful statement.
4266         Factor up some code.
4267         (end_scop): New.  Splits end of scope bbs on a harmful statement.
4268         (build_scops_1): Call end_scop.
4269
4270 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
4271
4272         * graphite.c: (succs_at_same_depth, end_scop, all_preds_visited_p,
4273         all_succs_visited_p, start_new_scop_for_each_succ, start_new_scop,
4274         add_dominators_to_open_scops, stop_last_open_scop, scop_end_loop,
4275         build_scops_1): Removed.
4276         (build_scops_2): Renamed build_scops_1.
4277
4278 2008-05-06  Sebastian Pop  <sebastian.pop@amd.com>
4279
4280         * graphite.c: Fix formatting.
4281
4282 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
4283
4284         * graphite.c (get_bb_type): New.
4285         (move_scops): New.
4286         (build_scops_2): New.
4287         (is_bb_addable): New.
4288         (build_scops): Switch the scop detection.
4289         (build_scop_bbs): Add entry bb to scop.
4290         * graphite.h (struct scop): Update comment.
4291
4292 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
4293
4294         * graphite.c (dot_all_scops_1): Fix some incorrect colors and add
4295         more colors.
4296
4297 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
4298
4299         * testsuite/gcc.dg/graphite/scop-1.c: Update.
4300         * testsuite/gcc.dg/graphite/scop-2.c: Update.
4301         * testsuite/gcc.dg/graphite/scop-4.c: Update.
4302         * testsuite/gcc.dg/graphite/scop-5.c: Add.
4303         * testsuite/gcc.dg/graphite/scop-6.c: Add.
4304
4305 2008-05-06  Sebastian Pop  <sebastian.pop@amd.com>
4306
4307         * testsuite/gcc.dg/graphite/scop-0.c: Add.
4308         * testsuite/gcc.dg/graphite/scop-7.c: Add.
4309         * testsuite/gcc.dg/graphite/scop-8.c: Add.
4310         * testsuite/gcc.dg/graphite/scop-9.c: Add.
4311         * testsuite/gcc.dg/graphite/scop-10.c: Add.
4312
4313 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
4314
4315         * graphite.c (scop_affine_expr): Renamed to loop_affine_expr.
4316         Check affine expressions depending on the outermost loop
4317         instead of a scop.
4318         (stmt_simple_for_scop_p): Same.
4319         (harmfule_stmt_in_scop): Same.
4320
4321 2008-04-28  Tobias Grosser  <grosser@fim.uni-passau.de>
4322
4323         * graphite.c (dot_all_scops): Remove incorrect difficult bb coloring,
4324         mark entry and exit, that are not part of the SCoP and update HTML
4325         formatting.
4326
4327 2008-04-25  Sebastian Pop  <sebastian.pop@amd.com>
4328
4329         * graphite.c (basic_block_simple_for_scop_p): Renamed
4330         harmful_stmt_in_bb.
4331         (save_scop, preds_at_same_depth, test_for_scop_bound): Removed.
4332         (add_dominators_to_open_scops, build_scops_1): Reimplemented.
4333         (all_preds_visited_p, all_succs_visited_p,
4334         start_new_scop_for_each_succ, start_new_scop, stop_last_open_scop,
4335         scop_end_loop): New.
4336         (build_scops): Do not use dfs_enumerate_from.
4337
4338         * testsuite/gcc.dg/graphite/scop-{1,2,4}.c: Updated.
4339
4340 2008-04-23  Sebastian Pop  <sebastian.pop@amd.com>
4341
4342         * graphite.c: Add comments to functions that are missing a
4343         description.
4344         (graphite_create_iv): Removed.  Merged in graphite_loop_to_gcc_loop.
4345
4346 2008-04-23  Sebastian Pop  <sebastian.pop@amd.com>
4347
4348         * graphite.c (nb_params_in_scop): Moved...
4349         (graphite_bb_from_bb, loop_body_to_cloog_stmts): New.
4350         (setup_cloog_loop): Call loop_body_to_cloog_stmts.
4351         (clast_to_gcc_expression): Reduce column size to less than 80.
4352         (graphite_create_iv): Return the new name of the IV.
4353         (find_transform): Set options->esp and options->cpp.
4354         (gloog): Comment out the invalidation of the old loop code.
4355         (initialize_dependence_polyhedron): Replace scop_nb_params with
4356         nb_params_in_scop.
4357
4358         * graphite.h (nb_params_in_scop): ... here.
4359         (scop_nb_params): Removed.
4360         (loop_domain_dim): Return something even when the loop was not
4361         found in the hash table: avoid ICEing on all the graphite.exp
4362         testcases.
4363
4364 2008-04-14  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4365
4366         * tree-chrec.c (for_each_scev_op): SCEV can have 3 operands.
4367
4368         * graphite.c (build_scop_dynamic_schedules): Schedule is built
4369         according to nesting level.
4370         (find_scop_parameters): Call instantiate_parameters.
4371         (scan_tree_for_params): Extend it to handle general affine bounds.
4372         Inner loop bound can depend on outer loop induction variable.
4373         (setup_cloog_loop): tmp variable is allocated on stack. Call
4374         instantiate_parameters with respect to outermost_loop_in_scop.
4375         (loop_domain_dim, ref_nb_loops, loop_iteration_vector_dim): moved to
4376         graphite.h.
4377         (create_empty_loop): Function loopify should be given edge
4378         probability, instead of edge frequency. Dominance relation from
4379         switch_bb to loop_header.
4380         (clast_to_gcc_expression): Added handling of clast_reduction node.
4381         (gloog): New functionality for removing old loop.
4382         (test_dependence): Factored out from build_rdg_all_levels.
4383         (build_rdg_all_levels): Dependence testing factored out to
4384         test_dependence function.
4385
4386         * graphite.h (struct graphite_bb): Extended with dynamic_schedule.
4387         (loop_domain_dim, ref_nb_loops, loop_iteration_vector_dim): Moved
4388         from graphite.c
4389
4390 2008-04-07  Sebastian Pop  <sebastian.pop@amd.com>
4391
4392         * graphite.c (free_scop, param_index, initialize_cloog_names,
4393         nb_params_in_scop): Use name_tree map instead of just a tree
4394         for keeping track of the variable name associated to that tree.
4395         (create_empty_loop, gmp_cst_to_tree, clast_name_to_gcc,
4396         clast_to_gcc_expression, graphite_create_iv,
4397         graphite_loop_to_gcc_loop, graphite_cond_to_gcc_cond,
4398         graphite_stmt_to_gcc_stmt): New.
4399         (gloog): Call these.
4400         * graphite.h (struct name_tree): New.
4401         (struct scop): Use name_tree instead of tree for params.
4402         Store a vector of name_tree for new_ivs.
4403         (SCOP_NEWIVS): New.
4404         (scop_nb_params): Use name_tree instead of tree.
4405
4406 2008-04-05  Alexander Lamaison  <awl03@doc.ic.ac.uk>
4407             Sebastian Pop  <sebastian.pop@amd.com>
4408
4409         * tree-bounds.c: New.
4410         * tree-bounds.h: New.
4411         * tree-pass.h: Declare pass_bounds_early and pass_bounds_late.
4412         * passes.c: Schedule pass_bounds_early, pass_bounds_late.
4413         * builtins.c (expand_builtin_alloca): Add flag_bounds as for
4414         flag_mudflap.
4415         * gcc.c: Same.
4416         * toplev.c: Same.
4417         * c-cppbuiltin.c: Same.
4418         * c-pragma.c: Same.
4419         * common.opt: Same.
4420         * varasm.c: Same.
4421         * tree-outof-ssa.c: Same.
4422         * c-common.c: Same.
4423         * Makefile.in: Same.
4424
4425 2008-03-15  Antoniu Pop  <antoniu.pop@gmail.com>
4426             Sebastian Pop  <sebastian.pop@amd.com>
4427
4428         * tree-loop-distribution.c (remaining_stmts,
4429         upstream_mem_writes): Removed static variables.
4430         (copy_loop_before, create_bb_after_loop,
4431         mark_nodes_having_upstream_mem_writes, free_rdg_components,
4432         rdg_build_components, rdg_build_partitions,
4433         dump_rdg_partitions): Extern.
4434         (generate_loops_for_partition, generate_code_for_partition): Do not
4435         return a bool.
4436         (already_processed_vertex_p, predecessor_has_mem_write,
4437         mark_nodes_having_upstream_mem_writes, has_upstream_mem_writes,
4438         rdg_flag_all_uses, rdg_flag_uses, rdg_flag_vertex_and_dependent,
4439         rdg_flag_loop_exits, rdg_flag_similar_memory_accesses,
4440         build_rdg_partition_for_component, rdg_build_partitions, ldist_gen):
4441         Pass remaining_stmts and upstream_mem_writes as parameters.
4442         (rdg_component): Moved...
4443         (build_rdg_partition_for_component): Do not aggregate components when
4444         flag_streamize_loops is set.
4445         (gen_sequential_loops): New.
4446         (ldist_gen): Call gen_sequential_loops.
4447
4448         * tree-pass.h (pass_loop_streamization): Declared.
4449
4450         * omp-low.c (expand_omp_sections): Call add_bb_to_loop on created
4451         basic blocks when loops structures exist.
4452
4453         * builtin-types.def (BT_FN_VOID_PTR_PTR_INT): New.
4454
4455         * tree-ssa-loop-ivopts.c (expr_invariant_in_region_p): New.
4456
4457         * tree-parloops.c (take_address_of, eliminate_local_variables_1,
4458         eliminate_local_variables_stmt, eliminate_local_variables,
4459         separate_decls_in_loop_name, separate_decls_in_loop_stmt,
4460         separate_decls_in_loop, gen_parallel_loop): Make them work on a region
4461         of code delimited by two edges in the CFG.
4462         (separate_decls_in_loop_name): Renamed separate_decls_in_region_name.
4463         (separate_decls_in_loop_stmt): Renamed separate_decls_in_region_stmt.
4464         (separate_decls_in_loop): Renamed separate_decls_in_region.  Isolate
4465         the case of parallelisation of reductions.
4466         (create_loop_fn): Extern.
4467         (create_omp_parallel_region): New.
4468
4469         * tree-data-ref.c (dump_data_dependence_relation): Don't call
4470         dump_data_reference for printing dra and drb.
4471         (create_rdg_edge_for_ddr, create_rdg_edges_for_scalar): Initialise
4472         RDGE_RELATION.
4473         (build_rdg): Don't call free_dependence_relations for the moment, as
4474         we attach dependence relations on each edge of the RDG.
4475         To be fixed later.
4476
4477         * tree-data-ref.h (rdg_component): ...here.
4478         (struct rdg_edge): New field ddr_p relation.
4479         (RDGE_RELATION): New.
4480         (create_bb_after_loop, copy_loop_before,
4481         mark_nodes_having_upstream_mem_writes, rdg_build_components,
4482         rdg_build_partitions, dump_rdg_partitions,
4483         free_rdg_components): Declared.
4484
4485         * omp-builtins.def (BUILT_IN_GOMP_STREAM_ALIGN_PUSH,
4486         BUILT_IN_GOMP_STREAM_ALIGN_POP): New.
4487
4488         * tree-loop-streamization.c: New.
4489
4490         * tree-flow.h (gather_blocks_in_sese_region, create_loop_fn,
4491         create_omp_parallel_region, expr_invariant_in_region_p): Declared.
4492
4493         * Makefile.in (tree-loop-streamization.o): Added to OBJS-common.
4494
4495         * tree-cfg.c (gather_blocks_in_sese_region): Extern.
4496
4497         * passes.c: Schedule pass_loop_streamization.
4498
4499 2008-03-08  Tobias Grosser  <grosser@fmi.uni-passau.de>
4500
4501         * graphite.c (dot_all_scops_1): Fix formatting for difficult bbs and
4502         update comment.
4503
4504 2008-03-07  Tobias Grosser  <grosser@fim.uni-passau.de>
4505
4506         * graphite.c (dot_all_scops): Update formatting.
4507         Bbs can now be part of more than one SCoP.
4508
4509 2008-03-04  Sebastian Pop  <sebastian.pop@amd.com>
4510
4511         * graphite.c (new_loop_to_cloog_loop_str, setup_cloog_loop): Fix
4512         malloc problems.
4513         (loop_domain_dim): Check for unregistered toplev SCOP loop.
4514         * graphite.h (loop_to_cloog_loop): New.
4515
4516 2008-03-04  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4517
4518         * graphite.c (loop_domain_dim, ref_nb_loops,
4519         loop_iteration_vector_dim): New.
4520         (build_access_matrix_with_af, build_access_matrix,
4521         initialize_dependence_polyhedron): Fixed for new matrix layout.
4522         No longer assume that all iteration domains are of the same
4523         dimensionality.
4524
4525 2008-03-02  Sebastian Pop  <sebastian.pop@amd.com>
4526
4527         * tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME
4528         defined in a loop at depth 0 is invariant.
4529         * tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto.
4530         * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Should never
4531         be called at loop depth 0.
4532
4533         * graphite.c (basic_block_simple_for_scop_p): Take the scop as
4534         a parameter.
4535         (dot_all_scops_1): Update use of basic_block_simple_for_scop_p.
4536         (down_open_scop): Removed.
4537         (loop_in_scop_p): Redefined.
4538         (scop_affine_expr): New argument: scop.
4539         (stmt_simple_for_scop_p): New argument: scop.  RETURN_EXPR is not
4540         a harmful statement ending a scop.
4541         (basic_block_simple_for_scop_p): New argument: scop.
4542         (get_loop_start): Removed.
4543         (new_scop): Initialize SCOP_LOOPS.
4544         (free_scop): Free SCOP_LOOPS.
4545         (succs_at_same_depth, preds_at_same_depth): New.
4546         (end_scop): Test the validity of a scop.
4547         (add_dominators_to_open_scops): New.
4548         (test_for_scop_bound): Call add_dominators_to_open_scops.
4549         Add cases for opening and closing multiple scops.
4550         (build_scops, build_scop_bbs): Iterate over basic blocks in
4551         depth first order.
4552         (build_graphite_bb): Pass scop directly.
4553         (dfs_bb_in_scop_p): New.
4554         (scop_record_loop): Use SCOP_LOOPS for not recording the same loop
4555         several times.
4556         (nb_loops_around_gb): Use loop_in_scop_p.
4557         (schedule_to_scattering): Disabled for the moment the code computing
4558         the "textual order for outer loop".
4559
4560         * graphite.h (struct scop): New field loops.
4561         (SCOP_LOOPS): New.
4562         (scop_loop_index): Test that the given loop belongs to SCOP_LOOPS.
4563
4564         * testsuite/gcc.dg/graphite/scop-{1,...,7}.c: Updated.
4565
4566 2008-02-27  Antoniu Pop  <antoniu.pop@gmail.com>
4567             Sebastian Pop  <sebastian.pop@amd.com>
4568
4569         * builtin-types.def (BT_FN_PTR_SIZE_UINT, BT_FN_BOOL_PTR): New.
4570         * common.opt (fstreamize-loops): New.
4571         * omp-builtins.def (BUILT_IN_GOMP_STREAM_CREATE,
4572         BUILT_IN_GOMP_STREAM_PUSH, BUILT_IN_GOMP_STREAM_HEAD,
4573         BUILT_IN_GOMP_STREAM_POP, BUILT_IN_GOMP_STREAM_EOS_P,
4574         BUILT_IN_GOMP_STREAM_SET_EOS, BUILT_IN_GOMP_STREAM_DESTROY): New.
4575
4576 2008-02-22  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4577
4578         * tree-data-ref.c (build_empty_rdg): New.
4579         (build_rdg): Use it.
4580         * tree-data-ref.h (build_empty_rdg): Declared.
4581         * graphite.c (free_scop): Free SCOP_LOOP2CLOOG_LOOP.
4582         (find_vertex_for_stmt): Removed.
4583         (build_rdg_all_levels): Use build_empty_rdg and rdg_vertex_for_stmt.
4584
4585 2008-02-21  Sebastian Pop  <sebastian.pop@amd.com>
4586
4587         * tree-loop-distribution.c (generate_builtin): After cancelling the
4588         loop tree, also delete basic blocks.
4589         (rdg_flag_uses): Stop recursion when a vertex has already been
4590         processed.
4591
4592 2008-02-15  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4593
4594         * graphite.c (build_scop_alpha): Removed.
4595         (graphite_transform_loops): Add a dummy call to build_all_rdg_levels
4596         and dump_dependence_graph to avoid compiler warnings.
4597
4598 2008-02-14  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4599
4600         * tree-data-ref.c (dr_may_alias_p, create_rdg_vertices): Extern.
4601         * tree-data-ref.h (dr_may_alias_p, create_rdg_vertices): Declared.
4602         * graphite.c (new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
4603         eq_loop_to_cloog_loop, del_loop_to_cloog_loop): New.
4604         (new_scop, setup_cloog_loop): Initialize SCOP_LOOP2CLOOG_LOOP.
4605         (initialize_dependence_polyhedron, find_vertex_for_stmt,
4606         initialize_data_dependence_polyhedron, is_empty_polyhedron,
4607         statement_precedes_p, build_rdg_all_levels, build_scop_alpha,
4608         dump_dependence_graph): New.
4609         * graphite.h (struct graphite_bb): New field compressed_alpha_matrix.
4610         (GBB_ALPHA): New.
4611         (struct scop): New field loop2cloog_loop.
4612         (SCOP_LOOP2CLOOG_LOOP, struct data_dependence_polyhedron,
4613         RDGE_DDP, ddp_p, struct loop_to_cloog_loop_str): New.
4614
4615 2008-02-10  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4616
4617         * graphite.c (build_graphite_bb): Fix initialization
4618         of the graphite basic block.
4619
4620 2008-02-05  Sebastian Pop  <sebastian.pop@amd.com>
4621
4622         * graphite.c (scan_tree_for_params): Rewrite for the new layout of
4623         loop domain matrix.  Pass in the number of loops contained in the
4624         constraint matrix.
4625         (nb_loops_around_gb): Moved before setup_cloog_loop that uses it.
4626         (setup_cloog_loop): Rewrite for the new layout of loop domain matrix:
4627         loops that are not surrounding the current loop are not represented
4628         in the domain constraint matrix.
4629         (build_scop_iteration_domain): Initial domain constraint matrix
4630         contains only the eq/ineq, cst, and scop parameters columns.
4631
4632 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4633
4634         * graphite.c (schedule_to_scattering, nb_loops_around_gb): New.
4635         (print_graphite_bb): Print scattering.
4636
4637 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4638
4639         * graphite.c (initialize_cloog_names): Initialize names of
4640         scattering variables.
4641
4642 2009-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4643
4644         * graphite.c (dot_all_scops_1): Disable debug output while
4645         printing graph.
4646
4647 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4648
4649         * graphite.c (find_transform): Change cloog output language to C.
4650
4651 2008-01-27  Sebastian Pop  <sebastian.pop@amd.com>
4652
4653         * tree-loop-distribution.c (generate_memset_zero,
4654         generate_builtin, generate_code_for_partition,
4655         rdg_flag_all_uses): New.
4656         (rdg_flag_uses): Gather in the same partition the statements defining
4657         the VUSES of the current statement.
4658         (rdg_flag_similar_stores): Renamed rdg_flag_similar_memory_accesses.
4659         Gather in the same partition not only the stores to the same memory
4660         access, but also the reads.
4661         (ldist_generate_loops): Renamed ldist_gen.
4662
4663 2008-01-24  Sebastian Pop  <sebastian.pop@amd.com>
4664             Tobias Grosser  <grosser@fmi.uni-passau.de>
4665
4666         * graphite.c (setup_cloog_loop): Chain all cloog loops with the
4667         next pointer, don't use the inner pointer.
4668
4669 2008-01-20  Tobias Grosser  <grosser@fmi.uni-passau.de>
4670
4671         * graphite.c (dot_all_scops, dot_all_scops_1): New.
4672         (find_transform): Call dot_all_1.
4673         * graphite.h (dot_all_scops): Declared.
4674
4675 2007-12-14  Sebastian Pop  <sebastian.pop@amd.com>
4676
4677         * tree-loop-distribution.c: Fix apsi.f ICE.
4678         (create_bb_after_loop): New.
4679         (generate_loops_for_partition): Use it.
4680         * testsuite/gfortran.dg/ldist-1.f90: New.
4681
4682         * tree-data-ref.c (dot_rdg): Use /tmp/rdg.dot for dotty format.
4683         * graphite.c (dot_scop): Use /tmp/scop.dot for dotty format.
4684
4685 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
4686
4687         * graphite.c (find_transform): Dump cloog program sent to cloog.
4688
4689 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
4690
4691         * graphite.c (initialize_cloog_names): Initialize cloog
4692         iterator names.
4693
4694 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
4695
4696         * graphite.c (build_scop_context): Fix typo, for the matrix
4697         format: insert '0 >= 0' instead of '-1 >= 0'.
4698
4699 2007-12-13  Sebastian Pop  <sebastian.pop@amd.com>
4700
4701         * Fix merge problems.
4702
4703 2007-12-13  Sebastian Pop  <sebastian.pop@amd.com>
4704
4705         * graphite.c (setup_cloog_loop): Fix typo.
4706
4707 2007-12-12  Sebastian Pop  <sebastian.pop@amd.com>
4708
4709         * doc/invoke.texi (-ftree-loop-distribution): Documented.
4710         * tree-loop-distribution.c: Reimplemented.
4711         * tree-pass.h (pass_loop_distribution): New.
4712         * tree-scalar-evolution.c (number_of_iterations_for_all_loops): Use
4713         print_loops.
4714         * graphds.h (struct graph): New field indexes.
4715         * timevar.def (TV_TREE_LOOP_DISTRIBUTION): New.
4716
4717         * tree-vect-analyze.c: Remove declaration of static functions when not
4718         needed.
4719         * tree-vectorizer.c: Same.
4720         (rename_variables_in_loop): Now extern.
4721         (slpeel_tree_duplicate_loop_to_edge_cfg): Renamed
4722         tree_duplicate_loop_to_edge_cfg.  Reset PENDING_STMT for edges after
4723         calling redirect_edge_and_branch_force.
4724
4725         * tree-vectorizer.h (tree_duplicate_loop_on_edge): Declared.
4726
4727         * tree-data-ref.c: Don't include tree-chrec.h.
4728         (debug_data_dependence_relations): New.
4729         (dump_data_dependence_relation): Call dump_data_reference on data refs
4730         in the relation.
4731         (same_access_functions): Moved...
4732         (find_vertex_for_stmt): Renamed rdg_vertex_for_stmt.
4733         (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
4734         debug_rdg_component, dump_rdg, debug_rdg, dot_rdg_1, dot_rdg,
4735         struct rdg_vertex_info, ): New.
4736         (create_rdg_edge_for_ddr): Compute the dependence level before looking
4737         at DDR_REVERSED_P.
4738         (create_rdg_vertices): Initialize the htab of graph->indexes.
4739         Initialize RDG_MEM_WRITE_STMT and RDG_MEM_READS_STMT.
4740         (stmts_from_loop): Don't save LABEL_EXPR.
4741         (hash_stmt_vertex_info, eq_stmt_vertex_info,
4742         hash_stmt_vertex_del): New.
4743         (build_rdg): Initialize rdg->indexes.
4744         (free_rdg, stores_from_loop, ref_base_address,
4745         rdg_defs_used_in_other_loops_p, have_similar_memory_accesses,
4746         have_similar_memory_accesses_1, ref_base_address_1,
4747         remove_similar_memory_refs): New.
4748
4749         * tree-data-ref.h: Include tree-chrec.h.
4750         (debug_data_dependence_relations): Declared.
4751         (same_access_functions): ...here.  Now static inline.
4752         (ddr_is_anti_dependent, ddrs_have_anti_deps,
4753         ddr_dependence_level): New.
4754         (struct rdg_vertex): New fields has_mem_write, has_mem_reads.
4755         (RDGV_HAS_MEM_WRITE, RDGV_HAS_MEM_READS, RDG_STMT, RDG_MEM_WRITE_STMT,
4756         RDG_MEM_READS_STMT): New.
4757         (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
4758         debug_rdg_component, dump_rdg, debug_rdg, dot_rdg,
4759         rdg_vertex_for_stmt): Declared.
4760         (struct rdg_edge): New field level.
4761         (RDGE_LEVEL, free_rdg): New.
4762         (stores_from_loop, remove_similar_memory_refs,
4763         rdg_defs_used_in_other_loops_p,
4764         have_similar_memory_accesses): Declared.
4765         (rdg_has_similar_memory_accesses): New.
4766
4767         * lambda.h (dependence_level): New.
4768         * common.opt (ftree-loop-distribution): New.
4769         * tree-flow.h (debug_loop_ir): Renamed debug_loops.
4770         (print_loop_ir): Renamed print_loops.
4771         (debug_loop, debug_loop_num, print_loops_bb, mark_virtual_ops_in_bb,
4772         tree_duplicate_loop_to_edge_cfg, rename_variables_in_loop): Declared.
4773         * Makefile.in (TREE_DATA_REF_H): Depends on tree-chrec.h.
4774         (tree-loop-distribution.o): Added.
4775         * tree-cfg.c (mark_virtual_ops_in_region): Use mark_virtual_ops_in_bb.
4776         (mark_virtual_ops_in_bb): New.
4777         (print_loops_bb, debug_loop_num, debug_loop): New.
4778         * passes.c: Scheduled pass_loop_distribution.
4779
4780 2007-12-12  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
4781
4782         * graphite.c (scan_tree_for_params): Correct the number of columns
4783         for polylib format.
4784         (nb_flat_iterator): New.
4785         (setup_cloog_loop): Initialize to 1 the first column for inequalities.
4786         (build_scop_iteration_domain): Correct the number of columns for
4787         polylib format.
4788
4789 2007-12-12  Sebastian Pop  <sebastian.pop@amd.com>
4790
4791         * Merge from mainline (129697:130800).
4792
4793 2007-10-30  Sebastian Pop  <sebastian.pop@amd.com>
4794
4795         * graphite.c (build_graphite_bb): SCoP's basic blocks are post
4796         dominated by SCoP's exit.
4797         (graphite_transform_loops): Compute post dominators.
4798
4799 2007-10-28  Sebastian Pop  <sebastian.pop@amd.com>
4800
4801         * Merge from mainline (127169:129697).
4802
4803 2007-10-28  Sebastian Pop  <sebastian.pop@amd.com>
4804
4805         * graphite.c (affine_expr): Renamed scop_affine_expr.  Use an extra
4806         parameter for the basic block that contains the expression.  Use
4807         outermost_loop_in_scop for evolution_function_is_affine_multivariate_p.
4808         (stmt_simple_for_scop_p): Pass to scop_affine_expr the basic block of
4809         the expression.
4810         * graphite.h (gbb_loop): New.
4811         (GBB_LOOP): Removed.
4812
4813 2007-08-03  Sebastian Pop  <sebpop@gmail.com>
4814
4815         * Makefile.in: Fix merge problem.
4816
4817 2007-08-03  Sebastian Pop  <sebpop@gmail.com>
4818
4819         * Merge from mainline (125309:127169).
4820         * tree-loop-distribution.c: Disabled.
4821
4822 2007-06-05  Sebastian Pop  <sebpop@gmail.com>
4823
4824         * Merge from mainline (r123693:125309).
4825
4826 2007-05-30  Sebastian Pop  <sebpop@gmail.com>
4827
4828         * tree-loop-distribution.c (correct_modify_expr_p): Renamed
4829         correct_modify_p
4830         (correct_modify_p, check_statements, number_of_lvalue_uses,
4831         number_of_scalar_dependences, create_edges): Use GIMPLE_MODIFY_STMT
4832         instead of MODIFY_EXPR.
4833         (update_edge_with_ddv): Don't pass index_of_edge.  Initialize
4834         and push new edges.
4835
4836 2007-05-24  Sebastian Pop  <sebpop@gmail.com>
4837
4838         * tree-loop-distribution.c (struct rdg): Replace arrays by
4839         VECs for edges and vertices.
4840         (RDG_NBV, RDG_NBE, RDG_VERTEX, RDG_EDGE): Removed.
4841         (RDGV_NB_PARTITIONS): New.
4842         (PRDG_NBV, PRDG_NBE): Removed.
4843         (build_scc_graph, correct_partitions_p, mark_partitions, build_prdg,
4844         dump_rdg, find_vertex_with_stmt, create_vertices, free_rdg,
4845         number_of_scalar_dependences, create_edges, build_rdg): Use VECs.
4846
4847 2007-05-17  Georges-Andre Silber  <silber@cri.ensmp.fr>
4848             Sebastian Pop  <sebpop@gmail.com>
4849
4850         * doc/invoke.texi (-ftree-loop-distribution): Document.
4851         * tree-loop-distribution.c: New file.
4852         * tree-pass.h (pass_loop_distribution): Declared.
4853         * timevar.def (TV_TREE_LOOP_DISTRIBUTION): New.
4854         * tree-data-ref.c (initialize_data_dependence_relation): Initialize
4855         and set reversed_p.
4856         * tree-data-ref.h (data_dependence_relation): Add reversed_p.
4857         (DDR_REVERSED_P): New.
4858         * common.opt (-ftree-loop-distribution): New.
4859         * tree-flow.h (distribute_loops): Declared.
4860         * Makefile.in (OBJS-common): Depend on tree-loop-distribution.o.
4861         * passes.c (init_optimization_passes): Schedule loop distribution.
4862
4863 2007-05-12  Sebastian Pop  <sebastian.pop@inria.fr>
4864
4865         * graphite.c (print_graphite_bb): Don't call dump_data_references.
4866         (print_scop): Don't print when scop is NULL.
4867         (build_scop_context, find_transform): Don't output to stderr.
4868
4869 2007-05-09  Sebastian Pop  <sebastian.pop@inria.fr>
4870
4871         * tree-data-ref.c: Don't include graphite.h.
4872         Comment out the code for printing data reference's scop.
4873         (build_access_matrix_with_af): Moved...
4874         * tree-data-ref.h (build_access_matrix_with_af): Removed declaration.
4875         * graphite.c (build_access_matrix_with_af): ... here.  Now static.
4876         (print_graphite_bb): Print basic block's schedule.
4877         (print_scop): Don't print the schedule, call cloog's pretty printer.
4878         (bb_in_scop_p): A basic block is in a scop only if it is both
4879         dominated and postdominated by the scop's entry and exit basic blocks.
4880         (function_parameter_p): New.
4881         (invariant_in_scop_p): Use function_parameter_p.
4882         (new_scop, save_scop): New.
4883         (end_scop, test_for_scop_bound, build_scops): Use new_scop, and
4884         save_scop.
4885         (scan_tree_for_params): Directly build the constraint as CloogMatrix.
4886         (loop_in_scop_p): New.
4887         (scop_record_loop): Use loop_in_scop_p.
4888         (build_scop_domain): Renamed build_scop_iteration_domain.
4889         (setup_cloog_loop, initialize_cloog_names, find_scop_parameters,
4890         nb_params_in_scop, build_scop_context, first_loop_in_scop,
4891         setup_cloog_loop, dot_scop_1, dot_scop): New.
4892         * graphite.h (GBB_LOOP, SCOP_PROG, dot_scop): New.
4893         (struct scop): Add a pointer to cloog's representation of a program.
4894
4895 2007-04-14  Sebastian Pop  <sebastian.pop@inria.fr>
4896
4897         * doc/invoke.texi (-ftree-check-verbose): Renamed
4898         -ftree-checks-verbose.
4899         * common.opt (flag_tree_check_verbose): Renamed
4900         flag_tree_checks_verbose.
4901         * tree-check.c (tree_check_warning): Use flag_tree_checks_verbose.
4902
4903 2007-04-14  Sebastian Pop  <sebastian.pop@inria.fr>
4904
4905         * configure: Regenerated.
4906         * config.in: Regenerated.
4907         * tree-ssa-loop.c (graphite_transforms): Execute
4908         graphite_transform_loops only when HAVE_cloog.
4909         * configure.ac (HAVE_polylib, HAVE_cloog, GRAPHITE): Defined.
4910         * graphite.c: Include polylibgmp.h and cloog.h.
4911         (graphite_transform_loops): Removed loops parameter.
4912         * tree-flow.h (graphite_transform_loops): Update declaration.
4913         * Makefile.in (POLYLIBLIBS, POLYLIBINC, CLOOGLIBS, CLOOGINC): New.
4914         (LIBS): Depend on CLOOGLIBS and on POLYLIBLIBS.
4915         (INCLUDES): Depend on POLYLIBINC and on CLOOGINC.
4916         (OBJS-common): Remove dependence on graphite.o.
4917         (BACKEND): Depend on @GRAPHITE@.
4918
4919 2007-04-13  Sebastian Pop  <sebastian.pop@inria.fr>
4920
4921         * doc/invoke.texi (-ftree-check-verbose): Documented.
4922         * testsuite/gcc.dg/tree-checker/tree-checks-1.c: New.
4923         * testsuite/gcc.dg/tree-checker/tree-checks-2.c: New.
4924         * testsuite/gcc.dg/tree-checker/tree-checks-3.c: New.
4925         * testsuite/gcc.dg/tree-checker/tree-checks-4.c: New.
4926         * testsuite/gcc.dg/tree-checker/tree-checks.exp: New.
4927         * testsuite/gcc.dg/tree-checker/condates.crp: New.
4928         * common.opt (ftree-checks-verbose): New.
4929         * tree-check.c (tree_check_warning): Move extra stderr output
4930         under control of flag_tree_check_verbose.
4931
4932 2007-04-12  Sebastian Pop  <sebastian.pop@inria.fr>
4933
4934         * tree-match.c: Fix comments formatting.
4935         * tree-match.h: Fix comments formatting.
4936         * tree-check.c: Fix comments formatting.
4937         (tree_check_init): Restructure.
4938
4939 2007-04-12  Nic Volanschi  <nic.volanschi@free.fr>
4940
4941         * doc/invoke.texi (-ftree-check, -ftree-checks): Documented.
4942
4943 2007-04-10  Sebastian Pop  <sebastian.pop@inria.fr>
4944
4945         * Merge from mainline (r120733:123693).
4946
4947 2007-03-20  Nic Volanschi  <nic.volanschi@free.fr>
4948
4949         * condate.y: New file.
4950         * tree-match.h (struct patt_info_s): New field sign.
4951         (struct condate_s): New field msg.
4952         (normalize_condate, name_condate, add_condate): New.
4953         (conds[], condate_parse): Made extern.
4954         * tree-check.c (tree_check_warning): First arg changed to cond;
4955         warning reformatted.
4956         (tree_check_init): Reset the TREE_VISITED bit on every CFG node.
4957         (tree_scan): New.
4958         (tree_check): Process trivial condates.
4959         (read_delimited_string): Removed.
4960         (print_cond): Print name and msg.
4961         (conds[]): Made extern.
4962         (parse_tree_check_file_once): Rewritten to use the parser in
4963         condate.y.
4964         Processing of option --tree_check_string moved to tree_scan().
4965         * Makefile.in: Added condate.y
4966
4967 2007-03-12  Sebastian Pop  <sebastian.pop@inria.fr>
4968
4969         * tree-pretty-print.c (dump_generic_bb_buff, lazy_dump_generic_node):
4970         Use VECs instead of varrays.
4971         * diagnostic.h (lazy_dump_generic_node): Update declaration.
4972         * Makefile.in (pretty-print.o): Depend on vec.h.
4973         * pretty-print.c: Include tree.h and vec.h.
4974         (pp_clear_state, pp_write_list_to_stream, pp_base_format,
4975         pp_base_format, pp_construct, pp_base_string, pp_lazy_mode,
4976         new_tree_chunk, pp_add_tree, pp_add_string, pp_add_char, pp_write_list,
4977         pp_free_list): Use VECs instead of varrays.
4978         * pretty-print.h: Do not include varray.h.
4979         (struct tree_chunk_s): Declaration moved before its use.
4980         (output_buffer): Rename varray field to chunks.
4981         * tree-match.c (tree_equal, chunk_1st_char, chunks_lookahead,
4982         tree_1st_char, match_chunks_pattinfo, match_tree_pattinfo,
4983         save_global_holes): Use VECs instead of varrays.
4984         * tree-match.h: Declare VECs of cfg_node, and hole_p.
4985         * tree-check.c (scan_cfg_stmts, push_node,
4986         print_matching_stmt): Removed.
4987         (tree_check_instance, push_global_holes_if_new, tree_check,
4988         execute_tree_check): Use VECs instead of varrays.
4989         (gate_tree_check): Don't execute the CFG check when basic_block_info
4990         is not available.
4991
4992 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
4993
4994         * Merge from mainline (r115016:120733).
4995
4996 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
4997
4998         * Merge from mainline (r117632:117661).
4999
5000 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
5001
5002         * tree-dump.c (dump_option_value_in): Add TDF_DEBUG.
5003         * tree-pass.h (TDF_DEBUG, debug_p): New.
5004         * tree-scalar-evolution.c (set_scalar_evolution, get_scalar_evolution,
5005         get_scalar_evolution, add_to_evolution, set_nb_iterations_in_loop,
5006         get_loop_exit_condition, analyze_evolution_in_loop,
5007         analyze_initial_condition, analyze_scalar_evolution,
5008         instantiate_parameters, number_of_latch_executions): Use debug_p.
5009         * tree-chrec.c (chrec_apply): Use debug_p.
5010         * tree-data-ref.c: Include graphite.h.
5011         (dump_data_reference): Print also the access matrix.
5012         (analyze_array, analyze_indirect_ref, init_data_ref,
5013         analyze_offset_expr, address_analysis, object_analysis,
5014         create_data_ref, finalize_ddr_dependent,
5015         non_affine_dependence_relation, analyze_ziv_subscript,
5016         analyze_siv_subscript_cst_affine,
5017         compute_overlap_steps_for_affine_1_2, analyze_subscript_affine_affine,
5018         can_use_analyze_subscript_affine_affine, analyze_siv_subscript,
5019         analyze_miv_subscript, analyze_overlapping_iterations,
5020         build_classic_dist_vector, subscript_dependence_tester,
5021         compute_affine_dependence, analyze_all_data_dependences): Use debug_p.
5022         (build_access_matrix_with_af): No longer static.
5023         * tree-data-ref.h (scop_p): ... declaration here.
5024         (data_reference.scop): New field.
5025         (DR_SCOP, DR_ACCESS_MATRIX): New.
5026         (build_access_matrix_with_af, dr_num_subscripts): Declared.
5027         * graphite.c (print_graphite_bb): Call dump_data_references.
5028         (print_scop): Use scop_nb_loops and scop_dim_domain.
5029         (test_for_scop_bound): Use debug_p.
5030         (scan_tree_for_params): Use scop_nb_loops, scop_nb_loops and
5031         scop_nb_params.
5032         (scop_loop_index): Moved...
5033         (scop_record_loop): New.
5034         (build_scop_loop_nests): Use scop_record_loop.
5035         (build_scop_domain): Use scop_dim_domain.
5036         (build_access_matrix): Implemented.
5037         (build_scop_canonical_schedules): Use scop_nb_loops.
5038         (build_graphite_bb): Initialize GBB_SCOP.
5039         * graphite.h (scop_p): Moved...
5040         (graphite_bb.scop): New field.
5041         (graphite_bb.iteration_domain, GBB_DOMAIN, scop.nb_params,
5042         scop.nb_loops, scop.dim_domain, SCOP_NB_LOOPS, SCOP_NB_PARAMS,
5043         SCOP_DIM_DOMAIN, SCOP_STMTS): Removed.
5044         (scop_nb_params, scop_nb_loops, scop_dim_domain, gbb_dim_domain,
5045         scop_loop_index): New.
5046         * Makefile.in (tree-data-ref.o): Depends on graphite.h.
5047
5048 2007-01-05  Sebastian Pop  <sebastian.pop@inria.fr>
5049
5050         * Merge from mainline (r117661:120450).
5051
5052 2006-10-12  Sebastian Pop  <sebastian.pop@inria.fr>
5053
5054         * tree-scalar-evolution.c (instantiate_parameters_1): Don't stop
5055         at the first declaration outside the varying loop, instantiate as
5056         far as possible.
5057         * tree-chrec.c (for_each_scev_op): New.
5058         * tree-chrec.h (for_each_scev_op): Declared.
5059         * tree-ssa-loop.c (pass_graphite_trans): Don't dump the function.
5060         * tree-data-ref.c (get_references_in_stmt,
5061         find_data_references_in_stmt): New, from trunk.
5062         (find_data_references_in_loop): Use get_references_in_stmt
5063         and find_data_references_in_loop, modified as in trunk.
5064         (build_access_matrix_with_af): New.
5065         * tree-data-ref.h (data_reference): Add a field access_matrix.
5066         (data_ref_loc): New, as in trunk.
5067         * graphite.c (print_graphite_bb, bb_in_scop_p, stmt_in_scop_p,
5068         invariant_in_scop_p, param_index, scan_tree_for_params,
5069         scop_loop_index, build_scop_loop_nests, build_scop_domain, irp_data,
5070         idx_record_param, idx_record_params, build_access_matrix,
5071         build_scop_data_accesses, build_scop_canonical_schedules,
5072         build_graphite_bb, build_scop_bbs, find_params_in_bb,
5073         build_scop_params): New.
5074         * graphite.h (graphite_bb): New.
5075         (scop): Add fields static_schedule, params, loop_nest,
5076         iteration_domain.
5077         * lambda.h: Declare vecs of lambda_matrix.
5078         * tree-flow.h (print_loop_ir_bb): Declared.
5079         * tree-cfg.c (print_loop_ir_bb): New.
5080         (print_loop): Use print_loop_ir_bb.
5081
5082 2006-10-12  Sebastian Pop  <pop@cri.ensmp.fr>
5083
5084         * Merge from mainline (r115016:117632).
5085
5086 2006-10-11  Sebastian Pop  <pop@cri.ensmp.fr>
5087
5088         * graphite.c (debug_scops): Adjust definition for avoiding a bootstrap
5089         break due to a warning.
5090
5091 2006-10-10  Sebastian Pop  <pop@cri.ensmp.fr>
5092
5093         * graphite.c (print_scops, debug_scops): New.
5094         (graphite_transform): Renamed graphite_find_transform.
5095         * graphite.h (debug_scops): Declared.
5096
5097 2006-08-17  Sebastian Pop  <pop@cri.ensmp.fr>
5098
5099         * tree-match.c: Reformat following the GNU style.
5100         * tree-match.h: Reformat following the GNU style.
5101         * tree-pattern.h: Removed empty file.
5102         * Makefile.in: Remove references to tree-pattern.h.
5103         * tree-check.c: Reformat following the GNU style.
5104         (execute_tree_check): Move gate condition code to...
5105         (gate_tree_check): ...here.  New function.
5106         (pass_check): Use the gate function.
5107
5108 2006-07-04  Nic Volanschi <nic.volanschi@free.fr>
5109
5110         * tree-pattern.h: New. Tree pattern matching and checking using
5111         concrete syntax.
5112         * tree-check.c: New. Tree/CFG checking pass.
5113         * tree-match.c: New. Library for tree pattern matching.
5114         * opts.c, common.opt: Add options --ftree-check & --ftree-checks.
5115         * toplev.c, flags.h: Add globals for tree-check pass.
5116         * Makefile.in: Integrate the files in tree-check pass.
5117         * timevar.def, tree-optimize.c, tree-pass.h: Register tree-check pass.
5118         * pretty-print.c, pretty-print.h, tree-pretty-print.c, diagnostic.h:
5119         Introduce a "lazy" pretty-print mode.
5120         * tree.c, tree.h: Add tree_name.
5121
5122 2006-07-04  Sebastian Pop  <pop@cri.ensmp.fr>
5123
5124         * doc/invoke.texi (-fgraphite): Correct typo.
5125         * tree-scalar-evolution.c (number_of_iterations_for_all_loops): Update
5126         use of print_loop_ir.
5127         * testsuite/gcc.dg/graphite/scop-1.c: New.
5128         * testsuite/gcc.dg/graphite/scop-2.c: New.
5129         * testsuite/gcc.dg/graphite/graphite.exp: New.
5130         * graphite.c: Include domwalk.h.
5131         (print_scop): Print only the entry and exit blocks.
5132         (debug_scop): No longer static.
5133         (affine_expr): Fix formating.  Return also true when the expression is
5134         constant.
5135         (stmt_simple_for_scop_p): Fix formating.
5136         (build_scops): Use domwalk.
5137         (get_loop_start, end_scop, test_for_scop_bound): New.
5138         (graphite_transform_loops): Avoid printing on stderr.
5139         * graphite.h (debug_scop): Declared.
5140         * tree-flow.h (debug_loop_ir, print_loop_ir): Update declarations.
5141         * Makefile.in (graphite.o): Depend on domwalk.h.
5142         * tree-cfg.c (print_loop, print_pred_bbs, print_succ_bbs): Remove
5143         declarations for static functions.
5144         (print_loop, print_loop_ir, debug_loop_ir): Use an extra parameter for
5145         controlling output verbosity.
5146
5147 2006-06-26  Sebastian Pop  <pop@cri.ensmp.fr>
5148             Plesco Alexandru  <shurikx@gmail.com>
5149
5150         * doc/invoke.texi (-fgraphite): Document.
5151         * tree-pass.h (pass_graphite_transforms): Declared.
5152         * timevar.def (TV_GRAPHITE_TRANSFORMS): New.
5153         * tree-ssa-loop.c (graphite_transforms, gate_graphite_transforms): New.
5154         (pass_graphite_transforms): Defined.
5155         * tree-data-ref.c (free_data_ref, data_reference): Extern.
5156         * tree-data-ref.h (free_data_ref, data_reference): Declared.
5157         * graphite.c, graphite.h: New.
5158         * common.opt (fgraphite): Declared.
5159         * tree-flow.h (graphite_transform_loops): Declared.
5160         * Makefile.in (OBJS-common): Add graphite.o.
5161         (graphite.o): New rule.
5162         * passes.c (pass_graphite_transforms): Scheduled.
5163