OSDN Git Service

Replace map with rename_map.
[pf3gnuchains/gcc-fork.git] / gcc / ChangeLog.graphite
1 2010-06-24  Sebastian Pop  <sebastian.pop@amd.com>
2
3         * graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
4         rename_map.
5         * sese.c (debug_rename_map): Same.
6         (get_rename): Same.
7         (set_rename): Same.
8         (rename_variables_in_stmt): Same.
9         (expand_scalar_variables_call): Same.
10         (expand_scalar_variables_ssa_name): Same.
11         (expand_scalar_variables_expr): Same.
12         (expand_scalar_variables_stmt): Same.
13         (expand_scalar_variables): Same.
14         (rename_variables): Same.
15         (graphite_copy_stmts_from_block): Same.
16         (copy_bb_and_scalar_dependences): Same.
17
18 2010-06-24  Sebastian Pop  <sebastian.pop@amd.com>
19
20         * graphite-clast-to-gimple.c (copy_renames): Removed.
21         (translate_clast_for): Do not call copy_renames.
22         (translate_clast_guard): Same.
23
24 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
25
26         * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
27         (rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps.
28         (rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps
29         before rewrite_cross_bb_scalar_deps.
30
31 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
32
33         * graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
34         Early return in when flag_associative_math is not set.
35
36 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
37
38         * gcc.dg/graphite/run-id-2.c: Call abort.
39
40 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
41
42         * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
43         of SSA copies on edges except for loop->latch.
44
45 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
46
47         * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
48         Split out of rewrite_reductions_out_of_ssa.
49         * graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
50         Declared.
51         * graphite.c (graphite_transform_loops): Call it.
52
53 2010-06-23  Sebastian Pop  <sebastian.pop@amd.com>
54
55         * graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
56
57 2010-06-15  Sebastian Pop  <sebastian.pop@amd.com>
58
59         * passes.c (init_optimization_passes): Add pass_graphite.
60         Schedule a pass_copy_prop before pass_graphite_transforms.
61         * timevar.def (TV_GRAPHITE): Declared.
62         * tree-pass.h (pass_graphite): Declared.
63         * tree-ssa-loop.c (pass_graphite): New.
64
65         * gcc.dg/graphite/id-20.c: New.
66
67 2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
68
69         * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
70         Remove calls to rename_nb_iterations and rename_sese_parameters.
71         * graphite-clast-to-gimple.h (gloog): Update declaration.
72         * graphite.c (graphite_transform_loops): Update call to gloog.
73         * sese.c (rename_variables_in_expr): Removed.
74         (rename_nb_iterations): Removed.
75         (rename_sese_parameters): Removed.
76         * sese.h (rename_nb_iterations): Removed.
77         (rename_sese_parameters): Removed.
78
79 2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
80
81         * graphite-clast-to-gimple.c (gloog): Remove call to
82         sese_adjust_liveout_phis.
83         * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
84         SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps.
85         (rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call
86         rewrite_phi_out_of_ssa.
87         * sese.c (get_vdef_before_sese): Removed.
88         (sese_adjust_vphi): Removed.
89         (sese_adjust_liveout_phis): Removed.
90         * sese.h (sese_adjust_liveout_phis): Removed.
91
92 2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
93
94         * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
95         argument for the place after which to insert the out of SSA copy.
96         (rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
97         (rewrite_phi_out_of_ssa): Same.
98         (rewrite_cross_bb_scalar_deps): Same.
99         (insert_copyout): Removed.
100         (insert_copyin): Removed.
101         (translate_scalar_reduction_to_array): Call insert_out_of_ssa_copy and
102         insert_out_of_ssa_copy_on_edge instead of insert_copyout and
103         insert_copyin.
104
105 2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
106
107         * graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
108         (rewrite_reductions_out_of_ssa): Same.
109         (rewrite_commutative_reductions_out_of_ssa): Same.
110         (build_poly_scop): Do not call these functions.
111         * graphite-sese-to-poly.h (build_poly_scop): Declared.
112         (rewrite_reductions_out_of_ssa): Declared.
113         (rewrite_commutative_reductions_out_of_ssa): Declared.
114         * graphite.c (graphite_transform_loops): Call on every scop
115         rewrite_commutative_reductions_out_of_ssa before calling
116         rewrite_reductions_out_of_ssa and build_scop_bbs.
117
118 2010-06-12  Sebastian Pop  <sebastian.pop@amd.com>
119
120         * graphite-dependences.c (dot_deps): Make system call to dotty run
121         in background.
122         (dot_deps_stmt): Same.
123         * graphite-poly.c (dot_lst): Same.
124
125 2010-06-11  Sebastian Pop  <sebastian.pop@amd.com>
126
127         * graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
128         old_type in parameter.
129         (gcc_type_for_value): Update call to gcc_type_for_interval.
130         (compute_type_for_level_1): Renamed compute_type_for_level.
131         Update call to gcc_type_for_interval.
132
133 2010-06-09  Sebastian Pop  <sebastian.pop@amd.com>
134
135         * tree-scalar-evolution.c (instantiate_scev_name): Do not fail
136         the scev analysis when the variable is not used outside the loop
137         in a close phi node: call compute_overall_effect_of_inner_loop.
138
139 2010-06-09  Sebastian Pop  <sebastian.pop@amd.com>
140
141         * graphite-sese-to-poly.c (single_pred_cond): Renamed
142         single_pred_cond_non_loop_exit.  Return NULL for loop exit edges.
143         (build_sese_conditions_before): Renamed call to single_pred_cond.
144         (build_sese_conditions_after): Same.
145
146 2010-06-09  Sebastian Pop  <sebastian.pop@amd.com>
147
148         * graphite-poly.h: Fix comments and indentation.
149         * graphite-sese-to-poly.c: Same.
150         (build_sese_conditions_before): Compute stmt and gbb only when needed.
151         * tree-chrec.c: Fix comments and indentation.
152         (tree-ssa-loop-niter.c): Same.
153
154 2010-06-08  Tobias Grosser  <grosser@fim.uni-passau.de>
155
156         * refined-regions.c (create_region): Only initialize the region.
157         (find_regions_with_entry): Initialize parent relation and bbmap
158         correctly.
159         (build_regions_tree): Set outermost_region to region instead of
160         topmost_region.
161         (calculate_region_tree): Remove unneeded parameters.
162
163 2010-06-02  Tobias Grosser  <grosser@fim.uni-passau.de>
164
165         * graphite-scop-detection.c (is_scop_p): New.
166         (build_scops_new): New. A skeleton for the new scop detection.
167         (build_scops_old): Renamed from build_scops.
168         (build_scops): New version. Call the new and the old scop
169         detection.
170
171 2010-05-27  Tobias Grosser  <grosser@fim.uni-passau.de>
172             Antoniu Pop  <antoniu.pop@gmail.com>
173
174         * Makefile.in (OBJS-common): Add refined-regions.o.
175         (refined-regions.o): New.
176         (graphite-scop-detection.o): Use refined-regions.h.
177         * graphite-scop-detection.c: Include refined-regions.h
178         (build_scops): Also build the refined region tree.
179         * refined-regions.c: New. Adds an algorithm to detect refined
180         regions.
181         (print_refined_region): New.
182         (debug_refined_region): New.
183         (refined_region_contains_bb_p): New.
184         (refined_region_contains_region_p): New.
185         (is_common_df): New.
186         (struct find_regions_global_data): New.
187         (is_region): New.
188         (typedef struct bb_bb_def): New.
189         (new_bb_bb_def): New.
190         (bb_bb_map_hash): New.
191         (eq_bb_bb_map): New.
192         (find_new_bb): New.
193         (bb_reg_def): New.
194         (new_bb_reg_def): New.
195         (bb_reg_map_hash): New.
196         (eq_bb_reg_map): New.
197         (find_new_region): New.
198         (insert_new_reg): New.
199         (insert_new_bb): New.
200         (insert_shortcut): New.
201         (get_next_postdom): New.
202         (create_region): New.
203         (find_regions_with_entry): New.
204         (find_regions_adc): New.
205         (find_regions): New.
206         (get_topmost_parent): New.
207         (build_regions_tree): New.
208         (calculate_region_tree): New.
209         (free_region_tree): New.
210         * refined-regions.h: New.
211         (struct refined_region): New.
212         (calculate_region_tree): New.
213         (free_region_tree): New.
214         (refined_region_contains_bb_p): New.
215         (refined_region_contains_region_p): New.
216         (print_refined_region): New.
217         (debug_refined_region): New.
218
219 2010-05-26  Sebastian Pop  <sebastian.pop@amd.com>
220
221         * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
222         size_one_node.
223
224 2010-05-07  Sebastian Pop  <sebastian.pop@amd.com>
225
226         * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Fix
227         type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
228
229 2010-05-07  Sebastian Pop  <sebastian.pop@amd.com>
230
231         * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
232         phi_arg_in_outermost_loop.
233         (remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
234         (remove_invariant_phi): Same.
235
236 2010-04-12  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
237
238         * graphite-blocking.c
239         (pbb_strip_mine_profitable_p): Replace Value with mpz_t.
240         * graphite-clast-to-gimple.c
241         (clast_to_gcc_expression): Same.
242         (precision_for_value): Same.
243         (precision_for_interval): Same.
244         (gcc_type_for_interval): Same.
245         (graphite_create_new_guard): Same.
246         (compute_bounds_for_level): Same.
247         (graphite_create_new_loop_guard): Same.
248         * graphite-interchange.c
249         (build_linearized_memory_access): Same.
250         (pdr_stride_in_loop): Same.
251         (memory_strides_in_loop_1): Same.
252         (memory_strides_in_loop): Same.
253         (extend_scattering): Same.
254         (psct_scattering_dim_for_loop_depth): Same.
255         (pbb_number_of_iterations): Same.
256         * graphite-poly.h
257         (debug_iteration_domains): Same.
258         * graphite-ppl.c
259         (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
260         (ppl_set_inhomogeneous_gmp): Same.
261         (ppl_strip_loop): Same.
262         (ppl_lexico_compare_linear_expressions): Same.
263         (ppl_read_polyhedron_matrix): Same.
264         (ppl_max_for_le_pointset): Same.
265         * graphite-ppl.h
266         (ppl_read_polyhedron_matrix): Same.
267         (tree_int_to_gmp): Same.
268         (gmp_cst_to_tree): Same.
269         (ppl_set_inhomogeneous): Same.
270         (ppl_set_inhomogeneous_tree): Same.
271         (ppl_set_coef): Same.
272         (ppl_set_coef_tree): Same.
273         * graphite-sese-to-poly.c
274         (build_pbb_scattering_polyhedrons): Same.
275         (build_scop_scattering): Same.
276         (scan_tree_for_params_right_scev): Same.
277         (scan_tree_for_params): Same.
278         (find_params_in_bb): Same.
279         (find_scop_parameters): Same.
280         (add_upper_bounds_from_estimated_nit): Same.
281         (build_loop_iteration_domains): Same.
282         (add_condition_to_domain): Same.
283         (pdr_add_memory_accesses): Same.
284
285 2010-04-11  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
286
287         * graphite-blocking.c (pbb_strip_mine_profitable_p): Resolve 
288         CLooG's value_* macros to their respective mpz_* counterparts.
289         * graphite-clast-to-gimple.c (clast_to_gcc_expression): Same.
290         (graphite_create_new_loop_guard): Same.
291         * graphite-interchange.c (build_linearized_memory_access): Same.
292         (pdr_stride_in_loop): Same.
293         (memory_strides_in_loop_1): Same.
294         (1st_interchange_profitable_p): Same.
295         * graphite-poly.c (extend_scattering): Same.
296         (psct_scattering_dim_for_loop_depth): Same.
297         (pbb_number_of_iterations): Same.
298         (pbb_number_of_iterations_at_time): Same.
299         * graphite-poly.h (new_1st_loop): Same.
300         * graphite-ppl.c (cloog_matrix_to_ppl_constraint): Same.
301         (oppose_constraint): Same.
302         (insert_constraint_into_matrix): Same.
303         (ppl_set_inhomogeneous_gmp): Same.
304         (ppl_set_coef_gmp): Same.
305         (ppl_strip_loop): Same.
306         (ppl_lexico_compare_linear_expressions): Same.
307         (ppl_max_for_le_pointset): Same.
308         (ppl_min_for_le_pointset): Same.
309         (ppl_build_realtion): Same.
310         * graphite-ppl.h (gmp_cst_to_tree): Same.
311         (ppl_set_inhomogeneous): Same.
312         (ppl_set_inhomogeneous_tree): Same.
313         (ppl_set_coef): Same.
314         (ppl_set_coef_tree): Same.
315         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Same.
316         (build_scop_scattering): Same.
317         (add_value_to_dim): Same.
318         (scan_tree_for_params_right_scev): Same.
319         (scan_tree_for_params_int): Same.
320         (scan_tree_for_params): Same.
321         (find_params_in_bb): Same.
322         (find_scop_parameters): Same.
323         (add_upper_bounds_from_estimated_nit): Same.
324         (build_loop_iteration_domains): Same.
325         (create_linear_expr_from_tree): Same.
326         (add_condition_to_domain): Same.
327         (pdr_add_memory_accesses): Same.
328
329 2010-04-05  Sebastian Pop  <sebastian.pop@amd.com>
330
331         PR middle-end/43519
332         * graphite-clast-to-gimple.c (max_signed_precision_type): Use
333         lang_hooks.types.type_for_size instead of build_nonstandard_integer_type.
334         When converting an unsigned type to signed, double its precision.
335         (gcc_type_for_interval): Use lang_hooks.types.type_for_size.
336         (gcc_type_for_iv_of_clast_loop): Call max_signed_precision_type.
337         (graphite_create_new_loop_guard): When ub + 1 wraps around, use lb <= ub.
338
339 2010-04-05  Sebastian Pop  <sebastian.pop@amd.com>
340
341         PR middle-end/43519
342         * graphite-clast-to-gimple.c (max_signed_precision_type): Use
343         build_nonstandard_integer_type.
344         (gcc_type_for_interval): Same.
345
346 2010-04-05  Sebastian Pop  <sebastian.pop@amd.com>
347
348         PR middle-end/43519
349         * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
350         POINTER_PLUS_EXPR for pointer types.
351
352         * gcc.dg/graphite/id-19.c: New.
353
354 2010-04-04  Sebastian Pop  <sebastian.pop@amd.com>
355
356         PR middle-end/43519
357         * Makefile.in (graphite-clast-to-gimple.o): Depends on langhooks.h.
358         * graphite-clast-to-gimple.c: Include langhooks.h.
359         (max_signed_precision_type): New.
360         (max_precision_type): Takes two types as arguments.
361         (precision_for_value): New.
362         (precision_for_interval): New.
363         (gcc_type_for_interval): New.
364         (gcc_type_for_value): New.
365         (gcc_type_for_clast_term): New.
366         (gcc_type_for_clast_red): New.
367         (gcc_type_for_clast_bin): New.
368         (gcc_type_for_clast_expr): Split up into several functions.
369         (gcc_type_for_clast_eq): Rewritten.
370         (compute_bounds_for_level): New.
371         (compute_type_for_level_1): New.
372         (compute_type_for_level): New.
373         (gcc_type_for_cloog_iv): Removed.
374         (gcc_type_for_iv_of_clast_loop): Rewritten.
375         (graphite_create_new_loop): Compute the lower and upper bound types
376         with gcc_type_for_clast_expr.
377         (graphite_create_new_loop_guard): Same.
378         (find_cloog_iv_in_expr): Removed.
379         (compute_cloog_iv_types_1): Removed.
380         (compute_cloog_iv_types): Removed.
381         (gloog): Do not call compute_cloog_iv_types.
382         * graphite-sese-to-poly.c (new_gimple_bb): Do not initialize
383         GBB_CLOOG_IV_TYPES.
384         (free_data_refs_aux): Do not free GBB_CLOOG_IV_TYPES.
385         * sese.h (struct gimple_bb): Removed field cloog_iv_types.
386         (GBB_CLOOG_IV_TYPES): Removed.
387
388         * gcc.dg/graphite/run-id-pr42644.c: Call abort.
389
390 2010-04-02  Sebastian Pop  <sebastian.pop@amd.com>
391
392         Reverted this commit: as at this point the loop closed SSA form
393         is under a canonical form respecting the single argument condition.
394         * graphite-sese-to-poly.c (scalar_close_phi_node_p): Loop
395         close phi nodes may have more than one argument.
396
397 2010-04-01  Sebastian Pop  <sebastian.pop@amd.com>
398
399         * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Assert that
400         gimple_phi_num_args of the loop close SSA phi node is equal to 1.
401         (detect_commutative_reduction): Same.
402
403 2010-03-31  Sebastian Pop  <sebastian.pop@amd.com>
404
405         * graphite-sese-to-poly.c (scalar_close_phi_node_p): Loop
406         close phi nodes may have more than one argument.
407
408 2010-03-30  Richard Guenther  <rguenther@suse.de>
409             Zdenek Dvorak  <ook@ucw.cz>
410             Sebastian Pop  <sebastian.pop@amd.com>
411
412         PR middle-end/43464
413         * tree-ssa-copy.c (init_copy_prop): Handle loop close phi nodes
414         with multiple arguments.
415         (execute_copy_prop): Remove call to rewrite_into_loop_closed_ssa.
416
417 2010-03-23  Sebastian Pop  <sebastian.pop@amd.com>
418
419         * graphite-dependences.c (print_pddr): Call print_pdr with an
420         extra argument.
421         * graphite-poly.c (debug_pdr): Add an extra argument for the
422         verbosity level.
423         (print_pdr): Same.
424         (print_pbb_domain): Same.
425         (print_pbb): Same.
426         (print_scop_context): Same.
427         (print_scop): Same.
428         (print_cloog): Same.
429         (debug_pbb_domain): Same.
430         (debug_pbb): Same.
431         (print_pdrs): Same.
432         (debug_pdrs): Same.
433         (debug_scop_context): Same.
434         (debug_scop): Same.
435         (debug_cloog): Same.
436         (print_scop_params): Same.
437         (debug_scop_params): Same.
438         (print_iteration_domain): Same.
439         (print_iteration_domains): Same.
440         (debug_iteration_domain): Same.
441         (debug_iteration_domains): Same.
442         (print_scattering_function): Same.
443         (print_scattering_functions): Same.
444         (debug_scattering_function): Same.
445         (debug_scattering_functions): Same.
446         * graphite-poly.h (debug_pdr): Update declaration.
447         (print_pdr): Same.
448         (print_pbb_domain): Same.
449         (print_pbb): Same.
450         (print_scop_context): Same.
451         (print_scop): Same.
452         (print_cloog): Same.
453         (debug_pbb_domain): Same.
454         (debug_pbb): Same.
455         (print_pdrs): Same.
456         (debug_pdrs): Same.
457         (debug_scop_context): Same.
458         (debug_scop): Same.
459         (debug_cloog): Same.
460         (print_scop_params): Same.
461         (debug_scop_params): Same.
462         (print_iteration_domain): Same.
463         (print_iteration_domains): Same.
464         (debug_iteration_domain): Same.
465         (debug_iteration_domains): Same.
466         (print_scattering_function): Same.
467         (print_scattering_functions): Same.
468         (debug_scattering_function): Same.
469         (debug_scattering_functions): Same.
470
471 2010-03-23  Sebastian Pop  <sebastian.pop@amd.com>
472
473         * graphite-poly.c (print_scattering_function_1): New.
474         (print_scattering_function): Call it.
475         (print_scop_params): Remove spaces at the end of lines.
476         (print_cloog): New.
477         (debug_cloog): New.
478         * graphite-poly.h (print_cloog): Declared.
479         (debug_cloog): Declared.
480
481 2010-03-23  Sebastian Pop  <sebastian.pop@amd.com>
482
483         * tree-ssa-copy.c: Revert this previous change:
484         (init_copy_prop): Loop closed phi nodes cancontain more than one
485         argument.
486         (execute_copy_prop): Revert the previous change: do not call
487         rewrite_into_loop_closed_ssa.
488
489 2010-03-21  Sebastian Pop  <sebastian.pop@amd.com>
490             Richard Guenther  <rguenther@suse.de>
491
492         PR middle-end/43464
493         * tree-ssa-copy.c (init_copy_prop): Loop closed phi nodes can
494         contain more than one argument.
495         (execute_copy_prop): Revert the previous change: do not call
496         rewrite_into_loop_closed_ssa.
497
498         * gcc.dg/graphite/id-pr43464.c: Remove compile warning.
499         * gcc.dg/graphite/id-pr43464-1.c: New.
500
501 2010-03-21  Sebastian Pop  <sebastian.pop@amd.com>
502
503         PR middle-end/43464
504         * tree-ssa-copy.c (execute_copy_prop): Call rewrite_into_loop_closed_ssa
505         and verify_loop_closed_ssa when copy prop is executed in the LNO.
506
507         * gcc.dg/graphite/id-pr43464.c: New.
508
509 2010-03-16  Sebastian Pop  <sebastian.pop@amd.com>
510
511         * graphite-sese-to-poly.c (graphite_loop_normal_form): Add the IV bump
512         in loop->header.
513         * tree-flow.h (canonicalize_loop_ivs): Updated declaration.
514         * tree-parloops.c (gen_parallel_loop): Add the IV bump in loop->latch.
515         * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Add a new parameter
516         to switch between adding the IV bump in loop->latch or in loop->header.
517
518 2010-03-16  Sebastian Pop  <sebastian.pop@amd.com>
519
520         * passes.c (init_optimization_passes): Add pass_copy_prop
521         after Graphite.
522
523 2010-03-16  Sebastian Pop  <sebastian.pop@amd.com>
524
525         * graphite-poly.c (print_scattering_function): Pretty print following
526         the scoplib format.
527         (print_pdr): Same.
528         (print_pbb_domain): Same.
529         (dump_gbb_cases): Same.
530         (dump_gbb_conditions): Same.
531         (print_pdrs): Same.
532         (print_pbb): Same.
533         (print_scop_params): Same.
534         (print_scop_context): Same.
535         (print_scop): Same.
536         (print_pbb_body): New.
537         (lst_indent_to): New.
538         (print_lst): Start new lines with a #.
539         * graphite-poly.h (pbb_bb): New.
540         (pbb_index): Use pbb_bb.
541         * graphite-ppl.c (ppl_print_powerset_matrix): Print the number of
542         disjuncts.
543         * tree-data-ref.c (dump_data_reference): Start new lines with a #.
544
545 2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
546
547         PR middle-end/43351
548         * gcc.dg/graphite/id-pr43351.c
549
550 2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
551
552         PR middle-end/43354
553         * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
554         call insert_out_of_ssa_copy for default definitions.
555         * gfortran.dg/graphite/id-pr43354.f: New.
556
557 2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
558
559         PR middle-end/43349
560         * gfortran.dg/graphite/pr43349.f: New.
561
562 2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
563
564         * graphite-clast-to-gimple.c (my_long_long): Defined.
565         (gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
566         * graphite-sese-to-poly.c (my_long_long): Defined.
567         (scop_ivs_can_be_represented): Use it.
568
569 2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
570
571         * doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
572         graphite-max-bbs-per-function, and loop-block-tile-size.
573         * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
574         with "maximum".
575         (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.
576
577 2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
578
579         * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
580         forward declaration.
581         * graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
582         (add_upper_bounds_from_estimated_nit): New.
583         (build_loop_iteration_domains): Use it.
584
585 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
586
587         * doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
588
589 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
590
591         PR middle-end/43306
592         * tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
593         should be an INTEGER_CST.  Also handle CASE_CONVERT.
594         * gcc.dg/graphite/pr43306.c: New.
595
596 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
597
598         * graphite.c (graphite_initialize): To bound the number of bbs per
599         function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
600         * params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
601         * doc/invoke.texi: Document it.
602
603 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
604
605         * graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
606         * graphite-sese-to-poly.h (build_poly_scop): Same.
607
608 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
609
610         * graphite-sese-to-poly.c (build_poly_scop): Limit scops following
611         the number of parameters in the scop.  Use as an upper bound
612         PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
613         * params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
614         * doc/invoke.texi: Document it.
615
616 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
617
618         * graphite-sese-to-poly.c (add_param_constraints): Use
619         lower_bound_in_type and upper_bound_in_type.
620
621 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
622
623         * graphite-sese-to-poly.c (add_param_constraints): Use sizetype
624         instead of unsigned_type_node.
625
626 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
627             Reza Yazdani  <reza.yazdani@amd.com>
628
629         PR middle-end/43065
630         * graphite-sese-to-poly.c (add_param_constraints): Insert bounds
631         on pointer type parameters.
632
633         * gcc.dg/graphite/run-id-4.c: New.
634
635 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
636
637         PR middle-end/43065
638         * gcc.dg/graphite/run-id-3.c: New.
639
640 2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
641             Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
642
643         * graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
644         handle conversions from pointer to integers.
645         (gcc_type_for_cloog_iv): Choose the smalles signed integer as an
646         induction variable, to be able to work with code generated by CLooG.
647         * graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
648         (build_poly_scop): Bail out if we cannot codegen a loop.
649
650 2010-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
651
652         * graphite-clast-to-gimple.c (translate_clast): Do not short-cut
653         code generation with gloog_error.
654
655 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
656
657         * sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
658         Call fold_convert on all the returned values.
659         (expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
660         the type of the resulting expression.
661
662 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
663
664         * graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
665         ppl_min_for_le_pointset.  Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
666         * graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
667
668 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
669
670         * graphite-dependences.c (map_into_dep_poly): Removed.
671         (dependence_polyhedron_1): Use combine_context_id_scat.
672
673 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
674
675         * graphite-poly.h (struct poly_scattering): Add layout documentation.
676         (struct poly_bb): Same.
677         (combine_context_id_scat): New.
678
679 2010-03-02  Sebastian Pop  <sebastian.pop@amd.com>
680
681         PR middle-end/42326
682         * sese.c (name_defined_in_loop_p): Return false for default
683         definitions.
684
685         * gcc.dg/graphite/pr42326.c: New.
686
687 2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
688
689         * graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify
690         and clean up the logic.
691
692 2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
693
694         * graphite-sese-to-poly.c (add_param_constraints): Enabled: remove
695         early return.
696
697 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
698
699         PR middle-end/43083
700         * graphite-scop-detection.c (create_single_exit_edge): Move
701         the call to find_single_exit_edge to....
702         (create_sese_edges): ...here.  Don't handle multiple edges
703         exiting the function.
704         (build_graphite_scops): Don't handle multiple edges
705         exiting the function.
706
707         * gcc.dg/graphite/pr43083.c: New.
708
709 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
710
711         PR middle-end/43097
712         * sese.c (get_rename): Assert that old_name is an SSA_NAME.
713         (rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
714
715         * gfortran.dg/graphite/pr43097.f: New.
716
717 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
718             Manuel López-Ibáñez  <manu@gcc.gnu.org>
719
720         PR middle-end/43140
721         * g++.dg/graphite/pr41305.C: Add -Wno-conversion-null.
722
723 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
724
725         PR middle-end/43026
726         * sese.c (expand_scalar_variables_expr): Handle COMPONENT_REF.
727
728         * g++.dg/graphite/pr43026.C: New.
729
730 2010-02-13  Tobias Grosser  <grosser@fim.uni-passau.de>
731
732         * Merge from mainline (154736:156693).
733
734 2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
735
736         PR middle-end/43012
737         * gcc.dg/graphite/pr43012.c: New.
738
739 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
740
741         * graphite.c (graphite_transform_loops): Re-enable dbg_cnt.
742 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
743
744         * g++.dg/graphite/pr42930.C: New.
745
746 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
747
748         PR middle-end/42930
749         * graphite-scop-detection.c (graphite_can_represent_scev): Call
750         graphite_can_represent_init for MULT_EXPR.
751
752 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
753
754         PR middle-end/42914
755         PR middle-end/42530
756         * graphite-sese-to-poly.c (remove_phi): New.
757         (translate_scalar_reduction_to_array): Call remove_phi.
758
759         * gcc.dg/graphite/pr42530.c: New.
760         * gcc.dg/graphite/pr42914.c: New.
761
762 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
763
764         PR middle-end/42771
765         * graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
766         * graphite-clast-to-gimple.h (gloog): Update declaration.
767         * graphite-poly.c (new_scop): Clear POLY_SCOP_P.
768         * graphite-poly.h (struct poly_bb): Add missing comments.
769         (struct scop): Add poly_scop_p field.
770         (POLY_SCOP_P): New.
771         * graphite-sese-to-poly.c (build_poly_scop): Set POLY_SCOP_P.
772         * graphite.c (graphite_transform_loops): Build the polyhedral
773         representation for each scop before code generation.
774         * sese.c (rename_variables_in_operand): Removed.
775         (rename_variables_in_expr): Return the renamed expression.
776         (rename_sese_parameters): New.
777         * sese.h (rename_sese_parameters): Declared.
778
779         * gcc.dg/graphite/pr42771.c: New.
780
781 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
782
783         * gcc.dg/graphite/block-0.c: Call abort for runtime test.  Always
784         return 0 from main.
785         * gcc.dg/graphite/block-1.c: Same.
786         * gcc.dg/graphite/block-3.c: Same.
787         * gcc.dg/graphite/block-4.c: Same.
788         * gcc.dg/graphite/block-5.c: Same.
789         * gcc.dg/graphite/block-6.c: Same.
790         * gcc.dg/graphite/block-7.c: Same.
791         * gcc.dg/graphite/interchange-0.c: Same.
792         * gcc.dg/graphite/interchange-1.c: Same.
793         * gcc.dg/graphite/interchange-10.c: Same.
794         * gcc.dg/graphite/interchange-11.c: Same.
795         * gcc.dg/graphite/interchange-12.c: Same.
796         * gcc.dg/graphite/interchange-2.c: Same.
797         * gcc.dg/graphite/interchange-3.c: Same.
798         * gcc.dg/graphite/interchange-4.c: Same.
799         * gcc.dg/graphite/interchange-5.c: Same.
800         * gcc.dg/graphite/interchange-6.c: Same.
801         * gcc.dg/graphite/interchange-7.c: Same.
802         * gcc.dg/graphite/interchange-8.c: Same.
803         * gcc.dg/graphite/interchange-9.c: Same.
804         * gcc.dg/graphite/interchange-mvt.c: Same.
805
806 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
807
808         * gfortran.dg/graphite/id-19.f: New.
809         * gfortran.dg/graphite/pr14741.f90: New.
810         * gfortran.dg/graphite/pr41924.f90: New.
811         * gfortran.dg/graphite/run-id-2.f90: New.
812
813 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
814
815         PR middle-end/42988
816         * graphite-dependences.c (dependence_polyhedron): Set PDDR_KIND
817         to unknown_dependence.
818         (graphite_legal_transform_dr): Handle the unknown_dependence.
819         (graphite_carried_dependence_level_k): Same.
820
821 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
822
823         * ChangeLog.graphite: Remove testsuite/ or gcc/testsuite/.
824
825 2010-02-05  Sebastian Pop  <sebastian.pop@amd.com>
826             Konrad Trifunovic  <konrad.trifunovic@inria.fr>
827
828         PR middle-end/42637
829         * graphite-dependences.c (build_lexicographical_constraint): Return
830         a union of dependence polyhedra.
831         (dependence_polyhedron_1): Adapt for build_lexicographical_constraint.
832
833         * gcc.dg/graphite/block-0.c: Enable runtime check.  XFAILed.
834         * gcc.dg/graphite/block-4.c: Same.
835         * gcc.dg/graphite/block-7.c: Same.
836         * gcc.dg/graphite/interchange-12.c: Same.
837         * gcc.dg/graphite/interchange-mvt.c: Same.
838         * gfortran.dg/graphite/interchange-1.f: XFAILed.
839         * gfortran.dg/graphite/interchange-3.f90: XFAILed.
840         * gfortran.dg/graphite/run-id-1.f: New testcase for PR42637.
841
842 2010-02-03  Sebastian Pop  <sebastian.pop@amd.com>
843
844         * gcc.dg/graphite/interchange-12.c: Return 0 to avoid
845         the execution check to FAIL.  This testcase is miscompiled by Graphite
846         and the check should be re-enabled.
847         * gcc.dg/graphite/interchange-mvt.c: Same.
848         * gcc.dg/graphite/block-0.c: Same.
849         * gcc.dg/graphite/block-4.c: Same.
850         * gcc.dg/graphite/block-7.c: Same.
851
852 2010-02-03  Sebastian Pop  <sebastian.pop@amd.com>
853
854         * gcc.dg/graphite/interchange-mvt.c: Un-XFAILed.
855         * gcc.dg/graphite/scop-0.c: Fix spaces.
856         * gfortran.dg/graphite/block-1.f90: Rewrite expected output.
857         * gfortran.dg/graphite/block-2.f: Same.
858         * gfortran.dg/graphite/block-3.f90: Same.
859         * gfortran.dg/graphite/block-4.f90: Same.
860         * gfortran.dg/graphite/interchange-1.f: Un-XFAILed.
861         * gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
862
863 2010-02-03  Sebastian Pop  <sebastian.pop@amd.com>
864
865         * graphite-dependences.c (new_poly_ddr): Initialize PDDR_KIND and
866         PDDR_ORIGINAL_SCATTERING_P.
867         (pddr_is_empty): Rewritten.
868         (print_dependence_polyhedron_layout): New.
869         (print_pddr): New.
870         (debug_pddr): New.
871         (build_alias_set_powerset): Moved up.
872         (poly_drs_may_alias_p): Moved up.
873         (lexicographically_gt_p): Removed.
874         (build_lexicographically_gt_constraint): Renamed
875         build_lexicographical_constraint, reimplemented.
876         (dependence_polyhedron_1): Simplified parameters.
877         (dependence_polyhedron): Same.  Keep along empty PDDRs
878         to make efficient use of the cache.
879         (reduction_dr_p): Compute the PBBs don't pass them as parameters.
880         (graphite_legal_transform_dr): Rewritten.
881         (graphite_legal_transform_bb): Pass fewer arguments to
882         graphite_legal_transform_dr.
883         (graphite_carried_dependence_level_k): Simplified implementation.
884         (dot_original_deps_stmt_1): Call dependence_polyhedron.
885         (dot_transformed_deps_stmt_1): Same.
886         (dot_original_deps): Same.
887         (dot_transformed_deps): Same.
888         * graphite-dependences.h (struct poly_ddr): Added a new field
889         original_scattering_p.
890         (PDDR_ORIGINAL_SCATTERING_P): New.
891         (print_pddr): Declared.
892         (debug_pddr): Declared.
893         * graphite-ppl.c: Clarify comment.
894         * sese.h (print_gimple_bb): Removed unused declaration.
895         (debug_gbb): Same.
896
897 2010-02-03  Sebastian Pop  <sebastian.pop@amd.com>
898
899         * g++.dg/graphite/graphite.exp: Rewritten.
900         * gcc.dg/graphite/graphite.exp: Rewritten.
901         * gfortran.dg/graphite/graphite.exp: Rewritten.
902         * gcc.dg/graphite/block-0.c: Added runtime test.
903         * gcc.dg/graphite/block-1.c: Same.
904         * gcc.dg/graphite/block-3.c: Same.
905         * gcc.dg/graphite/block-4.c: Same.
906         * gcc.dg/graphite/block-5.c: Same.
907         * gcc.dg/graphite/block-6.c: Same.
908         * gcc.dg/graphite/block-7.c: Same.
909         * gcc.dg/graphite/interchange-0.c: Same.
910         * gcc.dg/graphite/interchange-1.c: Same.
911         * gcc.dg/graphite/interchange-10.c: Same.
912         * gcc.dg/graphite/interchange-11.c: Same.
913         * gcc.dg/graphite/interchange-12.c: Same.
914         * gcc.dg/graphite/interchange-2.c: Same.
915         * gcc.dg/graphite/interchange-3.c: Same.
916         * gcc.dg/graphite/interchange-4.c: Same.
917         * gcc.dg/graphite/interchange-5.c: Same.
918         * gcc.dg/graphite/interchange-6.c: Same.
919         * gcc.dg/graphite/interchange-7.c: Same.
920         * gcc.dg/graphite/interchange-8.c: Same.
921         * gcc.dg/graphite/interchange-9.c: Same.
922         * gcc.dg/graphite/interchange-mvt.c: Same.
923         * gcc.dg/graphite/run-id-2.c: Remove useless dg-do run.
924
925 2010-01-22  Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
926
927         * graphite-scop-detection.c (dot_all_scops): Make calls to dot run in
928           background.
929
930 2010-01-22  Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
931
932         * common.opt: Add -fgraphite-cloog-opts.
933         * graphite-clast-to-gimple.c (set_cloog_options): Same.
934         * opts.c (decode_options): Same.
935
936 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
937
938         * gcc.dg/graphite/id-17.c: New.
939         * gcc.dg/graphite/pr41888.c: New.
940         * gcc.dg/graphite/scop-22.c: New.
941         * gfortran.dg/graphite/pr40982.f90: New.
942
943 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
944
945         * graphite-dependences.c: Clarify comments.
946         (build_pddr): Add an extra parameter direction.
947         (graphite_legal_transform_dr): Use build_pddr.
948         (dot_original_deps_stmt_1): Update use of build_pddr.
949         (dot_transformed_deps_stmt_1): Same.
950         (dot_original_deps): Same.
951         (dot_transformed_deps): Same.
952
953         * gcc.dg/graphite/interchange-12.c: New.
954         * gcc.dg/graphite/block-7.c: New.
955
956 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
957
958         * graphite-dependences.c (pddr_original_scattering): Renamed build_pddr.
959         (pddr_transformed_scattering): Removed.
960         (graphite_legal_transform_dr): Use build_pddr.
961         (dot_original_deps_stmt_1): Same.
962         (dot_transformed_deps_stmt_1): Same.
963         (dot_original_deps): Same.
964         (dot_transformed_deps): Same.
965
966 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
967
968         * graphite-dependences.c (lexicographically_gt_p): Add comments.
969         (build_lexicographically_gt_constraint): Same.
970         (dependence_polyhedron_1): Same.
971         (dependence_polyhedron): Same.
972
973 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
974
975         * graphite-dependences.c (build_pairwise_scheduling_equality): Removed.
976         (build_pairwise_scheduling_inequality): Renamed build_pairwise_scheduling.
977         (lexicographically_gt_p): Change type of direction to int.
978         (build_lexicographically_gt_constraint): Same.
979         (dependence_polyhedron_1): Same.
980         (dependence_polyhedron): Same.
981         (pddr_original_scattering): Use integers for direction.
982         (pddr_transformed_scattering): Same.
983         (graphite_legal_transform_dr): Same.
984         (graphite_carried_dependence_level_k): Same.
985
986 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
987
988         * graphite-dependences.c (build_pairwise_constraint): Renamed
989         ppl_build_relation.  Moved...
990         (dr_equality_constraints): Use ppl_build_relation.
991         (build_pairwise_scheduling_equality): Same.
992         (build_pairwise_scheduling_inequality): Same.
993         * graphite-ppl.c (ppl_build_relation): ...here.
994         * graphite-ppl.h (ppl_build_relation): Declared.
995
996 2010-01-14  Sebastian Pop  <sebastian.pop@amd.com>
997
998         PR middle-end/42681
999         * graphite-clast-to-gimple.c (gloog_error): New static variable.
1000         (clast_to_gcc_expression): Do not build MULT_EXPR of POINTER_TYPE_P.
1001         Set gloog_error when such an expression failed to be built.
1002         (translate_clast): Early return when gloog_error is set.
1003         (gloog): Clear gloog_error.  When gloog_error is set, call
1004         set_ifsese_condition to enable the original code.  Return the status
1005         of the code generation based on gloog_error.
1006         * sese.c (set_ifsese_condition): New.
1007         * sese.h (set_ifsese_condition): Declared.
1008
1009         * g++.dg/graphite/pr42681.C: New.
1010
1011 2010-01-14  Sebastian Pop  <sebastian.pop@amd.com>
1012
1013         PR middle-end/42732
1014         * graphite-clast-to-gimple.c (gloog): Call scev_reset_htab and
1015         rename_nb_iterations.
1016         * sese.c (rename_variables_in_operand): New.
1017         (rename_variables_in_expr): New.
1018         (rename_nb_iterations): New.
1019         (sese_adjust_liveout_phis): Update the rename_map.
1020         * sese.h (rename_nb_iterations): Declared.
1021         * tree-scalar-evolution.c (scev_reset_htab): New.
1022         (scev_reset): Call scev_reset_htab.
1023         * tree-scalar-evolution.h (scev_reset_htab): Declared.
1024
1025         * gfortran.dg/graphite/pr42732.f: New.
1026
1027 2010-01-08  Sebastian Pop  <sebastian.pop@amd.com>
1028
1029         PR middle-end/42393
1030         * graphite-clast-to-gimple.c: Fix formatting.
1031         * sese.c (defined_in_loop_p): Renamed name_defined_in_loop_p.
1032         (expr_defined_in_loop_p): New.
1033         (add_loop_exit_phis): Also handle full expressions: remove from
1034         the rename_map the expressions defined in the loop that we're closing.
1035
1036         * gfortran.dg/graphite/pr42393-1.f90: New.
1037         * gfortran.dg/graphite/pr42393.f90: Add new flags
1038         -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine to also
1039         make this testcase useful in the Graphite branch.
1040
1041 2010-01-08  Sebastian Pop  <sebastian.pop@amd.com>
1042
1043         * graphite-scop-detection.c (exclude_component_ref): Removed.
1044         (is_simple_operand): Removed.
1045         (stmt_simple_for_scop_p): Remove use of is_simple_operand.
1046
1047 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
1048
1049         PR middle-end/42221
1050         * sese.c (expand_scalar_variables_expr): Follow the SSA links into
1051         the array indexing of ADDR_EXPRs.
1052
1053         * gcc.dg/graphite/pr42221.c: New.
1054
1055 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
1056
1057         PR middle-end/42521
1058         * graphite.c (graphite_finalize): Call scev_reset.
1059         (graphite_transform_loops): Do not call scev_reset between the code
1060         generation of scops.
1061
1062         * gcc.dg/graphite/pr42521.c: New.
1063
1064 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
1065
1066         * graphite-interchange.c (memory_stride_in_loop): Renamed
1067         pdr_stride_in_loop.
1068         (memory_strides_in_loop): Renamed memory_strides_in_loop_1.
1069         (memory_strides_in_loop): Memoize the memory strides per loop.
1070         (lst_interchange_profitable_p): Do not initialize to zero the memory
1071         strides.
1072         * graphite-poly.h (struct lst): Add a field memory_strides.
1073         (LST_LOOP_MEMORY_STRIDES): New.
1074         (new_lst_loop): Initialize LST_LOOP_MEMORY_STRIDES to -1.
1075         (free_lst): Clear LST_LOOP_MEMORY_STRIDES.
1076
1077 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
1078
1079         * graphite-interchange.c (memory_strides_in_loop_depth): Renamed
1080         memory_strides_in_loop.  Gather memory strides on a whole loop.
1081         (pbb_interchange_profitable_p): Renamed lst_interchange_profitable_p.
1082         (lst_interchange_profitable_p): Removed.
1083         (lst_try_interchange_loops): Call lst_interchange_profitable_p.
1084
1085 2010-01-07  Sebastian Pop  <sebastian.pop@amd.com>
1086
1087         Revert patch 2009-11-23  Tobias Grosser  <grosser@fim.uni-passau.de>
1088         * graphite-clast-to-gimple.c (try_mark_loop_parallel): New.
1089         (translate_clast_for, translate_clast_guard, translate_clast, gloog):
1090         Remove context_loop and level.
1091
1092 2010-01-07  Richard Guenther  <rguenther@suse.de>
1093
1094         PR tree-optimization/42641
1095         * sese.c (rename_map_elt_info): Use the SSA name version, do
1096         not hash pointers.
1097
1098 2010-01-06  Sebastian Pop  <sebastian.pop@amd.com>
1099
1100         * graphite-blocking.c (scop_do_block): Print "SCoP will be loop
1101         blocked" only when both the strip mine and the interchange have
1102         been applied.
1103
1104         * gcc.dg/graphite/block-2.c: Removed.
1105         * gcc.dg/graphite/block-3.c: Add scan pattern.
1106         * gcc.dg/graphite/block-4.c: Same.
1107         * gcc.dg/graphite/block-5.c: Same.
1108         * gcc.dg/graphite/block-6.c: Same.
1109
1110 2010-01-06  Sebastian Pop  <sebastian.pop@amd.com>
1111
1112         * graphite-clast-to-gimple.c (save_clast_name_index): Free slot
1113         before allocating a new one.
1114         (copy_renames): Check that slot is not NULL.
1115         (mark_bb_with_pbb): Same.
1116         (compute_cloog_iv_types_1): Same.
1117         * graphite-interchange.c (lst_perfect_nestify): Free the before,
1118         nest, and after LSTs.
1119         (lst_try_interchange_loops): Same.
1120
1121 2010-01-05  Sebastian Pop  <sebastian.pop@amd.com>
1122
1123         PR middle-end/42178
1124         * graphite-interchange.c (lst_try_interchange_loops): Do not return
1125         the before, nest, and after LSTs.
1126         (lst_try_interchange): Removed.
1127         (lst_interchange_select_inner): Do not iterate over the LSTs if they
1128         were modified.
1129         (lst_interchange_select_outer): Apply interchange on the outer loop
1130         until there are no more changes in the inner loops.
1131
1132 2009-12-18  Sebastian Pop  <sebastian.pop@amd.com>
1133
1134         Revert patch fixing PR middle-end/42221.
1135
1136 2009-12-18  Sebastian Pop  <sebastian.pop@amd.com>
1137
1138         PR middle-end/42180
1139         * graphite-sese-to-poly.c (follow_ssa_with_commutative_ops): Handle
1140         GIMPLE_CALL.
1141
1142         * gfortran.dg/graphite/pr42180.f90: Add compile flags.
1143
1144 2009-12-18  Sebastian Pop  <sebastian.pop@amd.com>
1145
1146         PR middle-end/42180
1147         * graphite-sese-to-poly.c (split_reduction_stmt): Do not split blocks
1148         that contain only one statement.
1149
1150         * gfortran.dg/graphite/pr42180.f90: New.
1151
1152 2009-12-17  Sebastian Pop  <sebastian.pop@amd.com>
1153
1154         PR middle-end/42393
1155         * gfortran.dg/graphite/pr42393.f90: New.
1156
1157 2009-12-17  Sebastian Pop  <sebastian.pop@amd.com>
1158
1159         PR middle-end/42186
1160         * gfortran.dg/graphite/pr42186.f90: New.
1161
1162 2009-12-17  Sebastian Pop  <sebastian.pop@amd.com>
1163
1164         PR middle-end/42205
1165         * graphite-sese-to-poly.c (translate_scalar_reduction_to_array_for_stmt):
1166         Insert the reduction copy in the same block as the phi node.
1167         (follow_ssa_with_commutative_ops): Handle GIMPLE_NOPs.
1168
1169         * gcc.dg/graphite/pr42205-1.c: New.
1170         * gcc.dg/graphite/pr42205-2.c: New.
1171
1172 2009-12-17  Sebastian Pop  <sebastian.pop@amd.com>
1173
1174         PR middle-end/42221
1175         * sese.c (expand_scalar_variables_expr): Follow the SSA links into
1176         the array indexing of ADDR_EXPRs.
1177
1178         * gcc.dg/graphite/pr42221.c: New.
1179
1180 2009-12-17  Sebastian Pop  <sebastian.pop@amd.com>
1181
1182         PR middle-end/42178
1183         PR middle-end/42334
1184         * graphite-interchange.c (lst_try_interchange): Do not modify OUTER
1185         index.  Call lst_interchange_select_inner only once.
1186         (lst_interchange_select_inner): Update use of lst_try_interchange.
1187         (lst_interchange_select_outer): Update.
1188
1189 2009-12-15  Sebastian Pop  <sebastian.pop@amd.com>
1190
1191         PR middle-end/42178
1192         PR middle-end/42334
1193         * graphite-interchange.c (lst_try_interchange): Do not increment the
1194         the OUTER index when there is no AFTER kernel.  Do not increment the
1195         OUTER index for after processing the AFTER kernel.
1196         (lst_interchange_select_inner): Call lst_try_interchange only on loops.
1197         (lst_interchange_select_outer): Do not pass in a pointer to the OUTER
1198         index.  Do not pass to lst_interchange_select_inner the OUTER index.
1199         (scop_do_interchange): Update use of lst_interchange_select_outer.
1200
1201         * gfortran.dg/graphite/graphite.exp
1202         (DEFAULT_FLAGS_GRAPHITE_IDENTITY): Remove -fdump-tree-graphite-all.
1203         * gfortran.dg/graphite/interchange-1.f: Add comment.  Clean
1204         the graphite dump file.
1205         * gfortran.dg/graphite/interchange-2.f: Same.
1206         * gfortran.dg/graphite/pr42334-1.f: New.
1207
1208 2009-12-15  Sebastian Pop  <sebastian.pop@amd.com>
1209
1210         PR middle-end/42178
1211         PR middle-end/42334
1212         * graphite-interchange.c (lst_perfect_nestify): Reset to NULL the LSTs
1213         that are empty.
1214         (lst_do_interchange_1): Renamed lst_interchange_select_inner.
1215         (lst_try_interchange): Reimplemented.
1216         (lst_interchange_select_inner): Same.
1217         (lst_do_interchange): Renamed lst_interchange_select_outer.
1218         Reimplemented.
1219         (scop_do_interchange): Update use of lst_interchange_select_outer.
1220
1221         * g++.dg/graphite/pr42130.C: Add -fgraphite-identity.
1222         * gcc.dg/graphite/block-0.c: Un-XFAILed.
1223         * gcc.dg/graphite/pr42211.c: New.
1224         * gfortran.dg/graphite/pr42334.f90: New.
1225
1226 2009-12-14  Sebastian Pop  <sebastian.pop@amd.com>
1227
1228         PR middle-end/42181
1229         * graphite-scop-detection.c (graphite_can_represent_scev): Handle more
1230         carefully PLUS_EXPR, MINUS_EXPR, and MULT_EXPR.
1231
1232         * gfortran.dg/graphite/pr42181.f90: New.
1233
1234 2009-12-12  Sebastian Pop  <sebpop@gmail.com>
1235
1236         PR middle-end/42284
1237         * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Call
1238         insert_out_of_ssa_copy_on_edge for anything else than SSA_NAMEs.
1239         (detect_commutative_reduction_arg): Simplified.
1240         (detect_commutative_reduction): Early return when the argument of
1241         the close phi is not of an SSA_NAME.
1242
1243         * gcc.dg/graphite/pr42284.c: New.
1244
1245 2009-12-11  Alexander Monakov  <amonakov@ispras.ru>
1246
1247         * dbgcnt.def (graphite_scop): New counter.
1248         * graphite.c: Include dbgcnt.h
1249         (graphite_transform_loops): Use new counter to limit transformations.
1250
1251 2009-12-08  Sebastian Pop  <sebpop@gmail.com>
1252
1253         PR middle-end/42285
1254         * graphite-scop-detection.c (graphite_can_represent_init): Also
1255         handle more complex MULT_EXPRs containing parameters by recursion
1256         on the structure.
1257
1258         * gfortran.dg/graphite/pr42285.f90: New.
1259
1260 2009-12-01  Tobias Grosser  <grosser@fim.uni-passau.de>
1261
1262         * g++.dg/graphite/pr42130.C: Fix type.
1263
1264 2009-11-29  Alexander Monakov <amonakov@gcc.gnu.org>
1265
1266         * g++.dg/graphite/pr42130.C: Correct testcase.
1267
1268 2009-11-28 Tobias Grosser  <grosser@fim.uni-passau.de>
1269
1270         * Merge from mainline (154493:154734).
1271
1272 2009-11-28 Tobias Grosser  <grosser@fim.uni-passau.de>
1273
1274         * Merge from mainline (151362:154491).
1275
1276 2009-11-24  Tobias Grosser  <grosser@fim.uni-passau.de>
1277
1278         * graphite-clast-to-gimple.c (try_mark_loop_parallel,
1279         graphite_create_new_loop_guard, translate_clast_for): Fix comments.
1280
1281 2009-11-23  Tobias Grosser  <grosser@fim.uni-passau.de>
1282
1283         PR middle-end/42130
1284         * graphite-clast-to-gimple.c (graphite_create_new_loop_guard,
1285         translate_clast_for_loop): New.
1286         (translate_clast_for): Add a condition around the loop, to do not
1287         execute loops with zero iterations.
1288         * g++.dg/graphite/pr42130.C: New.
1289         * gcc.dg/graphite/pr35356-2.c: Adapt.
1290
1291 2009-11-23  Tobias Grosser  <grosser@fim.uni-passau.de>
1292
1293         * graphite-clast-to-gimple.c (try_mark_loop_parallel): New.
1294         (translate_clast_for, translate_clast_guard, translate_clast, gloog):
1295         Remove context_loop and level.
1296
1297 2009-11-23  Tobias Grosser  <grosser@fim.uni-passau.de>
1298
1299         * graphite-clast-to-gimple.c (translate_clast_user,
1300         translate_clast_for, translate_clast_guard): Simplify and move common
1301         elements to translate_clast().
1302         (translate_clast): Simplify and get common elements.
1303
1304 2009-11-23  Tobias Grosser  <grosser@fim.uni-passau.de>
1305
1306         * graphite-clast-to-gimple.c (translate_clast_user,
1307         translate_clast_for, translate_clast_guard): Split out of
1308         translate_clast.
1309
1310 2009-11-21  Tobias Grosser  <grosser@fim.uni-passau.de>
1311
1312         * graphite-clast-to-gimple.c (clast_name_index, new_clast_name_index,
1313         clast_name_to_index, save_clast_name_index, debug_clast_name_index,
1314         debug_clast_name_indexes_1, debug_clast_name_indexes,
1315         clast_name_index_elt_info, eq_clast_name_indexes): Moved from sese.h.
1316         (clast_name_to_gcc, clast_to_gcc_expression,
1317         clast_to_gcc_expression_red, gcc_type_for_clast_expr,
1318         gcc_type_for_clast_eq, graphite_translate_clast_equation,
1319         graphite_create_guard_cond_expr, graphite_create_new_loop,
1320         translate_clast): Add params_index.
1321         (initialize_cloog_names): Create parameter strings from scratch, do
1322         not reference other strings.
1323         (create_params_index): New.
1324         (gloog): Initialize params_index.
1325         * graphite-scop-detection (free_scops_1): Removed.
1326         (limit_scops): Use normal free_scops.
1327         * graphite-sese-to-poly.c (save_var_names): Removed.
1328         (parameter_index_in_region): Do not initialize SESE_PARAM_NAMES
1329         and SESE_PARAMS_INDEX.
1330         * sese.c (new_sese, free_sese): Dito.
1331         * sese.h (struct sese): Remove params_index, params_names.
1332         (SESE_PARAMS_INDEX, SESE_PARAMS_NAMES): Removed.
1333
1334 2009-11-20  Sebastian Pop  <sebastian.pop@amd.com>
1335
1336         Revert the following patch from 2009-09-14:
1337         * graphite-blocking.c: Fix order of includes: tree-chrec.h, then
1338         tree-scalar-evolution.h, and then tree-data-ref.h.
1339         * graphite-clast-to-gimple.c: Same.
1340         * graphite-dependences.c: Same.
1341         * graphite-interchange.c: Same.
1342         * graphite-poly.c: Same.
1343         * graphite-scop-detection.c: Same.
1344         * graphite-sese-to-poly.c: Same.
1345         * graphite.c: Same.
1346         * lambda-code.c: Same.
1347         * matrix-reorg.c: Same.
1348         * tree-data-ref.c: Same.
1349         * tree-if-conv.c: Same.
1350         * tree-loop-distribu: Same.: Same.
1351         * tree-loop-linear.c: Same.
1352         * tree-parloops.c: Same.
1353         * tree-predcom.c: Same.
1354         * tree-vect-patterns.c: Same.
1355
1356 2009-11-20  Sebastian Pop  <sebastian.pop@amd.com>
1357
1358         Revert patch from 2009-09-14.
1359         * tree-ssa-loop.c (gate_graphite_transforms): Re-enable Graphite
1360         passes at -O1 and below.
1361
1362 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1363
1364         PR middle-end/40281
1365         * gcc.dg/graphite/pr40281.c: New.
1366
1367         * tree-scalar-evolution.c (instantiate_scev_poly): Base and stride
1368         evolutions should not variate in inner loops.
1369
1370 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1371
1372         PR middle-end/42050
1373         * gfortran.dg/graphite/pr42050.f90: New.
1374
1375 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1376
1377         * graphite-interchange.c (memory_strides_in_loop_depth): New.
1378         (pbb_interchange_profitable_p): Call memory_strides_in_loop_depth.
1379
1380 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1381
1382         * graphite-blocking.c (scop_do_block): New.
1383         * graphite-poly.c (apply_poly_transforms): Call scop_do_block.
1384         * graphite-poly.h (scop_do_block): Declared.
1385
1386 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1387
1388         * graphite-blocking.c (pbb_strip_mine_profitable_p): The parameter
1389         depth is the loop nesting depth in the LST.  Call psct_dynamic_dim
1390         to transform depth into the time_depth before calling
1391         pbb_number_of_iterations_at_time.
1392         (lst_do_strip_mine): Use a scalar variable instead of recomputing
1393         lst_depth.
1394
1395 2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>
1396
1397         Reverted the patch for "scattering permutations" from 2009-10-28.
1398
1399         * graphite-poly.c (print_permutation): New.
1400         (debug_permutation): New.
1401         (new_poly_bb): Initialize PBB_PERMUTATION.
1402         (free_poly_bb): Free PBB_PERMUTATION.
1403         * graphite-poly.h (pbb_permutation_elt_p): Declared.
1404         (struct pbb_permutation_elt): New.
1405         (PBB_PERMUTATION_ELT_STRIDE): New.
1406         (PBB_PERMUTATION_ELT_STRIDED_P): New.
1407         (PBB_PERMUTATION_ELT_TIME_DIMENSION): New.
1408         (new_pbb_permutation_elt): New.
1409         (pbb_permutation_elt_free): New.
1410         (struct poly_bb): Add field permutation.
1411         (PBB_PERMUTATION): New.
1412         (print_permutation): Declared.
1413         (debug_permutation): Declared.
1414
1415 2009-11-04  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
1416
1417         * graphite-interchange.c (build_partial_difference): New.
1418         (memory_stride_in_loop): Refactored the computation of
1419         equality constraints into build_partial_difference function.
1420         Added support for debugging stride computations.
1421
1422 2009-11-03  Sebastian Pop  <sebastian.pop@amd.com>
1423
1424         * graphite-clast-to-gimple.c (gloog): Free if_region,
1425         if_region->true_region, and if_region->region.
1426         * sese.c (if_region_set_false_region): Free if_region->false_region.
1427         (create_if_region_on_edge): Do not use GGC_NEW.
1428         (move_sese_in_condition): Remove useless initialization.
1429
1430 2009-11-03  Sebastian Pop  <sebastian.pop@amd.com>
1431
1432         * graphite-interchange.c (lst_perfect_nestify): Pass 3 parameters
1433         for the loops created by the loop distribution.  Do not modify the
1434         input LSTs.
1435         (lst_try_interchange_loops): Same.  Use a temporary LST for the
1436         transformed schedule.  Call lst_update_scattering before data
1437         dependence analysis.
1438         (lst_try_interchange): Pass an extra parameter INDEX.
1439         (lst_do_interchange_1): New.
1440         (lst_do_interchange): Call lst_do_interchange_1.
1441         (scop_do_interchange): Call lst_update_scattering.
1442         * graphite-poly.c (apply_poly_transforms): Do not call
1443         lst_update_scattering.
1444         * graphite-poly.h (lst_pred): New.
1445         (lst_succ): New.
1446         (lst_find_first_pbb): Return NULL when not found.
1447         (lst_empty_p): New.
1448         (lst_insert_in_sequence): Allow LST1 to be NULL.
1449         (lst_replace): New.
1450         (lst_substitute_3): New.
1451         * gcc.dg/graphite/interchange-1.c: XFail.
1452         * gcc.dg/graphite/interchange-8.c: XFail.
1453         * gcc.dg/graphite/interchange-11.c: XFail.
1454
1455 2009-10-30  Sebastian Pop  <sebastian.pop@amd.com>
1456
1457         * graphite-interchange.c (lst_perfectly_nested_p): New.
1458         (lst_perfect_nestify): New.
1459         (lst_try_interchange_loops): Call store_lst_schedule,
1460         lst_perfectly_nested_p, lst_perfect_nestify and restore_lst_schedule.
1461         (scop_do_interchange): Avoid redundant legality test.
1462         Call lst_do_interchange on a copy of SCOP_TRANSFORMED_SCHEDULE.
1463         * graphite-poly.c (apply_poly_transforms): Call lst_update_scattering.
1464         * graphite-poly.h (psct_static_dim): New.
1465         (lst_dewey_number_at_depth): New.
1466         (lst_find_pbb): Restructured.
1467         (lst_find_first_pbb): Restructured.
1468         (lst_find_last_pbb): New.
1469         (lst_contains_p): New.
1470         (lst_contains_pbb): New.
1471         (lst_create_nest): New.
1472         (lst_remove_from_sequence): New.
1473         (pbb_update_scattering): New.
1474         (lst_update_scattering_under): New.
1475         (lst_update_scattering_seq): New.
1476         (lst_update_scattering): New.
1477         (lst_insert_in_sequence): New.
1478         (lst_distribute_lst): New.
1479         (lst_remove_all_before_including_pbb): New.
1480         (lst_remove_all_before_excluding_pbb): New.
1481
1482 2009-10-30  Sebastian Pop  <sebastian.pop@amd.com>
1483
1484         * tree-ssa-loop-niter.c (finite_loop_p): Do not call twice
1485         get_loop_exit_edges.
1486
1487 2009-10-30  Sebastian Pop  <sebastian.pop@amd.com>
1488
1489         * graphite-poly.c (pbb_remove_duplicate_pdrs): Free collapsed.
1490
1491 2009-10-28  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
1492
1493         * graphite-poly.c (print_permutation): New.
1494         (debug_permutation): New.
1495         (new_poly_bb): Initialize PBB_PERMUTATION.
1496         (free_poly_bb): Free PBB_PERMUTATION.
1497         * graphite-poly.h (pbb_permutation_elt_p): Declared.
1498         (struct pbb_permutation_elt): New.
1499         (PBB_PERMUTATION_ELT_STRIDE): New.
1500         (PBB_PERMUTATION_ELT_STRIDED_P): New.
1501         (PBB_PERMUTATION_ELT_TIME_DIMENSION): New.
1502         (new_pbb_permutation_elt): New.
1503         (pbb_permutation_elt_free): New.
1504         (struct poly_bb): Add field permutation.
1505         (PBB_PERMUTATION): New.
1506         (print_permutation): Declared.
1507         (debug_permutation): Declared.
1508
1509 2009-10-26  Sebastian Pop  <sebastian.pop@amd.com>
1510
1511         * graphite-clast-to-gimple.c (gloog): Do not call
1512         sese_reset_aux_in_loops.
1513         * graphite-sese-to-poly.c (build_loop_iteration_domains): Pass an
1514         extra argument for domains.  Do not use loop->aux.
1515         (build_scop_iteration_domain): Initialize and free domains, pass it
1516         to build_loop_iteration_domains and extract the information from
1517         domains.  Do not use loop->aux.
1518         * sese.c (sese_reset_aux_in_loops): Removed.
1519         * sese.h (sese_reset_aux_in_loops): Removed.
1520
1521 2009-10-26  Sebastian Pop  <sebastian.pop@amd.com>
1522
1523         * graphite-clast-to-gimple.c (find_pbb_via_hash): Moved up.
1524         (dependency_in_loop_p): Same.
1525         (translate_clast): Do not use loop->aux.  Initialize
1526         loop->can_be_parallel.
1527         (mark_loops_parallel): Removed.
1528         * graphite-clast-to-gimple.h (mark_loops_parallel): Removed.
1529         * graphite.c (free_aux_in_new_loops): Removed.
1530         (graphite_finalize): Do not call free_aux_in_new_loops.
1531         (graphite_transform_loops): Do not call mark_loops_parallel.
1532
1533 2009-10-26  Li Feng  <nemokingdom@gmail.com>
1534
1535         * graphite-clast-to-gimple.c (get_stmtfor_depth): Removed.
1536         (translate_clast): Pass an extra parameter LEVEL.
1537         Call get_scattering_level.
1538         * graphite-clast-to-gimple.h (get_scattering_level): New.
1539
1540 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1541
1542         * cfgloop.c (alloc_loop): Initialize loop->single_iv.
1543         * cfgloop.h (struct loop): New field single_iv.
1544
1545         * graphite-clast-to-gimple.c (pbb_to_depth_to_oldiv): Do not use
1546         loop->aux anymore: use loop->single_iv.
1547         (graphite_loop_normal_form): Moved...
1548         (build_graphite_loop_normal_form): Removed.
1549         (gloog): Do not call build_graphite_loop_normal_form.
1550         (free_aux_in_new_loops): Moved...
1551         (mark_loops_parallel): Restructure.
1552         * graphite-clast-to-gimple.h (free_aux_in_new_loops): Do not declare.
1553         * graphite-sese-to-poly.c (graphite_loop_normal_form): ...here.
1554         (scop_canonicalize_loops): New.
1555         (build_poly_scop): Call scop_canonicalize_loops.
1556         * graphite.c (free_aux_in_new_loops): ...here.
1557
1558 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1559
1560         * g++.dg/graphite/graphite.exp: Add the same rules as in
1561         gcc.dg/graphite/graphite.exp.
1562
1563 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1564
1565         * g++.dg/graphite/id-1.C: New.
1566
1567 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1568
1569         * graphite-sese-to-poly.c (create_zero_dim_array): Pass an extra
1570         argument base_name.
1571         (rewrite_close_phi_out_of_ssa): Update use of create_zero_dim_array.
1572         (rewrite_phi_out_of_ssa): Same.
1573         (rewrite_cross_bb_scalar_deps): Same.
1574         (translate_scalar_reduction_to_array): Same.
1575
1576 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1577
1578         * graphite-sese-to-poly.c (build_scop_drs): Disable call to
1579         dump_alias_graphs.
1580
1581 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1582
1583         * graphite-sese-to-poly.c (dump_alias_graphs): New.
1584         (build_scop_drs): Call dump_alias_graphs.
1585
1586 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1587
1588         * graphite-poly.c (new_scop): Initialize SCOP_ORIGINAL_SCHEDULE,
1589         SCOP_TRANSFORMED_SCHEDULE, and SCOP_SAVED_SCHEDULE.
1590         (free_scop): Call free_lst on SCOP_ORIGINAL_SCHEDULE,
1591         SCOP_TRANSFORMED_SCHEDULE, and SCOP_SAVED_SCHEDULE.
1592         * graphite-poly.h (free_lst): New.
1593         (store_lst_schedule): Free SCOP_SAVED_SCHEDULE.
1594         (restore_lst_schedule): Free SCOP_TRANSFORMED_SCHEDULE.
1595
1596 2009-10-22  Sebastian Pop  <sebastian.pop@amd.com>
1597
1598         * graphite-poly.h (struct scop): Add a field saved_schedule.
1599         (SCOP_SAVED_SCHEDULE): New.
1600         (store_lst_schedule): New.
1601         (restore_lst_schedule): New.
1602         (store_scattering): Call store_lst_schedule.
1603         (restore_scattering): Call restore_lst_schedule.
1604
1605 2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>
1606
1607         * graphite-sese-to-poly.c (free_data_refs_aux): Fix formatting.
1608         (pdr_add_alias_set): Same.
1609         (build_poly_dr): Same.
1610         (build_alias_set_optimal_p): Same.
1611         (build_base_obj_set_for_drs): Same.  Do not store the result of
1612         graphds_dfs.
1613
1614 2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>
1615
1616         * graphite-sese-to-poly.c (build_alias_set_optimal_p): Initialize
1617         all_components_are_cliques to 1.
1618
1619 2009-10-20  Li Feng  <nemokingdom@gmail.com>
1620
1621         * graphite-sese-to-poly.c (free_data_refs_aux): Update to free
1622         the new structure.
1623         (pdr_add_alias_set): Update retrieving alias_set_num.
1624         (build_poly_dr): Update retrieving dr_base_object_set.
1625         (partition_drs_to_sets): Remove.
1626         (build_alias_set_optimal_p): New.
1627         (build_alias_set_for_drs): Rename.
1628         (build_scop_drs): Update.
1629         * graphite-sese-to-poly.h (struct base_alias_pair): New.
1630         (ALIAS_SET_INDEX): Remove.
1631         (BASE_OBJECT_SET_INDEX): Remove.
1632
1633 2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>
1634
1635         * sese.c (get_vdef_before_sese): Handle GIMPLE_ASSIGN and GIMPLE_CALL.
1636
1637 2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>
1638
1639         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Do not infer
1640         loop upper bounds for 1-element arrays at end of structures.
1641         * tree-flow.h (array_at_struct_end_p): Declared.
1642         * tree-ssa-loop-niter.c (array_at_struct_end_p): Not static anymore.
1643
1644 2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>
1645
1646         * g++.dg/graphite/pr41305.C: New.
1647
1648 2009-10-20  Alexander Monakov  <amonakov@ispras.ru>
1649
1650         * graphite-sese-to-poly.c (build_loop_iteration_domains): Generalize
1651         construction of parameter constraints from loop iteration analysis.
1652         * gcc.dg/graphite/run-id-2.c: New test.
1653
1654 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1655
1656         * graphite-interchange.c (memory_stride_in_loop): Delete p1, lma
1657         and new_cstr.
1658
1659 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1660
1661         * graphite-dependences.c (dependence_polyhedron_1): Remove
1662         unused gdim dimensions from the DDR polyhedron.
1663
1664 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1665
1666         * graphite-dependences.c (pddr_transformed_scattering): New.
1667         (dot_original_deps_stmt_1): New.
1668         (dot_transformed_deps_stmt_1): New.
1669         (dot_deps_stmt_1): Call dot_original_deps_stmt_1 and
1670         dot_transformed_deps_stmt_1.
1671         (dot_original_deps): New.
1672         (dot_transformed_deps): New.
1673         (dot_deps_1): Call dot_original_deps and dot_transformed_deps.
1674
1675 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1676
1677         * graphite-dependences.c (reduction_dr_1): Remove wrong
1678         assert: reduction BBs can have multiple reduction writes
1679         to memory.  interchange-3.f90 is an example.
1680
1681 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1682
1683         * gfortran.dg/graphite/interchange-3.f90: New.
1684
1685 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1686
1687         * gcc.dg/graphite/interchange-1.c: Un-XFAILed.
1688
1689 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1690
1691         * graphite-dependences.c (dependence_polyhedron_1): Add the
1692         context to the dependence polyhedron.
1693
1694 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1695
1696         * graphite-poly.c (pbb_remove_duplicate_pdrs): Initialize
1697         PBB_PDR_DUPLICATES_REMOVED.
1698         (new_poly_bb): Same.
1699
1700 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1701
1702         * graphite-sese-to-poly.c (find_scop_parameters): Initialize
1703         SCOP_CONTEXT.
1704         (build_loop_iteration_domains): Extract bounds on parameters
1705         based on the data size.
1706         (build_scop_context): Do not initialize SCOP_CONTEXT;
1707         add new constraints.
1708
1709 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1710
1711         * graphite-ppl.c (ppl_min_for_le_polyhedron): New.
1712         * graphite-ppl.h (graphite-ppl.h): Declared.
1713
1714 2009-10-17  Sebastian Pop  <sebastian.pop@amd.com>
1715
1716         * graphite-ppl.c (ppl_print_linear_expr): New.
1717         (debug_ppl_linear_expr): New.
1718         * graphite-ppl.h (ppl_print_linear_expr): Declared.
1719         (debug_ppl_linear_expr): Declared.
1720
1721 2009-10-16  Sebastian Pop  <sebastian.pop@amd.com>
1722
1723         * graphite-interchange.c: Fix comments.
1724         * gcc.dg/graphite/block-1.c: Fix comments.
1725
1726 2009-10-16  Sebastian Pop  <sebastian.pop@amd.com>
1727
1728         * gcc.dg/graphite/interchange-7.c: Un-XFAILed.
1729         * gcc.dg/graphite/interchange-9.c: Un-XFAILed.
1730
1731 2009-10-16  Sebastian Pop  <sebastian.pop@amd.com>
1732
1733         Reapply the patch from Alexander Monakov that disappeared during
1734         the last merges from trunk.
1735
1736         2009-09-16  Alexander Monakov  <amonakov@ispras.ru>
1737
1738         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Add bounds only
1739         for ARRAY_REFs.  Use array_ref_{low,up}_bound to determine bounds.
1740
1741 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1742
1743         * graphite-interchange.c (memory_stride_in_loop): The depth
1744         argument corresponds to a dynamic time dimension, so use
1745         psct_dynamic_dim to refer to the transformed scattering dimension.
1746
1747 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1748
1749         * graphite-interchange.c (memory_stride_in_loop): Fix comments.
1750
1751 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1752
1753         * graphite-blocking.c (lst_do_strip_mine): Avoid strip mining the
1754         root of the LST.
1755         * graphite-interchange.c (lst_do_interchange): Avoid interchanging
1756         the root of the LST.
1757         * graphite-poly.c (scop_to_lst): Fix LST sequence in an outermost
1758         fake loop.
1759         (print_lst): Print the root of LST in a different format.
1760         * graphite-poly.h (lst_depth): Adjust to include the root of the LST.
1761
1762 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1763
1764         * graphite-poly.c (print_scop): Fix pretty printing of a SCoP.
1765
1766 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1767
1768         * doc/passes.texi: Document the Graphite infrastructure.
1769
1770 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1771
1772         * graphite-sese-to-poly.c (insert_copyin): Use gsi_insert_seq_on_edge.
1773         (rewrite_commutative_reductions_out_of_ssa): Call gsi_commit_edge_inserts,
1774         and check the SSA representation.
1775
1776         * gfortran.dg/graphite/id-18.f90: New, reduced from PR41193.
1777
1778 2009-10-15  Sebastian Pop  <sebastian.pop@amd.com>
1779
1780         * gcc.dg/graphite/pr40157.c: Use -floop-block as reported in the PR.
1781
1782 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1783
1784         * gcc.dg/graphite/interchange-11.c: New.
1785
1786 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1787
1788         * gcc.dg/graphite/interchange-8.c: Enable loop interchange.
1789
1790 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1791
1792         * gcc.dg/graphite/graphite.exp (DEFAULT_CFLAGS_GRAPHITE_BLOCK):
1793         Add -fno-loop-strip-mine and -fno-loop-interchange.
1794         (DEFAULT_FLAGS_GRAPHITE_INTERCHANGE): Add -fno-loop-block and
1795         -fno-loop-strip-mine.
1796         * gfortran.dg/graphite/graphite.exp: Same.
1797
1798 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1799
1800         * gcc.dg/graphite/graphite.exp (DEFAULT_CFLAGS_GRAPHITE_BLOCK):
1801         Renamed DEFAULT_FLAGS_GRAPHITE_BLOCK.
1802         (DEFAULT_CFLAGS_GRAPHITE_IDENTITY): Renamed
1803         DEFAULT_FLAGS_GRAPHITE_IDENTITY.
1804         (DEFAULT_CFLAGS_GRAPHITE_INTERCHANGE): Renamed
1805         DEFAULT_FLAGS_GRAPHITE_INTERCHANGE.
1806         (DEFAULT_CFLAGS_GRAPHITE_SCOP): Renamed
1807         DEFAULT_FLAGS_GRAPHITE_SCOP.
1808         (DEFAULT_CFLAGS_RUN_ID): Renamed DEFAULT_FLAGS_RUN_ID.
1809         (DEFAULT_CFLAGS_GRAPHITE): Renamed DEFAULT_FLAGS_GRAPHITE.
1810
1811 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1812
1813         * graphite-poly.c (pbb_number_of_iterations_at_time): Cleanup comments.
1814
1815 2009-10-14  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
1816             Sebastian Pop  <sebastian.pop@amd.com>
1817
1818         * graphite-interchange.c (build_linearized_memory_access): Pass an
1819         offset as parameter.
1820         (memory_stride_in_loop): Include transform scattering in the
1821         access functions to be able to querry the strides in the
1822         transformed loops.
1823         (pbb_interchange_loop_depths): Interchange the psct_dynamic_dim,
1824         not the psct_iterator_dim.
1825
1826 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1827
1828         * graphite-blocking.c (pbb_do_strip_mine): Removed.
1829         (lst_do_strip_mine_loop): New.
1830         (lst_do_strip_mine): New.
1831         (scop_do_strip_mine): Call lst_do_strip_mine.
1832         * graphite-poly.h (lst_add_loop_under_loop): New.
1833         (lst_find_first_pbb): New.
1834
1835 2009-10-14  Sebastian Pop  <sebastian.pop@amd.com>
1836
1837         * graphite-poly.c (loop_to_lst): Fix LST creation.
1838
1839 2009-10-14  Tobias Grosser  <grosser@fim.uni-passau.de>
1840
1841         * gcc.dg/graphite/id-15.c: (8 * 8) replaced with
1842         sizeof(unsigned long) to make it run on 32bit systems.
1843
1844 2009-10-14  Tobias Grosser  <grosser@fim.uni-passau.de>
1845
1846         * gcc.dg/graphite/run-id-1.c: Use smaller matrix to not
1847         SEGFAULT on 32bit.
1848
1849 2009-10-14  Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
1850
1851         * graphite-sese-to-poly.c (write_alias_graph_to_ascii_dimacs): Fix
1852         Comment.
1853         (write_alias_graph_to_ascii_dot): New.
1854         (write_alias_graph_to_ascii_ecc): Ditto.
1855         (partition_drs_to_sets): Add testing of optimality of current method
1856         which assigns alias numbers according to DFS Comopnent number.  used
1857         as heuristic for the upcoming ECC algorithm.
1858         (build_scop_drs): Write to file also with the ecc and dot format.
1859
1860 2009-10-13  Sebastian Pop  <sebastian.pop@amd.com>
1861
1862         * gfortran.dg/graphite/interchange-1.f: XFail.
1863
1864 2009-10-13  Sebastian Pop  <sebastian.pop@amd.com>
1865
1866         * graphite.c (graphite_initialize): Do not handle functions with
1867         more than 100 basic blocks.
1868
1869 2009-10-13  Sebastian Pop  <sebastian.pop@amd.com>
1870
1871         * graphite-blocking.c (pbb_do_strip_mine): Use
1872         PARAM_LOOP_BLOCK_TILE_SIZE.
1873
1874 2009-10-13  Sebastian Pop  <sebastian.pop@amd.com>
1875
1876         * graphite-poly.c (dot_lst_1): New.
1877         (dot_lst): New.
1878         * graphite-poly.h (dot_lst): Declared.
1879
1880 2009-10-13  Sebastian Pop  <sebastian.pop@amd.com>
1881
1882         * graphite-dependences.c (dot_deps_stmt_1): New.
1883         (dot_deps_stmt): New.
1884         * graphite-dependences.h (dot_deps_stmt): Declared.
1885
1886 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
1887
1888         * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence): Do
1889         not replace cross BB scalar dependences ending on PHI nodes.
1890         (rewrite_cross_bb_scalar_deps): Filter out GIMPLE_PHI nodes.
1891
1892 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
1893
1894         * graphite-poly.c (apply_poly_transforms): Implement the high
1895         level driver for flag_loop_block.
1896         * opts.c (decode_options): Enable flag_loop_block at -O2.
1897         * tree-ssa-loop.c (gate_graphite_transforms): Remove call to sorry for
1898         flag_loop_block.
1899
1900         * gcc.dg/graphite/graphite.exp (DEFAULT_CFLAGS_GRAPHITE_BLOCK): Add
1901         -floop-block.
1902         * gfortran.dg/graphite/graphite.exp (DEFAULT_CFLAGS_GRAPHITE_BLOCK):
1903         Add -floop-block.
1904
1905 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
1906
1907         * graphite-poly.h (lst_find_pbb): New.
1908         (find_lst_loop): New.
1909
1910 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
1911
1912         * graphite-poly.c (new_scop): Remove init of SCOP_DEP_GRAPH.
1913         * graphite-poly.h (struct scop): Remove dep_graph field.
1914         (SCOP_DEP_GRAPH): Removed.
1915
1916 2009-10-09  Sebastian Pop  <sebastian.pop@amd.com>
1917
1918         * graphite-poly.h (copy_lst): Do full copy of LST.
1919
1920 2009-10-07  Sebastian Pop  <sebastian.pop@amd.com>
1921
1922         * graphite-sese-to-poly.c (reduction_phi_p): Call remove_invariant_phi
1923         when the loop stride is zero.
1924
1925         * gcc.dg/graphite/id-16.c: New.
1926
1927 2009-10-06  Sebastian Pop  <sebastian.pop@amd.com>
1928
1929         * graphite-dependences.c (reduction_dr_1): New.
1930         (reduction_dr_p): New.
1931         (graphite_legal_transform_dr): Call reduction_dr_p.
1932         (reduction_ddr): Renamed reduction_ddr_p.
1933         * graphite-poly.h (same_pdr_p): New.
1934         (number_of_write_pdrs): New.
1935         * graphite-sese-to-poly.c (nb_data_writes_in_bb): New.
1936         (split_reduction_stmt): Do not split reduction statements
1937         when there are no writes to memory.
1938         (translate_scalar_reduction_to_array_for_stmt): Insert the
1939         memory reduction statement just after the scalar reduction statement.
1940
1941         * gcc.dg/graphite/interchange-10.c: Updated to differ from interchange-4.c.
1942         Un-XFAIL-ed.
1943         * gcc.dg/graphite/interchange-3.c: Un-XFAIL-ed.
1944         * gcc.dg/graphite/interchange-4.c: Un-XFAIL-ed.
1945
1946 2009-10-06  Sebastian Pop  <sebastian.pop@amd.com>
1947
1948         * graphite-interchange.c (lst_apply_interchange): New.
1949         (lst_interchange_profitable_p): New.
1950         (lst_try_interchange_loops): New.
1951         (lst_try_interchange): New.
1952         (lst_do_interchange): New.
1953         (pbb_do_interchange): Removed.
1954         (scop_do_interchange): Call lst_do_interchange.
1955
1956 2009-10-06  Sebastian Pop  <sebastian.pop@amd.com>
1957
1958         * graphite-poly.c (print_scop): Print SCOP_ORIGINAL_SCHEDULE and
1959         SCOP_TRANSFORMED_SCHEDULE.
1960         (loop_to_lst): New.
1961         (scop_to_lst): New.
1962         (print_lst): New.
1963         (debug_lst): New.
1964         * graphite-poly.h (lst_p): New.
1965         (struct lst): New.
1966         (LST_LOOP_P): New.
1967         (LST_LOOP_FATHER): New.
1968         (LST_PBB): New.
1969         (LST_SEQ): New.
1970         (scop_to_lst): Declared.
1971         (print_lst): Declared.
1972         (debug_lst): Declared.
1973         (new_lst_loop): New.
1974         (new_lst_stmt): New.
1975         (copy_lst): New.
1976         (lst_depth): New.
1977         (lst_dewey_number): New.
1978         (struct scop): Add original_schedule and transformed_schedule fields.
1979         (SCOP_ORIGINAL_SCHEDULE): New.
1980         (SCOP_TRANSFORMED_SCHEDULE): New.
1981         * graphite-sese-to-poly.c (build_poly_scop): Call scop_to_lst.
1982
1983 2009-10-05  Sebastian Pop  <sebastian.pop@amd.com>
1984
1985         * graphite-dependences.c (reduction_ddr): New.
1986         (graphite_legal_transform_bb): Call reduction_ddr.
1987         * graphite-poly.c (new_poly_bb): Pass a new bool parameter.
1988         Initialize PBB_IS_REDUCTION.
1989         * graphite-poly.h (struct poly_bb): New bool field is_reduction.
1990         (PBB_IS_REDUCTION): New.
1991         (new_poly_bb): Update declaration.
1992         * graphite-scop-detection.h (build_scop_bbs): Removed.
1993         (nb_reductions_in_loop): Removed.
1994         * graphite-sese-to-poly.c (try_generate_gimple_bb): Pass a sbitmap
1995         parameter for reductions.
1996         (try_generate_gimple_bb): Update call to new_poly_bb.
1997         (build_scop_bbs_1): Same.
1998         (build_scop_bbs): Same.
1999         (gsi_for_phi_node): New.
2000         (scalar_close_phi_node_p): Remove gcc_assert.
2001         (split_reduction_stmt): New.
2002         (is_reduction_operation_p): New.
2003         (phi_contains_arg): New.
2004         (follow_ssa_with_commutative_ops): New.
2005         (detect_commutative_reduction_arg): New.
2006         (detect_commutative_reduction_assign): New.
2007         (follow_inital_value_to_phi): New.
2008         (edge_initial_value_for_loop_phi): New.
2009         (initial_value_for_loop_phi): New.
2010         (detect_commutative_reduction): New.
2011         (translate_scalar_reduction_to_array_for_stmt): New.
2012         (insert_copyout): New.
2013         (insert_copyin): New.
2014         (translate_scalar_reduction_to_array): New.
2015         (rewrite_commutative_reductions_out_of_ssa_close_phi): New.
2016         (rewrite_commutative_reductions_out_of_ssa_loop): New.
2017         (rewrite_commutative_reductions_out_of_ssa): New.
2018         (build_poly_scop): Call rewrite_commutative_reductions_out_of_ssa.
2019         * sese.h (split_region_for_bb): New.
2020
2021         * gcc.dg/graphite/graphite.exp (DEFAULT_CFLAGS_GRAPHITE_BLOCK): Add -ffast-math.
2022         * gcc.dg/graphite/interchange-1.c: Fix format.
2023         * gcc.dg/graphite/interchange-10.c: New.
2024
2025 2009-10-05  Sebastian Pop  <sebastian.pop@amd.com>
2026
2027         * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Remove
2028         buggy assert.
2029
2030 2009-10-05  Sebastian Pop  <sebastian.pop@amd.com>
2031
2032         * graphite-sese-to-poly.c (scev_analyzable_p): New.
2033         (rewrite_cross_bb_scalar_dependence): New.
2034         (rewrite_cross_bb_scalar_deps): New.
2035         (rewrite_reductions_out_of_ssa): Use bb_in_sese_p.
2036         Call rewrite_cross_bb_scalar_deps.
2037
2038 2009-10-05  Sebastian Pop  <sebastian.pop@amd.com>
2039
2040         * graphite-sese-to-poly.c (gsi_for_ssa_name_def): Removed.
2041         (insert_out_of_ssa_copy): Directly use gsi_after_labels and
2042         gsi_for_stmt.
2043
2044 2009-10-05  Sebastian Pop  <sebastian.pop@amd.com>
2045
2046         * graphite-clast-to-gimple.c (build_cloog_prog): Use pbb_index.
2047         * graphite-interchange.c (pbb_do_interchange): Same.
2048         * graphite-poly.c (print_scattering_function): Same.
2049         (debug_pdrs): Same.
2050         * graphite-poly.h (pbb_loop): New.
2051         * graphite-sese-to-poly.c (create_linear_expr_from_tree): Use pbb_loop.
2052
2053 2009-09-27  Sebastian Pop  <sebastian.pop@amd.com>
2054
2055         * graphite-scop-detection.c (limit_scops): Do not build poly_bbs.
2056
2057 2009-09-27  Sebastian Pop  <sebastian.pop@amd.com>
2058
2059         * graphite-sese-to-poly.c (partition_drs_to_sets): Drs is not modified,
2060         so don't pass a pointer to it.
2061         (build_alias_set_for_drs): Same.
2062         (build_base_obj_set_for_drs): Same.
2063         (build_scop_drs): Same.
2064
2065 2009-09-26  Li Feng  <nemokingdom@gmail.com>
2066
2067         * graphite-sese-to-poly.c (build_scop_drs): Disable writing to file
2068         the alias graph of data references.
2069
2070 2009-09-25  Li Feng  <nemokingdom@gmail.com>
2071
2072         * graphite-sese-to-poly.c (write_alias_graph_to_ascii_dimacs): New.
2073         (build_scop_drs): When debugging, write the alias graph to file,
2074         otherwise, should be disabled.
2075
2076 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2077
2078         * Merge from mainline (151310:151361).
2079
2080 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2081
2082         * Merge from mainline (151171:151310).
2083
2084 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2085
2086         * Merge from mainline (151171:151806).
2087
2088 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2089
2090         * Revert the last commit.
2091
2092 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2093
2094         * Merge from mainline (151171:151819).
2095
2096 2009-09-17  Sebastian Pop  <sebastian.pop@amd.com>
2097
2098         * graphite-scop-detection.c (stmt_simple_memref_p): Removed.
2099         (is_simple_operand): Remove call to stmt_simple_memref_p.
2100         (stmt_simple_for_scop_p): Update call to is_simple_operand.
2101
2102 2009-09-17  David Edelsohn  <edelsohn@gnu.org>
2103
2104         * gcc.dg/graphite/interchange-mvt.c: New File.
2105         * gcc.dg/graphite/scop-dsyrk.c: New File.
2106         * gcc.dg/graphite/scop-dsyr2k.c: New File.
2107         * gcc.dg/graphite/scop-mvt.c: New File.
2108         * gcc.dg/graphite/scop-sor.c: New File.
2109
2110 2009-09-17 Li Feng  <nemokingdom@gmail.com>
2111
2112         * graphite-dependences.c (poly_drs_may_alias_p): Adjust definition.
2113         (pddr_original_scattering): Make sure 2 pdr2 in the same base object set.
2114         (graphite_carried_dependence_level_k): Ditto.
2115         * graphite-poly.c (new_poly_dr): Add init of PDR_BASE_OBJECT_SET.
2116         * graphite-poly.h (struct poly_dr): Add member dr_base_object_set.
2117         (new_poly_dr): Adjust declaration.
2118         * graphite-sese-to-poly.c (free_data_refs_aux): New.
2119         (free_gimple_bb): Added free_data_refs_aux.
2120         (build_poly_dr): Add dr_base_object_set.
2121         (partition_drs_to_sets): New.
2122         (dr_same_base_object_p): New.
2123         (build_alias_set_for_drs): New.
2124         (build_base_object_set_for_drs): New.
2125         (build_scop_drs): Add build_base_obj_set_for_drs.
2126         * graphite-sese-to-poly.h: Added #define for alias set number index and
2127         base object set index.
2128         * libgomp/testsuite/libgomp.graphite/force-parallel-6.c: Refine tests.
2129         * libgomp/testsuite/libgomp.graphite/pr4118.c: New.
2130
2131 2009-09-16  Alexander Monakov  <amonakov@ispras.ru>
2132
2133         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Add bounds only
2134         for ARRAY_REFs.  Use array_ref_{low,up}_bound to determine bounds.
2135
2136 2009-09-14  Sebastian Pop  <sebastian.pop@amd.com>
2137
2138         * graphite-sese-to-poly.c (struct irp_data): Removed.
2139         (idx_record_params): Removed.
2140         (find_params_in_bb): Scan for parameters the access functions; don't
2141         parse the tree representation.
2142
2143 2009-09-14  Sebastian Pop  <sebastian.pop@amd.com>
2144
2145         * tree-ssa-loop.c (gate_graphite_transforms): Disable Graphite
2146         passes at -O1 and below.
2147
2148 2009-09-14  Sebastian Pop  <sebastian.pop@amd.com>
2149
2150         * graphite-blocking.c: Fix order of includes: tree-chrec.h, then
2151         tree-scalar-evolution.h, and then tree-data-ref.h.
2152         * graphite-clast-to-gimple.c: Same.
2153         * graphite-dependences.c: Same.
2154         * graphite-interchange.c: Same.
2155         * graphite-poly.c: Same.
2156         * graphite-scop-detection.c: Same.
2157         * graphite-sese-to-poly.c: Same.
2158         * graphite.c: Same.
2159         * lambda-code.c: Same.
2160         * matrix-reorg.c: Same.
2161         * tree-data-ref.c: Same.
2162         * tree-if-conv.c: Same.
2163         * tree-loop-distribu: Same.: Same.
2164         * tree-loop-linear.c: Same.
2165         * tree-parloops.c: Same.
2166         * tree-predcom.c: Same.
2167         * tree-vect-patterns.c: Same.
2168
2169 2009-09-02  Sebastian Pop  <sebastian.pop@amd.com>
2170
2171         Partially revert the previous patch, except the following.
2172         * tree-scalar-evolution.c (instantiate_scev_not): Adapted to pass
2173         as parameters the operands of the not expression.
2174
2175 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2176
2177         * tree-scalar-evolution.c (instantiate_scev_assign): New.
2178         Do not call analyze_scalar_evolution on assignments.
2179         (instantiate_scev_phi): Call analyze_scalar_evolution.
2180         (instantiate_scev_name): Call instantiate_scev_assign and
2181         instantiate_scev_phi.
2182         (instantiate_scev_not): Adapted to pass as parameters the operands
2183         of the not expression.
2184
2185 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2186
2187         * tree-scalar-evolution.c (instantiate_scev_binary): Adapted
2188         to pass as parameters the operands of the binary expression.
2189
2190 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2191
2192         * tree-scalar-evolution.c (instantiate_scev_bitnot): Renamed
2193         instantiate_scev_not.  Handle NEGATE_EXPR.
2194         (instantiate_scev_r): Handle NEGATE_EXPR.
2195
2196 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2197
2198         * tree-scalar-evolution.c (instantiate_scev_1): Renamed
2199         instantiate_scev_r.
2200         (instantiate_scev_r): Move code in instantiate_scev_2
2201         and instantiate_scev_1.
2202
2203 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2204
2205         * tree-scalar-evolution.c (instantiate_scev_3): New.
2206         (instantiate_scev_1): Move code in instantiate_scev_3.
2207
2208 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2209
2210         * tree-scalar-evolution.c (instantiate_scev_poly): New.
2211         (instantiate_scev_1): Move code in instantiate_scev_poly.
2212
2213 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2214
2215         * tree-scalar-evolution.c (instantiate_scev_bitnot): New.
2216         (instantiate_scev_1): Move code in instantiate_scev_bitnot.
2217
2218 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2219
2220         * tree-scalar-evolution.c (instantiate_scev_convert): New.
2221         (instantiate_scev_1): Move code in instantiate_scev_convert.
2222
2223 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2224
2225         * tree-scalar-evolution.c (instantiate_scev_binary): New.
2226         (instantiate_scev_1): Move code in instantiate_scev_binary.
2227
2228 2009-09-01  Sebastian Pop  <sebastian.pop@amd.com>
2229
2230         * tree-scalar-evolution.c (instantiate_scev_name): New.
2231         (instantiate_scev_1): Move code in instantiate_scev_name.
2232
2233 2009-08-28  Sebastian Pop  <sebastian.pop@amd.com>
2234
2235         * Merge from mainline (150992:151171).
2236
2237 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2238
2239         * opts.c (decode_options): Enable flag_loop_interchange at -O2.
2240
2241 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2242
2243         * graphite-dependences.c (graphite_legal_transform_bb): Call
2244         pbb_remove_duplicate_pdrs.
2245         * graphite-poly.c (can_collapse_pdr): Removed.
2246         (pdr_find_duplicate): Removed.
2247         (can_collapse_pdrs): New.
2248         (pbb_remove_duplicate_pdrs): New.
2249         (new_poly_dr): Do not look for duplicates.
2250         * graphite-poly.h (struct poly_bb): New field pdr_duplicates_removed.
2251         (PBB_PDR_DUPLICATES_REMOVED): New.
2252         (pbb_remove_duplicate_pdrs): Declared.
2253
2254 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2255
2256         * graphite-interchange.c (pbb_interchange_profitable_p): Adjust
2257         the strides by multiplying by PDR_NB_REFS.
2258         * graphite-poly.c (can_collapse_pdr): New.
2259         (pdr_find_duplicate): New.
2260         (new_poly_dr): Call pdr_find_duplicate.  Collapse duplicate PDRs.
2261         Initialize PDR_NB_REFS.
2262         * graphite-poly.h (struct poly_dr): Add field nb_refs.
2263         (PDR_NB_REFS): New.
2264         (new_poly_dr): Number of subscripts is a graphite_dim_t.
2265
2266 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2267
2268         Revert one of the previous commits:
2269         * graphite-dependences.c (graphite_legal_transform_bb): Avoid
2270         the computation of symmetric data dependence relations.
2271         (dependency_between_pbbs_p): Same.
2272
2273 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2274
2275         PR middle-end/40965
2276         * graphite-poly.c (apply_poly_transforms): Remove legality test before
2277         any transform.
2278
2279 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2280
2281         * graphite-dependences.c (pddr_original_scattering): Return NULL
2282         for read-read dependence relations.
2283         * graphite-poly.h (enum poly_dr_type): Fix comment.
2284         (pdr_read_p): New.
2285         (pdr_write_p): New.
2286         (pdr_may_write_p): New.
2287
2288 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2289
2290         * graphite-poly.h (enum POLY_DR_TYPE): Renamed poly_dr_type.
2291         (struct poly_dr): Same.
2292         (new_poly_dr): Same.
2293         * graphite-poly.c (new_poly_dr): Same.
2294
2295 2009-08-25  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
2296             Sebastian Pop  <sebastian.pop@amd.com>
2297
2298         * graphite-blocking.c (pbb_strip_mine_loop_depth): Renamed
2299         pbb_strip_mine_time_depth.  Changed the implementation so that
2300         transformation is expressed as a transformation on
2301         time (scatttering) dimensions.  Also, ensures that the 2d+1
2302         scheduling format is preserved.
2303         (pbb_strip_mine_profitable_p): Profitability is based on the
2304         iteration number of a given time (scattering) dimension,
2305         and not on a original loop depth dimension.
2306         (pbb_strip_mine): Call pbb_number_of_iterations_at_time.
2307         (pbb_do_strip_mine): Call psct_dynamic_dim.
2308         * graphite-poly.c (pbb_number_of_iterations_at_time): New.
2309         * graphite-poly.h (pbb_number_of_iterations_at_time): Declared.
2310         (pbb_nb_dynamic_scattering_transform): New.
2311         (psct_dynamic_dim): New.
2312
2313 2009-08-25  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
2314
2315         * graphite-ppl.c (ppl_max_for_le): Renamed ppl_max_for_le_pointset.
2316         * graphite-ppl.h (ppl_max_for_le): Renamed ppl_max_for_le_pointset.
2317         * graphite-poly.c (pbb_number_of_iterations): Rename ppl_max_for_le.
2318         * graphite-interchange.c (build_linearized_memory_access): Same.
2319         (memory_stride_in_loop): Same.
2320
2321 2009-08-25  Sebastian Pop  <sebastian.pop@amd.com>
2322
2323         * graphite-dependences.c (pddr_original_scattering): New.
2324         (graphite_legal_transform_dr): Call pddr_original_scattering.
2325         (dot_deps_1): New.
2326         (dot_deps): New.
2327         * graphite-dependences.h (dot_deps): Declared.
2328         * graphite-poly.c (new_poly_dr): Initialize PDR_ID.
2329         (print_pdr): Print PDR_ID.
2330         * graphite-poly.h (struct poly_dr): Add field id.
2331         (PDR_ID): New.
2332         (pbb_index): New.
2333         * graphite-scop-detection.c (dot_all_scops_1): Cleanup comment.
2334
2335 2009-08-22  Sebastian Pop  <sebastian.pop@amd.com>
2336
2337         * graphite-dependences.c (graphite_carried_dependence_level_k): Do
2338         not delete the original dependence relation.
2339
2340 2009-08-21  Sebastian Pop  <sebastian.pop@amd.com>
2341
2342         * graphite-dependences.c (graphite_legal_transform_bb): Avoid
2343         the computation of symmetric data dependence relations.
2344         (dependency_between_pbbs_p): Same.
2345
2346 2009-08-21  Sebastian Pop  <sebastian.pop@amd.com>
2347
2348         * graphite-dependences.c (new_poly_dr_pair): Renamed new_poly_ddr.
2349         (eq_poly_dr_pair_p): Renamed eq_poly_ddr_p.
2350         (hash_poly_dr_pair_p): Renamed hash_poly_ddr_p.
2351         (free_poly_ddr): New.
2352         (pddr_is_empty): New.
2353         (dependence_polyhedron_1): Now returns a poly_ddr_p.
2354         (dependence_polyhedron): Same.  Remove useless gcc_assert.
2355         Remove fprintfs.
2356         (graphite_legal_transform_dr): Call pddr_is_empty and free_poly_ddr.
2357         (graphite_carried_dependence_level_k): Call pddr_is_empty.
2358         * graphite-dependences.h (enum poly_dependence_kind): New.
2359         (poly_dr_pair): Renamed poly_ddr.  Added a field kind.
2360         (PDRP_SOURCE): Renamed PDDR_SOURCE.
2361         (PDRP_SINK): Renamed PDDR_SINK.
2362         (PDRP_DDP): Renamed PDDR_DDP.
2363         (PDDR_KIND): New.
2364         (free_poly_ddr): Declared.
2365         * graphite-poly.c (new_scop): Use the new hash function names.
2366         * graphite-poly.h (struct scop): Renamed field original_pdr_pairs
2367         into original_pddrs.
2368         (SCOP_ORIGINAL_PDR_PAIRS): Renamed SCOP_ORIGINAL_PDDRS.
2369
2370 2009-08-21  Sebastian Pop  <sebastian.pop@amd.com>
2371
2372         * Merge from mainline (150764:150992).
2373
2374 2009-08-18  Sebastian Pop  <sebastian.pop@amd.com>
2375
2376         * cfgloopmanip.c (create_empty_loop_on_edge): Generate upper
2377         bounds with LT_EXPR to make niter analysis more precise on code
2378         generated by Graphite.
2379
2380 2009-08-18  Sebastian Pop  <sebastian.pop@amd.com>
2381
2382         * graphite-dependences.c (graphite_legal_transform_dr): Fix formatting.
2383         (graphite_legal_transform_bb): Same.
2384         (poly_drs_may_alias_p): Same.
2385
2386 2009-08-15  Sebastian Pop  <sebastian.pop@amd.com>
2387
2388         PR middle-end/40981
2389         * graphite-ppl.c (ppl_max_for_le): Correct the use of
2390         ppl_Pointset_Powerset_C_Polyhedron_maximize.
2391
2392 2009-08-13  Sebastian Pop  <sebastian.pop@amd.com>
2393
2394         * graphite-poly.c (print_pbb): Print PBB index.
2395
2396 2009-08-13  Sebastian Pop  <sebastian.pop@amd.com>
2397
2398         * Merge from mainline (r150672:150764).
2399
2400 2009-08-13  Sebastian Pop  <sebastian.pop@amd.com>
2401
2402         * graphite-interchange.c (ppl_max_for_le): Moved...
2403         * graphite-poly.c (pbb_number_of_iterations): Call ppl_max_for_le.
2404         * graphite-ppl.c (ppl_max_for_le): ... here.
2405         * graphite-ppl.h (ppl_max_for_le): Declared.
2406
2407 2009-08-12  Sebastian Pop  <sebastian.pop@amd.com>
2408
2409         * Merge from mainline (r150372:150672).
2410
2411 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2412
2413         PR middle-end/40980
2414         * sese.c (convert_for_phi_arg): New.
2415         (add_guard_exit_phis): Use convert_for_phi_arg.
2416
2417         * gfortran.dg/graphite/id-17.f: New.
2418
2419 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2420
2421         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Dont add
2422         unknown subscript upper bounds.
2423
2424         * gcc.dg/graphite/interchange-6.c: Un-XFAIL.
2425
2426 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2427             Pranav Garg  <pranav.garg2107@gmail.com>
2428
2429         * graphite-interchange.c (gather_access_strides): Removed.
2430         (ppl_max_for_le): New.
2431         (build_linearized_memory_access): New.
2432         (memory_stride_in_loop): New.
2433         (pbb_interchange_profitable_p): Reimplemented.
2434         * graphite-ppl.h (ppl_new_id_map): New.
2435         (ppl_interchange): New.
2436
2437         * gcc.dg/graphite/interchange-6.c: XFAILed.
2438
2439 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2440
2441         * graphite-interchange.c (compute_subscript): Removed.
2442         (compute_array_size_cstr): Removed.
2443         (compute_array_size_poly): Removed.
2444         (compute_array_size): Removed.
2445         (gather_access_strides_poly): Removed.
2446         (gather_access_strides): Empty.
2447
2448 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2449
2450         * graphite-dependences.c (dependence_polyhedron_1): Replace
2451         pdr_nb_subscripts with PDR_NB_SUBSCRIPTS.
2452         (graphite_legal_transform_dr): Same.
2453         (graphite_carried_dependence_level_k): Same.
2454         * graphite-poly.c (new_poly_dr): Add a parameter nb_subscripts.
2455         Initialize PDR_NB_SUBSCRIPTS.
2456         (print_pdr_access_layout): Replace pdr_nb_subscripts with
2457         PDR_NB_SUBSCRIPTS.
2458         * graphite-poly.h (struct poly_dr): Add nb_subscripts field.
2459         (PDR_NB_SUBSCRIPTS): New.
2460         (pdr_nb_subscripts): Removed.
2461         (pdr_dim): Simplified.
2462         * graphite-sese-to-poly.c (build_poly_dr): Replace pdr_nb_subscripts
2463         with PDR_NB_SUBSCRIPTS.
2464
2465 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2466
2467         * graphite-interchange.c (compute_array_size): Remove use of
2468         PDR_DATA_CONTAINER.
2469         * graphite-poly.c (new_poly_dr): Remove argument data_container.
2470         Do not initialize PDR_DATA_CONTAINER.
2471         (print_pdr): Do not print PDR_DATA_CONTAINER.
2472         * graphite-poly.h (struct poly_dr): Remove data_container field.
2473         (PDR_DATA_CONTAINER): Removed.
2474         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Remove use of
2475         PDR_DATA_CONTAINER.
2476         (build_poly_dr): Same.
2477
2478 2009-08-11  Sebastian Pop  <sebastian.pop@amd.com>
2479
2480         * gcc.dg/graphite/interchange-9.c: New.
2481
2482 2009-08-05  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
2483             Sebastian Pop  <sebastian.pop@amd.com>
2484
2485         * graphite-dependences.c (graphite_legal_transform_dr): Work on a
2486         copy of the dependence polyhedron.  Free the temporary objects.
2487         (graphite_carried_dependence_level_k): Free unused objects before
2488         returning.
2489
2490         * gcc.dg/graphite/interchange-1.c: XFAILed.
2491         * gcc.dg/graphite/interchange-2.c: XFAILed.
2492         * gcc.dg/graphite/interchange-3.c: XFAILed.
2493         * gcc.dg/graphite/interchange-4.c: XFAILed.
2494         * gcc.dg/graphite/interchange-7.c: XFAILed.
2495
2496 2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>
2497
2498         * graphite-blocking.c (scop_do_strip_mine): Call store_scattering.
2499         Early return without analyzing the data dependences if no
2500         transform has been done.  Call restore_scattering if the transform
2501         is not legal.
2502         (graphite-interchange.c): Same.
2503         * graphite-poly.c (print_scattering_function): Test for PBB_TRANSFORMED.
2504         (graphite_read_transforms): Initialize PBB_TRANSFORMED.
2505         (apply_poly_transforms): Do not gcc_assert that
2506         the transform is legal.
2507         (new_poly_bb): Initialize PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL.
2508         Do not initialize PBB_NB_SCATTERING_TRANSFORM, PBB_NB_LOCAL_VARIABLES,
2509         PBB_TRANSFORMED_SCATTERING, and PBB_ORIGINAL_SCATTERING.
2510         (free_poly_dr): Free PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL.
2511         * graphite-poly.h (struct poly_scattering): New.
2512         (struct poly_bb): Add original, transformed, and saved fields.
2513         Remove transformed_scattering, original_scattering, nb_local_variables,
2514         and nb_scattering_transform fields.
2515         (PBB_ORIGINAL, PBB_TRANSFORMED, PBB_SAVED): New.
2516         (poly_scattering_new): New.
2517         (poly_scattering_free): New.
2518         (poly_scattering_copy): New.
2519         (store_scattering_pbb): New.
2520         (store_scattering): New.
2521         (restore_scattering_pbb): New.
2522         (restore_scattering): New.
2523         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons):
2524         Initialize PBB_TRANSFORMED and PBB_ORIGINAL.
2525
2526 2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>
2527
2528         * graphite-poly.c (print_pbb): Add parentheses in the pretty print.
2529         (print_scop): Same.
2530
2531 2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>
2532
2533         * Makefile.in (graphite.o): Depends on PREDICT_H.
2534         * graphite.c: Include predict.h.
2535         (graphite_finalize): Call tree_estimate_probability.
2536         * predict.c (predict_loops): Do not call scev_initialize and
2537         scev_finalize.
2538         (tree_estimate_probability_bb): New.
2539         (tree_estimate_probability): Do not initialize loops: move that
2540         code to the driver.  Call tree_estimate_probability_bb.
2541         (tree_estimate_probability_driver): New.
2542         (pass_profile): Use tree_estimate_probability_driver.
2543         * predict.h (tree_estimate_probability): Declared.
2544
2545 2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>
2546
2547         * graphite-clast-to-gimple.c (gloog): Add time to TV_GRAPHITE_CODE_GEN.
2548         * graphite-dependences.c (graphite_legal_transform): Add time to
2549         TV_GRAPHITE_DATA_DEPS.
2550         (dependency_between_pbbs_p): Same.
2551         * timevar.def (TV_GRAPHITE_DATA_DEPS, TV_GRAPHITE_CODE_GEN): New.
2552
2553 2009-08-03  Sebastian Pop  <sebastian.pop@amd.com>
2554
2555         * Merge from mainline (r149952:150372).
2556
2557 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2558
2559         * ChangeLog.graphite: Fix indenting, white spaces and 80 columns.
2560         * graphite-blocking.c: Same.
2561         * graphite-clast-to-gimple.c: Same.
2562         * graphite-dependences.c: Same.
2563         * graphite-poly.c: Same.
2564         * graphite-poly.h: Same.
2565         * graphite-ppl.c: Same.
2566         * graphite-scop-detection.c: Same.
2567         * graphite-sese-to-poly.c: Same.
2568         * graphite.c: Same.
2569
2570 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2571
2572         * graphite-sese-to-poly.c (loop_entry_phi_arg): New.
2573         (remove_simple_copy_phi): New.
2574         (remove_invariant_phi): New.
2575         (simple_copy_phi_p): New.
2576         (reduction_phi_p): New.
2577         (gsi_for_ssa_name_def): New.
2578         (insert_out_of_ssa_copy): New.
2579         (insert_out_of_ssa_copy_on_edge): New.
2580         (create_zero_dim_array): New.
2581         (scalar_close_phi_node_p): New.
2582         (rewrite_close_phi_out_of_ssa): New.
2583         (rewrite_phi_out_of_ssa): New.
2584         (rewrite_reductions_out_of_ssa): New.
2585         (build_poly_scop): Call rewrite_reductions_out_of_ssa.
2586
2587         * gcc.dg/graphite/id-11.c: New.
2588         * gcc.dg/graphite/id-15.c: New.
2589         * gcc.dg/graphite/interchange-1.c: Un-XFAIL.
2590         * gcc.dg/graphite/interchange-2.c: Un-XFAIL.
2591         * gcc.dg/graphite/interchange-3.c: Un-XFAIL.
2592         * gcc.dg/graphite/interchange-4.c: Un-XFAIL.
2593         * gcc.dg/graphite/interchange-7.c: Un-XFAIL.
2594         * gcc.dg/graphite/scop-matmult.c: Un-XFAIL.
2595         * gfortran.dg/graphite/id-13.f: New.
2596         * gfortran.dg/graphite/id-5.f: New.
2597
2598 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2599
2600         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not
2601         check that nb_reductions_in_loop is zero.
2602         * graphite-scop-detection.c (harmful_stmt_in_bb): Don't filter out
2603         reduction phi nodes.
2604         (nb_reductions_in_loop): Removed.
2605         (graphite_can_represent_loop): Do not call nb_reductions_in_loop.
2606         * graphite-sese-to-poly.c (phi_node_is_iv): Removed.
2607         (bb_contains_non_iv_scalar_phi_nodes): Removed.
2608         (scop_contains_non_iv_scalar_phi_nodes): Removed.
2609         (build_poly_scop): Do not call scop_contains_non_iv_scalar_phi_nodes.
2610
2611 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2612
2613         * graphite-clast-to-gimple.c (build_cloog_prog): Do not code generate
2614         statements that have an empty iteration domain.
2615         * gfortran.dg/graphite/id-16.f: New.
2616
2617 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2618
2619         * tree-scalar-evolution.c (instantiate_scev_1): Return
2620         chrec_dont_know when the result is not above instantiate_below.
2621         * graphite-scop-detection.c (scopdet_basic_block_info): Fix formatting.
2622         * graphite-sese-to-poly.c (create_linear_expr_from_tree): Assert that
2623         the tree has a known scalar evolution.
2624         * gfortran.dg/graphite/id-14.f: New.
2625         * gfortran.dg/graphite/id-15.f: New.
2626
2627 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2628
2629         * sese.c (rename_variables_in_stmt): Pass in an extra parameter
2630         insert_gsi.
2631         (rename_variables): Keep inserting renames after the ones already
2632         inserted.
2633
2634 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2635
2636         * graphite-sese-to-poly.c (compare_bb_depths): New.
2637         (graphite_sort_dominated_info): New.
2638         (build_scop_bbs_1): Call graphite_sort_dominated_info.
2639         (build_scop_scattering): Fix comment.
2640
2641 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
2642
2643         * graphite.c (graphite_finalize): Call print_loops instead of
2644         dump_function_to_file.
2645         * gcc.dg/graphite/graphite.exp: Fix formatting.
2646         * gcc.dg/graphite/pr35356-1.c: New.  Look for the number of
2647         loops generated in the graphite output file.
2648         * gcc.dg/graphite/pr35356-2.c: New.
2649         * gcc.dg/graphite/pr35356-3.c: New.  XFAILed for now.
2650         * gfortran.dg/graphite/id-12.f: New.
2651
2652 2009-07-24  Li Feng  <nemokingdom@gmail.com>
2653
2654         * gcc.dg/graphite/graphite_autopar/force-parallel-8.c:
2655         Remove 2 XFAIL.
2656
2657 2009-07-24  Li Feng  <nemokingdom@gmail.com>
2658             Tobias Grosser  <grosser@fim.uni-passau.de>
2659
2660         * graphite-sese-to-poly.c (pdr_add_alias_set): Use data reference's
2661         alias set number build alias in ACCESSES polyhedron.
2662         (build_alias_set_for_drs): New.
2663         (build_pbb_drs): Added build_alias_set_for_drs.
2664         * graphite-dependences.c (poly_drs_may_alias_p): New.
2665         (graphite_carried_dependence_level_k): Check alias information
2666         before building polyhedron.
2667
2668 2009-07-24  Tobias Grosser  <grosser@fim.uni-passau.de>
2669
2670         * Makefile.in (lambda-code.o): Fix formatting.
2671
2672 2009-07-24  Tobias Grosser  <grosser@fim.uni-passau.de>
2673
2674         * Merge from mainline (r149350-149952)
2675
2676 2009-07-18  Tobias Grosser  <grosser@fim.uni-passau.de>
2677
2678         * graphite-poly.c (apply_poly_transforms): Move strip_mine
2679         before interchange to prepare for loop blocking.
2680
2681 2009-07-18  Tobias Grosser  <grosser@fim.uni-passau.de>
2682
2683         * graphite-poly.c (apply_poly_transforms): Add checks after every
2684         transformation.
2685         * graphite-sese-to-poly.c (build_poly_scop): Remove check, as already
2686         done in apply_poly_transforms.
2687
2688 2009-07-17  Konrad Trifunovic  <konrad.trifunovic@gmail.com>
2689
2690         * graphite-dependences.c (build_lexicographically_gt_constraint):
2691         Replace RES parameter with *RES.
2692         (dependence_polyhedron_1): Pass an address of the parameter RES
2693         instead of value of RES.
2694
2695 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2696
2697         * graphite.c (graphite_finalize): Fix comment.
2698         (graphite_transform_loops): Reset scev info after code generation
2699         of each scop.
2700
2701 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2702
2703         * graphite.c (graphite_finalize): Call scev_reset.
2704
2705 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2706
2707         * graphite-clast-to-gimple.c (compute_cloog_iv_types): Do not create
2708         GBB_CLOOG_IV_TYPES hash table twice.
2709         * graphite-sese-to-poly.c (free_gimple_bb): Call free_data_refs.
2710         (add_condition_to_domain): Clear GMP values.
2711
2712 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2713
2714         * graphite-dependences.c: Fix formatting.
2715         * graphite-poly.c (free_poly_dr): Also free PDR_DATA_CONTAINER.
2716         (pbb_number_of_iterations): Free ppl_Linear_Expression.
2717         * graphite-sese-to-poly.c: Fix formatting.
2718         * graphite.c (graphite_transform_loops): Create the hash table
2719         after the early return.
2720
2721 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2722
2723         * gcc.dg/graphite/id-14.c: New.
2724         * gcc.dg/graphite/pr40157.c: New.
2725         * gfortran.dg/graphite/id-11.f: New.
2726
2727 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2728
2729         * graphite-sese-to-poly.c (nb_pbbs_in_loops): New.
2730         (build_poly_scop): Return false when there are no pbbs within
2731         loops to avoid to pass to cloog scops with no loops.
2732
2733 2009-07-16  Sebastian Pop  <sebastian.pop@amd.com>
2734
2735         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Avoid
2736         useless test "i % 2".
2737         (build_pbb_scattering_polyhedrons): Fix formatting.
2738         (build_poly_dr): Same.
2739         * graphite.c (graphite_transform_loops): Restructure.
2740
2741 2009-07-14  Razya Ladelsky  <razya@il.ibm.com>
2742
2743         * tree-ssa-loop-manip.c (rewrite_phi_with_iv): Remove
2744         reduction_list parameter.
2745         (rewrite_all_phi_nodes_with_iv): Same.
2746         (canonicalize_loop_ivs): Same.
2747         * tree-parloops.c (struct brli): Removed.
2748         (build_reduction_list_info): Removed.
2749         (build_new_reduction): New.
2750         (analyze_reduction_list): Removed.
2751         (gather_scalar_reductions): Find reductions instead of phi
2752         nodes that can't be canonicalized.
2753         (try_create_reduction_list): Remove reduction_list parameter.
2754         (gen_parallel_loop): Same.
2755         (parallelize_loops): Remove analyze_reductions variable,
2756         initialization and free.
2757         Change reduction_list htab initialization to reduction_info
2758         elements instead of ssa names.
2759         Call try_create_reduction_list and gen_parallel_loop without
2760         analyzed_reduction argument.
2761         * graphite-clast-to-gimple (graphite_loop_normal_form): Call
2762         canonicalize_loop_ivs with one less argument.
2763         * tree-flow.h (canonicalize_loop_ivs): Remove one argument.
2764
2765 2009-07-14  Konrad Trifunovic <konrad.trifunovic@gmail.com>
2766
2767         * graphite-dependences.c (new_poly_dr_pair): New.
2768         (dependence_polyhedron): Renamed into dependence_polyhedron_1.
2769         (new_poly_dr_pair): New.
2770         (eq_poly_dr_pair_p): New.
2771         (hash_poly_dr_pair_p): New.
2772         * graphite-dependences.h (struct poly_dr_pair): New.
2773         (eq_poly_dr_pair_p): Declared.
2774         (hash_poly_dr_pair_p): Declared.
2775         * graphite-poly.c (new_scop): Initialize SCOP_ORIGINAL_PDR_PAIRS.
2776         (free_scop): Free SCOP_ORIGINAL_PDR_PAIRS.
2777         * graphite-poly.h (struct scop): Add original_pdr_pairs field.
2778         * Makefile.in (graphite-poly.o): Add dependence on
2779         graphite-dependences.h.
2780
2781 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
2782
2783         * graphite-scop-detection.c (graphite_can_represent_scev): Do not let
2784         polynomials of degree > 1 pass to Graphite.
2785         * tree-chrec.c (scev_is_linear_expression): Call
2786         evolution_function_is_affine_multivariate_p.
2787         * gfortran.dg/graphite/id-10.f90: New.
2788
2789 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
2790
2791         * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop):
2792         Instantiate scevs varying in outer loops.
2793         * gfortran.dg/graphite/id-9.f: Correct testcase.
2794
2795 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
2796
2797         * graphite-sese-to-poly.c (build_loop_iteration_domains): Do not insert
2798         redundant constraint.
2799
2800 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
2801
2802         * gcc.dg/graphite/graphite.exp: Fix comments.
2803         * gfortran.dg/graphite/graphite.exp: Trigger actions
2804         based on the file names as in the C testsuite.
2805         * gfortran.dg/graphite/block-1.f90: Fix patterns.
2806         * gfortran.dg/graphite/block-2.f: Same.
2807         * gfortran.dg/graphite/block-3.f90: Same.
2808         * gfortran.dg/graphite/block-4.f90: Same.
2809         * gfortran.dg/graphite/id-1.f90: Same.
2810         * gfortran.dg/graphite/id-2.f90: Same.
2811         * gfortran.dg/graphite/id-3.f90: Same.
2812         * gfortran.dg/graphite/id-4.f90: Same.
2813         * gfortran.dg/graphite/id-6.f: Same.
2814         * gfortran.dg/graphite/id-9.f: Same.
2815         * gfortran.dg/graphite/interchange-1.f: Same.
2816         * gfortran.dg/graphite/interchange-2.f: Same.
2817         * gfortran.dg/graphite/scop-1.f: Same.
2818
2819 2009-07-14  Sebastian Pop  <sebastian.pop@amd.com>
2820
2821         * sese.c (expand_scalar_variables_call): New.
2822         (expand_scalar_variables_ssa_name): Handle calls in expander.
2823
2824 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
2825
2826         * gcc.dg/graphite/graphite_autopar/force-parallel-6.c:
2827         Expect to see the pattern twice.
2828         * gcc.dg/graphite/interchange-0.c: Un-XFAIL.
2829         * gcc.dg/graphite/interchange-5.c: Same.
2830         * gcc.dg/graphite/interchange-6.c: Same.
2831
2832 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
2833
2834         * gcc.dg/graphite/id-10.c: New.
2835         * gcc.dg/graphite/id-12.c: New.
2836         * gfortran.dg/graphite/id-7.f: New.
2837         * gfortran.dg/graphite/id-8.f: New.
2838
2839 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
2840
2841         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Fix division by
2842         zero.
2843
2844 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
2845
2846         * sese.c (rename_variables_in_stmt): Call fold_convert during renaming.
2847
2848 2009-07-13  Sebastian Pop  <sebastian.pop@amd.com>
2849
2850         * sese.c (expand_scalar_variables_stmt): Avoid unnecessary expansion.
2851
2852 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
2853
2854         * graphite-sese-to-poly.c (pdr_add_memory_accesses): Fix order of
2855         building PDR subscripts.
2856
2857 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
2858
2859         * graphite-sese-to-poly.c (pdr_add_data_dimensions): Fix the
2860         computation of array sizes.
2861
2862 2009-07-10  Sebastian Pop  <sebastian.pop@amd.com>
2863
2864         * graphite-sese-to-poly.c (add_param_constraints): Disabled.
2865
2866 2009-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
2867
2868         * graphite-dependences.c (map_into_dep_poly, map_dr_into_dep_poly,
2869         build_pairwise_constraint, dr_equality_constraints,
2870         build_pairwise_scheduling_equality,
2871         build_pairwise_scheduling_inequality, lexicographically_gt_p,
2872         build_lexicographically_gt_constraint, dependence_polyhedron,
2873         graphite_legal_transform_dr, graphite_carried_dependence_level_k):
2874         Move from NNC_Polyhedron to C_Polyhedron.
2875         * graphite-interchange.c (compute_array_size_poly,
2876         gather_access_strides): Dito.
2877         * graphite-poly.c (apply_poly_transforms, new_poly_dr, free_poly_bb,
2878         free_scop, pbb_number_of_iterations): Dito.
2879         * graphite-poly.h (struct poly_dr, pdr_nb_subscripts, struct poly_bb,
2880         pbb_dim_iter_domain, struct scop): Dito.
2881         * graphite-ppl.c (new_Constraint_System_from_Cloog_Matrix,
2882         new_Cloog_Domain_from_ppl_Polyhedron,
2883         new_Cloog_Domain_from_ppl_Pointset_Powerset, ppl_set_coef_gmp,
2884         ppl_insert_dimensions_pointset, ppl_insert_dimensions_pointset,
2885         ppl_strip_loop, ppl_strip_loop, ppl_print_polyhedron_matrix,
2886         ppl_print_powerset_matrix, debug_ppl_polyhedron_matrix,
2887         debug_ppl_powerset_matrix, ppl_read_polyhedron_matrix): Dito.
2888         * graphite-ppl.h (ppl_Pointset_Powerset_C_Polyhedron_t,
2889         new_C_Polyhedron_from_Cloog_Matrix, ppl_print_powerset_matrix,
2890         debug_ppl_powerset_matrix, ppl_insert_dimensions_pointset): Dito.
2891         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons,
2892         build_loop_iteration_domains, ppl_constraint_type_from_tree_code,
2893         add_condition_to_domain, add_condition_to_pbb, build_scop_context,
2894         build_scop_iteration_domain, build_poly_dr): Dito
2895
2896 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2897
2898         * gcc.dg/graphite/graphite.exp: Added a rule to execute
2899         run-id-*.c files.
2900         * gcc.dg/graphite/run-id-1.c: New.
2901
2902 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2903
2904         * graphite-sese-to-poly.c (build_loop_iteration_domains): Add the
2905         positivity constraint on the symbolic number of iterations.
2906
2907 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2908
2909         * graphite-sese-to-poly.c (build_loop_iteration_domains): Rewrite.
2910
2911 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2912             Tobias Grosser  <grosser@fim.uni-passau.de>
2913
2914         * graphite-clast-to-gimple.c (build_scop_context): Removed.
2915         (build_cloog_prog): Directly use SCOP_CONTEXT.
2916         * graphite-poly.c (new_scop): Initialize SCOP_CONTEXT.
2917         (free_scop): Free SCOP_CONTEXT.
2918         (print_scop_context): New.
2919         (print_scop): Call print_scop_context.
2920         (debug_scop_context): New.
2921         * graphite-poly.h (print_scop_context, debug_scop_context): Declared.
2922         (struct scop): Added field context.
2923         (SCOP_CONTEXT): New.
2924         * graphite-sese-to-poly.c (add_param_constraints): New.
2925         (build_scop_context): New.
2926         (build_poly_scop): Call build_scop_context.
2927
2928 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2929
2930         * graphite-clast-to-gimple.c (gmp_cst_to_tree): Moved...
2931         * graphite-ppl.c (ppl_set_inhomogeneous_gmp, ppl_set_coef_gmp): New.
2932         (ppl_set_inhomogeneous, ppl_set_coef): Moved...
2933         * graphite-ppl.h: Include double-int.h and tree.h.
2934         (ppl_set_inhomogeneous_gmp, ppl_set_coef_gmp): Declared.
2935         (ppl_set_inhomogeneous, ppl_set_coef): ...here.
2936         (gmp_cst_to_tree): ...here.  Reimplemented using mpz_get_double_int.
2937         (tree_int_to_gmp, ppl_set_inhomogeneous_tree, ppl_set_coef_tree): New.
2938
2939 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2940
2941         * graphite-clast-to-gimple.c (clast_to_gcc_expression_red): Generate
2942         POINTER_PLUS_EXPR for pointer types.
2943         (clast_to_gcc_expression): Same.
2944
2945 2009-07-09  Sebastian Pop  <sebastian.pop@amd.com>
2946
2947         * graphite-poly.c (print_scattering_function): Early return when
2948         PBB_TRANSFORMED_SCATTERING is not initialized.
2949         (print_pbb_domain): Early return when PBB_DOMAIN is not initialized.
2950
2951 2009-07-08  Sebastian Pop  <sebastian.pop@amd.com>
2952
2953         * tree-parloops.c (analyze_reduction_list): Remove unused variable
2954         to fix bootstrap.
2955
2956 2009-07-08  Razya Ladelsky  <razya@il.ibm.com>
2957
2958         * tree-parloops.c (analyze_reduction_list): Change return
2959         value to void.
2960         (try_create_reduction_list): Move the call to
2961         analyze_reduction_list to the beginining.
2962         Call reduction_phi with analyzed_reductions as argument
2963         instead of reduction_list.
2964
2965 2009-07-08  Tobias Grosser  <grosser@fim.uni-passau.de>
2966
2967         *  Merge from mainline (r148296:149346)
2968
2969 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
2970
2971         * graphite-scop-detection.c (graphite_can_represent_init): New.
2972         (graphite_can_represent_scev): Call graphite_can_represent_init:
2973         check that the initial value does not contain multiplications of
2974         parameters.
2975         (stmt_has_simple_data_refs_p): New.
2976         (stmt_simple_for_scop_p): Call stmt_simple_for_scop_p.
2977         (is_simple_operand): Fix formatting.
2978         * graphite-sese-to-poly.c (try_generate_gimple_bb): Fix formatting.
2979
2980 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
2981
2982         * gcc.dg/graphite/id-13.c: New.
2983         * graphite-sese-to-poly.c (graphite_stmt_p): Do not call
2984         analyze_scalar_evolution, use scalar_evolution_in_region.
2985         (scan_tree_for_params_right_scev): Add extra assert.
2986         (parameter_index_in_region_1): Split from parameter_index_in_region.
2987         (idx_record_params): Use scalar_evolution_in_region.
2988         (find_params_in_bb): Same.
2989         (find_scop_parameters): Same.
2990         (build_loop_iteration_domains): Same.
2991         (create_linear_expr_from_tree): Same.
2992         * sese.c (scalar_evolution_in_region): New.
2993         * sese.h (scalar_evolution_in_region): Declared.
2994         (defined_in_sese_p): New.
2995         * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop): Not
2996         static anymore.
2997         * tree-scalar-evolution.h (compute_overall_effect_of_inner_loop):
2998         Declared.
2999
3000 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
3001
3002         * Makefile.in: Replace dependences on tree-chrec.h with SCEV_H.
3003         TREE_DATA_REF_H also implies SCEV_H.
3004
3005 2009-07-07  Sebastian Pop  <sebastian.pop@amd.com>
3006
3007         * graphite-poly.c (print_scop_params): New.
3008         (print_scop): Call print_scop_params.
3009         (debug_scop_params): New.
3010         * graphite-poly.h (print_scop_params, debug_scop_params): Declared.
3011
3012 2009-07-07  Li Feng  <nemokingdom@gmail.com>
3013
3014         * gcc.dg/graphite/graphite_autopar/force-parallel-4.c: New.
3015         * gcc.dg/graphite/graphite_autopar/force-parallel-5.c: New.
3016         * gcc.dg/graphite/graphite_autopar/force-parallel-6.c: New.
3017         * gcc.dg/graphite/graphite_autopar/force-parallel-7.c: New.
3018         * gcc.dg/graphite/graphite_autopar/force-parallel-8.c: New.
3019         * gcc.dg/graphite/graphite_autopar/force-parallel-9.c: New.
3020
3021 2009-07-07  Li Feng  <nemokingdom@gmail.com>
3022
3023         * graphite-clast-to-gimple.c (mark_loops_parallel): Dump information
3024         for dependency checking part.
3025         * gcc.dg/graphite/graphite_autopar/force-parallel-1.c: Add
3026         tests for dependency checking.
3027         * gcc.dg/graphite/graphite_autopar/force-parallel-2.c: Ditto.
3028         * gcc.dg/graphite/graphite_autopar/force-parallel-3.c: Ditto.
3029         * gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: Add
3030         flag -fdump-tree-graphite-all for autopar testsuites.
3031
3032 2009-07-06  Sebastian Pop  <sebastian.pop@amd.com>
3033
3034         * Makefile.in (tree-ssa-loop-manip.o): Depends on langhooks.h.
3035         * tree-parloops.c (rewrite_phi_with_iv, rewrite_all_phi_nodes_with_iv,
3036         canonicalize_loop_ivs): Moved...
3037         * tree-ssa-loop-manip.c: ... here.  Include langhooks.h.
3038
3039 2009-07-06  Sebastian Pop  <sebastian.pop@amd.com>
3040
3041         * tree-parloops.c (try_create_reduction_list): Pass an extra
3042         argument analyzed_reductions.  Call analyze_reduction_list.
3043         (gen_parallel_loop): Do not call analyze_reduction_list.
3044         (parallelize_loops): Init and finalize analyzed_reductions.
3045
3046 2009-07-06  Li Feng  <nemokingdom@gmail.com>
3047
3048         * gcc.dg/graphite/graphite_autopar/graphite_autopar.exp:
3049         Added flag -fno-loop-strip-mine for autopar testcase.
3050
3051 2009-07-04  Li Feng  <nemokingdom@gmail.com>
3052
3053         * graphite-dependences.c (graphite_carried_dependence_level_k): Use
3054         transformed scattering dimension instead of unmatch orignal when
3055         calling dependence_polyhedron.
3056
3057 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
3058
3059         * opts.c (decode_options): Enable flag_loop_strip_mine at -O2.
3060
3061 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
3062
3063         * graphite-poly.c (pbb_number_of_iterations): Check for returned
3064         value 1 from ppl_Pointset_Powerset_NNC_Polyhedron_maximize.
3065
3066 2009-06-30  Sebastian Pop  <sebastian.pop@amd.com>
3067
3068         * graphite-blocking.c (pbb_strip_mine_profitable_p): New.
3069         (pbb_do_strip_mine): Call pbb_strip_mine_profitable_p.
3070         * graphite-poly.c (pbb_number_of_iterations): New.
3071         * graphite-poly.h (pbb_number_of_iterations): Declared.
3072         (pbb_iterator_dim, pbb_parameter_dim): New.
3073
3074 2009-06-29  Sebastian Pop  <sebastian.pop@amd.com>
3075
3076         * graphite-clast-to-gimple.c (graphite_create_new_loop): Revert the
3077         last commit on type of lower and upper bound of loops.
3078
3079 2009-06-29  Li Feng  <nemokingdom@gmail.com>
3080
3081         * Makefile.in (graphite-clast-to-gimple.o): Added dependence on
3082         graphite-dependences.h.
3083         * graphite-clast-to-gimple.c (new_bb_pbb_def): New.
3084         (mark_bb_with_pbb): New.
3085         (get_stmtfor_depth): New.
3086         (find_pbb_via_hash): New.
3087         (dependency_in_loop_p): New.
3088         (mark_loops_parallel): New.
3089         (free_aux_in_new_loops): New.
3090         (translate_clast): Add parameter BB_PBB_MAPPING.  Mark newly created
3091         bb with it's relevant pbb. Mark newly created loops.  Remove mark
3092         innermost loop parallel without checking.
3093         (gloog): Add parameter BB_PBB_MAPPING.
3094         * graphite-clast-to-gimple.h (struct bb_pbb_def): New.
3095         (gloog): Change declaration.
3096         (mark_loop_parallel): Make extern.
3097         (free_aux_in_new_loops): Declare.
3098         (bb_pbb_map_hash): New.
3099         (eq_bb_pbb_map): New.
3100         * graphite.c (graphite_transform_loops): Added BB_PBB_MAPPING. Trigger
3101         auto parallelization when flag_graphite_force_parallel is set.
3102         (graphite_finalize): Added free_aux_in_new_loops.
3103         * tree-parloops.c (parallelize_loops): Only generate parallel code for
3104         the innermost loop that marked parallel.  Use
3105         flag_graphite_force_parallel instead of loop->can_be_parallel.
3106         (loop_parallel_p): Move inner most checking out of function.
3107
3108 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3109
3110         * graphite-clast-to-gimple.c (graphite_create_new_loop): Make the
3111         type of lower and upper bound of loops signed long int.
3112
3113 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3114
3115         * cfgloopmanip.c (create_empty_loop_on_edge): Gimplify the loop exit
3116         expression outside the loop.
3117
3118 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3119
3120         * gcc.dg/graphite/interchange-8.c: New.
3121
3122 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3123
3124         * gcc.dg/graphite/interchange-0.c: XFailed.
3125         * gcc.dg/graphite/interchange-5.c: XFailed.
3126         * gcc.dg/graphite/interchange-6.c: XFailed.
3127
3128 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3129
3130         * graphite-interchange.c (compute_array_size_poly): The end of the
3131         recursion should return 1.
3132
3133 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3134
3135         * graphite-interchange.c (compute_array_size_cstr): Allow the
3136         subscript multiplier to be -1.
3137         (compute_array_size): Use PDR_DATA_CONTAINER and not PDR_ACCESSES.
3138         * graphite-poly.c (new_poly_dr): Takes an extra argument for the
3139         data_container.  Initializes PDR_DATA_CONTAINER.
3140         (print_pdr_access_layout): New.
3141         (print_pdr): Call print_pdr_access_layout.  Print PDR_DATA_CONTAINER.
3142         * graphite-poly.h (struct poly_dr): Adjust comment.  Add a new field
3143         data_container.
3144         (PDR_DATA_CONTAINER): New.
3145         (new_poly_dr): Update declaration.
3146         * graphite-sese-to-poly.c (pdr_add_data_dimensions): New.
3147         (build_poly_dr): Call pdr_add_data_dimensions.
3148
3149 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3150
3151         * graphite-poly.h (struct poly_dr): Fix comment.
3152         * graphite-sese-to-poly.c (pdr_add_alias_set): New.
3153         (pdr_add_memory_accesses): New.
3154         (build_poly_dr): Call pdr_add_memory_accesses and pdr_add_alias_set.
3155
3156 2009-06-26  Sebastian Pop  <sebastian.pop@amd.com>
3157
3158         * graphite-poly.c (print_pdrs, debug_pdrs): New.
3159         (print_pbb): Add call to print_pdrs.
3160         * graphite-poly.h (print_pdrs, debug_pdrs): Declared.
3161
3162 2009-06-24  Konrad Trifunovic <konrad.trifunovic@gmail.com>
3163             Li Feng <nemokingdom@gmail.com>
3164
3165         * graphite-dependences.c (graphite_carried_dependence_level_k): New.
3166         (dependency_between_pbbs_p): New.
3167         (lexicographically_gt_p): Assure !empty_p before polyhedron
3168         intersection assign.
3169         (build_lexicographically_gt_constraint): Correct lexicographically
3170         judging.
3171         * graphite-dependences.h: New.
3172         * Makefile.in (graphite-dependences.o): Add graphite-dependences.h.
3173
3174 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
3175
3176         * graphite-clast-to-gimple.c (print_clast_stmt): New.
3177         (gloog): Print to dump_file the generated clast.
3178         * graphite-clast-to-gimple.h (print_clast_stmt): Declared.
3179         * graphite-interchange.c (pbb_do_interchange): Fix dump formatting.
3180
3181 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
3182
3183         * graphite-poly.c (extend_scattering): Increment
3184         PBB_NB_LOCAL_VARIABLES by the number of added dimensions.
3185
3186 2009-06-24  Sebastian Pop  <sebastian.pop@amd.com>
3187
3188         * graphite-interchange.c (compute_array_size_poly): Added exit of
3189         recursion condition.  Continue iterating even after the first equality.
3190         (compute_array_size): Same.
3191
3192 2009-06-24  Li Feng  <nemokingdom@gmail.com>
3193
3194         * gcc.dg/graphite/graphite_autopar/force-parallel-1.c: Update
3195         -fdump-tree-final_cleanup to -fdump-tree-optimized.
3196         * gcc.dg/graphite/graphite_autopar/force-parallel-2.c: Ditto.
3197         * gcc.dg/graphite/graphite_autopar/force-parallel-3.c: Ditto.
3198         * gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: Ditto.
3199
3200 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3201
3202         * sese.c (expand_scalar_variables_stmt): Expand scalar variables
3203         only when the use verifies is_gimple_reg.
3204
3205 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3206
3207         * graphite-clast-to-gimple.c (build_cloog_prog): Fix memory corruption.
3208         Allocate scaldims after call to unify_scattering_dimensions.
3209
3210 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3211
3212         * graphite-clast-to-gimple.c (translate_clast): Fix memory leak.
3213
3214 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3215             Albert Cohen  <albert.cohen@inria.fr>
3216
3217         * graphite-blocking.c (pbb_strip_mine_loop_depth): Do not use local
3218         variables for the strip mining.
3219
3220 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3221             Pranav Garg  <pranav.garg2107@gmail.com>
3222
3223         * Makefile.in (OBJS-common): Added graphite-blocking.o.
3224         (graphite-sese-to-poly.o): Moved down to be in lexicographical order.
3225         (graphite-blocking.o): New rule.
3226         (graphite-poly.o, graphite-ppl.o): Moved to be in lexicographical order.
3227         * graphite-blocking.c: New.
3228         * graphite-poly.c (apply_poly_transforms): Call scop_do_strip_mine for
3229         flag_loop_strip_mine.
3230         (psct_scattering_dim_for_loop_depth): New.
3231         * graphite-poly.h (scop_do_strip_mine): Declared.
3232         (psct_add_local_variable): Increment PBB_NB_LOCAL_VARIABLES.
3233         * tree-ssa-loop.c (gate_graphite_transforms): Do not fail when using
3234         flag_loop_strip_mine.
3235
3236 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3237
3238         * graphite-poly.c (extend_scattering): Avoid initializing and freeing
3239         a GMP value and a PPL coefficient at each iteration of a loop.
3240
3241 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3242
3243         * graphite-dependences.c (dependence_polyhedron): Do not use
3244         pbb_nb_scattering_dims anymore.  Use pbb_nb_scattering_orig and
3245         pbb_nb_scattering_transform.
3246         (graphite_legal_transform_dr): Same.
3247         * graphite-poly.c (extend_scattering): Same.
3248         (unify_scattering_dimensions): Same.
3249         (print_scattering_function): Same.
3250         (new_poly_bb): Initialize PBB_NB_SCATTERING_TRANSFORM and
3251         PBB_NB_LOCAL_VARIABLES.
3252         * graphite-poly.h (pbb_nb_scattering): Removed declaration.
3253         (struct poly_bb): Added nb_local_variables and nb_scattering_transform.
3254         (PBB_NB_LOCAL_VARIABLES, PBB_NB_SCATTERING_TRANSFORM): New.
3255         (pbb_nb_scattering_orig, pbb_nb_scattering_transform): New.
3256         (pbb_nb_scattering_dims, pbb_nb_scattering): Removed.
3257         (pbb_nb_scattering_transform): New.
3258         (pbb_nb_local_vars): Return PBB_NB_LOCAL_VARIABLES.
3259         (psco_scattering_dim): Add assert on parameters.
3260         (psct_scattering_dim): Same.
3261         (psct_scattering_dim_for_loop_depth): Declared.
3262         (psct_local_var_dim): New.
3263         (psco_iterator_dim, psco_parameter_dim): Add assert on parameters.
3264         (psct_iterator_dim, psct_parameter_dim): Same.  To maintain the
3265         correct layout, call pbb_nb_local_vars.
3266         (psct_add_local_variable, psct_add_scattering_dimension): New.
3267         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons):
3268         Initialize PBB_NB_SCATTERING_TRANSFORM.
3269
3270 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3271
3272         * graphite-ppl.c (set_inhomogeneous): Renamed ppl_set_inhomogeneous.
3273         (set_coef): Renamed ppl_set_coef.
3274         * graphite-ppl.h (ppl_set_inhomogeneous, ppl_set_coef): Declared.
3275
3276 2009-06-23  Sebastian Pop  <sebastian.pop@amd.com>
3277
3278         * graphite-dependences.c (build_pairwise_scheduling_inequality): Don't
3279         test a boolean against 1.
3280         * graphite-interchange.c (pbb_interchange_loop_depths): Do not build
3281         a new polyhedron for the PBB_TRANSFORMED_SCATTERING.
3282         (pbb_do_interchange): Returns true when a transform has been performed.
3283         (scop_do_interchange): Same.
3284         * graphite-poly.c (apply_poly_transforms): Use the return value of
3285         scop_do_interchange.
3286         * graphite-poly.h (scop_do_interchange): Update declaration.
3287
3288 2009-06-23  Tobias Grosser  <grosser@fim.uni-passau.de>
3289
3290         * graphite-clast-to-gimple.c (gloog): Reset loop->aux right
3291         after last use.
3292         * sese.c (sese_reset_aux_in_loops): New.
3293         * sese.h (sese_reset_aux_in_loops): New.
3294
3295 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3296
3297         * graphite-sese-to-poly.c (scan_tree_for_params_int): Pass in the
3298         multiplier and multiply the constant by the multiplier.
3299         (scan_tree_for_params): Bound the multiplier to its MULT_EXPR.
3300         (build_poly_dr): Do not use the multiplier to define the subscript.
3301
3302 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3303
3304         * graphite-poly.c (new_poly_dr): Pass an extra argument for the
3305         compiler's data reference.  Initialize PDR_CDR.
3306         (print_pdr): Call dump_data_reference.
3307         * graphite-poly.h (struct poly_dr): Rename black_box into pbb.
3308         Add compiler_dr field.
3309         (PDR_BB): Renamed PDR_PBB.
3310         (PDR_CDR): New.
3311         * graphite-sese-to-poly.c (build_poly_dr): Pass to new_poly_dr
3312         GCC's data reference representation.
3313         * tree-data-ref.c (debug_data_references, debug_data_reference): New.
3314         * tree-data-ref.h (debug_data_references, debug_data_reference): Decl.
3315
3316 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3317
3318         * graphite-poly.c (print_scattering_function): Also print the layout.
3319         * graphite-poly.h (pbb_nb_local_vars): New.
3320
3321 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3322
3323         * graphite-poly.c (print_pbb_domain): Also print the layout names.
3324
3325 2009-06-19  Sebastian Pop  <sebastian.pop@amd.com>
3326
3327         * graphite-poly.c (print_pdr, debug_pdr): New.
3328         * graphite-poly.h (print_pdr, debug_pdr): Declared.
3329         (PDR_BASE): Removed.
3330
3331 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
3332
3333         * gcc.dg/graphite/interchange-{1..7}.c: New avatars of
3334         ltrans-{1..6,8}.c.
3335
3336 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
3337
3338         * graphite-interchange.c (compute_subscript): Allow also -1 in the
3339         subscript identification column.
3340         (pbb_do_interchange): Print to dump_file that some loops "will be
3341         interchanged".  Rely on that chain of characters in the testcases.
3342         * gcc.dg/graphite/interchange-0.c: New.
3343         * gcc.dg/graphite/graphite.exp: Iterate over the testsuite
3344         interchange-*.c files and compile them with -floop-interchange.
3345
3346 2009-06-18  Pranav Garg  <pranav.garg2107@gmail.com>
3347
3348         * graphite-interchange.c (interchange_profitable_p): Renamed
3349         pbb_interchange_profitable_p.
3350
3351 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
3352             Harsha Jagasia  <harsha.jagasia@amd.com>
3353             Pranav Garg  <pranav.garg2107@gmail.com>
3354
3355         * graphite-interchange.c (interchange_profitable_p): Make static.
3356         (pbb_interchange_loop_depths, pbb_do_interchange,
3357         scop_do_interchange): New.
3358         * graphite-poly.c (apply_poly_transforms): Call scop_do_interchange
3359         for flag_loop_interchange.
3360         * graphite-poly.h (scop_do_interchange): Declared.
3361         * tree-ssa-loop.c (gate_graphite_transforms): Do not fail when
3362         flag_loop_interchange is used.
3363
3364 2009-06-18  Sebastian Pop  <sebastian.pop@amd.com>
3365
3366         * graphite-dependences.c (dependence_polyhedron): Update use of
3367         pbb_nb_scattering_dims.
3368         * graphite-poly.h (pbb_nb_scattering_dims): Do not pass SCOP.
3369         (pbb_nb_scattering): Update use of pbb_nb_scattering_dims.
3370         (psco_scattering_dim, psct_scattering_dim, psco_iterator_dim,
3371         psct_iterator_dim, psco_parameter_dim, psct_parameter_dim): New.
3372
3373 2009-06-16  Sebastian Pop  <sebastian.pop@amd.com>
3374
3375         * graphite.c: Cleanup foo.
3376
3377 2009-06-16  Sebastian Pop  <sebastian.pop@amd.com>
3378
3379         * Merge from mainline (r143684:148293).
3380         * Disabled libpcp until it gets fixed.
3381
3382 2009-06-05  Sebastian Pop  <sebastian.pop@amd.com>
3383             Harsha Jagasia  <harsha.jagasia@amd.com>
3384
3385         * graphite-interchange.c: New.
3386         * Makefile.in (graphite-interchange.o): New.
3387         * graphite-poly.h (interchange_profitable_p): Declared.
3388         * graphite-ppl.h (value_max): New.
3389
3390 2009-06-04  Sebastian Pop  <sebastian.pop@amd.com>
3391
3392         * graphite-dependences.c (dependence_polyhedron): Use pdr_dim.
3393         * graphite-poly.h: Fix some comments.
3394         (pdr_dim): New.
3395         (pdr_scop): New.
3396
3397 2009-06-04  Sebastian Pop  <sebastian.pop@amd.com>
3398
3399         * graphite-poly.h
3400         (pdr_accessp_nb_subscripts): Renamed pdr_nb_subscripts.
3401         (pdr_accessp_nb_iterators): Renamed pdr_dim_iter_domain.
3402         (pdr_accessp_nb_params): Renamed pdr_nb_params.
3403         (pdr_accessp_alias_set_dim): Renamed pdr_alias_set_dim.
3404         (pdr_accessp_subscript_dim): Renamed pdr_subscript_dim.
3405         (pdr_accessp_iterator_dim): Renamed pdr_iterator_dim.
3406         (pdr_accessp_param_dim): Renamed pdr_parameter_dim.
3407         (pbb_nb_loops): Renamed pbb_dim_iter_domain.
3408         * graphite-clast-to-gimple.c: Same.
3409         * graphite-dependences.c: Same.
3410         * graphite-poly.c: Same.
3411         * graphite-sese-to-poly.c: Same.
3412
3413 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
3414
3415         * graphite-clast-to-gimple.c (build_iv_mapping): Insert full
3416         expressions for an IV rename, as returned by clast_to_gcc_expression.
3417         (copy_renames): Rename new_name to expr.
3418         * sese.c (debug_rename_elt): Same.
3419         (get_rename): Same.
3420         (set_rename): Same.
3421         (sese_adjust_liveout_phis): Call force_gimple_operand before using
3422         the information from the rename map.
3423         (rename_variables_in_stmt): Same.
3424         (add_loop_exit_phis): Rename new_name to expr.
3425         (insert_loop_close_phis): Same.
3426         (add_guard_exit_phis): Same.  Call force_gimple_operand.
3427         * sese.h (struct rename_map_elt): Rename new_name to expr.
3428         (new_rename_map_elt): Same.
3429
3430 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
3431
3432         * graphite-clast-to-gimple.c (build_iv_mapping): Use set_rename.
3433         * sese.c (set_rename): Make it extern.
3434         * sese.h (set_rename): Declared.
3435
3436 2009-06-03  Sebastian Pop  <sebastian.pop@amd.com>
3437
3438         * graphite-poly.c (extend_scattering): Free values.
3439         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Pointset_Powerset):
3440         Free iterators.
3441         (ppl_print_powerset_matrix): Same.
3442         * graphite-scop-detection.c (free_scops_1): New.
3443         (limit_scops): Call free_scops_1.
3444         * graphite-sese-to-poly.c (build_scop_bbs_1): Free dom.
3445         (build_poly_dr): Free PPL coefficients.
3446         * tree-parloops.c (rewrite_all_phi_nodes_with_iv): Free bbs.
3447
3448 2009-06-02  Sebastian Pop  <sebastian.pop@amd.com>
3449
3450         * graphite-dependences.c: New.
3451         * graphite-data-ref.c: Removed.
3452         * graphite-data-ref.h: Removed.
3453         * Makefile.in (graphite-data-ref.o): Removed.
3454         (graphite-dependences.o): Added.
3455         * graphite-clast-to-gimple.c: Remove dependence on graphite-data-ref.h.
3456         * graphite-poly.c: Same.
3457         Move the data dependence testing to graphite-dependences.c.
3458
3459 2009-05-19  Tobias Grosser  <grosser@fim.uni-passau.de>
3460
3461         * graphite-scop-detection.c (graphite_can_represent_loop): Renamed
3462         from graphite_cannot_represent_loop. Code refactored.
3463         (scopdet_basic_block_info): Call graphite_can_represent_loop.
3464
3465 2009-05-17  Li Feng  <nemokingdom@gmail.com>
3466
3467         * gcc.dg/graphite/graphite_autopar/graphite_autopar.exp:
3468         Cover all the testcases (not only the filtered ones).
3469
3470 2009-05-17  Tobias Grosser  <grosser@fim.uni-passau.de>
3471
3472         * graphite-scop-detection.c (stmt_simple_for_scop_p): Remove
3473         unnecessary check. Update comments. Move check for REAL_TYPE here.
3474         (harmful_stmt_in_bb): Remove checks for conditions. This is already
3475         done in (stmt_simple_for_scop_p).
3476
3477 2009-05-14 Tobias Grosser  <grosser@fim.uni-passau.de>
3478
3479         * graphite.c (print_global_statistics): New.
3480         (print_graphite_scop_statistic): New.
3481         (print_graphite_statistics): New.
3482         (graphite_initialize, graphite_transform_loops): Print statistics.
3483         * graphite-scop-detection (build_scops): Print statistics.
3484         (print_graphite_scop_statistics): New.
3485         (print_graphite_statistics): New.
3486
3487 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3488
3489         * graphite-clast-to-gimple.c (struct clast_name_index): Removed.
3490         (debug_clast_name_index): Removed.
3491         (debug_clast_name_indexes_1): Removed.
3492         (debug_clast_name_indexes): Removed.
3493         (clast_name_index_elt_info): Removed.
3494         (eq_clast_name_indexes): Removed.
3495         (clast_name_to_index): Removed.
3496         (new_clast_name_index): Removed.
3497         (save_clast_name_index): Removed.
3498         (save_var_name): Moved...
3499         (init_sese_params_index): Removed.
3500         (clast_name_to_gcc): Remove use of name_tree.
3501         (initialize_cloog_names): Same.
3502         (gloog): Do not call init_sese_params_index.
3503         * graphite-sese-to-poly.c (save_var_name): ...here.
3504         (parameter_index_in_region): New.
3505         * sese.c (new_sese): Initialize SESE_PARAMS_NAMES.
3506         (parameter_index_in_region): Removed.
3507         (is_parameter): Remove use of name_tree.
3508         * sese.h (struct name_tree): Removed.
3509         (struct sese): Remove use of name_tree.  New field params_names.
3510         (SESE_PARAMS_NAMES): New.
3511         (SESE_PARAMS): Remove duplicate.
3512         (parameter_index_in_region): Removed.
3513         (sese_nb_params): Remove use of name_tree.
3514         (struct clast_name_index): New.
3515         (new_clast_name_index): New.
3516         (clast_name_to_index): New.
3517         (save_clast_name_index): New.
3518         (debug_clast_name_index): New.
3519         (debug_clast_name_indexes_1): New.
3520         (debug_clast_name_indexes): New.
3521         (clast_name_index_elt_info): New.
3522         (eq_clast_name_indexes): New.
3523
3524 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3525
3526         * graphite-clast-to-gimple.c (compute_cloog_iv_types_1): Call
3527         pbb_to_depth_to_oldiv.  Remove call to oldiv_for_loop.
3528         (graphite_loop_normal_form): Do not pass region.  Do not
3529         initialize SESE_OLDIVS.
3530         (build_graphite_loop_normal_form): Update call to
3531         graphite_loop_normal_form.
3532         * sese.c (debug_oldivs): Removed.
3533         (new_sese): Do not initialize SESE_OLDIVS.
3534         (free_sese): Do not free SESE_OLDIVS.
3535         (oldiv_for_loop): Removed.
3536         * sese.h (struct sese): Remove old_ivs.
3537         (SESE_OLDIVS): Removed.
3538         (oldiv_for_loop): Removed.
3539
3540 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3541
3542         * graphite-clast-to-gimple.c (clast_name_to_gcc): Pass newivs,
3543         remove ivstack.  Remove call to loop_iv_stack_get_iv_from_name,
3544         replaced by a call to newivs_to_depth_to_newiv.
3545         (clast_to_gcc_expression): Pass newivs, remove ivstack.
3546         (clast_to_gcc_expression_red): Same.
3547         (gcc_type_for_clast_expr): Same.
3548         (gcc_type_for_clast_eq): Same.
3549         (graphite_translate_clast_equation): Same.
3550         (graphite_create_guard_cond_expr): Same.
3551         (graphite_create_new_guard): Same.
3552         (graphite_create_new_loop): Same.
3553         (build_iv_mapping): Same.
3554         (translate_clast): Same.
3555         (gloog): Same.
3556         (loop_iv_stack_patch_for_consts): Removed.  *
3557         sese.c (iv_stack_entry_is_constant): Removed.
3558         (iv_stack_entry_is_iv): Removed.
3559         (loop_iv_stack_push_iv): Removed.
3560         (loop_iv_stack_insert_constant): Removed.
3561         (loop_iv_stack_pop): Removed.
3562         (loop_iv_stack_get_iv): Removed.
3563         (loop_iv_stack_get_iv_from_name): Removed.
3564         (debug_loop_iv_stack): Removed.
3565         (free_loop_iv_stack): Removed.
3566         (loop_iv_stack_remove_constants): Removed.  *
3567         sese.h (iv_stack_entry_kind): Removed.
3568         (iv_stack_entry_data_union): Removed.
3569         (iv_stack_entry_struct): Removed.
3570         (iv_stack_entry_p): Removed.
3571         (debug_oldivs, debug_loop_iv_stack, loop_iv_stack_insert_constant,
3572         loop_iv_stack_get_iv_from_name, loop_iv_stack_push_iv,
3573         loop_iv_stack_get_iv, loop_iv_stack_remove_constants,
3574         loop_iv_stack_pop, free_loop_iv_stack): Removed.
3575         (gbb_loop_at_index): Fix indenting.
3576         (gbb_loop_index): Removed.
3577
3578 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3579
3580         * graphite-clast-to-gimple.c (clast_name_to_gcc): Do not use strcmp.
3581         Call clast_name_to_index.
3582
3583 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3584
3585         * graphite-clast-to-gimple.c (clast_name_to_gcc): Pass region,
3586         do not pass params.  Get params from SESE_PARAMS.
3587         (clast_to_gcc_expression): Same.
3588         (clast_to_gcc_expression_red): Same.
3589         (gcc_type_for_clast_eq): Same.
3590         (graphite_translate_clast_equation): Same.
3591         (graphite_create_new_loop): Same.
3592         * sese.c (rename_variables_in_stmt): Fix comment.
3593
3594 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3595
3596         * graphite-clast-to-gimple.c (graphite_create_new_loop): Pass
3597         newivs_index.
3598         Call save_clast_name_index.
3599         (translate_clast): Pass newivs_index.
3600         (gloog): Create and free newivs_index.
3601
3602 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3603
3604         * graphite-clast-to-gimple.c (clast_name_index): New structure.
3605         (clast_name_index_p): New type.
3606         (debug_clast_name_index): New.
3607         (debug_clast_name_indexes_1): New.
3608         (debug_clast_name_indexes): New.
3609         (clast_name_index_elt_info): New.
3610         (eq_clast_name_indexes): New.
3611         (clast_name_to_index): New.
3612         (new_clast_name_index): New.
3613         (save_clast_name_index): New.
3614         (init_sese_params_index): New.
3615         (gloog): Call init_sese_params_index.
3616         * graphite-clast-to-gimple.h (debug_clast_name_indexes): Declared.
3617         * sese.c (new_sese): Initialize SESE_PARAMS_INDEX.
3618         (free_sese): Free SESE_PARAMS_INDEX.
3619         * sese.h (struct sese): Add params_index.
3620         (SESE_PARAMS_INDEX): New.
3621
3622 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3623
3624         * graphite-clast-to-gimple.c (newivs_to_depth_to_newiv): New.
3625         (graphite_create_new_loop): Pass the newivs vector.  Push the
3626         newly created IV to newivs.
3627         (translate_clast): Pass the newivs vector.
3628         (gloog): Create and destroy the newivs vector.
3629
3630 2009-05-13  Sebastian Pop  <sebastian.pop@amd.com>
3631
3632         * graphite-clast-to-gimple.c (pbb_to_depth_to_oldiv): New.
3633         (graphite_loop_normal_form): Initialize loop->aux with the unique
3634         IV that has been created.
3635
3636 2009-05-13 Tobias Grosser  <grosser@fim.uni-passau.de>
3637
3638         * tree-chrec.c (evolution_function_right_is_integer_cst): Allow
3639         scev with parameters in the base part. They where forbidden
3640         exidently.
3641
3642 2009-05-11  Li Feng  <nemokingdom@gmail.com>
3643
3644         * gcc.dg/graphite/graphite.exp: Set different default
3645         compile options by file names.
3646         * gcc.dg/graphite/block{0-6}.c: Remove dg-option line.
3647         * gcc.dg/graphite/id-{1-9}.c: Ditto.
3648         * gcc.dg/graphite/scop-{0-20}.c: Ditto.
3649         * gcc.dg/graphite/scop-matmult.c: Ditto.
3650
3651 2009-05-08  Li Feng <nemokingdom@gmail.com>
3652
3653         * gcc.dg/graphite/graphite_autopar/graphite_autopar.exp: New.
3654         * gcc.dg/graphite/graphite_autopar/force-parallel-1.c: New.
3655         * gcc.dg/graphite/graphite_autopar/force-parallel-2.c: New.
3656         * gcc.dg/graphite/graphite_autopar/force-parallel-3.c: New.
3657
3658 2009-05-07  Tobias Grosser  <grosser@fim.uni-passau.de>
3659
3660         * graphite-scop-detection (build_scops_1): Fix little bug introduced
3661         by final cleanup.
3662
3663 2009-05-07  Tobias Grosser  <grosser@fim.uni-passau.de>
3664
3665         * graphite-scop-detection.c (graphite_can_represent_scev): Only
3666         allow integer constant strides.
3667         (graphite_can_represent_expr): Depend on outermost_loop.
3668         (stmt_simple_memref_p, graphite_cannot_represent_loop,
3669         harmful_stmt_in_bb, is_simple_operand, stmt_simple_for_scop_p,
3670         build_scops_1): Same.
3671         (scopdet_basic_block_info): Same and insert layered SCoP
3672         detection.
3673         (try_generate_gimple_bb): Cleanup.
3674         (build_scops): Enable data references.
3675
3676         * gcc.dg/graphite/id-5.c: New.
3677         * gcc.dg/graphite/id-9.c: New.
3678         * tree-chrec.c (evolution_function_right_is_integer_cst): New.
3679         * tree-chrec.h (evolution_function_right_is_integer_cst): New.
3680
3681 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
3682
3683         * sese.c (expand_scalar_variables_ssa_name): Only build expressions,
3684         that we have not yet built for this SCoP.
3685
3686 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
3687
3688         * sese.c (expand_scalar_variables_expr): Fix expand_scalar_variables
3689         for complex numbers.
3690
3691 2009-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
3692
3693         * graphite-ppl.c: Fix build if cloog is not available.
3694
3695 2009-05-04  Li Feng  <nemokingdom@gmail.com>
3696
3697         * tree-parloops.c (loop_parallel_p): Remove construction of
3698         NITER and REDUCTION_LIST.
3699         (try_get_loop_niter): New.
3700         (try_create_reduction_list): New.
3701         (parallelize_loops): Bypass the failed checkings in autopar
3702         when can_be_parallel in loop structure is set to true.
3703
3704 2009-05-01  Tobias Grosser  <grosser@fim.uni-passau.de>
3705
3706         * gcc.dg/graphite/id-6.c: Update testcase.
3707         * gcc.dg/graphite/scop-3.c: Dito.
3708
3709 2009-05-01  Tobias Grosser  <grosser@fim.uni-passau.de>
3710
3711         * graphite-scop-detection.c (stmt_simple_for_scop_p):
3712         Enable EQ_EXPR and NE_EXPR again.
3713
3714 2009-04-30  Tobias Grosser  <grosser@fim.uni-passau.de>
3715
3716         * graphite-scop-detection.c (graphite_can_represent_scev):
3717         Add check if scev is affine multivariate.
3718         (harmful_stmt_in_bb): Check if we can represent the conditions.
3719         (scopdet_basic_block_info (basic_block bb, VEC): Pass the loop to
3720         harmful_stmt_in_bb.
3721         * gcc.dg/graphite/id-7.c: New.
3722
3723 2009-04-30  Tobias Grosser  <grosser@fim.uni-passau.de>
3724
3725         * graphite-sese-to-poly.c (bb_contains_non_iv_scalar_phi_nodes):
3726         Check all bbs in region, not only the bbs that are represented in
3727         GRAPHITE.
3728         (build_poly_scop): Add newline.
3729         * gcc.dg/graphite/id-8.c: New.
3730
3731 2009-04-30  Li Feng  <nemokingdom@gmail.com>
3732
3733         * cfgloop.c (alloc_loop): Initialize can_be_parallel to false
3734         when loop initialize.
3735         * cfgloop.h (struct loop): Introduce flag can_be_parallel.
3736         * common.opt: Declare flag_graphite_force_parallel.
3737         * graphite-clast-to-gimple.c (translate_clast): Mark the innermost
3738         loop parallel.
3739         * graphite-poly.c (apply_poly_transforms): Introduce
3740         flag_graphite_force_parallel.
3741         * tree-ssa-loop.c (gate_graphite_transforms): ditto.
3742         * toplev.c (process_options): ditto and replace a not correctly
3743         encoded space.
3744
3745 2009-04-30  Li Feng  <nemokingdom@gmail.com>
3746
3747         * graphite-clast-to-gimple.c (loop_iv_stack_patch_for_consts):
3748         Change the call of gbb_loop_at_index and/or gbb_loop_index due
3749         to the redefinition.
3750         (compute_cloog_iv_types_1): ditto.
3751         (build_iv_mapping): ditto.
3752         * graphite-sese-to-poly.c (new_gimple_bb): Remove GBB_LOOPS related
3753         initialization.
3754         (free_gimple_bb): Removed GBB_LOOPS related free part.
3755         (build_bb_loops): Removed.
3756         * sese.h (struct gimple_bb): Removed loops.
3757         (GBB_LOOPS): Removed.
3758         (gbb_loop_at_index): Instead of using GBB_LOOPS, we use sese instead.
3759         (gbb_loop_index): ditto.
3760
3761 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
3762
3763         * graphite-scop-detection.c (graphite_can_represent_scev): Do not
3764         allow non constant strides.
3765         * gcc.dg/graphite/scop-20.c: New.
3766
3767 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3768
3769         * graphite-scop-detection.c (dot_all_scops): Fix system call
3770         return value warning.
3771         (dot_scop): Same.
3772
3773 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3774
3775         * gcc.dg/graphite/id-6.c: Fix pattern.
3776         * gcc.dg/graphite/scop-3.c: Same.
3777
3778 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3779
3780         * graphite-poly.c (map_into_dep_poly, map_dr_into_dep_poly,
3781         build_pairwise_constraint, dr_equality_constraints,
3782         build_pairwise_scheduling_equality,
3783         build_pairwise_scheduling_inequality, lexicographically_gt_p,
3784         build_lexicographically_gt_constraint, dependence_polyhedron,
3785         graphite_legal_transform_dr, graphite_legal_transform_bb,
3786         graphite_legal_transform): New.
3787         * graphite-poly.h (graphite_legal_transform): Declared.
3788         * graphite-sese-to-poly.c (build_poly_scop): Call to
3789         graphite_legal_transform is disabled for the moment.
3790
3791 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3792
3793         * graphite-poly.h (pbb_nb_scattering_dims): New.
3794         (pbb_nb_scattering): Use it.
3795
3796 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3797
3798         * graphite-ppl.c (ppl_insert_dimensions_pointset): Add
3799         Pointset_Powerset version of ppl_insert_dimensions.
3800         * graphite-ppl.h (ppl_insert_dimensions_pointset): Declared.
3801
3802 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3803
3804         * graphite-ppl.c (ppl_insert_dimensions): Fix formatting.
3805
3806 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3807
3808         * graphite-poly.h: Fix comment.
3809
3810 2009-04-24  Sebastian Pop  <sebastian.pop@amd.com>
3811
3812         * graphite-sese-to-poly.c (build_poly_dr): Fix data ref multiplier.
3813
3814 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
3815
3816         * sese.c (expand_scalar_variables_stmt): Only iterate over the old
3817         statements.
3818
3819 2009-04-24  Tobias Grosser  <grosser@fim.uni-passau.de>
3820
3821         * graphite-sese-to-poly.c (var_used_in_not_loop_header_phi_node): New.
3822         (graphite_stmt_p): Represent bbs necessary to build the phi nodes of
3823         conditions.
3824
3825 2009-04-20  Sebastian Pop  <sebastian.pop@amd.com>
3826
3827         * graphite-scop-detection.c (stmt_simple_for_scop_p): Do not
3828         handle EQ_EXPR and NE_EXPR.
3829
3830 2009-04-17  Tobias Grosser  <grosser@fim.uni-passau.de>
3831
3832         * graphite-poly.h (poly_dr): Fix comment.
3833
3834 2009-04-09  Sebastian Pop  <sebastian.pop@amd.com>
3835             Tobias Grosser  <grosser@fim.uni-passau.de>
3836
3837         * graphite-poly.c (new_poly_bb): Do not initialize PBB_DOMAIN
3838         with a zero dimension polyhedron.
3839         (find_scop_parameters): Move the call to scop_set_nb_params here.
3840         (build_loop_iteration_domains): Store in loop->aux the iteration
3841         domain polyhedron.
3842         (build_scop_iteration_domain): Fix PBB_DOMAIN for bbs not surrounded
3843         by any loop in scop.
3844         (build_poly_scop): Do not call scop_set_nb_params.
3845
3846 2009-04-09  Sebastian Pop  <sebastian.pop@amd.com>
3847             Tobias Grosser  <grosser@fim.uni-passau.de>
3848
3849         * graphite-sese-to-poly.c (add_condition_to_pbb): Pass code to
3850         add_condition_to_domain not GT_EXPR.
3851
3852 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
3853
3854         * graphite-ppl.c (debug_ppl_powerset_matrix): New.
3855         * graphite-ppl.h (debug_ppl_powerset_matrix): New.
3856         * graphite-sese-to-poly.c (add_condition_to_pbb): Use
3857         upper_bound_assign to calculate unions.
3858         * gcc.dg/graphite/id-6.c: New.
3859
3860 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
3861
3862         * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Do not
3863         handle abnormal edges.
3864
3865 2009-04-09  Tobias Grosser  <grosser@fim.uni-passau.de>
3866
3867         * graphite-poly.c (new_poly_dr, free_poly_dr): New.
3868         (free_poly_bb): Also free poly_drs.
3869         * graphite-poly.h (new_poly_dr, free_poly_dr): New.
3870         (poly_dr): Polyhedron to Pointset_Powerset.
3871         (pdr_accessp_nb_subscripts): Same.
3872         * graphite-sese-to-poly.c (build_poly_dr): Same. And actually build
3873         poly_drs.
3874
3875 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3876
3877         * graphite-clast-to-gimple.c (initialize_cloog_names): Change cloog
3878         names into more meaningful names.
3879
3880 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3881
3882         * gfortran.dg/graphite/interchange-1.c: New.
3883         * gfortran.dg/graphite/interchange-2.c: New.
3884
3885 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3886
3887         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not build
3888         the reduction_list.
3889         * tree-parloops.c (rewrite_phi_with_iv): New.
3890         (rewrite_all_phi_nodes_with_iv): New.
3891         (canonicalize_loop_ivs): Call them.
3892
3893 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3894
3895         * graphite-sese-to-poly.c (try_generate_gimple_bb): Use
3896         graphite_find_data_references_in_stmt.
3897         * tree-data-ref.c (graphite_find_data_references_in_stmt): New.
3898         * tree-data-ref.h (graphite_find_data_references_in_stmt): Declared.
3899
3900 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3901
3902         * sese.c (add_loop_exit_phis): Don't fail on non SSA_NAME renames.
3903
3904 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3905
3906         * graphite-sese-to-poly.c (build_scop_bbs_1): Use bb_in_sese_p
3907         instead of bb_in_region.
3908         (flag_bb_in_region): Same.  Renamed flag_bb_in_sese.
3909         (build_sese_conditions): Use flag_bb_in_sese.
3910         * sese.c (register_bb_in_sese): Removed.
3911         (new_sese): Remove initialization of SESE_REGION_BBS.
3912         (free_sese): Do not free SESE_REGION_BBS.
3913         * sese.h (struct sese): Remove field region_basic_blocks.
3914         (SESE_REGION_BBS): Removed.
3915         (bb_in_sese_p): Implement in function of bb_in_region.
3916
3917 2009-04-08  Sebastian Pop  <sebastian.pop@amd.com>
3918
3919         * graphite-scop-detection.c (limit_scops): Deal only with single exit
3920         loops.
3921
3922 2009-04-08  Tobias Grosser  <grosser@fim.uni-passau.de>
3923
3924         * graphite-scop-detection.c (stmt_simple_for_scop_p): Allow NE_EXPR
3925         and EQ_EXPR.
3926         * graphite-sese-to-poly.c (create_linear_expr_from_tree): New.
3927         (add_condition_to_domain): New.
3928         (add_condition_to_pbb): New.
3929         (add_conditions_to_domain): Cleanup and handle of NE_EXPR and EQ_EXPR.
3930         * gcc.dg/graphite/scop-3.c: Update number of detected SCoPs.
3931
3932 2009-04-08  Tobias Grosser  <grosser@fim.uni-passau.de>
3933
3934         * graphite-clast-to-gimple.c (build_cloog_prog): ppl_Polyhedron ->
3935         ppl_Pointset_Powerset.
3936         * graphite-poly.c (new_poly_bb, free_poly_bb): Same.
3937         * graphite-poly.h (poly_bb): poly_bb.domain Same.
3938         (pbb_nb_loops): Same.
3939         * graphite-sese-to-poly.c (build_loop_iteration_domains,
3940         add_conditions_to_domain): Same.
3941         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Pointset_Powerset): New.
3942         (ppl_print_polyhedron_matrix): ppl_Polyhedron_t ->
3943         ppl_const_Polyhedron_t.
3944         (ppl_print_powerset_matrix): New.
3945         * graphite-ppl.h (new_Cloog_Domain_from_ppl_Pointset_Powerset,
3946         ppl_print_powerset_matrix): New.
3947         (ppl_print_polyhedron_matrix): Updated.
3948
3949 2009-04-07  Sebastian Pop  <sebastian.pop@amd.com>
3950
3951         * tree-scalar-evolution.c (analyze_scalar_evolution_1): Fix comment.
3952
3953 2009-04-07  Sebastian Pop  <sebastian.pop@amd.com>
3954
3955         * graphite-poly.c (extend_scattering): Fix indenting.  Free cstr.
3956         (print_iteration_domains, debug_iteration_domain,
3957         debug_iteration_domains): New.
3958         * graphite-poly.h (print_iteration_domains, debug_iteration_domain,
3959         debug_iteration_domains): Declared.
3960         * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Fix
3961         indenting.
3962
3963 2009-04-03  Tobias Grosser  <grosser@fim.uni-passau.de>
3964             Sebastian Pop  <sebastian.pop@amd.com>
3965
3966         * graphite-poly.h (print_iteration_domain): New.
3967         * graphite-sese-to-poly.c (add_conditions_to_domain): Fixed bug.
3968         (build_sese_conditions_1, build_sese_conditions_after,
3969         build_sese_conditions_before): New.
3970         (build_sese_conditions): Rewritten.
3971
3972 2009-04-03  Sebastian Pop  <sebastian.pop@amd.com>
3973             Tobias Grosser  <grosser@fim.uni-passau.de>
3974
3975         Cleanup of code generation liveouts.
3976         * graphite-clast-to-gimple.c (translate_clast): Use a single
3977         rename_map instead of one per translated statement.
3978         Do not use SESE_LIVEOUT_RENAMES.
3979         (graphite_loop_normal_form): Do not use SESE_REDUCTION_LIST.
3980         (gloog): Do not use SESE_LIVEOUT_RENAMES.
3981         * graphite-scop-detection.c (harmful_stmt_in_bb): Return the close
3982         phi node of a reduction: when a loop contains a reduction used outside
3983         the loop, there should be a scalar close phi node on the exit block.
3984         * sese.c (new_sese): Do not initialize SESE_LIVEOUT,
3985         SESE_LIVEOUT_RENAMES, and SESE_REDUCTION_LIST.
3986         (free_sese): Do not free them.
3987         (sese_build_liveouts_use): Do not use them.
3988         (sese_build_liveouts_bb): Same.
3989         (sese_build_liveouts): Same.
3990         (sese_insert_phis_for_liveouts): Same.
3991         (sese_adjust_phis_for_liveouts): Same.  Renamed sese_adjust_liveout_phis.
3992         (defined_in_loop_p): New.
3993         (alive_after_loop): New.
3994         (close_phi_not_yet_inserted_p): New.
3995         (struct alep, alep_p): New.
3996         (add_loop_exit_phis): Remove from the rename_map all the names defined
3997         in the code generated loop.
3998         (insert_loop_close_phis): Traverse the rename_map passed to it.
3999         Don't use SESE_LIVEOUT_RENAMES.
4000         (default_liveout_before_guard): Renamed default_before_guard.
4001         (insert_guard_phis): Do not use SESE_LIVEOUT_RENAMES.
4002         (graphite_copy_stmts_from_block): Do not directly call set_rename.
4003         (register_sese_liveout_renames): Removed.
4004         (copy_bb_and_scalar_dependences): Do not call it.
4005         * sese.h (struct sese): Removed fields: liveout, liveout_renames, and
4006         reduction_list.
4007         (SESE_LIVEOUT): Removed.
4008         (SESE_LIVEOUT_RENAMES): Removed.
4009         (SESE_REDUCTION_LIST): Removed.
4010         (sese_build_liveouts): Removed.
4011         (sese_adjust_phis_for_liveouts): Renamed sese_adjust_liveout_phis.
4012         (insert_loop_close_phis): Pass a htab_t instead of a sese.
4013         (insert_guard_phis): Same.
4014         (rename_map_elt): Declare a VEC of them.
4015         * tree-parloops.c (canonicalize_loop_ivs): reduction_list contains
4016         trees not pointers to trees.
4017
4018         Rewrite in canonical close SSA form:
4019         * graphite-scop-detection.c (contains_only_close_phi_nodes): New.
4020         (limit_scops): Close the scop after the block containing the close phi
4021         nodes.
4022         (canonicalize_loop_closed_ssa): New.
4023         (canonicalize_loop_closed_ssa_form): New.
4024         (build_scops): Call canonicalize_loop_closed_ssa_form.
4025
4026         * graphite-sese-to-poly.c: Fix typos.
4027
4028 2009-04-03  Sebastian Pop  <sebastian.pop@amd.com>
4029
4030         * graphite-poly.c (print_scattering_function, print_pbb_domain):
4031         Extended.
4032         (dump_gbb_conditions, dump_gbb_cases, print_iteration_domain): New.
4033         (print_pbb): Add conditions.
4034
4035 2009-04-01  Tobias Grosser  <grosser@fim.uni-passau.de>
4036             Sebastian Pop  <sebastian.pop@amd.com>
4037
4038         * graphite-scop-detection.c (bb_in_sd_region): Use bb_in_region.
4039         * graphite-sese-to-poly.c (all_non_dominated_preds_marked_p): New.
4040         (build_scop_bbs_1): New.
4041         (build_scop_bbs): Rewrite.
4042         * sese.h (bb_in_region): New.
4043
4044 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4045
4046         * graphite-poly.c (new_poly_bb, free_poly_bb): Initialize/free
4047         poly_drs vector.
4048         (print_scop): Style.
4049         * graphite-poly.h (poly_bb): Add drs vector.
4050         (PBB_DRS): Add accessor.
4051         * graphite-sese-to-poly.c (build_poly_dr): New.
4052         (build_pbb_drs, build_scop_drs): New.
4053         (build_poly_scop): call build_scop_drs (Disabled at the moment).
4054
4055 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4056
4057         * tree-ssa-loop.c: Include forgotten toplev.h
4058
4059 2009-03-29  Tobias Grosser  <grosser@fim.uni-passau.de>
4060
4061         * graphite-poly.c: (apply_poly_transforms): sorry -> gcc_unreachable.
4062         * gcc.dg/graphite/pr37883.c: Remove -floop-*
4063         * gcc.dg/graphite/pr37928.c: Same
4064         * gcc.dg/graphite/pr38409.c: Same
4065         * gcc.dg/graphite/pr38498.c: Same
4066         * gcc.dg/graphite/pr38559.c: Same
4067         * gcc.dg/graphite/pr39335.c: Same
4068         * gcc.dg/graphite/pr39335_1.c: Same
4069         * gfortran.dg/graphite/block-2.f: Same
4070         * tree-ssa-loop.c (gate_graphite_transforms): Always fail if called
4071         with -floop-*.
4072
4073 2009-03-28  Tobias Grosser  <grosser@fim.uni-passau.de>
4074
4075         * graphite-sese-to-poly.c (ref_nb_loops, build_access_matrix_with_af,
4076         build_access_matrix, build_scop_data_accesses): Remove access function
4077         building. (We get a new version soon).
4078         (build_bb_loops, scan_tree_for_params_right_scev): Update.
4079         * sese.h (nb_loops_around_loop_in_sese): Remove.
4080         (sese_loop_depth): Do not use SESE_LOOP_NEST any more.
4081
4082 2009-03-27  Tobias Grosser  <grosser@fim.uni-passau.de>
4083             Sebastian Pop  <sebastian.pop@amd.com>
4084
4085         * graphite-scop-detection.c (struct scopdet_info): Rename last
4086         field to exit.
4087         (scopdet_basic_block_info, build_scops_1): Don't use
4088         CDI_POST_DOMINATORS.  CDI_POST_DOMINATORS should never be used.
4089
4090 2009-03-26  Tobias Grosser  <grosser@fim.uni-passau.de>
4091             Sebastian Pop  <sebastian.pop@amd.com>
4092
4093         * graphite-clast-to-gimple.c (gloog): Call sese_build_liveouts.
4094         * sese.c (sese_build_liveouts_use): Renamed from
4095         sese_build_livein_liveouts_use. Remove liveins.
4096         (sese_build_liveouts_bb): Renamed from sese_build_livein_liveouts_bb.
4097         Call sese_build_liveouts_use.
4098         (sese_build_liveouts): Renamed from sese_build_livein_liveouts.
4099         Call sese_build_liveouts_bb.
4100         (new_sese, free_sese): Remove liveins.
4101         (sese_add_exit_phis_var): Deleted.
4102         (sese_insert_phis_for_liveouts): Call sese_add_exit_phis_edge
4103         directly.
4104         (graphite_copy_stmts_from_block): Remove SESE_NUM_VER.
4105
4106         * sese.h (sese): Remove num_ver and livein.
4107         (SESE_LIVEIN, SESE_LIVEIN_VER, SESE_NUM_VER): Removed.
4108
4109 2009-03-25  Tobias Grosser  <grosser@fim.uni-passau.de>
4110
4111         * graphite-sese-to-poly.c (build_scop_scattering): Fix compile.
4112
4113 2009-03-25  Tobias Grosser  <grosser@fim.uni-passau.de>
4114
4115         * graphite-sese-to-poly.c (compare_prefix_loops): Removed.
4116         (build_scop_scattering): Do not use compare_prefix_loops any more.
4117         (nb_common_loops): New.
4118
4119 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4120
4121         * sese.c (get_new_name_from_old_name): Renamed get_rename.
4122         (register_old_and_new_names): Renamed set_rename.
4123
4124 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4125
4126         * graphite-scop-detection.h (nb_reductions_in_loop): Revert removal
4127         of the decl from the previous commit.
4128
4129 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4130
4131         * graphite-scop-detection.c (dot_scop): New.
4132         * graphite-scop-detection.h (dot_scop): Declared.
4133
4134 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4135
4136         * graphite-sese-to-poly.c (compare_prefix_loops): Fix compare.
4137
4138 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4139
4140         * cfgloopmanip.c (create_empty_loop_on_edge): Generate the loop exit
4141         condition at the end of the loop.
4142         * graphite.c (graphite_initialize, graphite_finalize): Print to
4143         dump_file the compiled function.
4144         * graphite-clast-to-gimple.c (graphite_create_new_loop): Update use
4145         of create_empty_loop_on_edge.
4146         (translate_clast): Update the code generation of loops for the new
4147         shape of loops.
4148         * cfgloop.h (create_empty_loop_on_edge): Update declaration.
4149
4150 2009-03-24  Sebastian Pop  <sebastian.pop@amd.com>
4151
4152         Reverted the patch from 2009-03-19.
4153
4154 2009-03-19  Tobias Grosser  <grosser@fim.uni-passau.de>
4155
4156         * graphite-poly.c (new_poly_bb, free_poly_bb): Initialize/free
4157         poly_drs vector.
4158         (print_scop): Style.
4159         * graphite-poly.h (poly_bb): Add drs vector.
4160         (PBB_DRS): Add accessor.
4161         * graphite-sese-to-poly.c (ref_nb_loops): Remove.
4162         (build_access_matrix_with_af, build_access_matrix,
4163         build_scop_data_accesses): Delete.
4164         (build_poly_dr): New.
4165         (build_pbb_drs, build_scop_drs): New.
4166         (build_poly_scop): call build_scop_drs.
4167
4168 2009-03-13  Sebastian Pop  <sebastian.pop@amd.com>
4169
4170         * graphite-scop-detection.c (dot_all_scops_1): Close the table
4171         once per basic block.
4172
4173 2009-03-13  Tobias Grosser  <grosser@fim.uni-passau.de>
4174
4175         * graphite-scop-detection.c (graphite_can_represent_scev): New.
4176         (graphite_can_represent_expr): Renamed from loop_affine_expr
4177         and enhanced.
4178         (stmt_simple_for_scop_p): Call graphite_can_represent_expr.
4179         (graphite_cannot_represent_loop): Add scop_entry to parameters.
4180         (scopdet_basic_block_info): Actually define entry_block.
4181         (stmt_simple_memref_p): Moved here from ...
4182
4183         * tree-data-ref.c (stmt_simple_memref_p): here.
4184         * tree-data-ref.h (stmt_simple_memref_p): Removed.
4185
4186 2009-03-13  Tobias Grosser  <grosser@fim.uni-passau.de>
4187
4188         * gcc.dg/graphite/id-4.c: New.
4189
4190 2009-03-12  Sebastian Pop  <sebastian.pop@amd.com>
4191
4192         * sese.c (expand_scalar_variables_expr): Handle tcc_comparison.
4193         (register_old_and_new_names): Update the content of the map.
4194         When there was already a rename_map_elt in the map at that
4195         location, free it.
4196         (copy_bb_and_scalar_dependences): Do rename_variables after
4197         expand_scalar_variables.
4198         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
4199         of the map.  When there was already a rename_map_elt in the
4200         map at that location, free it.
4201         (translate_clast): Pass the rename_map.  Do not initialize and free
4202         a rename_map per stmt_user.
4203         (gloog): Initialize and free one rename_map and pass it to
4204         translate_clast.
4205
4206 2009-03-12  Sebastian Pop  <sebastian.pop@amd.com>
4207
4208         * sese.c (expand_scalar_variables_stmt,
4209         expand_scalar_variables_ssa_name): Add a gimple_stmt_iterator
4210         parameter.
4211         (expand_scalar_variables_expr): Handle REALPART_EXPR and IMAGPART_EXPR.
4212         (expand_scalar_variables): Pass to expand_scalar_variables_stmt
4213         the gimple_stmt_iterator of the statement to be expanded.
4214         * graphite-scop-detection.c (is_simple_operand): Do handle
4215         REALPART_EXPR.
4216
4217 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
4218
4219         * graphite-scop-detection.c (is_simple_operand): Do not handle
4220         REALPART_EXPR.
4221         * gcc.dg/graphite/id-2.c: New.
4222
4223         * graphite-sese-to-poly.c (build_bb_loops,
4224         add_value_to_dim, scan_tree_for_params_right_scev,
4225         scan_tree_for_params_int, scan_tree_for_params, idx_record_params,
4226         find_params_in_bb, build_loop_iteration_domains,
4227         add_conditions_to_domain): Remove subtract.
4228
4229 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
4230
4231         * graphite-clast-to-gimple.c (loop_iv_stack_patch_for_consts,
4232         build_iv_mapping, compute_cloog_iv_types_1, build_cloog_prog):
4233         pbb_loop_at_index -> gbb_loop_at_index.
4234         * graphite-poly.c (new_poly_bb, new_scop): New accessors.
4235         (debug_loop_vec): Delete.
4236         * graphite-poly.h (poly_bb, scop): Change black_box and region to void
4237         pointer.  Move LOOPS to gimple_bb_p and insert nb_params.
4238         (PBB_LOOPS): Removed.
4239         (PBB_BLACK_BOX): Insert cast.
4240         (pbb_set_black_box): New setter.
4241         (pbb_loop_at_index, pbb_loop_index): Removed.
4242         (scop_set_region, scop_set_nb_params): New.
4243         * graphite-sese-to-poly.c (new_gimple_bb, free_gimple_bb,
4244         build_scop_scattering, build_bb_loops): Add GBB_LOOPS.
4245         (build_poly_scop): Use scop_set_nb_params.
4246         * sese.h (gimple_bb): Add LOOPS.
4247         (GBB_LOOPS, gbb_loop_index, gbb_loop_at_index): New.
4248
4249 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
4250
4251         Revert previous commit.
4252
4253 2009-03-11  Sebastian Pop  <sebastian.pop@amd.com>
4254
4255         * sese.c (expand_scalar_variables_expr): Handle tcc_comparison.
4256         (register_old_and_new_names): Update the content of the map.
4257         When there was already a rename_map_elt in the map at that
4258         location, free it.
4259         (copy_bb_and_scalar_dependences): Do rename_variables after
4260         expand_scalar_variables.
4261         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
4262         of the map.  When there was already a rename_map_elt in the
4263         map at that location, free it.
4264         (translate_clast): Pass the rename_map.  Do not initialize and free
4265         a rename_map per stmt_user.
4266         (gloog): Initialize and free one rename_map and pass it to
4267         translate_clast.
4268
4269 2009-03-11  Tobias Grosser  <grosser@fim.uni-passau.de>
4270
4271         Remove forgotten line in revert.
4272
4273 2009-03-11  Sebastian Pop  <sebastian.pop@amd.com>
4274
4275         Revert previous commit.
4276
4277 2009-03-10  Sebastian Pop  <sebastian.pop@amd.com>
4278
4279         * sese.c (register_old_and_new_names): Update the content
4280         of the map.  When there was already a rename_map_elt in the
4281         map at that location, free it.
4282         (copy_bb_and_scalar_dependences): Do rename_variables after
4283         expand_scalar_variables.
4284         * graphite-clast-to-gimple.c (build_iv_mapping): Update the content
4285         of the map.  When there was already a rename_map_elt in the
4286         map at that location, free it.
4287         (translate_clast): Pass the rename_map.  Do not initialize and free
4288         a rename_map per stmt_user.
4289         (gloog): Initialize and free one rename_map and pass it to
4290         translate_clast.
4291
4292 2009-03-10  Sebastian Pop  <sebastian.pop@amd.com>
4293
4294         * graphite-clast-to-gimple.c (translate_clast): context_loop
4295         is never NULL.
4296
4297 2009-03-10  Tobias Grosser  <grosser@fim.uni-passau.de>
4298             Sebastian Pop  <sebastian.pop@amd.com>
4299
4300         * graphite-ppl.c (ppl_insert_dimensions): Fix stupid mistake
4301         of the use of ppl_Polyhedron_map_space_dimensions.
4302
4303 2009-03-10  Tobias Grosser  <grosser@fim.uni-passau.de>
4304             Sebastian Pop  <sebastian.pop@amd.com>
4305
4306         * graphite-poly.c (unify_scattering_dimensions): Fix types.
4307         * graphite-poly.h (poly_dr_p, poly_dr, POLY_DR_TYPE, PDR_BB,
4308         PDR_TYPE, PDR_ACCESSES, pdr_accessp_nb_subscripts,
4309         pdr_accessp_nb_iterators, pdr_accessp_nb_params,
4310         pdr_accessp_alias_set_dim, pdr_accessp_subscript_dim,
4311         pdr_accessp_iterator_dim, pdr_accessp_param_dim,
4312         pbb_nb_params): New.
4313         (pbb_nb_loops, pbb_nb_scattering, scop_nb_params,
4314         nb_loops_around_pbb): Adapt return types.
4315
4316 2009-03-09  Tobias Grosser  <grosser@fim.uni-passau.de>
4317
4318         * Makefile.in (graphite.o, graphite-sese-to-poly.o,
4319         graphite-clast-to-gimple.o,  graphite-data-ref.o,
4320         graphite-scop-detection.o, graphite-poly.o): Add
4321         more headers.
4322
4323 2009-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
4324
4325         * Makefile.in (graphite.o, graphite-sese-to-poly.o,
4326         graphite-clast-to-gimple.o,  graphite-data-ref.o,
4327         graphite-scop-detection.o, graphite-poly.o): Add graphite-poly.h.
4328
4329 2009-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
4330
4331         * gcc.dg/graphite/pr37485.c: Remove -floop-block
4332         * gcc.dg/graphite/pr37828.c: Same.
4333         * gcc.dg/graphite/pr37684.c: Same.
4334         * gcc.dg/graphite/block-0.c: Same.
4335         * gcc.dg/graphite/block-1.c: Same.
4336         * gcc.dg/graphite/block-2.c: Same.
4337         * gcc.dg/graphite/block-3.c: Same.
4338         * gcc.dg/graphite/block-4.c: Same.
4339         * gcc.dg/graphite/block-5.c: Same.
4340         * gcc.dg/graphite/block-6.c: Same.
4341         * gfortran.dg/graphite/pr38083.f90: Same.
4342         * gfortran.dg/graphite/block-1.f90: Same.
4343         * gfortran.dg/graphite/block-3.f90: Same.
4344         * gfortran.dg/graphite/pr37852.f90: Same.
4345         * gfortran.dg/graphite/block-4.f90: Same.
4346         * gfortran.dg/graphite/pr37980.f90: Same.
4347         * gfortran.dg/graphite/pr38953.f90: Same.
4348         * gfortran.dg/graphite/pr37857.f90: Same.
4349         * opts.c: Remove -floop-block from -O2.
4350         * graphite-poly.c: Fail if -floop-block -floop-interchange or
4351         -floop-strip-mine are used.
4352
4353 2009-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
4354             Sebastian Pop  <sebastian.pop@amd.com>
4355
4356         * graphite-clast-to-gimple.c (build_cloog_prog): Unify scattering
4357         dimensions.
4358         * graphite-poly.c (pbb_compare, graphite_sort_pbbs,
4359         graphite_trans_bb_move_loop, graphite_trans_bb_strip_mine,
4360         strip_mine_profitable_p, is_interchange_valid,
4361         graphite_trans_bb_block, graphite_trans_loop_block,
4362         graphite_trans_scop_block): Temporary removed.
4363         (extend_scattering, unify_scattering_dimensions): New.
4364         (print_scattering_function, graphite_read_transforms):
4365         PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
4366         (graphite_generate_scattering_fns): Removed.
4367         (apply_poly_transforms): Cleanup.
4368         (free_poly_bb): Add PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
4369         (schedule_to_scattering): Moved.
4370         (PBB_STATIC_SCHEDULE, PBB_SCATTERING): Removed.
4371         (PBB_ORIGINAL_SCATTERING, PBB_TRANSFORMED_SCATTERING): New.
4372         (pbb_nb_scattering): New.
4373         (SCOP_ENTRY, SCOP_EXIT, SCOP_REGION_BBS, SCOP_DEP_GRAPH, SCOP_PARAMS,
4374         SCOP_LOOP_NEST, SCOP_PARAMS, SCOP_OLDIVS, SCOP_LIVEOUT_RENAMES):
4375         Removed.
4376         * graphite-ppl.c (ppl_insert_dimensions): Extended and renamed from
4377         shift_poly.
4378         (ppl_strip_loop): PBB_SCATTERING -> PBB_TRANSFORMED_SCATTERING.
4379         * graphite-scop-detection.c (dot_all_scops_1):  PBB_SCATTERING
4380         -> PBB_TRANSFORMED_SCATTERING.
4381         * graphite-sese-to-poly.c (build_scop_bbs): Remove region.
4382         (build_pbb_scattering_polyhedron): Moved from schedule_to_scattering.
4383         (build_scop_scattering): Renamed from build_scop_canonical_schedules.
4384         (check_poly_representation): Do not return bool.
4385         (graphite_transform_loops): Reformat.
4386         * sese.h (SESE_ENTRY_BB, SESE_EXIT_BB): New.
4387
4388 2009-03-04  Sebastian Pop  <sebastian.pop@amd.com>
4389
4390         * graphite-poly.c (print_pbb_domain, print_pbb, print_scop,
4391         debug_pbb_domain, debug_pbb, debug_scop): New.
4392         * graphite-poly.h (print_pbb_domain, print_pbb, print_scop,
4393         debug_pbb_domain, debug_pbb, debug_scop): Declared.
4394
4395 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
4396
4397         PR middle-end/39335
4398         * tree-parloops.c (canonicalize_loop_ivs): Call fold_convert
4399         when the type precision of the induction variable should be
4400         larger than the type precision of nit.
4401         (gen_parallel_loop): Update use of canonicalize_loop_ivs.
4402         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Same.
4403         * tree-flow.h (canonicalize_loop_ivs): Update declaration.
4404
4405         * gcc.dg/graphite/pr39335_1.c: New.
4406         * gcc.dg/graphite/pr39335.c: New.
4407
4408 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
4409
4410         * tree-parloops.c (canonicalize_loop_ivs): reduction_list contains
4411         SSA_NAMES not struct reduction_info.
4412
4413 2009-03-02  Sebastian Pop  <sebastian.pop@amd.com>
4414
4415         * sese.c (expand_scalar_variables_expr): Handle ADDR_EXPR.
4416
4417 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
4418             Tobias Grosser  <grosser@fim.uni-passau.de>
4419
4420         * sese.c (new_sese): Initialize SESE_REDUCTION_LIST.
4421         (free_sese): Free SESE_REDUCTION_LIST.
4422         * sese.h (struct sese): Add field reduction_list.
4423         (SESE_REDUCTION_LIST): New.
4424         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Call
4425         canonicalize_loop_ivs on SESE_REDUCTION_LIST.
4426
4427 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
4428             Tobias Grosser  <grosser@fim.uni-passau.de>
4429
4430         * tree-flow.h (gather_scalar_reductions): Use struct loop * instead
4431         of loop_p.
4432
4433 2009-02-27  Sebastian Pop  <sebastian.pop@amd.com>
4434             Tobias Grosser  <grosser@fim.uni-passau.de>
4435
4436         * tree-parloops.c (struct brli, build_reduction_list_info,
4437         analyze_reduction_list, gather_scalar_reductions): New.
4438         (loop_parallel_p): Build a reduction list containing only
4439         PHI_RESULT SSA_NAMEs: call gather_scalar_reductions.
4440         (gen_parallel_loop): Call the analysis analyze_reduction_list.
4441         (parallelize_loops): Now reduction_list is a htab_t of SSA_NAMEs.
4442         * tree-flow.h (gather_scalar_reductions): Declared.
4443
4444 2009-02-26  Sebastian Pop  <sebastian.pop@amd.com>
4445
4446         PR middle-end/39308
4447         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not call
4448         number_of_iterations_exit from a gcc_assert.
4449
4450 2009-02-25  Sebastian Pop  <sebastian.pop@amd.com>
4451             Jan Sjodin  <jan.sjodin@amd.com>
4452
4453         * output.h (graphite_out_file, graphite_in_file): Declared.
4454         * toplev.c (graphite_out_file, graphite_in_file): New.
4455         (init_asm_output): Initialize graphite_in_file and graphite_out_file.
4456         * graphite-clast-to-gimple.c (build_cloog_prog): Read PBB_SCATTERING.
4457         Don't call schedule_to_scattering.
4458         * common.opt (fgraphite-write, fgraphite-read): New.
4459         * graphite-poly.c: Include output.h.
4460         (print_scattering_function, print_scattering_functions,
4461         debug_scattering_function, debug_scattering_functions,
4462         graphite_write_transforms, graphite_read_transforms,
4463         graphite_generate_scattering_fns): New.
4464         (apply_poly_transforms): Do not apply transform if flag_graphite_read.
4465         Call graphite_generate_scattering_fns, graphite_write_transforms,
4466         graphite_read_transforms.
4467         (new_poly_bb): Initialize PBB_SCATTERING.
4468         (free_poly_bb): Free PBB_SCATTERING.
4469         (schedule_to_scattering): Does not return, initialize PBB_SCATTERING.
4470         * graphite-poly.h (struct poly_bb): Add field scattering.
4471         (PBB_SCATTERING): New.
4472         (print_scattering_function, print_scattering_functions,
4473         debug_scattering_function, debug_scattering_functions): Declared.
4474         * graphite-ppl.c (cloog_matrix_to_ppl_constraint): Matrices contain
4475         GMP values, not integers!
4476         (ppl_print_polyhedron_matrix, debug_ppl_polyhedron_matrix,
4477         ppl_read_polyhedron_matrix): New.
4478         * graphite-ppl.h (ppl_print_polyhedron_matrix,
4479         debug_ppl_polyhedron_matrix,
4480         ppl_read_polyhedron_matrix): Declared.
4481         * Makefile.in (graphite-poly.o): Depends on output.h.
4482
4483 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4484             Tobias Grosser  <grosser@fim.uni-passau.de>
4485
4486         Revert this change:
4487         * graphite-scop-detection.c (stmt_simple_for_scop_p): Analyze
4488         scalar evolutions in the scop_entry->loop_father.
4489
4490 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4491             Tobias Grosser  <grosser@fim.uni-passau.de>
4492
4493         * graphite.h (ref_nb_loops): Remove declaration.
4494         (struct gimple_bb, gimple_bb_p, GBB_BB, GBB_DATA_REFS, GBB_CONDITIONS,
4495         GBB_CONDITION_CASES, GBB_CLOOG_IV_TYPES, gbb_loop, print_gimple_bb,
4496         debug_gbb): Moved to sese.h.
4497         * sese.h: As said.
4498
4499 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4500             Tobias Grosser  <grosser@fim.uni-passau.de>
4501
4502         * graphite-data-ref.[ch]: Disable.
4503
4504 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4505             Tobias Grosser  <grosser@fim.uni-passau.de>
4506
4507         * graphite-scop-detection.c (stmt_simple_for_scop_p): Analyze
4508         scalar evolutions in the scop_entry->loop_father.
4509
4510 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4511
4512         * graphite-scop-detection.c (nb_reductions_in_loop): Moved here...
4513         (graphite_cannot_represent_loop_niter): Renamed
4514         graphite_cannot_represent_loop.  Call nb_reductions_in_loop.
4515         (limit_scops): build_sese_loop_nests does not return a bool.
4516         * graphite-scop-detection.h (nb_reductions_in_loop): Declared.
4517         * sese.c (nb_reductions_in_loop): ... from here.
4518         (graphite_loop_normal_form): ... from here.
4519         (sese_record_loop): Does not fail, so does not return a bool.
4520         (build_sese_loop_nests): Same.
4521         * sese.h (build_sese_loop_nests): Update declaration.
4522         * graphite-clast-to-gimple.c (graphite_loop_normal_form): Moved here...
4523         (build_graphite_loop_normal_form): New.
4524         (gloog): Call build_graphite_loop_normal_form.
4525         * graphite-sese-to-poly.c (build_poly_scop): Don't fail on
4526         build_sese_loop_nests.
4527
4528         * gcc.dg/graphite/id-1.c: New.
4529
4530 2009-02-23  Sebastian Pop  <sebastian.pop@amd.com>
4531             Tobias Grosser  <grosser@fim.uni-passau.de>
4532
4533         * graphite-sese-to-poly.c (scan_tree_for_params): Remove REAL_CST.
4534         The SCoP detection fix is sufficient.
4535
4536 2009-02-21  Sebastian Pop  <sebastian.pop@amd.com>
4537
4538         PR tree-optimization/39260
4539         * graphite-scop-detection.c (harmful_stmt_in_bb): Stop a SCoP when
4540         the basic block contains a condition with a real type.
4541         * graphite-sese-to-poly.c (scan_tree_for_params): Handle REAL_CST.
4542
4543         * gcc.dg/graphite/pr39260.c: New.
4544
4545 2009-02-21  Sebastian Pop  <sebastian.pop@amd.com>
4546
4547         * graphite-poly.c: Inlcude params.h.
4548         (graphite_trans_loop_block): Use PARAM_LOOP_BLOCK_TILE_SIZE for
4549         the size of a tile.
4550         * Makefile.in (graphite-poly.o): Depend on PARAMS_H.
4551         * params.def (PARAM_LOOP_BLOCK_TILE_SIZE): Define.
4552
4553 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
4554             Tobias Grosser  <grosser@fim.uni-passau.de>
4555
4556         * graphite-scop-detection.c (dot_all_scops_1,
4557         dot_all_scops): Moved here.
4558         * graphite-scop-detection.h (dot_all_scops): Declared here.
4559         * graphite.c (graphite_initialize, graphite_finalize): New.
4560         (graphite_transform_loops): Cleaned up.
4561         * sese.c (debug_oldivs): Moved here.
4562         * graphite-poly.c (graphite_apply_transformations): Renamed
4563         apply_poly_transforms.
4564         (debug_loop_vec): Moved here.
4565         * graphite-sese-to-poly.c (build_bb_loops, build_sese_conditions_1,
4566         scop_contains_non_iv_scalar_phi_nodes, build_sese_conditions,
4567         find_scop_parameters, build_scop_iteration_domain,
4568         add_conditions_to_constraints, build_scop_canonical_schedules,
4569         build_scop_data_accesses): Now static.
4570         (build_poly_scop, check_poly_representation): New.
4571
4572 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
4573
4574         * graphite.c (graphite_stmt_p, new_gimple_bb, free_gimple_bb,
4575         remove_gbbs_in_scop, free_scops, try_generate_gimple_bb,
4576         build_scop_bbs, ref_nb_loops, compare_prefix_loops,
4577         build_scop_canonical_schedules, build_bb_loops, add_value_to_dim,
4578         scan_tree_for_params_right_scev, scan_tree_for_params_int,
4579         scan_tree_for_params, struct irp_data, dx_record_params,
4580         find_params_in_bb, find_scop_parameters, gbb_from_bb,
4581         build_loop_iteration_domains, add_conditions_to_domain,
4582         phi_node_is_iv, bb_contains_non_iv_scalar_phi_nodes,
4583         scop_contains_non_iv_scalar_phi_nodes, build_sese_conditions_1,
4584         build_sese_conditions, add_conditions_to_constraints,
4585         build_scop_iteration_domain, build_access_matrix_with_af,
4586         build_access_matrix,
4587         build_scop_data_accesses): Moved to graphite-sese-to-poly.c.
4588
4589         * graphite-sese-to-poly.c: New.
4590         * graphite-sese-to-poly.h: New.
4591
4592         * Makefile.in: Add new rule for graphite-sese-to-poly.o.
4593
4594 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
4595
4596         * graphite.c: Split graphite code generation to a new file.
4597         (graphite_verify, gmp_cst_to_tree, clast_name_to_gcc,
4598         max_precision_type, clast_to_gcc_expression_red,
4599         clast_to_gcc_expression, gcc_type_for_clast_expr,
4600         gcc_type_for_clast_eq, loop_iv_stack_patch_for_consts,
4601         graphite_translate_clast_equation, graphite_create_guard_cond_expr,
4602         graphite_create_new_guard, clast_get_body_of_loop,
4603         gcc_type_for_cloog_iv, gcc_type_for_iv_of_clast_loop,
4604         graphite_create_new_loop, build_iv_mapping, copy_renames,
4605         translate_clast, find_cloog_iv_in_expr, compute_cloog_iv_types_1,
4606         compute_cloog_iv_types, free_scattering, save_var_name,
4607         initialize_cloog_names, build_scop_context, build_cloog_prog,
4608         set_cloog_options, debug_clast_stmt, scop_to_clast,
4609         print_generated_program, debug_generated_program,
4610         gloog): Moved to graphite-clast-to-gimple.c.
4611
4612         (struct cloog_prog_clast): Moved to graphite-clast-to-gimple.h.
4613
4614         (iv_stack_entry_is_constant, iv_stack_entry_is_iv,
4615         loop_iv_stack_push_iv, loop_iv_stack_insert_constant,
4616         loop_iv_stack_pop, loop_iv_stack_get_iv,
4617         loop_iv_stack_get_iv_from_name, debug_loop_iv_stack,
4618         free_loop_iv_stack, loop_iv_stack_remove_constants,
4619         debug_rename_elt, debug_rename_map_1, debug_rename_map,
4620         rename_map_elt_info, eq_rename_map_elts, debug_ivtype_elt,
4621         debug_ivtype_map_1, debug_ivtype_map, ivtype_map_elt_info,
4622         eq_ivtype_map_elts, sese_add_exit_phis_edge,
4623         sese_add_exit_phis_var, sese_insert_phis_for_liveouts,
4624         get_vdef_before_sese, sese_adjust_vphi,
4625         get_new_name_from_old_name, sese_adjust_phis_for_liveouts,
4626         oldiv_for_loop, rename_variables_in_stmt, is_parameter,
4627         is_iv, expand_scalar_variables_ssa_name,
4628         expand_scalar_variables_expr, expand_scalar_variables_stmt,
4629         expand_scalar_variables, rename_variables, remove_condition,
4630         get_true_edge_from_guard_bb, get_false_edge_from_guard_bb,
4631         add_loop_exit_phis, insert_loop_close_phis, struct igp,
4632         default_liveout_before_guard, add_guard_exit_phis,
4633         insert_guard_phis, register_old_and_new_names,
4634         graphite_copy_stmts_from_block, register_sese_liveout_renames,
4635         copy_bb_and_scalar_dependences, outermost_loop_in_sese,
4636         if_region_set_false_region, create_if_region_on_edge,
4637         move_sese_in_condition): Moved to sese.c.
4638
4639         (nb_loops_around_loop_in_sese, struct ifsese, if_region_entry,
4640         if_region_exit, if_region_get_condition_block,
4641         struct rename_map_elt, new_rename_map_elt, enum iv_stack_entry_kind,
4642         union iv_stack_entry_data_union, struct iv_stack_entry_struct,
4643         iv_stack_entry_p, loop_iv_stack, struct ivtype_map_elt,
4644         ivtype_map_elt, new_ivtype_map_elt,
4645         recompute_all_dominators): Moved to sese.h.
4646
4647         * graphite-clast-to-gimple.c: New.
4648         * graphite-clast-to-gimple.h: New.
4649         * Makefile.in: Add new rule for graphite-clast-to-gimple.o.
4650         * sese.c: Modified as said above.
4651         * sese.h: Same.
4652
4653 2009-02-20  Sebastian Pop  <sebastian.pop@amd.com>
4654
4655         * graphite.c: Split scop detection to a new file.
4656         (enum gbb_type, gbb_type, get_bb_type, struct sd_region_p, sd_region,
4657         move_sd_regions, loop_affine_expr, exclude_component_ref,
4658         is_simple_operand, stmt_simple_for_scop_p, harmful_stmt_in_bb,
4659         graphite_cannot_represent_loop_niter, struct scopdet_info,
4660         scopdet_basic_block_info, build_scops_1, bb_in_sd_region,
4661         find_single_entry_edge, find_single_exit_edge,
4662         create_single_entry_edge, sd_region_without_exit,
4663         create_single_exit_edge, unmark_exit_edges, mark_exit_edges,
4664         create_sese_edges, build_graphite_scops, limit_scops, build_scops):
4665         Moved to graphite-scop-detection.c.
4666
4667         * graphite-scop-detection.c: New.
4668         * graphite-scop-detection.h: New.
4669         * Makefile.in: Add new rule for graphite-scop-detection.o.
4670
4671         * sese.c: Include tree-chrec.h, tree-data-ref.h, and
4672         tree-scalar-evolution.h.
4673         (nb_reductions_in_loop, graphite_loop_normal_form, sese_record_loop,
4674         build_sese_loop_nests): Moved here from graphite.c.
4675         (param_index): Renamed parameter_index_in_region.
4676
4677 2009-02-18  Tobias Grosser  <grosser@fim.uni-passau.de>
4678             Sebastian Pop  <sebastian.pop@amd.com>
4679
4680         * gcc.dg/graphite/block-0.c: Expected to fail now.
4681         * gcc.dg/graphite/block-1.c: Same.
4682         * gcc.dg/graphite/block-5.c: Same.
4683         * gcc.dg/graphite/block-6.c: Same.
4684
4685 2009-02-18  Tobias Grosser  <grosser@fim.uni-passau.de>
4686             Sebastian Pop  <sebastian.pop@amd.com>
4687
4688         * graphite.h: Separate from graphite_bb_p the polyhedral
4689         representation in poly_bb_p and the GCC specifics in gimple_bb_p.
4690         (struct data_dependence_polyhedron, RDGE_DDP, ddp_p): Moved to
4691         graphite-data-ref.h.
4692         (struct poly_bb, PBB_SCOP, PBB_STATIC_SCHEDULE, PBB_DOMAIN,
4693         PBB_BLACK_BOX, PBB_LOOPS, pbb_nb_loops, pbb_loop_at_index,
4694         pbb_loop_index, struct scop, SCOP_BBS, SCOP_REGION, SCOP_ENTRY,
4695         SCOP_EXIT, SCOP_REGION_BBS, SCOP_DEP_GRAPH, SCOP_PARAMS,
4696         SCOP_LOOP_NEST, SCOP_PARAMS, SCOP_OLDIVS, SCOP_LIVEOUT_RENAMES,
4697         scop_nb_params): Moved to graphite-poly.h.
4698         * graphite-data-ref.c: Same.
4699         * graphite-data-ref.h: New.
4700         * graphite.c: Same.
4701         (pbb_compare, graphite_sort_pbbs, graphite_trans_bb_move_loop,
4702         graphite_trans_bb_strip_mine, strip_mine_profitable_p,
4703         is_interchange_valid, graphite_trans_bb_block,
4704         graphite_trans_loop_block, scop_max_loop_depth,
4705         graphite_trans_scop_block, graphite_apply_transformations,
4706         new_poly_bb, free_poly_bb, new_scop, free_scop): Moved to
4707         graphite-poly.c.
4708         * graphite-poly.h: New.
4709         * graphite-poly.c: New.
4710         * Makefile.in (OBJS-common): Add graphite-poly.o.
4711         (graphite-poly.o): New rule.
4712         * tree-data-ref.h (struct data_reference): Remove unused scop field.
4713         (DR_SCOP): Removed.
4714
4715 2009-02-18  Sebastian Pop  <sebastian.pop@amd.com>
4716             Tobias Grosser  <grosser@fim.uni-passau.de>
4717
4718         * graphite.c: Replace gb -> gbb.
4719         * graphite.h: Same.
4720         * graphite-data-ref.c: Same.
4721
4722 2009-02-18  Sebastian Pop  <sebastian.pop@amd.com>
4723             Tobias Grosser  <grosser@fim.uni-passau.de>
4724
4725         * Makefile.in (OBJS-commmon): Add sese.o.
4726         (sese.o): New.
4727         (graphite.o): Add sese.h.
4728         * graphite.c (bb_in_ss_p, loop_in_sese_p,
4729         sese_build_livein_liveouts_use, sese_build_livein_liveouts_bb,
4730         sese_build_livein_liveouts, register_bb_in_sese, new_sese, free_sese):
4731         Move to sese.
4732         (block_before_scop): Add missing return.
4733         (new_scop, free_scop): Remove SESE data structures.
4734         (scop_record_loop, scan_tree_for_params, find_params_in_bb,
4735         find_scop_parameters, build_loop_iteration_domains,
4736         add_conditions_to_domain, register_scop_liveout_renames,
4737         copy_bb_and_scalar_dependences): Scop -> SESE.
4738
4739         (add_conditions_to_domain): SCoP -> SESE and remove check
4740         (scop_contains_non_iv_scalar_phi_nodes): New.
4741         (build_scop_conditions_1, build_scop_conditions): Remove check for
4742         non iv scalar phi nodes.
4743         (print_scop_statistics): New.
4744         (graphite_transform_loops): Cleanup.
4745
4746         * graphite.h: Move to sese & cleanup.
4747         * sese.c: New.
4748         * sese.h: New.
4749
4750 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4751             Tobias Grosser  <grosser@fim.uni-passau.de>
4752
4753         * graphite.c (build_scop_conditions_1): Conditions are only
4754         at the end of a basic block.
4755
4756 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4757             Tobias Grosser  <grosser@fim.uni-passau>
4758
4759         * graphite.h (struct graphite_bb): Remove compressed_alpha_matrix
4760         field.
4761         (GBB_ALPHA): Removed.
4762
4763 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4764             Tobias Grosser  <grosser@fim.uni-passau.de>
4765
4766         * graphite-data-ref.c (graphite_test_dependence): Don't use
4767         GBB_DYNAMIC_SCHEDULE.
4768         * graphite.c (new_graphite_bb): Same.
4769         (free_graphite_bb): Same.
4770         (build_scop_dynamic_schedules): Removed.
4771         (graphite_transform_loops): Don't call it.
4772         * graphite.h (struct graphite_bb): Remove dynamic_schedule field.
4773         (GBB_DYNAMIC_SCHEDULE): Removed.
4774
4775 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4776             Tobias Grosser  <grosser@fim.uni-passau.de>
4777
4778         * graphite.c (schedule_to_scattering): Don't use CloogMatrix.
4779         (print_graphite_bb): Same.
4780         (build_cloog_prog): Same.
4781
4782 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4783             Tobias Grosser  <grosser@fim.uni-passau.de>
4784
4785         * graphite.c (build_cloog_prog): Don't use CloogMatrix.
4786
4787 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4788             Tobias Grosser  <grosser@fim.uni-passau.de>
4789
4790         * graphite.c (build_scop_context): Don't use CloogMatrix.
4791         * graphite-ppl.c (new_Cloog_Domain_from_ppl_Polyhedron): New.
4792         * graphite-ppl.h (new_Cloog_Domain_from_ppl_Polyhedron): Declared.
4793
4794 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4795             Tobias Grosser  <grosser@fim.uni-passau.de>
4796
4797         * graphite.h (struct scop): Move params, old_ivs, loops, loop_nest,
4798         liveout_renames, add_params fields...
4799         (struct sese): ... here.
4800         (SESE_PARAMS, SESE_LOOPS, SESE_LOOP_NEST, SESE_ADD_PARAMS,
4801         SESE_PARAMS, SESE_OLDIVS, SESE_LIVEOUT_RENAMES): New.
4802
4803 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4804             Tobias Grosser  <grosser@fim.uni-passau.de>
4805
4806         * graphite.c (print_scop): Do not print the CLooG program.
4807         (new_scop, free_scop, initialize_cloog_names, build_scop_context,
4808         build_cloog_prog, gloog): Don't use SCOP_PROG.
4809         (find_transform): Renamed scop_to_clast.
4810         (print_generated_program, debug_generated_program): New.
4811         (graphite_transform_loops): Adapt to new interface.
4812         * graphite.h (struct scop): Remove program field.
4813         (SCOP_PROG): Removed.
4814         (print_generated_program, debug_generated_program): Declared.
4815
4816 2009-02-16  Sebastian Pop  <sebastian.pop@amd.com>
4817
4818         * graphite-data-ref.c (schedule_precedes_p, schedule_same_p): New.
4819         (statement_precedes_p): Use schedule_same_p and schedule_precedes_p.
4820         * graphite.c (gbb_compare, schedule_to_scattering, print_graphite_bb,
4821         free_graphite_bb, build_scop_canonical_schedules,
4822         graphite_trans_bb_strip_mine, graphite_trans_scop_block): Static
4823         schedules are now represented using a ppl_Linear_Expression_t.
4824         * graphite.h (struct graphite_bb): Same.
4825         * graphite-ppl.c (ppl_lexico_compare_linear_expressions): New.
4826         * graphite-ppl.h (ppl_lexico_compare_linear_expressions): Declared.
4827
4828 2009-02-15  Sebastian Pop  <sebastian.pop@amd.com>
4829
4830         * graphite.c: Free local memory.
4831         * graphite-ppl.c: Same.
4832
4833 2009-02-15  Sebastian Pop  <sebastian.pop@amd.com>
4834
4835         * graphite.c (const_column_index, get_first_matching_sign_row_index,
4836         get_lower_bound_row, get_upper_bound_row, copy_constraint,
4837         swap_constraint_variables, scale_constraint_variable): Removed.
4838         (graphite_trans_bb_strip_mine): Remove pong.
4839         * graphite-ppl.c: Include missing header files.
4840         (set_inhomogeneous, set_coef, shift_poly, ppl_strip_loop): New.
4841         * graphite-ppl.h (ppl_strip_loop): Declared.
4842         * Makefile.in (graphite-ppl.o): Adjust dependences.
4843
4844 2009-02-14  Sebastian Pop  <sebastian.pop@amd.com>
4845
4846         * graphite.c (build_loop_iteration_domains): Remove ping pong.
4847         (build_scop_iteration_domain): Same.
4848
4849 2009-02-13  Sebastian Pop  <sebastian.pop@amd.com>
4850
4851         * graphite.c (scan_tree_for_params, add_conditions_to_domain): Remove
4852         ping pong.
4853         (add_value_to_dim, scan_tree_for_params_right_scev,
4854         scan_tree_for_params_int): New.
4855         * graphite-ppl.c (oppose_constraint): New.
4856         (insert_constraint_into_matrix): Implement missing cases.
4857         * graphite-ppl.h (insert_constraint_into_matrix): Declared.
4858
4859 2009-02-13  Sebastian Pop  <sebastian.pop@amd.com>
4860
4861         * graphite.c (graphite_trans_bb_move_loop): Remove ping pong,
4862         use ppl_move_dimension.
4863
4864 2009-02-12  Sebastian Pop  <sebastian.pop@amd.com>
4865
4866         * graphite-data-ref.c: Domains are now ppl_Polyhedra_t.
4867         * graphite.c: Same.
4868         * graphite.h: Same.
4869         * graphite-ppl.c: Same.
4870         * graphite-ppl.h: Same.
4871
4872 2009-02-12  Sebastian Pop  <sebastian.pop@amd.com>
4873
4874         Revert last 3 commits.
4875
4876 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
4877
4878         * graphite.c (scan_tree_for_params, add_conditions_to_domain): Remove
4879         ping pong.
4880         (add_value_to_dim, scan_tree_for_params_right_scev,
4881         scan_tree_for_params_int): New.
4882         * graphite-ppl.c (oppose_constraint): New.
4883         (insert_constraint_into_matrix): Implement missing cases.
4884         * graphite-ppl.h (insert_constraint_into_matrix): Declared.
4885
4886 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
4887
4888         * graphite.c (graphite_trans_bb_move_loop): Remove unused variables.
4889
4890 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
4891             Tobias Grosser  <grosser@fim.uni-passau.de>
4892
4893         * graphite.c (graphite_trans_bb_move_loop): Remove ping pong,
4894         use ppl_move_dimension.
4895         * graphite-ppl.c (ppl_move_dimension): New.
4896         * graphite-ppl.h (ppl_move_dimension): Declared.
4897
4898 2009-02-10  Sebastian Pop  <sebastian.pop@amd.com>
4899
4900         * graphite.c: Do not include cloog/cloog.h.
4901         (print_graphite_bb): Remove ping pong, call PPL print function.
4902
4903 2009-02-10  Tobias Grosser  <grosser@fim.uni-passau.de>
4904
4905         * Makefile.in (OBJS-common): Add graphite-ppl.o.
4906         (graphite.o): Add dependence on graphite-ppl.h.
4907         (graphite-ppl.o): New.
4908         (graphite-data-ref.c): Ping pong between PPL data structures
4909         and matrices.
4910         * graphite-ppl.c: New.
4911         * graphite-ppl.h: New.
4912         * graphite.c: Include graphite-ppl.h.
4913         (print_graphite_bb, add_conditions_to_domain, build_cloog_prog,
4914         graphite_trans_bb_move_loop, graphite_trans_bb_strip_mine):
4915         Ping pong between PPL data structures and matrices.
4916         (new_graphite_bb): Create a PPL constraint system.
4917         Call ppl_delete_Constraint_System instead of cloog_matrix_free.
4918         (build_loop_iteration_domains): Use PPL functions.
4919         * graphite.h: Include graphite-ppl.h.  Fix comments.
4920         (graphite_bb): Use a ppl_Constraint_System_t instead of
4921         CloogMatrix for representing the domain.
4922         (scop): Remove static_schedule.
4923         (gbb_nb_loops): Ping pong between PPL data structures and matrices.
4924
4925 2009-02-06  Sebastian Pop  <sebastian.pop@amd.com>
4926
4927         * graphite.c: Fix some comments.
4928
4929 2009-02-05  Sebastian Pop  <sebastian.pop@amd.com>
4930
4931         PR middle-end/38953
4932         * graphite.c (if_region_set_false_region): After moving a region
4933         in the false branch of a condition, remove the empty dummy
4934         basic block.
4935         (gloog): Remove wrong fix for PR38953.
4936
4937 2009-02-03  Tobias Grosser  <grosser@fim.uni-passau.de>
4938
4939         * graphite.c (bb_in_sese_p, sese_build_livein_liveouts_use,
4940         sese_build_livein_liveouts_bb, sese_build_livein_liveouts,
4941         register_bb_in_sese, new_sese, free_sese): Moved.
4942         (dot_scop_1, build_scop_loop_nests, build_loop_iteration_domains,
4943         outermost_loop_in_scop, build_scop_iteration_domain,
4944         expand_scalar_variables_ssa_name, get_vdef_before_scop,
4945         limit_scops): Use bb_in_sese_p instead of bb_in_scop_p.
4946         Use loop_in_sese_p instead of loop_in_scop_p.
4947         (new_graphite_bb, new_scop, gloog): Do not initialize SCOP_BBS_B.
4948         (free_scop): Do not free SCOP_BBS_B.
4949         (nb_loops_around_loop_in_scop, nb_loops_around_gb,
4950         ref_nb_loops): Moved here...
4951         * graphite.h (ref_nb_loops): ... from here.
4952         (struct scop): Remove bbs_b bitmap.
4953         (SCOP_BBS_B, bb_in_scop_p, loop_in_scop_p): Removed.
4954         * gcc.dg/graphite/scop-19.c: New
4955
4956 2009-02-03  Tobias Grosser  <grosser@fim.uni-passau.de>
4957
4958         * graphite.c (scopdet_basic_block_info): Fix bug in scop
4959         detection.
4960
4961 2009-01-30  Tobias Grosser  <grosser@fim.uni-passau.de>
4962
4963         * graphite.c (new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
4964         eq_loop_to_cloog_loop): Remove.
4965         (new_scop, free_scop): Remove SCOP_LOOP2CLOOG_LOOP.
4966         * graphite.h (struct scop): Remove loop2cloog_loop.
4967         (loop_domain_dim, loop_iteration_vector_dim): Remove.
4968
4969 2009-01-30  Tobias Grosser  <grosser@fim.uni-passau.de>
4970
4971         * opts.c (decode_options): Only add graphite options to O2
4972         if we compile with graphite enabled.
4973
4974 2009-01-26  Sebastian Pop  <sebastian.pop@amd.com>
4975
4976         * Merge from mainline (r143163:143684).
4977
4978 2009-01-26  Sebastian Pop  <sebastian.pop@amd.com>
4979
4980         * graphite.c (debug_value): Removed.
4981         * graphite.h (debug_value): Removed.
4982
4983 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
4984
4985         * passes.c (init_optimization_passes): Do not call pass_copy_prop
4986         after graphite: pass_copy_prop does not maintain a proper loop closed
4987         SSA form.  pass_copy_prop should be fixed.
4988
4989 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
4990
4991         * graphite.c (scop_adjust_phis_for_liveouts): Fix warning.
4992
4993 2009-01-23  Sebastian Pop  <sebastian.pop@amd.com>
4994
4995         * graphite.c (graphite_verify): Add a call to verify_loop_closed_ssa.
4996         (gloog): Split the exit of the scop when the scop exit is a loop exit.
4997         (graphite_transform_loops): Only call cleanup_tree_cfg if gloog
4998         changed the CFG.
4999
5000 2009-01-20  Sebastian Pop  <sebastian.pop@amd.com>
5001
5002         * graphite.c (gloog): Return true when code gen succeeded.
5003         (graphite_transform_loops): Do not call cleanup_tree_cfg if
5004         the code of the function did not changed.  After cleanup_tree_cfg
5005         call rewrite_into_loop_closed_ssa to maintain the loop closed ssa
5006         form.
5007
5008 2009-01-19  Sebastian Pop  <sebastian.pop@amd.com>
5009
5010         * graphite.c (stmt_simple_for_scop_p): Also handle cases when
5011         gimple_call_lhs is NULL.
5012
5013 2009-01-16  Sebastian Pop  <sebastian.pop@amd.com>
5014             Tobias Grosser  <tobi.grosser@amd.com>
5015
5016         * graphite.c (graphite_trans_scop_block): Do not block single
5017         nested loops.
5018
5019 2009-01-15  Sebastian Pop  <sebastian.pop@amd.com>
5020             Tobias Grosser  <tobi.grosser@amd.com>
5021
5022         * graphite.c (build_scop_canonical_schedules): Start schedules at
5023         zero.
5024
5025 2009-01-15  Sebastian Pop  <sebastian.pop@amd.com>
5026             Tobias Grosser  <tobi.grosser@amd.com>
5027
5028         * graphite.c (compare_prefix_loops): New.
5029         (build_scop_canonical_schedules): Rewritten.
5030         (graphite_transform_loops): Move build_scop_canonical_schedules
5031         after build_scop_iteration_domain.
5032
5033 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
5034             Tobias Grosser  <tobi.grosser@amd.com>
5035
5036         * graphite.c (add_conditions_to_domain): Add the loops to
5037         the dimension of the iteration domain.  Do copy the domain
5038         only when it exists.
5039         (build_scop_conditions_1): Do not call add_conditions_to_domain.
5040         (add_conditions_to_constraints): New.
5041         (can_generate_code_stmt, can_generate_code): Removed.
5042         (gloog): Do not call can_generate_code.
5043         (graphite_transform_loops): Call add_conditions_to_constraints
5044         after building the iteration domain.
5045
5046 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
5047             Tobias Grosser  <tobi.grosser@amd.com>
5048             Jan Sjodin  <jan.sjodin@amd.com>
5049
5050         * graphite.c (scan_tree_for_params): On substractions negate
5051         all the coefficients of the term.
5052         (clast_to_gcc_expression_red): New.  Handle reduction expressions
5053         of more than two operands.
5054         (clast_to_gcc_expression): Call clast_to_gcc_expression_red.
5055         (get_vdef_before_scop): Handle also the case of default definitions.
5056
5057 2009-01-14  Sebastian Pop  <sebastian.pop@amd.com>
5058
5059         PR middle-end/38431
5060         * graphite.c (get_vdef_before_scop, scop_adjust_vphi): New.
5061         (scop_adjust_phis_for_liveouts): Call scop_adjust_vphi.
5062         (gloog): Do not call cleanup_tree_cfg.
5063         (graphite_transform_loops): Call cleanup_tree_cfg after all
5064         scops have been code generated.
5065
5066 2009-01-13  Sebastian Pop  <sebastian.pop@amd.com>
5067
5068         * passes.c (init_optimization_passes): Schedule after
5069         graphite transforms pass_copy_prop, pass_dce_loop and pass_lim.
5070
5071 2009-01-13  Sebastian Pop  <sebastian.pop@amd.com>
5072
5073         * graphite.c (expand_scalar_variables_stmt): Do not pass loop_p.
5074         Fix comment.
5075         (expand_scalar_variables_ssa_name): Do not pass loop_p.  Fix comment.
5076         Set the type of an expression to the type of its assign statement.
5077         (expand_scalar_variables_expr):  Do not pass loop_p.
5078         Fix comment.  Stop recursion on tcc_constant or tcc_declaration.
5079         (copy_bb_and_scalar_dependences): Do not pass loop_p.
5080         (translate_clast): Update call to copy_bb_and_scalar_dependences.
5081
5082 2009-01-11  Sebastian Pop  <sebastian.pop@amd.com>
5083
5084         * graphite.c (expand_scalar_variables_ssa_name): Set the type of
5085         an expression to the gimple_expr_type of its assign statement.
5086         (expand_scalar_variables_expr): Stop recursion on tcc_constant
5087         or tcc_declaration.
5088
5089 2009-01-11  Sebastian Pop  <sebastian.pop@amd.com>
5090
5091         PR tree-optimization/38786
5092         * gcc.dg/graphite/pr38786.c: New.
5093         * graphite.c (expand_scalar_variables_ssa_name): New, outlined from
5094         the SSA_NAME case of expand_scalar_variables_expr.
5095         (expand_scalar_variables_expr): Also gather the scalar computation
5096         used to index the memory access.
5097         (expand_scalar_variables_stmt): Pass to expand_scalar_variables_expr
5098         the gimple_stmt_iterator where it inserts new code.
5099
5100 2009-01-10  Sebastian Pop  <sebastian.pop@amd.com>
5101
5102         * gcc.dg/graphite/block-3.c: Fix compile error on 32bit.
5103
5104 2009-01-10  Sebastian Pop  <sebastian.pop@amd.com>
5105
5106         * opts.c (decode_options): Enable flag_graphite_identity and
5107         flag_loop_block in -O2 and above.
5108
5109 2009-01-08  Sebastian Pop  <sebastian.pop@amd.com>
5110
5111         * libjava/classpath/lib/gnu/java/awt/peer/gtk/GtkMouseInfoPeer.class:
5112         Fix merge problem: replace with the file from trunk.
5113
5114 2009-01-08  Sebastian Pop  <sebastian.pop@amd.com>
5115
5116         * Merge from mainline (r141727:143163).
5117
5118 2009-01-07  Sebastian Pop  <sebastian.pop@amd.com>
5119             Jan Sjodin  <jan.sjodin@amd.com>
5120
5121         PR tree-optimization/38559
5122         * gcc.dg/graphite/pr38559.c: New.
5123
5124         * graphite.c (debug_value, copy_constraint,
5125         swap_constraint_variables, scale_constraint_variable, ): New.
5126         (get_lower_bound, get_upper_bound): Removed.
5127         (graphite_trans_bb_strip_mine): Clean up this code that works
5128         only for constant number of iterations.  Fully copy upper and
5129         lower bound constraints, not only the constant part of them.
5130         * graphite.h (debug_value): Declared.
5131
5132 2009-01-06  Jan Sjodin  <jan.sjodin@amd.com>
5133
5134         PR tree-optimization/38492
5135         PR tree-optimization/38498
5136         * tree-check.c (operator_is_linear, scev_is_linear_expression): New.
5137         * tree-chrec.h (scev_is_linear_expression): Declared.
5138         * graphite.c (graphite_cannot_represent_loop_niter): New.
5139         (scopdet_basic_block_info): Call graphite_cannot_represent_loop_niter.
5140         (graphite_loop_normal_form): Use gcc_assert.
5141         (scan_tree_for_params): Use CASE_CONVERT.
5142         (phi_node_is_iv, bb_contains_non_iv_scalar_phi_nodes): New.
5143         (build_scop_conditions_1): Call bb_contains_non_iv_scalar_phi_nodes.
5144         Use gcc_assert.  Discard scops that contain unhandled cases.
5145         (build_scop_conditions): Return a boolean status for unhandled cases.
5146         (strip_mine_profitable_p): Print the loop number, not its depth.
5147         (is_interchange_valid): Pass the depth of the loop nest, don't
5148         recompute it wrongly.
5149         (graphite_trans_bb_block): Same.
5150         (graphite_trans_bb_block): Print tentative of loop blocking.
5151         (graphite_trans_scop_block): Do not print that the loop has been
5152         blocked.
5153         (graphite_transform_loops): Do not handle scops that contain condition
5154         scalar phi nodes.
5155
5156         * gcc.dg/graphite/pr38500.c: Fixed warning as committed
5157         in trunk.
5158         * gcc.dg/graphite/block-0.c: Update test.
5159         * gcc.dg/graphite/block-1.c: Same.
5160         * gcc.dg/graphite/block-2.c: Remove xfail and test for
5161         blocking.
5162         * gcc.dg/graphite/block-4.c: Remove test for strip mine.
5163         * gcc.dg/graphite/block-3.c: New.
5164         * gcc.dg/graphite/pr38498.c: New.
5165
5166 2008-12-22  Harsha Jagasia  <harsha.jagasia@amd.com>
5167
5168         PR tree-optimization/38510
5169         * gcc.dg/graphite/pr38510.c: New.
5170         * graphite.c (recompute_all_dominators): Call mark_irreducible_loops.
5171           (translate_clast): Call recompute_all_dominators before
5172           graphite_verify.
5173           (gloog): Call recompute_all_dominators before graphite_verify.
5174
5175 2008-12-12  Sebastian Pop  <sebastian.pop@amd.com>
5176
5177         PR tree-optimization/38492
5178         * graphite.c (rename_map_elt, debug_rename_elt,
5179         debug_rename_map_1, debug_rename_map, new_rename_map_elt,
5180         rename_map_elt_info, eq_rename_map_elts,
5181         get_new_name_from_old_name, bb_in_sese_p): Moved around.
5182         (sese_find_uses_to_rename_use): Renamed sese_build_livein_liveouts_use.
5183         (sese_find_uses_to_rename_bb): Renamed sese_build_livein_liveouts_bb.
5184         (sese_build_livein_liveouts): New.
5185         (new_sese, free_sese): New.
5186         (new_scop): Call new_sese.
5187         (free_scop): Call free_sese.
5188         (rename_variables_from_edge, rename_phis_end_scop): Removed.
5189         (register_old_new_names): Renamed register_old_and_new_names.
5190         (register_scop_liveout_renames, add_loop_exit_phis,
5191         insert_loop_close_phis, struct igp,
5192         default_liveout_before_guard, add_guard_exit_phis,
5193         insert_guard_phis, copy_renames): New.
5194         (translate_clast): Call insert_loop_close_phis and insert_guard_phis.
5195         (sese_add_exit_phis_edge): Renamed scop_add_exit_phis_edge.
5196         (rewrite_into_sese_closed_ssa): Renamed scop_insert_phis_for_liveouts.
5197         (scop_adjust_phis_for_liveouts): New.
5198         (gloog): Call scop_adjust_phis_for_liveouts.
5199
5200         * graphite.h (struct sese): Documented.  Added fields liveout,
5201         num_ver and livein.
5202         (SESE_LIVEOUT, SESE_LIVEIN, SESE_LIVEIN_VER, SESE_NUM_VER): New.
5203         (new_sese, free_sese, sese_build_livein_liveouts): Declared.
5204         (struct scop): Added field liveout_renames.
5205         (SCOP_LIVEOUT_RENAMES): New.
5206
5207 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
5208
5209         PR tree-optimization/38409
5210         * gcc.dg/graphite/pr38409.c: New.
5211         * graphite.c (nb_reductions_in_loop): Use simple_iv.
5212
5213 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
5214
5215         * graphite.c (gcc_type_for_cloog_iv): By default return
5216         integer_type_node.
5217         (graphite_create_new_loop): Don't fold_convert the already
5218         fold_convert-ed expression.
5219
5220 2008-12-11  Harsha Jagasia  <harsha.jagasia@amd.com>
5221
5222         PR tree-optimization/38446
5223         * gcc.dg/graphite/pr38446.c: New.
5224         * graphite.c (register_bb_in_sese): New.
5225         (bb_in_sese_p): Check if bb belongs to sese region by explicitly
5226         looking at the bbs in the region.
5227         * graphite.h (sese): Add region_basic_blocks pointer set to
5228         structure and initialize at the time of defining new scop.
5229
5230 2008-12-11  Tobias Grosser  <grosser@fim.uni-passau.de>
5231
5232         * graphite.c (new_graphite_bb): Initialize GBB_STATIC_SCHEDULE.
5233         (find_params_in_bb): Do not free data refs.
5234         (free_graphite_bb): Add FIXME on disabled free_data_refs.
5235
5236 2008-12-11  Sebastian Pop  <sebastian.pop@amd.com>
5237
5238         * gcc.dg/graphite/scop-16.c: Test only scop specific info.
5239         * gcc.dg/graphite/scop-17.c: Same.
5240         * gcc.dg/graphite/block-5.c: New.
5241         * gcc.dg/graphite/block-6.c: New.
5242         * gcc.dg/graphite/pr37485.c: Clean dump file after.
5243         * gcc.dg/graphite/pr37684.c: Same.
5244         * gcc.dg/graphite/block-2.c: Same.
5245
5246         * graphite.c (struct ivtype_map_elt): New.
5247         (debug_ivtype_elt, debug_ivtype_map_1, debug_ivtype_map,
5248         new_ivtype_map_elt, ivtype_map_elt_info, eq_ivtype_map_elts,
5249         gcc_type_for_cloog_iv): New.
5250         (loop_iv_stack_patch_for_consts): Use the type of the induction
5251         variable from the original loop, except for the automatically
5252         generated loops, i.e., in the case of a strip-mined loop, in
5253         which case there is no original loop: in that case just use
5254         integer_type_node.
5255         (new_graphite_bb): Initialize GBB_CLOOG_IV_TYPES.
5256         (free_graphite_bb): Free GBB_CLOOG_IV_TYPES.
5257         (clast_name_to_gcc): Accept params to be NULL.
5258         (clast_to_gcc_expression): Take an extra parameter for the type.
5259         Convert to that type all the expressions built by this function.
5260         (gcc_type_for_clast_expr, gcc_type_for_clast_eq): New.
5261         (graphite_translate_clast_equation): Compute the type of the
5262         clast_equation before translating its LHS and RHS.
5263         (clast_get_body_of_loop, gcc_type_for_iv_of_clast_loop): New.
5264         (graphite_create_new_loop): Compute the type of the induction
5265         variable before translating the lower and upper bounds and before
5266         creating the induction variable.
5267         (rename_variables_from_edge, rename_phis_end_scop): New.
5268         (copy_bb_and_scalar_dependences): Call rename_phis_end_scop.
5269         (sese_add_exit_phis_edge): Do not use integer_zero_node.
5270         (find_cloog_iv_in_expr, compute_cloog_iv_types_1,
5271         compute_cloog_iv_types): New.
5272         (gloog): Call compute_cloog_iv_types before starting the
5273         translation of the clast.
5274
5275         * graphite.h (struct graphite_bb): New field cloog_iv_types.
5276         (GBB_CLOOG_IV_TYPES): New.
5277         (debug_ivtype_map): Declared.
5278         (oldiv_for_loop): New.
5279
5280 2008-12-10  Tobias Grosser  <grosser@fim.uni-passau.de>
5281
5282         PR middle-end/38459
5283         * graphite.c (new_scop): Initialize SCOP_ADD_PARAMS.
5284         (param_index): Assert if parameter is not know after parameter
5285         detection.
5286         (find_params_in_bb): Detect params directly in GBB_CONDITIONS.
5287         (find_scop_parameters): Mark, that we have finished parameter
5288         detection.
5289         (graphite_transform_loops): Move condition detection before parameter
5290         detection.
5291         * graphite.h (struct scop): Add SCOP_ADD_PARAMS.
5292         * gfortran.dg/graphite/pr38459.f90: New.
5293
5294 2008-12-09  Tobias Grosser  <grosser@fim.uni-passau.de>
5295
5296         * graphite.c (graphite_transform_loops): Always call find_transform ()
5297         in ENABLE_CHECKING.  So we test these code paths, even if we do not
5298         generate code.
5299
5300 2008-12-09  Tobias Grosser  <grosser@fim.uni-passau.de>
5301
5302         * graphite.c (print_graphite_bb): Fix printing to file != dump_file.
5303         (print_scop): Ditto.
5304
5305 2008-12-08  Tobias Grosser  <grosser@fim.uni-passau.de>
5306
5307         PR middle-end/38084
5308         Fix gfortran.dg/graphite/id-3.f90.
5309         * graphite.c (scopdet_basic_block_info): Fix bug that found some
5310         regions more than once.
5311
5312 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
5313
5314         Fix gfortran.dg/graphite/id-4.f90.
5315         * graphite.c (scan_tree_for_params): Do not compute the multiplicand
5316         when not needed.
5317
5318 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
5319
5320         Fix gfortran.dg/graphite/id-1.f90.
5321         * graphite.c (gmp_cst_to_tree): Pass the type in parameter.
5322         (loop_iv_stack_patch_for_consts): Update use of gmp_cst_to_tree.
5323         (max_precision_type): New.
5324         (value_clast): Removed.
5325         (clast_to_gcc_expression): Be more careful to types of expressions.
5326         Use max_precision_type and update use of gmp_cst_to_tree.
5327         (graphite_translate_clast_equation): Use max_precision_type.
5328         (graphite_create_guard_cond_expr): Do not use integer_type_node,
5329         use the type of the condition.
5330         (graphite_create_new_loop): Do not use integer_type_node, use the
5331         max_precision_type of lb and ub.
5332
5333 2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>
5334
5335         * graphite.c (build_scops_1): Initialize open_scop.exit
5336         and sinfo.last.
5337
5338 2008-12-02  Sebastian Pop  <sebastian.pop@amd.com>
5339
5340         * gcc.dg/graphite/pr38084.c: New.
5341         * gfortran.dg/graphite/id-1.f90: New.
5342         * gfortran.dg/graphite/id-2.f90: New.
5343         * gfortran.dg/graphite/id-3.f90: New.
5344         * gfortran.dg/graphite/id-4.f90: New.
5345         * gfortran.dg/graphite/pr37857.f90: New.
5346
5347 2008-12-02  Sebastian Pop  <sebastian.pop@amd.com>
5348             Jan Sjodin  <jan.sjodin@amd.com>
5349             Harsha Jagasia  <harsha.jagasia@amd.com>
5350
5351         PR middle-end/37852
5352         PR middle-end/37883
5353         PR middle-end/37928
5354         PR middle-end/37980
5355         PR middle-end/38038
5356         PR middle-end/38039
5357         PR middle-end/38073
5358         PR middle-end/38083
5359         PR middle-end/38125
5360
5361         * gcc.dg/graphite/pr38073.c: New.
5362         * gcc.dg/graphite/pr37928.c: New.
5363         * gcc.dg/graphite/pr37883.c: New.
5364         * gcc.dg/graphite/pr38125.c: New.
5365         * gfortran.dg/graphite/pr38083.f90: New.
5366         * gfortran.dg/graphite/pr37852.f90: New.
5367         * gfortran.dg/graphite/pr37980.f90: New.
5368
5369         * gcc.dg/graphite/scop-18.c: Remove reduction, test for
5370         the number of detected scops.  Copy exact same test for loop
5371         blocking...
5372         * gcc.dg/graphite/block-1.c: Fix the number of expected
5373         loops to be blocked as reductions are not handled.
5374         * gcc.dg/graphite/block-4.c: ...here.  New.
5375
5376         * tree-phinodes.c (remove_phi_nodes): New, extracted from...
5377         * tree-cfg.c (remove_phi_nodes_and_edges_for_unreachable_block):
5378         ...here.
5379         * tree-flow.h (remove_phi_nodes, canonicalize_loop_ivs): Declared.
5380         * Makefile.in (graphite.o): Depend on value-prof.h.
5381         (graphite.o-warn): Removed -Wno-error.
5382         * tree-parloops.c (canonicalize_loop_ivs): Allow reduction_list
5383         to be a NULL pointer.  Call update_stmt.  Return the newly created
5384         cannonical induction variable.
5385
5386         * graphite.h (debug_rename_map): Declared.  Fix some comments.
5387
5388         * graphite.c: Reimplement the code generation from graphite to gimple.
5389         Include value-prof.h.
5390         (loop_iv_stack_get_iv): Do not return NULL for constant substitutions.
5391         (get_old_iv_from_ssa_name): Removed.
5392         (graphite_stmt_p): New.
5393         (new_graphite_bb): Test for useful statements before building a
5394         graphite statement for the basic block.
5395         (free_graphite_bb): Do not free GBB_DATA_REFS: this is a bug
5396         in free_data_ref that calls BITMAP_FREE (DR_VOPS (dr)) without
5397         reason.
5398         (recompute_all_dominators, graphite_verify,
5399         nb_reductions_in_loop, graphite_loop_normal_form): New.
5400         (scop_record_loop): Call graphite_loop_normal_form.
5401         (build_scop_loop_nests): Iterate over all the blocks of the
5402         function instead of relying on the incomplete information from
5403         SCOP_BBS.  Return the success of the operation.
5404         (find_params_in_bb): Use the data from GBB_DATA_REFS.
5405         (add_bb_domains): Removed.
5406         (build_loop_iteration_domains): Don't call add_bb_domains.
5407         Add the iteration domain only to the basic blocks that have been
5408         translated to graphite.
5409         (build_scop_conditions_1): Add constraints only if the basic
5410         block have been translated to graphite.
5411         (build_scop_data_accesses): Completely disabled until data
5412         dependence is correctly implemented.
5413         (debug_rename_elt, debug_rename_map_1, debug_rename_map): New.
5414         (remove_all_edges_1, remove_all_edges): Removed.
5415         (get_new_name_from_old_name): New.
5416         (graphite_rename_variables_in_stmt): Renamed
5417         rename_variables_in_stmt.  Call get_new_name_from_old_name.
5418         Use replace_exp and update_stmt.
5419         (is_old_iv): Renamed is_iv.
5420         (expand_scalar_variables_stmt): Extra parameter for renaming map.
5421         Use replace_exp and update_stmt.
5422         (expand_scalar_variables_expr): Same.  Use the map to get the
5423         new names for the renaming of induction variables and for the
5424         renaming of variables after a basic block has been copied.
5425         (expand_scalar_variables): Same.
5426         (graphite_rename_variables): Renamed rename_variables.
5427         (move_phi_nodes): Removed.
5428         (get_false_edge_from_guard_bb): New.
5429         (build_iv_mapping): Do not insert the induction variable of a
5430         loop in the renaming iv map if the basic block does not belong
5431         to that loop.
5432         (register_old_new_names, graphite_copy_stmts_from_block,
5433         copy_bb_and_scalar_dependences): New.
5434         (translate_clast): Heavily reimplemented: copy basic blocks,
5435         do not move them.  Finally, in call cleanup_tree_cfg in gloog.
5436         At each translation step call graphite_verify ensuring the
5437         consistency of the SSA, loops and dominators information.
5438         (collect_virtual_phis, find_vdef_for_var_in_bb,
5439         find_vdef_for_var_1, find_vdef_for_var,
5440         patch_phis_for_virtual_defs): Removed huge hack.
5441         (mark_old_loops, remove_dead_loops, skip_phi_defs,
5442         collect_scop_exit_phi_args, patch_scop_exit_phi_args,
5443         gbb_can_be_ignored, scop_remove_ignoreable_gbbs, ): Removed.
5444         (remove_sese_region, ifsese, if_region_entry, if_region_exit,
5445         if_region_get_condition_block, if_region_set_false_region,
5446         create_if_region_on_edge, move_sese_in_condition, bb_in_sese_p,
5447         sese_find_uses_to_rename_use, sese_find_uses_to_rename_bb,
5448         sese_add_exit_phis_edge, sese_add_exit_phis_var,
5449         rewrite_into_sese_closed_ssa): New.
5450         (gloog): Remove dead code.  Early return if code cannot be
5451         generated.  Call cleanup_tree_cfg once the scop has been code
5452         generated.
5453         (graphite_trans_scop_block, graphite_trans_loop_block): Do not
5454         block loops with less than two loops.
5455         (graphite_apply_transformations): Remove the call to
5456         scop_remove_ignoreable_gbbs.
5457         (limit_scops): When build_scop_loop_nests fails, continue on
5458         the next scop.  Fix open_scop.entry.
5459         (graphite_transform_loops): Call recompute_all_dominators: force the
5460         recomputation of correct CDI_DOMINATORS and CDI_POST_DOMINATORS.
5461         Call initialize_original_copy_tables and free_original_copy_tables
5462         to be able to copy basic blocks during code generation.
5463         When build_scop_loop_nests fails, continue on next scop.
5464         (value_clast): New union.
5465         (clast_to_gcc_expression): Fix type cast warning.
5466
5467 2008-11-09  Sebastian Pop  <sebastian.pop@amd.com>
5468
5469         * Merge from mainline (r140838:141727).
5470
5471 2008-11-05  Tobias Grosser  <grosser@fim.uni-passau.de>
5472
5473         PR middle-end/37833
5474
5475         * graphite.c (scan_tree_for_params): Add POINTER_PLUS_EXPR.
5476
5477 2008-11-05  Tobias Grosser  <grosser@fim.uni-passau.de>
5478
5479         PR middle-end/37943
5480
5481         * graphite.c (scopdet_basic_block_info): Fix loops with multiple
5482         exits and conditions.
5483         * gcc.dg/graphite/pr37943.c: New.
5484
5485 2008-10-23  Tobias Grosser  <grosser@fim.uni-passau.de>
5486
5487         PR middle-end/37886
5488         * graphite.c (gloog): Replace EXIT_BLOCK_PTR with scop exit.
5489
5490 2008-10-23  Tobias Grosser  <grosser@fim.uni-passau.de>
5491
5492         * doc/invoke.texi: Fix spaces.
5493
5494 2008-10-22  Sebastian Pop  <sebastian.pop@amd.com>
5495
5496         PR tree-optimization/37891
5497         Reverted last commit.
5498         * graphite.c (create_single_entry_edge): Set
5499         EDGE_IRREDUCIBLE_LOOP and BB_IRREDUCIBLE_LOOP.
5500
5501 2008-10-21  Sebastian Pop  <sebastian.pop@amd.com>
5502             Mitul Thakkar  <mitul.thakkar@amd.com>
5503
5504         * graphite.c (create_single_entry_edge): Set
5505         EDGE_IRREDUCIBLE_LOOP and BB_IRREDUCIBLE_LOOP.
5506
5507 2008-10-16  Tobias Grosser  <grosser@fim.uni-passau.de>
5508
5509         * doc/invoke.texi: Add -fgraphite-identity.
5510         * graphite.c (graphite_apply_transformations): Check for
5511         -fgraphite-identity.
5512         * toplev.c (process_options): Add flag_graphite_identity.
5513         * tree-ssa-loop.c: Add flag_graphite_identity.
5514
5515 2008-10-14  Sebastian Pop  <sebastian.pop@amd.com>
5516
5517         Undo changes from 2008-10-02:
5518         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Convert
5519         operand type when copying the operand to a variable of different type.
5520         * cfgloopmanip.c (create_empty_loop_on_edge): Write exit condition
5521         with the IV name after increment.
5522
5523 2008-10-14  Sebastian Pop  <sebastian.pop@amd.com>
5524             Harsha Jagasia  <harsha.jagasia@amd.com>
5525
5526         PR tree-optimization/37828
5527         * gcc.dg/graphite/pr37828.c: New.
5528         * graphite.c (graphite_trans_loop_block): Do not loop block
5529         single nested loops.
5530
5531 2008-10-09  Harsha Jagasia  <harsha.jagasia@amd.com>
5532             Sebastian Pop  <sebastian.pop@amd.com>
5533
5534         * graphite.c (struct rename_map_elt, new_rename_map_elt,
5535         rename_map_elt_info, eq_rename_map_elts): New.
5536         (graphite_rename_ivs_stmt): Renamed graphite_rename_variables_in_stmt.
5537         (expand_scalar_variables_expr): Change parameters.
5538         (expand_scalar_variables_stmt): Same.
5539         (expand_scalar_variables): Same.
5540         (graphite_rename_ivs): Rename graphite_rename_variables.
5541         (build_iv_mapping): New.
5542         (translate_clast): Call build_iv_mapping.
5543         * graphite.h (gbb_p): New name.
5544
5545 2008-10-03  Harsha Jagasia  <harsha.jagasia@amd.com>
5546
5547         PR tree-optimization/37684
5548         * gcc.dg/graphite/pr37684.c: New.
5549         * graphite.c (exclude_component_ref): New.
5550         (is_simple_operand): Call exclude_component_ref.
5551
5552 2008-10-02  Jan Sjodin  <jan.sjodin@amd.com>
5553             Harsha Jagasia  <harsha.jagasia@amd.com>
5554
5555         PR tree-optimization/37485
5556         * gcc.dg/graphite/block-2.c: New
5557         * graphite.c (gmp_cst_to_tree): Moved.
5558         (iv_stack_entry_is_constant): New.
5559         (iv_stack_entry_is_iv): New.
5560         (loop_iv_stack_push): Renamed to loop_iv_stack_push_iv.
5561         (loop_iv_stack_insert_constant): New.
5562         (loop_iv_stack_pop): Use new datatpype.
5563         (loop_iv_stack_get_iv): Same.
5564         (loop_iv_stack_get_iv_from_name): Same.
5565         (loop_iv_stack_debug): Renamed to debug_loop_iv_stack.
5566         (loop_iv_stack_patch_for_consts): New.
5567         (loop_iv_stack_remove_constants): New.
5568         (graphite_create_new_loop): Use loop_iv_stack_push_iv.
5569         (translate_clast): Call loop_iv_stack_patch_for_consts and
5570         loop_iv_stack_remove_constants.
5571         (gloog): Use new datatype.  Redirect construction edge to end
5572         block to avoid accidental deletion.
5573         * graphite.h (enum iv_stack_entry_kind): New.  Tag for data in
5574         iv stack entry.
5575         (union iv_stack_entry_data): New.  Data in iv stack entry.
5576         (struct iv_stack_entry): New.  Datatype for iv stack entries.
5577
5578 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
5579
5580         * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Convert
5581         operand type when copying the operand to a variable of different type.
5582
5583 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
5584
5585         * cfgloopmanip.c (create_empty_loop_on_edge): Write exit condition
5586         with the IV name after increment.
5587
5588 2008-10-02  Sebastian Pop  <sebastian.pop@amd.com>
5589
5590         * Merge from mainline (r140164:140838).
5591
5592 2008-09-10  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
5593
5594         * graphite-data-ref.c: New.
5595         * graphite.c (print_scop): Also dump the dependence graph.
5596         (bb_in_scop_p, loop_in_scop_p, nb_loops_around_gb): Moved...
5597         (new_scop): Initialize SCOP_DEP_GRAPH.
5598         (build_scop_dynamic_schedules): New.
5599         (build_access_matrix_with_af): Fixed column numbering.
5600         (graphite_transform_loops): Call build_scop_dynamic_schedules.
5601         * graphite.h: Add ifndef/define guards against multiple inclusion.
5602         (struct scop): Add dep_graph field.
5603         (SCOP_DEP_GRAPH): Defined.
5604         (ref_nb_loops): Fixed and moved to other position.
5605         (bb_in_scop_p, loop_in_scop_p, nb_loops_around_gb): ... here.
5606         (nb_loops_around_loop_in_scop): New.
5607         (graphite_dump_dependence_graph): Declared.
5608         (graphite_build_rdg_all_levels): Declared.
5609         (graphite_test_dependence): Declared.
5610         * Makefile.in (graphite-data-ref.o): New target.
5611
5612 2008-09-09  Sebastian Pop  <sebastian.pop@amd.com>
5613
5614         * Merge from mainline (139870:140164).
5615
5616 2008-09-01  Sebastian Pop  <sebastian.pop@amd.com>
5617
5618         * Merge from mainline (138275:139870).
5619         * gcc.dg/graphite/scop-matmult.c: XFailed as one of
5620         the commits from trunk broke the niter detection.
5621
5622 2008-09-01  Sebastian Pop  <sebastian.pop@amd.com>
5623
5624         * graphite.c: Add more documentation.  Fix formatting.
5625         (debug_loop_vec, debug_oldivs, loop_iv_stack,
5626         loop_iv_stack_debug): Moved...
5627         (schedule_to_scattering): Move before use.
5628         (dot_all_scops): Include in "#if 0" the code for system
5629         call dotty.
5630
5631         * graphite.h: (debug_loop_vec, debug_oldivs, loop_iv_stack,
5632         loop_iv_stack_debug): ...here.
5633
5634 2008-08-29  Jan Sjodin  <jan.sjodin@amd.com>
5635
5636         * tree-phinodes.c (make_phi_node): Extern.
5637         (add_phi_node_to_bb): New.
5638         (create_phi_node): Call add_phi_node_to_bb.
5639         * tree-ssa-loop-ivopts.c (get_phi_with_result): New.
5640         (remove_statement): Handle case where stored phi was updated
5641         and is no longer the same.
5642         * graphite.c (is_parameter): New.
5643         (is_old_iv): New.
5644         (expand_scalar_variables_expr): New.
5645         (expand_scalar_variables_stmt): New.
5646         (expand_scalar_variables): New.
5647         (move_phi_nodes): Create new phi instead of moving old one.
5648         (translate_clast): Call expand_scalar_variables.
5649         (find_vdef_for_var_in_bb): Also scan regular definitions.
5650         (skip_phi_defs): New.
5651         (collect_scop_exit_phi_args): New.
5652         (patch_scop_exit_phi_args): New.
5653         (gloog): Patch phis after scop.
5654         * tree-flow.h: (add_phi_node_to_bb): Declared.
5655         (make_phi_node): Declared.
5656
5657 2008-08-26  Sebastian Pop  <sebastian.pop@amd.com>
5658
5659         * graphite.c (end_scop): Split the entry of the scop when it
5660         is the header of the loop in which the scop is ending.
5661         (build_scops_1, limit_scops): Update uses of end_scop.
5662
5663 2008-08-26  Sebastian Pop  <sebastian.pop@amd.com>
5664
5665         * graphite.c (dot_all_scops_1): Do not fail on uninitialized
5666         SCOP_ENTRY or SCOP_EXIT.
5667
5668 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5669
5670         * graphite.c (get_construction_edge): Removed.
5671         (gloog): Construction edge is the scop entry edge.
5672
5673 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5674
5675         * graphite.c (can_generate_for_scop): Removed.
5676         (gloog): Do not call it.
5677
5678 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5679
5680         * graphite.c (new_scop): Entry of a scop is an edge.
5681         Initialize SESE region.
5682         (free_scop): Free SESE region.
5683         (build_scops_1, scopdet_bb_info): Work on edges, not on bbs.
5684         (split_difficult_bb): New, split from end_scop.
5685         (end_scop): Exit of a scop is an edge.
5686         (build_scop_bbs): Never check CDI_POST_DOMINATORS: this info is
5687         not automatically updated and thus is always wrong.
5688         * graphite.h (struct sese): New.
5689         (SESE_ENTRY): New.
5690         (SESE_EXIT): New.
5691         (struct scop): New field for a SESE region.  Remove entry, exit.
5692         (SCOP_ENTRY, SCOP_EXIT): Update definitions to match same
5693         semantics as before.  Moved comment around.
5694
5695 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
5696             Sebastian Pop  <sebastian.pop@amd.com>
5697
5698         * graphite.c (graphite_transform_loops): Always enable gloog
5699         and find_transform when ENABLE_CHECKING.
5700
5701 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5702
5703         * graphite.c (graphite_transform_loops): Move pretty printer
5704         of SCOPs before doing any transform.  Remove call to print_scops
5705         and dot_all_scops_1.
5706
5707 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5708
5709         * graphite.c (dump_gbb_conditions): Don't try to print NULL pointers.
5710         (print_graphite_bb): Same.
5711
5712 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5713
5714         * graphite.c (dot_all_scops_1): Cleanup.
5715         (move_scops): Fix comment.
5716
5717 2008-08-25  Sebastian Pop  <sebastian.pop@amd.com>
5718
5719         * graphite.c (build_scop_bbs): Revert commit 139355:
5720
5721         2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5722                     Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5723
5724                 * graphite.c (build_scop_bbs): Factor up code.
5725
5726 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
5727
5728         * graphite.c (gloog): Update dominator info.
5729
5730 2008-08-25  Tobias Grosser  <grosser@fim.uni-passau.de>
5731
5732         * graphite.c (remove_cond_exprs): Do not fail on empty bbs.
5733
5734 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
5735
5736         * graphite.c (new_graphite_bb): Remove GBB_INDEX_TO_NUM_MAP
5737         initialization.
5738         (free_graphite_bb): Remove GBB_INDEX_TO_NUM_MAP free.
5739         (translate_clast): Correct formatting.
5740         * graphite.h (struct num_map): Removed.
5741         (struct graphite_bb): Remove num_map field.
5742         (GBB_INDEX_TO_NUM_MAP): Removed.
5743
5744 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
5745
5746         * graphite.c (build_access_matrix_with_af): Fix comments.
5747         (build_scop_data_accesses): Same.
5748
5749 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
5750
5751         * graphite.c (build_scop_data_accesses): Don't construct
5752         access matrices.  Add a FIXME and an assert condition that
5753         should pass when the access matrices will be needed.
5754
5755 2008-08-24  Sebastian Pop  <sebastian.pop@amd.com>
5756
5757         * tree-data-ref.c (stmt_simple_memref_p): Don't call
5758         really_constant_p.
5759         * graphite.c (build_graphite_bb): Renamed new_graphite_bb.
5760         Moved close by free_graphite_bb.
5761         (free_graphite_bb): Call free_data_refs.  Reset bb->aux.
5762         (new_scop): Move close by free_scop.
5763         (graphite_transform_loops): Avoid linear scan to reset bb->aux.
5764
5765 2008-08-22  Jan Sjodin  <jan.sjodin@amd.com>
5766
5767         * cfgloopmanip.c (create_empty_if_region_on_edge): New.
5768         * graphite.c (clast_to_gcc_expression): Call gmp_cst_to_tree
5769         instead of recursive call.
5770         (graphite_translate_clast_equation): New.
5771         (graphite_create_guard_cond_expr): New.
5772         (graphite_create_new_guard): New.
5773         (get_stack_index_from_iv): Removed.
5774         (graphite_rename_ivs_stmt): Use gbb_loop_index.
5775         (get_true_edge_from_guard_bb): New.
5776         (translate_clast): Handle stmt_guard in clast.
5777         (get_construction_edge): Allow construction edge detection for
5778         a scope entry with multiple predecessors if one predecessor is
5779         the immediate dominator of scope entry.
5780         (can_generate_code_stmt): Enable code generation for clast_guard.
5781         (gloog): Use correct context loop.  Removed check for post dominators.
5782         * cfgloop.h (create_empty_if_region_on_edge): Declared.
5783
5784 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
5785
5786         * graphite.c (remove_dead_loops): Document better which
5787         loops are removed.
5788
5789 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
5790
5791         * Makefile.in: Rename POLYLIBLIBS and POLYLIBINC to PPLLIBS
5792         and PPLINC.
5793         (graphite.o): Also depends on pointer-set.h.
5794
5795 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
5796
5797         * graphite.c (scop_record_loop): Fix compile warning.
5798
5799 2008-08-21  Harsha Jagasia  <harsha.jagasia@amd.com>
5800             Sebastian Pop  <sebastian.pop@amd.com>
5801
5802         * graphite.c (scop_record_loop): DECL_NAME can be NULL.
5803
5804 2008-08-21  Sebastian Pop  <sebastian.pop@amd.com>
5805
5806         * graphite.c (build_graphite_bb): Initialize bb->aux to
5807         point to the graphite_bb_p.
5808         (graphite_bb_from_bb): Renamed gbb_from_bb; returns the
5809         content of bb->aux.
5810         (add_bb_domains): Does not use the scop parameter.
5811         (graphite_transform_loops): Clean bb->aux at the end.
5812
5813 2008-08-20  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5814             Sebastian Pop  <sebastian.pop@amd.com>
5815
5816         * lib/target-supports.exp
5817         (check_effective_target_fgraphite): New.
5818
5819         * gcc.dg/graphite/graphite.exp: Early exit when
5820         check_effective_target_fgraphite returns false.
5821         Set dg-do-what-default to compile.
5822         (scan-graphite-dump-times): Removed.
5823         * gfortran.dg/graphite/graphite.exp: Same.
5824
5825         * gcc.dg/graphite/scop-0.c: Do not use "dg-do compile".
5826         Use scan-tree-dump-times instead of scan-graphite-dump-times.
5827         * gcc.dg/graphite/scop-1.c: Same.
5828         * gcc.dg/graphite/scop-2.c: Same.
5829         * gcc.dg/graphite/scop-3.c: Same.
5830         * gcc.dg/graphite/scop-4.c: Same.
5831         * gcc.dg/graphite/scop-5.c: Same.
5832         * gcc.dg/graphite/scop-6.c: Same.
5833         * gcc.dg/graphite/scop-7.c: Same.
5834         * gcc.dg/graphite/scop-8.c: Same.
5835         * gcc.dg/graphite/scop-9.c: Same.
5836         * gcc.dg/graphite/scop-10.c: Same.
5837         * gcc.dg/graphite/scop-11.c: Same.
5838         * gcc.dg/graphite/scop-12.c: Same.
5839         * gcc.dg/graphite/scop-13.c: Same.
5840         * gcc.dg/graphite/scop-matmult.c: Same.
5841         * gcc.dg/graphite/scop-14.c: Same.
5842         * gcc.dg/graphite/scop-15.c: Same.
5843         * gcc.dg/graphite/block-0.c: Same.
5844         * gcc.dg/graphite/scop-16.c: Same.
5845         * gcc.dg/graphite/block-1.c: Same.
5846         * gcc.dg/graphite/scop-17.c: Same.
5847         * gcc.dg/graphite/scop-18.c: Same.
5848         * gfortran.dg/graphite/block-1.f90: Same.
5849         * gfortran.dg/graphite/scop-1.f: Same.
5850         * gfortran.dg/graphite/block-2.f: Same.
5851
5852 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5853
5854         * graphite.c: Fix some XXX comments.
5855         (build_scop_dynamic_schedules): Removed.
5856
5857 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5858
5859         * graphite.h (scop_max_loop_depth): Moved...
5860         * graphite.c (scop_max_loop_depth): ...here.
5861         (remove_all_edges_1): New.
5862         (remove_all_edges): Factored code.
5863         (remove_cond_exprs): Check only the last statement for
5864         a GIMPLE_COND expression.
5865
5866 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5867
5868         * graphite.c (scan_tree_for_params): Early return when the
5869         expression is a chrec_dont_know.  Handle case NEGATE_EXPR.
5870         (find_scop_parameters): Factor out code.
5871         (graphite_trans_bb_strip_mine): Remove dead code.
5872
5873 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5874
5875         * graphite.c (clast_to_gcc_expression, graphite_create_new_loop,
5876         graphite_trans_bb_move_loop): Factor asserts.
5877         (gloog): Perform sanity checks only for ENABLE_CHECKING.
5878         Do not call calculate_dominance_info and estimate_bb_frequencies.
5879
5880 2008-08-20  Jan Sjodin  <jan.sjodin@amd.com>
5881
5882         * graphite.c (create_loops_mapping, free_loops_mapping,
5883         create_loops_mapping_num, debug_loop_mapping_1,
5884         debug_loop_mapping, graphite_loops_mapping_max_loop_num,
5885         get_loop_mapping_for_num, graphite_loops_mapping_add_child,
5886         graphite_loops_mapping_add_child_num,
5887         graphite_loops_mapping_insert_child,
5888         graphite_loops_mapping_parent, get_loop_mapped_depth_for_num,
5889         get_loop_mapped_depth, split_loop_mapped_depth_for_num,
5890         loop_mapped_depth_split_loop, swap_loop_mapped_depth_for_num,
5891         create_num_from_index, get_num_from_index,
5892         swap_loop_mapped_depth): Removed.
5893         (new_scop): Do not initialize SCOP_LOOPS_MAPPING.
5894         (free_scop): Do not call free_loops_mapping.
5895         (graphite_get_new_iv_stack_index_from_old_iv): Renamed
5896         get_stack_index_from_iv.  Use GBB_LOOPS instead of calling
5897         get_loop_mapped_depth.
5898         (graphite_trans_bb_move_loop): Do not update the loop mapping.
5899         (graphite_trans_bb_strip_mine): Same.
5900         * graphite.h (graphite_loops_mapping, graphite_loop_node): Removed.
5901         (struct scop): Remove field loops_mapping.
5902
5903 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5904             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5905
5906         * graphite.c (scop_record_loop): Factor out one level of the
5907         condition by early return.
5908         (build_scop_loop_nests): Format following FSF coding style.
5909         (build_scop_dynamic_schedules): Factor out code.
5910         (scopdet_bb_info): Reindent.  Default case should not be reachable.
5911
5912 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5913             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5914
5915         * graphite.c (loop_affine_expr): Check for DECL_P or struct
5916         assignments that are not handled as simple operands for now.
5917
5918 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5919             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5920
5921         * graphite.c (build_scop_bbs): Factor up code.
5922
5923 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5924             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5925
5926         * graphite.c (stmt_simple_for_scop_p): Factor code out
5927         of the loop.
5928         (enum gbb_type): New.  Group all the GBB_* types under it.
5929         (is_loop_exit): Moved...
5930         (end_scop): Enable BB spliting.
5931         * cfgloop.c (is_loop_exit): ...here.  Reimplemented.
5932         * cfgloop.h (is_loop_exit): Declared.
5933
5934 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5935
5936         * doc/invoke.texi: Remove strides from examples containing
5937         DO loops when the strides are equal to 1.
5938
5939 2008-08-20  Harsha Jagasia  <harsha.jagasia@amd.com>
5940             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
5941
5942         * graphite.c (graphite_trans_scop_block): Or the result with
5943         the result from graphite_trans_loop_block.
5944         * gcc.dg/graphite/block-1.c: New.
5945         * gfortran.dg/graphite/block-1.f90: New.
5946         * gfortran.dg/graphite/block-2.f: New.
5947
5948 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5949
5950         * graphite.c (graphite_transform_loops): Call cloog_initialize
5951         and cloog_finalize.
5952
5953 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5954
5955         * tree-data-ref.c) (stmt_simple_memref_p): New.
5956         * tree-data-ref.h (stmt_simple_memref_p): Declared.
5957         * graphite.c (stmt_simple_memref_for_scop_p): Removed.
5958         (is_simple_operand): Call stmt_simple_memref_p.
5959
5960         * gcc.dg/graphite/scop-matmult.c: Updated for not
5961         using pointer arithmetic, as this is optimized by PRE and
5962         makes the code too difficult to analyze.
5963
5964         * gcc.dg/graphite/scop-18.c: Same.
5965
5966 2008-08-20  Sebastian Pop  <sebastian.pop@amd.com>
5967
5968         * gdbinit.in (pgg): New.
5969
5970 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
5971
5972         * graphite.c (graphite_trans_loop_block): Fix warning.
5973
5974 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
5975
5976         * graphite.c (graphite_trans_loop_block): Fix my merge error.
5977
5978 2008-08-15  Tobias Grosser  <grosser@fim.uni-passau.de>
5979
5980         * graphite.c (graphite_trans_bb_block): Remove check for
5981         flag_loop_strip_mine, flag_loop_block, flag_loop_interchange.
5982         Check if loop blocking is profitable for every loop, before applying
5983         the changes.
5984         (graphite_apply_transformations): Call graphite_trans_bb_block only,
5985         if flag_loop_block is set.
5986
5987 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
5988
5989         * graphite.c: Add some more documentation for the loop
5990         mapping.
5991
5992 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
5993
5994         * Makefile.in (tree-data-ref.o): Remove dependence on graphite.h.
5995         * graphite.c: Format on less than 80 columns.
5996         * graphite.h: Same.
5997
5998 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
5999
6000         * cfgloopmanip.c (loopify): Use update_dominators_in_loop.
6001
6002 2008-08-14  Sebastian Pop  <sebastian.pop@amd.com>
6003
6004         * doc/invoke.texi (floop-block, floop-strip-mine,
6005         floop-interchange): Update documentation with examples.
6006
6007 2008-08-13  Sebastian Pop  <sebastian.pop@amd.com>
6008
6009         * cfgloopmanip.c (create_empty_loop_on_edge): Don't call
6010         add_referenced_var.
6011         * graphite.c (graphite_create_new_loop): Call add_referenced_var.
6012
6013 2008-08-13  Sebastian Pop  <sebastian.pop@amd.com>
6014
6015         * cfgloopmanip.c (create_empty_loop_on_edge): Improve documentation.
6016         Factor gcc_asserts into a single one.  Use force_gimple_operand_gsi.
6017         * tree-scalar-evolution.c: Revert useless changes.
6018         * tree-phinodes.c: Same.
6019         * cfghooks.c: Same.
6020         * vec.h: Same.
6021         * tree-vectorizer.h: Same.
6022         * tree-flow.h: Same.
6023         * tree-cfg.c: Same.
6024         * common.opt (fgraphite): Update documentation.
6025
6026 2008-08-12  Harsha Jagasia  <harsha.jagasia@amd.com>
6027
6028         * doc/invoke.texi (-floop-block, -floop-strip-mine,
6029         -floop-interchange): Add more text for explaining what each of these
6030         flags is doing.
6031         * tree-into-ssa.c (gimple_vec): Moved to...
6032         * graphite.c: Include gimple.h.
6033         (gimple_vec): Moved to...
6034         (del_loop_to_cloog_loop): Removed.
6035         (loop_affine_expr): Do not call create_data_ref when the
6036         operand is a constant.
6037         (new_scop): Use free instead of del_loop_to_cloog_loop.
6038         * Makefile.in (graphite.o): Depend on GIMPLE_H.
6039         * gimple.h (gimple_vec): ... here.
6040
6041 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6042
6043         * graphite.c (scopdet_bb_info): Only allow loops with known number of
6044         latch executions.
6045         (build_loop_iteration_domains): Fail, if latch executions unknown.
6046
6047 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6048
6049         * graphite.c (add_conditions_to_domain): New.
6050         (build_scop_conditions_1): Call add_conditions_to_domain.
6051         (set_cloog_options): Allow to disable optimizations.
6052
6053 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6054
6055         * graphite.c (find_params_in_bb): Look for parameters in conditions.
6056         Do not use walk_dominator_tree.
6057         (find_scop_parameters): Do not use walk_dominator_tree.
6058
6059 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6060
6061         * graphite.c (scan_tree_for_params) Add / Subtract inequality.
6062         (idx_record_params): Adapt.
6063         * graphite.h (scop_gimple_loop_depth): New.
6064
6065 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6066
6067         * graphite.c (build_scop_dynamic_schedules): Remove value_init.
6068         (scan_tree_for_params): Remove value_init.
6069         (build_scop_context): Remove value_init.
6070         (build_loop_iteration_domains): Remove value_init.
6071         (schedule_to_scattering): Remove value_init.
6072         (graphite_trans_bb_strip_mine): Remove value_init.
6073
6074 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6075
6076         * gcc/graphite.c (limit_scops): New.
6077         (graphite_transform_loops): Add limit SCoPs.
6078         * gcc.dg/graphite/scop-0.c: Update number of SCoPs.
6079         * gcc.dg/graphite/scop-1.c: Update number of SCoPs.
6080         * gcc.dg/graphite/scop-10.c: Update number of SCoPs.
6081         * gcc.dg/graphite/scop-11.c: Update number of SCoPs.
6082         * gcc.dg/graphite/scop-12.c: Update number of SCoPs.
6083         * gcc.dg/graphite/scop-13.c: Update number of SCoPs.
6084         * gcc.dg/graphite/scop-14.c: Update number of SCoPs.
6085         * gcc.dg/graphite/scop-15.c: Update number of SCoPs.
6086         * gcc.dg/graphite/scop-16.c: Update number of SCoPs.
6087         Change loop numbers.
6088         * gcc.dg/graphite/scop-17.c: Update number of SCoPs.
6089         Change loop numbers.
6090         * gcc.dg/graphite/scop-18.c: Update number of SCoPs.
6091         * gcc.dg/graphite/scop-2.c: Update number of SCoPs.
6092         * gcc.dg/graphite/scop-3.c: Update number of SCoPs.
6093         * gcc.dg/graphite/scop-4.c: Update number of SCoPs.
6094         * gcc.dg/graphite/scop-5.c: Update number of SCoPs.
6095         * gcc.dg/graphite/scop-6.c: Update number of SCoPs.
6096         * gcc.dg/graphite/scop-7.c: Update number of SCoPs.
6097         * gcc.dg/graphite/scop-8.c: Update number of SCoPs.
6098         * gcc.dg/graphite/scop-9.c: Update number of SCoPs.
6099         * gcc.dg/graphite/scop-matmult.c: Update number of SCoPs.
6100
6101 2008-08-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6102
6103         * graphite.c (graphite_transform_loops): Call always find_transform.
6104
6105 2008-08-08  Tobias Grosser  <grosser@fim.uni-passau.de>
6106
6107         * graphite.c (free_loops_mapping): New.
6108         (stmt_simple_for_scop_p): Fix typo.
6109         (stmt_simple_for_scop_p): Fix tuples functions, that
6110         broke polyhedron.
6111         (free_graphite_bb): Fix some memleaks.
6112         (free_scop): Fix some memleaks.
6113         (scopdet_bb_info): Do not forget some tmp SCoPs.
6114         (find_params_in_bb): Fix some memleaks.
6115         (clast_to_gcc_expression): Fix warning.
6116
6117 2008-08-07  Tobias Grosser  <grosser@fim.uni-passau.de>
6118
6119         * gcc.dg/graphite/scop-16.c: Fix for 32bit.
6120         * gcc.dg/graphite/scop-17.c: Fix for 32bit.
6121
6122 2008-08-04  Sebastian Pop  <sebastian.pop@amd.com>
6123
6124         * tree-ssa-loop.c (tree-ssa-loop.o): Do not include toplev.h.
6125         Move code ifdef-ed HAVE_cloog...
6126         * graphite.c: Include toplev.h.
6127         ... here.
6128         * Makefile.in (OBJS-common): Always build graphite.o.
6129         (BACKEND): Remove @GRAPHITE@.
6130         (tree-ssa-loop.o): Do not depend on TOPLEV_H.
6131         (graphite.o): Depend on TOPLEV_H.
6132
6133 2008-08-04  Sebastian Pop  <sebastian.pop@amd.com>
6134
6135         * Makefile.in (tree-ssa-loop.o): Depend on TOPLEV_H.
6136         Remove typo left from polylib to ppl conversion.
6137         * graphite.c (graphite_transforms): Use sorry instead of fatal.
6138
6139 2008-08-03  Sebastian Pop  <sebastian.pop@amd.com>
6140
6141         * toplev.c (process_options): Move the graphite loop optimization
6142         flags...
6143         * tree-ssa-loop.c (graphite_transforms): ... here.
6144         When not configured with CLooG, print to dump_file that
6145         Graphite transforms were not performed.
6146         * gcc.dg/graphite/graphite.exp (scan-graphite-dump-times):
6147         New.
6148         * gcc.dg/graphite/*.c: Updated all testcases to use
6149         scan-graphite-dump-times.
6150
6151 2008-08-03  Sebastian Pop  <sebastian.pop@amd.com>
6152
6153         * graphite.c (dot_scop, dot_all_scops): Do not call system.
6154         Do not open /tmp/scop.dot and /tmp/allscops.dot.
6155
6156 2008-08-02  Sebastian Pop  <sebastian.pop@amd.com>
6157             Jan Sjodin  <jan.sjodin@amd.com>
6158
6159         * configure: Regenerated.
6160         * omp-low.c (expand_omp_sections): Remove now unused code.
6161         * config.in (HAVE_polylib): Removed.
6162         * configure.ac (HAVE_polylib, POLYLIBLIBS, POLYLIBINC): Removed.
6163         (PPLLIBS, PPLINC): Added.
6164         * graphite.c: Replace unsigned with int wherever possible.
6165         Don't access Cloog's data structures, but use accessor functions.
6166         Clast's stmt->type is now implemented as a vtable: change the
6167         switches of stmt->type into ifs.
6168         (polylib/polylibgmp.h): Don't include.
6169         (initialize_dependence_polyhedron,
6170         initialize_data_dependence_polyhedron, is_empty_polyhedron,
6171         statement_precedes_p, test_dependence, build_rdg_all_levels,
6172         dump_dependence_graph): Removed until this code is cleaned up
6173         or ported to Cloog.
6174         * Makefile.in (POLYLIBLIBS): Renamed PPLLIBS.
6175         (POLYLIBINC): Renamed PPLINC.
6176
6177 2008-08-01  Harsha Jagasia  <harsha.jagasia@amd.com>
6178             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
6179             Jan Sjodin  <jan.sjodin@amd.com>
6180
6181         Finish the merge and tuplification of graphite.
6182
6183 2008-07-24  Sebastian Pop  <sebastian.pop@amd.com>
6184             Jan Sjodin  <jan.sjodin@amd.com>
6185
6186         Partial merge from mainline (138072:138275).
6187         * graphite.c still has to be tuplified.
6188
6189 2008-07-29  Jan Sjodin  <jan.sjodin@amd.com>
6190
6191         * graphite.c (graphite_loops_mapping_max_loop_num): New.
6192         (create_num_from_index): New.
6193         (get_num_from_index): Also pass in the graphite BB.
6194         (free_graphite_bb): Free GBB_INDEX_TO_NUM_MAP.
6195         (build_graphite_bb): Initialize GBB_INDEX_TO_NUM_MAP.
6196         (graphite_trans_bb_strip_mine): Call create_num_from_index.
6197         (is_interchange_valid): Return false when failing.
6198         * graphite.h (struct num_map): New.
6199         (struct graphite_bb): New field num_map.
6200         (GBB_LOOPS_MAPPING): Renamed GBB_INDEX_TO_NUM_MAP.
6201
6202 2008-07-29  Tobias Grosser  <grosser@fim.uni-passau.de>
6203
6204         * graphite.c (dump_gbb_conditions): Print also conditions like
6205         "if (a)".  Remove dublicated code and use print_generic_expr ().
6206         (stmt_simple_for_scop_p): Only allow conditions we can handle
6207         {<, <=, >, >=}.
6208
6209 2008-07-25  Jan Sjodin  <jan.sjodin@amd.com>
6210
6211         * graphite.h (struct scop): Removed new_ivs field.
6212         (SCOP_NEWIVS): Deleted.
6213         * graphite.c (new_scop, free_scop, clast_name_to_gcc,
6214         clast_to_gcc_expression, graphite_create_new_loop):
6215         Removed use of new_ivs.
6216
6217 2008-07-25  Jan Sjodin  <jan.sjodin@amd.com>
6218
6219         * graphite.c (debug_oldivs, debug_loop_vec, create_loops_mapping,
6220         create_loops_mapping_num, debug_loop_mapping_1): New.
6221         (debug_loop_mapping): Call debug_loop_mapping_1.
6222         (get_loop_mapping_for_num,
6223         graphite_loops_mapping_add_child,
6224         graphite_loops_mapping_add_child_num,
6225         graphite_loops_mapping_insert_child,
6226         graphite_loops_mapping_parent,
6227         split_loop_mapped_depth_for_num,
6228         loop_mapped_depth_split_loop): New.
6229         (increment_loop_mapped_depths): Removed.
6230         (swap_loop_mapped_depth_for_num): Reimplemented.
6231         (new_scop): Call create_loops_mapping.
6232         (scop_record_loop): Call graphite_loops_mapping_insert_child.
6233         (translate_clast): Pass the old loop father in parameter, and pass
6234         it to get_old_iv_from_ssa_name.
6235         (remove_edges_around_useless_blocks, can_generate_code_stmt,
6236         can_generate_code, can_generate_for_scop): New.
6237         (graphite_trans_bb_block): Returns false when it fails to transform.
6238         * graphite.h (graphite_loop_node, graphite_loops_mapping): New.
6239
6240 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
6241
6242         Reverted all the changes related to the streamization and
6243         loop fusion.
6244         These changes are now tracked in the streamization branch.
6245
6246 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
6247             Jan Sjodin  <jan.sjodin@amd.com>
6248
6249         * graphite.c (gbb_compare): Correctly constify.
6250         (gbb_can_be_ignored): Indent.
6251         (graphite_trans_scop_swap_1and2): Add legality check.
6252         Remove dead FIXMEs.
6253
6254 2008-07-25  Sebastian Pop  <sebastian.pop@amd.com>
6255
6256         Remove fallouts from "Reverted the Condate changes".
6257         * tree.h: Remove unused decl.
6258         * gcc.dg/tree-checker: Same.
6259         * timevar.def: Remove counter.
6260
6261 2008-07-24  Sebastian Pop  <sebastian.pop@amd.com>
6262
6263         * Merge from mainline (135673:138072).
6264
6265         Reverted the MIRO changes (from 2008-04-05) that are now
6266         tracked in the miro branch.
6267         * tree-bounds.c: Removed.
6268         * tree-bounds.h: Removed.
6269
6270         Reverted the Condate changes (from 2006-07-04, 2007-03-20) that
6271         are now tracked in the condate branch.
6272         * tree-check.c: Removed.
6273         * tree-match.c: Removed.
6274         * condate.y: Removed.
6275
6276 2008-07-24  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
6277
6278         * common.opt: New user flag -floop-block, -floop-strip-mine
6279         and -floop-interchange.
6280         * toplev.c (process_options): Enable -fgraphite pass if any one of the
6281         graphite loop optimization flags is turned on.
6282         * graphite.c (graphite_apply_transformations): Add flag_loop_block,
6283         flag_loop_strip_mine and flag_loop_interchange checks before
6284         optimizations.
6285         * doc/invoke.texi: Remove -fgraphite and add -floop-block,
6286         -floop-strip-mine and -floop-interchange.
6287         * gcc.dg/graphite/block-0.c: Add -floop-block and remove
6288         -fgraphite.
6289         * gcc.dg/graphite/scop-16.c: Ditto.
6290         * gcc.dg/graphite/scop-17.c: Ditto.
6291         * gcc.dg/graphite/scop-18.c: Ditto.
6292
6293 2008-07-23  Jan Sjodin  <jan.sjodin@amd.com>
6294             Sebastian Pop  <sebastian.pop@amd.com>
6295
6296         * cfgloopmanip.c (update_dominators_in_loop): Make it static.
6297         (create_empty_loop_on_edge): More fixes.
6298         * tree-phinodes.c (resize_phi_node): Extern.
6299         (unlink_phi_node, move_phi_node): New split from remove_phi_node.
6300         * cfghooks.c (update_dominator_information): New split from
6301         split_edge.
6302         * tree-vectorizer.c (rename_variables_in_bb): Extern.
6303         * tree-dfa.c (collect_dfa_stats): Start walking the CFG on the
6304         successor of the function entry block.
6305
6306         * graphite.c: Include pointer-set.h.
6307         (debug_loop_mapping, increment_loop_mapped_depths,
6308         get_loop_mapped_depth_for_num, get_loop_mapped_depth,
6309         set_loop_mapped_depth_for_num, set_loop_mapped_depth,
6310         swap_loop_mapped_depth_for_num, get_num_from_index,
6311         swap_loop_mapped_depth, loop_iv_stack_debug,
6312         loop_iv_stack_push, loop_iv_stack_pop, loop_iv_stack_get_iv,
6313         loop_iv_stack_get_iv_from_name, loop_iv_stack_debug,
6314         get_old_iv_from_ssa_name): New.
6315         (new_scop): Initialize SCOP_LOOPS_MAPPING.
6316         (free_scop): Free SCOP_LOOPS_MAPPING.
6317         (scop_record_loop): Record old ivs.
6318         (create_var_name): Removed.
6319         (initialize_cloog_names): Allocate double space in case strip mine
6320         applies to all loops once.
6321         (clast_name_to_gcc): Look up in the map ivstack passed in parameter.
6322         (clast_to_gcc_expression): Same.  Implement more clast to gimple
6323         translation.
6324         (graphite_create_new_loop): Pass in ivstack.
6325         (remove_all_edges): Pass in the construction_edge.
6326         (graphite_remove_iv): Removed.
6327         (graphite_rename_ivs, graphite_rename_ivs_stmt,
6328         remove_cond_exprs): Rewritten.
6329         (move_phi_nodes): New.
6330         (disconnect_virtual_phi_nodes, disconnect_cond_expr): Removed.
6331         (translate_clast): Pass in ivstack.  Rewrite some cases.
6332         (set_cloog_options, debug_clast_stmt): New.
6333         (find_transform): Use set_cloog_options.
6334         (outermost_loop_layer): Removed.
6335         (get_construction_edge, collect_virtual_phis, find_vdef_for_var_in_bb,
6336         find_vdef_for_var_1, find_vdef_for_var, patch_phis_for_virtual_defs,
6337         mark_old_loops, remove_dead_loops): New.
6338         (gloog): Rewritten.
6339         (graphite_trans_bb_move_loop): Call swap_loop_mapped_depth.
6340         (const_column_index, get_first_matching_sign_row_index,
6341         get_lower_bound_row, get_upper_bound_row, get_lower_bound,
6342         get_upper_bound): New.
6343         (graphite_trans_bb_strip_mine): Also update the iv map.
6344
6345         * graphite.h (graphite_loops_mapping, GBB_LOOPS_MAPPING): New.
6346         (struct name_tree): Add a loop field.
6347         (struct scop): Add a graphite_loops_mapping field.
6348         (SCOP_LOOPS_MAPPING): New.
6349         (debug_clast_stmt): Declare.
6350         * lambda.h (find_induction_var_from_exit_cond): Declare.
6351         (lambda-code.c): (find_induction_var_from_exit_cond): Extern.
6352         * cfgloop.h (update_dominators_in_loop): Removed declaration.
6353         (create_empty_loop_on_edge): Updated.
6354         * tree-flow.h (remove_bb, resize_phi_node, move_phi_node,
6355         rename_variables_in_bb): Declare.
6356         * tree-cfg.c (remove_bb): Extern.
6357
6358         * gcc.dg/graphite/block-0.c: New.
6359
6360 2008-07-21  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
6361             Sebastian Pop  <sebastian.pop@amd.com>
6362
6363         * graphite.c (strip_mine_profitable_p): New.
6364         (graphite_trans_bb_block): Disable strip mining if not profitable.
6365
6366         * gcc.dg/graphite/scop-18.c: New.
6367         * gcc.dg/graphite/scop-17.c: Fixed.
6368         * gcc.dg/graphite/scop-16.c: Fixed.
6369
6370 2008-07-17  Harsha Jagasia  <harsha.jagasia@amd.com>
6371             Jan Sjodin  <jan.sjodin@amd.com>
6372             Sebastian Pop  <sebastian.pop@amd.com>
6373
6374         * graphite.c (is_interchange_valid): New.
6375         (graphite_trans_bb_block): Check loop nest of basic block for legality
6376         of interchange.
6377
6378         * graphite.h (gbb_inner_most_loop_index, outer_most_loop_1,
6379         outer_most_loop, gbb_outer_most_loop_index): New.
6380
6381         * tree-loop-linear.c (perfect_loop_nest_depth): Remove static.
6382         * tree-flow.h (perfect_loop_nest_depth): Declare as extern.
6383         * gcc.dg/graphite/scop-16.c: New.
6384         * gcc.dg/graphite/scop-17.c: New.
6385
6386 2008-07-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6387
6388         * graphite.c (scop_remove_ignoreable_gbbs): Also update bitmap.
6389         (graphite_trans_scop_block): Ignore SCoPs without bbs.
6390
6391 2008-07-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6392
6393         * graphite.c (new_scop): Initialize SCOP_EXIT.
6394         (scopdet_info): Add.
6395         (scopdet_bb_info): Rename from is_bb_addable. Cleanup, bugfixes.
6396         (build_scops_1): Cleanup, bugfixes.
6397         (build_scops): Cleanup.
6398
6399         * gcc.dg/graphite/scop-matmult.c: Remove duplicated code.
6400         * gcc.dg/graphite/scop-15.c: Add SCoP numbers.
6401
6402 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
6403
6404         * gfortran.dg/graphite/scop-1.f: Update to reduced test case.
6405
6406         * gfortran.dg/graphite/graphite.exp: Use
6407         DEFAULT_GRAPHITE_FLAGS.
6408
6409         * gcc.dg/graphite/scop-15.c: Update to reduced test case.
6410
6411 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
6412
6413         * graphite.c (scan_tree_for_params): Do not assert any more if
6414         MULT_EXPR parameter is negative.
6415
6416         * gfortran.dg/graphite/scop-1.f: New.
6417
6418         * gfortran.dg/graphite/graphite.exp: New.
6419
6420         * gcc.dg/graphite/scop-15.c: New.
6421
6422 2008-07-10  Harsha Jagasia  <harsha.jagasia@amd.com>
6423
6424         * graphite.c (is_bb_addable): Fix segfault in spec gzip and reformat.
6425
6426 2008-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
6427
6428         * graphite.c (graphite_trans_bb_swap_loops): Rename from
6429         graphite_swap_loops.
6430         (graphite_trans_bb_move_loop): New.
6431         (graphite_trans_bb_strip_mine): Rename from graphite_strip_mine_loop.
6432         (graphite_trans_bb_block): New.
6433         (graphite_trans_loop_block): New.
6434         (graphite_trans_scop_swap_1and2): Rename from
6435         graphite_trans_swap_1and2.
6436         (graphite_trans_scop_strip): Rename from graphite_trans_strip.
6437         (graphite_trans_scop_block): New.
6438         (graphite_apply_transformations): Rename from
6439         graphite_transformations.
6440
6441         * gcc.dg/graphite/scop-matmult.c: New.
6442
6443 2008-07-10  Tobias Grosser  <grosser@fim.uni-passau.de>
6444
6445         * graphite.c (gbb_compare): New.
6446         (graphite_sort_gbbs): New.
6447         (gbb_can_be_ignored): New.
6448         (scop_remove_ignoreable_gbbs): New.
6449         (graphite_transformations): Cleanup and add
6450         scop_remove_ignoreable_gbbs.
6451         * lambda.h (lambda_vector_compare): New.
6452
6453 2008-07-09  Tobias Grosser  <grosser@fim.uni-passau.de>
6454
6455         * graphite.c (print_graphite_bb): Correct printing of static schedule.
6456         (graphite_swap_loops): int -> unsigned
6457         (graphite_strip_mine_loop): int -> unsigned, Fix SCHEDULE
6458         (graphite_transformations): New.
6459         (graphite_transform_loops): Move to graphite_transformations.
6460         * graphite.h (gbb_nb_loops): Return unsigned.
6461
6462 2008-07-04  Tobias Grosser  <grosser@fim.uni-passau.de>
6463
6464         * graphite.c (scan_tree_for_params): Fix insertion of parameters into
6465         the domain matrix.  This makes scop-0.c work again.
6466
6467 2008-06-20  Richard Guenther  <rguenther@suse.de>
6468
6469         * graphite.h: Adjust copyright to GPLv3.
6470         * graphite.c: Likewise.
6471         (stmt_simple_memref_for_scop_p): Split out from ...
6472         (stmt_simple_for_scop_p): ... here.  Fix handling of calls
6473         and simplify.
6474         (get_bb_type): Optimize.
6475         (is_pred): Remove.
6476         (is_bb_addable): Fix memleak, replace is_pred call with
6477         single_pred.
6478         (build_scops): Use current_loops.
6479         (param_index): Fix memleak.
6480
6481 2008-06-20  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
6482
6483         * graphite.c: Fix formatting.
6484
6485 2008-06-19  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
6486
6487         * graphite.c (new_scop): Memory allocation for SCOP_{NEWIVS, OLDIVS}.
6488         (free_scop): Memory deallocation for SCOP_NEWIVS, SCOP_OLDIVS.
6489         (create_var_name, save_var_name): Newly defined functions.
6490         (initialize_cloog_names): Part of the code factored out to
6491         save_var_name.
6492         (clast_to_gcc_expression): Now handles the case of clast_red_sum
6493         in clast_reduction statement.
6494         (graphite_create_new_loop): Now takes a new parameter
6495         for outer_loop.
6496         (translate_clast): Now also takes the context_loop and bb_exit
6497         parameters. Rewritten the code so that it creates a gimple code
6498         inside the given context.
6499         (outermost_loop_layer, graphite_remove_iv, graphite_rename_ivs,
6500         remove_cond_expr, disconnect_cond_expr,
6501         disconnect_virtual_phi_nodes): Newly defined functions.
6502         * graphite.h (struct scop): added old_ivs vector.
6503         SCOP_OLDIVS: New macro.
6504
6505 2008-06-19  Sebastian Pop  <sebastian.pop@amd.com>
6506
6507         * cfgloopmanip.c: Add missing function comments, fix formatting.
6508
6509 2008-06-18  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
6510
6511         * cfgloopmanip.c (update_dominators_in_loop): Defined.
6512         (create_empty_loop_on_edge): Defined.
6513         * tree-parloops.c (canonicalize_loop_ivs): Returns tree
6514         instead of void.
6515         * cfgloop.h (create_empty_loop_on_edge): Declared as extern.
6516         (update_dominators_in_loop): Declared as extern
6517         * tree-flow.h (canonicalize_loop_ivs): Declared as extern.
6518
6519 2008-06-16  Tobias Grosser  <grosser@fim.uni-passau.de>
6520
6521         * graphite.c (print_graphite_bb): Allow changing number of loops
6522         in SCoP domain.
6523         (initialize_cloog_names): Allow changing number of loops.
6524         (build_cloog_prog): Simplify.
6525         (find_transform): Enable cloog option --strides.
6526         (graphite_swap_loops): New.
6527         (graphite_strip_mine_loop): New.
6528         (graphite_trans_swap_1and2): New.
6529         (graphite_trans_strip): New.
6530         (graphite_transform_loops): Add graphite_trans_strip.
6531         * graphite.h (scop_max_loop_depth): New.
6532
6533 2008-06-15  Tobias Grosser  <grosser@fim.uni-passau.de>
6534
6535         * graphite.c (build_scop_iteration_domain): Remove forgotten
6536         line. (Fixes compile)
6537
6538 2008-06-15  Tobias Grosser  <grosser@fim.uni-passau.de>
6539
6540         * graphite.c (print_graphite_bb): Add output of GBB_LOOPS.
6541         (build_graphite_bb): Add GBB_LOOPS and GBB_DOMAIN and reorder.
6542         (build_bb_loops): New.
6543         (graphite_transform_loops): Add build_bb_loops.
6544         (schedule_to_scattering): Use gbb_nb_loops to support changing loop
6545         numbers.
6546         * graphite.h (graphite_bb): Add loops.
6547         (gbb_nb_loops): New.
6548         (gbb_loop_at_index): New.
6549         (gbb_loop_index): New.
6550         (nb_params_in_scop): Renamed to scop_nb_params. Updated all functions
6551         using nb_params_in_scop.
6552
6553 2008-06-14  Tobias Grosser  <grosser@fim.uni-passau.de>
6554
6555         * graphite.c (print_graphite_bb): Adapt to minimized schedule.
6556         (build_scop_canonical_schedules): Build minimized schedule.
6557         (schedule_to_scattering): Adapt to minimized schedule.
6558         * graphite.h (graphite_bb): Add/Update descriptions.
6559
6560 2008-06-14  Adrien Eliche  <aeliche@isty.uvsq.fr>
6561             Tobias Grosser  <grosser@fim.uni-passau.de>
6562
6563         * graphite.c (print_graphite_bb): Add condition printing.
6564         (dump_value): New.
6565         (dump_gbb_conditions): New.
6566         (build_scop_conditions_1): New.
6567         (build_scop_conditions): New.
6568         * graphite.h (graphite_bb): Add conditions.
6569
6570 2008-06-14  Tobias Grosser  <grosser@fim.uni-passau.de>
6571
6572         * graphite.c (print_graphite_bb):
6573         (free_graphite_bb): New.
6574         (free_scop): Free bbs.
6575         (get_bb_type): Free doms.
6576         (build_scop_context): Free context matrix.
6577         (build_loop_iteration_domains): Remove unused code.
6578         (build_cloog_prog): Free scattering function and blocklist.
6579         (find_transform): Free options.
6580
6581 2008-06-13  Tobias Grosser  <grosser@fim.uni-passau.de>
6582
6583         * graphite.c (loop_body_to_cloog_stmts): Rename to add_bb_domains.
6584         Remove unnecessery cloog data structures. Make a copy of the domain
6585         (setup_cloog_loop): Rename to build_loop_iteration_domains. Remove
6586         unnecessary cloog data structures. Fix memory leaks. Remove insert
6587         into SCOP_LOOP2CLOOG_LOOP as the inserted CloogLoops will never be
6588         used.
6589         (build_scop_iteration_domain): Remove unnecessary cloog
6590         data structures.  Fix memory leaks.
6591         (graphite_transform_loops): Disable build_scop_dynamic_schedules as it
6592         uses SCOP_LOOP2CLOOG_LOOP, that is at the moment not working.
6593
6594 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
6595
6596         * graphite.c (find_scop_params): Remove initialize_cloog_names.
6597
6598 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
6599
6600         * graphite.c (end_scop): Style fix.
6601         (schedule_to_scattering): Style and comment fix.
6602
6603 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
6604         * graphite.c (print_graphite_bb): Fix definiton of
6605         schedule_to_scattering.
6606         (initialize_cloog_names): Change nb_scattdims to max loop
6607         depth in SCoP.
6608         (schedule_to_scattering): Take parameter for number of scattering
6609         dimensions.
6610         (build_cloog_prog): Only build as much scattering dimensions as
6611         necessary.
6612
6613 2008-06-12  Tobias Grosser  <grosser@fim.uni-passau.de>
6614
6615         * graphite.c (end_scop): Disable bb splitting. Fixes SIGSEGV
6616         in polyhedron/aermod.f90.
6617
6618 2008-06-11  Tobias Grosser  <grosser@fim.uni-passau.de>
6619             Dwarak Rajagopal  <dwarak.rajagopal@amd.com>
6620             Harsha Jagasia  <harsha.jagasia@amd.com>
6621
6622         * graphite.c (is_bb_addable): Fix segfault.
6623
6624 2008-06-10  Tobias Grosser  <grosser@fim.uni-passau.de>
6625
6626         * graphite.c (is_bb_addable): Fix memory leak, handling of loops
6627         with multiple exits and conditional handling in edge cases.
6628         (is_loop_exit): Fix memory leak. (Forgotten in last commit)
6629
6630         * gcc.dg/graphite/scop-14.c: New.
6631
6632 2008-06-06  Tobias Grosser  <grosser@fim.uni-passau.de>
6633             Adrien Eliche  <aeliche@isty.uvsq.fr>
6634
6635         * graphite.c (is_bb_addable): Add more comments and enhance
6636         readablity of the source code. Fix memory leak.
6637         (is_loop_exit): Fix memory leak.
6638
6639 2008-06-05  Tobias Grosser  <grosser@fim.uni-passau.de>
6640
6641         * graphite.c (first_loop_in_scop): Deleted.
6642         (setup_cloog_loop): Only walk the loop chain for inner loops.
6643         (build_scop_iteration_domain): Execute setup_cloog_loop for
6644         all loops in the first layer.
6645
6646 2008-06-05  Tobias Grosser  <grosser@fim.uni-passau.de>
6647
6648         * graphite.c (scan_tree_for_params): Change the way params are
6649         added to be indepenent of the number of loops.
6650         (setup_cloog_loop): Revert to short matrix format. Fix parameter
6651         handling.
6652         (build_cloog_prog): Revert to short matrix format.
6653
6654 2008-06-05  Sebastian Pop  <sebastian.pop@amd.com>
6655             Dwarak Rajagopal <dwarak.rajagopal@amd.com>
6656
6657         * tree-loop-fusion.c (fuse_loops): Fix uninitialized variable
6658         warning.
6659
6660 2008-06-05  Sebastian Pop  <sebastian.pop@amd.com>
6661
6662         * graphite.c (nb_data_refs_in_scop): New.
6663         (graphite_transform_loops): Print more stats: number of
6664         loops, basic blocks and data references per scop.
6665
6666 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
6667             Jan Sjodin  <jan.sjodin@amd.com>
6668
6669         * graphite.c (loop_affine_expr, idx_record_params,
6670         find_scop_parameters, setup_cloog_loop): Use instantiate_scev
6671         instead of instantiate_parameters.
6672
6673 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
6674
6675         * graphite.c (schedule_to_scattering): Fix scattering dimensions,
6676         add support for parameters, add STATIC_SCHEDULE at the right places,
6677         cleanup.
6678
6679 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
6680
6681         * graphite.c (build_scop_loop_nests): Only add the loops, that
6682         are contained completely in the SCoP.
6683         (build_cloog_prog): Disable scattering, until schedule_to_scattering
6684         and the domains are fixed.
6685         (build_scop_canonical_schedules): Add support for bbs not contained
6686         in any SCoP.
6687
6688 2008-06-04  Tobias Grosser  <grosser@fim.uni-passau.de>
6689
6690         * graphite.h (scop_contains_loop): Update comments to match
6691         the actual behavior.
6692         (scop_contains_loop): New.
6693         * graphite.c (schedule_to_scattering): Use scop_contains_loop.
6694
6695 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
6696
6697         * graphite.c (get_bb_type): On function body, i.e. loop_0,
6698         don't mark blocks as GBB_LOOP_SING_EXIT_HEADER, mark them
6699         as GBB_COND_HEADER.
6700
6701 2008-06-04  Sebastian Pop  <sebastian.pop@amd.com>
6702             Tobias Grosser  <grosser@fim.uni-passau.de>
6703
6704         * graphite.c (graphite_transform_loops): Early return when
6705         there are no loops in the function.
6706
6707 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
6708             Jan Sjodin  <jan.sjodin@amd.com>
6709
6710         * graphite.c (scan_tree_for_params, setup_cloog_loop): Compute the
6711         offset of the last loop.
6712         (setup_cloog_loop): Copy the entire outer constraint matrix.
6713
6714 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
6715             Jan Sjodin  <jan.sjodin@amd.com>
6716
6717         * graphite.c (stmt_in_scop_p, function_parameter_p,
6718         invariant_in_scop_p): Removed.
6719         (scan_tree_for_params): Can be used with no constraint
6720         matrix for gathering parameters.
6721         (idx_record_params): Don't use idx_record_param, instead use
6722         scan_tree_for_params.
6723         (find_scop_parameters): Same.
6724         (setup_cloog_loop, build_scop_iteration_domain, build_cloog_prog):
6725         Fix the size of loop domains.
6726         (schedule_to_scattering): Exit when the outer loop is not in scop.
6727         (find_transform): Enable build_cloog_prog.
6728
6729 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
6730             Jan Sjodin  <jan.sjodin@amd.com>
6731
6732         * graphite.c (schedule_to_scattering): Make scattering domains
6733         uniformly of the same size, as required by CLooG 0.14.0 and before.
6734
6735 2008-05-31  Sebastian Pop  <sebastian.pop@amd.com>
6736             Jan Sjodin  <jan.sjodin@amd.com>
6737
6738         * graphite.c (schedule_to_scattering): Rewrite, correct the
6739         translation of the scheduling function to scattering.
6740         (build_cloog_prog): Call schedule_to_scattering only once.
6741         * graphite.h (scop_loop_index): Do not fail for loops not
6742         in the scop: return -1.
6743
6744 2008-05-30 Tobias Grosser  <grosser@fim.uni-passau.de>
6745
6746         * graphite.c (build_graphite_bb): Initialize GBB_DOMAIN.
6747         (loop_body_to_cloog_stmts): Export GBB_DOMAIN.
6748         (setup_cloog_loop): Export GBB_DOMAIN.
6749         (build_cloog_prog): New.  Create new CLOOG_PROG, which should be
6750         able to rebuild the original control flow.
6751         * graphite.h (graphite_bb): Add domain field and access macro.
6752         (GBB_DOMAIN): New.
6753
6754 2008-05-30  Sebastian Pop  <sebastian.pop@amd.com>
6755
6756         * graphite.c (debug_gbb): New.
6757         (print_scop, build_graphite_bb): Use SCOP_BBS.
6758         (build_scop_bbs): Reimplemented.
6759         (dfs_bb_in_scop_p): Removed.
6760         (build_scop_loop_nests): Reorder loops inserted in
6761         SCOP_LOOP_NEST: outer loops should come first.
6762         (build_scop_canonical_schedules): Reinitialize at zero
6763         the components of the SCOP_STATIC_SCHEDULE for the loops
6764         that have already been parsed.
6765
6766         * graphite.h (debug_gbb): Declared.
6767
6768 2008-05-30  Sebastian Pop  <sebastian.pop@amd.com>
6769             Jan Sjodin  <jan.sjodin@amd.com>
6770
6771         * graphite.c (create_empty_loop): Renamed graphite_create_new_loop.
6772         (graphite_loop_to_gcc_loop): Removed.
6773         (remove_all_edges): New.
6774         (graphite_stmt_to_gcc_stmt): Renamed translate_clast.
6775         (gloog): Remove useless code.
6776
6777 2008-05-29  Tobias Grosser  <grosser@fim.uni-passau.de>
6778
6779         * graphite.c (get_bb_type): Reworked. We distinguish between
6780         loops with one or multiple exits.
6781         (is_loop_exit): New.
6782         (is_pred): New.
6783         (is_bb_addable): Rework condition handling, now support for case
6784         case statements and loops with multiple exits.
6785
6786         * gcc.dg/graphite/scop-11.c: New.
6787         * gcc.dg/graphite/scop-12.c: New.
6788         * gcc.dg/graphite/scop-13.c: New.
6789
6790 2008-05-29  Tobias Grosser  <grosser@fim.uni-passau.de>
6791
6792         * graphite.c (dot_all_scops_1): Fix some colors. Reuse colors, if
6793         we have too many colors.
6794
6795 2008-05-22  Sandeep Maram <smaram_b04@iiita.ac.in>
6796
6797         * doc/invoke.texi (-ftree-loop-fusion): Document.
6798         * tree-pass.h (pass_loop_fusion): Declared.
6799         * tree-loop-fusion.c: New.
6800         * timevar.def (TV_TREE_LOOP_FUSION): Declared.
6801         * tree-data-ref.c (find_data_references_in_loop): Make extern.
6802         * tree-data-ref.h (find_data_references_in_loop): Declared.
6803         * common.opt (ftree-loop-fusion): Declared.
6804         * Makefile.in (tree-loop-fusion.o): Added rule and to OBJS-common.
6805
6806 2008-05-21  Sebastian Pop  <sebastian.pop@amd.com>
6807
6808         * graphite.c (build_access_matrix): Fix typo from the merge.
6809
6810 2008-05-20  Sebastian Pop  <sebastian.pop@amd.com>
6811
6812         * Merge from mainline (130800:135673).
6813
6814 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
6815
6816         * graphite.c (end_scop): The exit of the scop is not part of the scop.
6817         Update dominators after splitting.
6818
6819 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
6820
6821         * graphite.c (is_bb_addable): Return the harmful statement.
6822         Factor up some code.
6823         (end_scop): New.  Splits end of scope bbs on a harmful statement.
6824         (build_scops_1): Call end_scop.
6825
6826 2008-05-07  Sebastian Pop  <sebastian.pop@amd.com>
6827
6828         * graphite.c: (succs_at_same_depth, end_scop, all_preds_visited_p,
6829         all_succs_visited_p, start_new_scop_for_each_succ, start_new_scop,
6830         add_dominators_to_open_scops, stop_last_open_scop, scop_end_loop,
6831         build_scops_1): Removed.
6832         (build_scops_2): Renamed build_scops_1.
6833
6834 2008-05-06  Sebastian Pop  <sebastian.pop@amd.com>
6835
6836         * graphite.c: Fix formatting.
6837
6838 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
6839
6840         * graphite.c (get_bb_type): New.
6841         (move_scops): New.
6842         (build_scops_2): New.
6843         (is_bb_addable): New.
6844         (build_scops): Switch the scop detection.
6845         (build_scop_bbs): Add entry bb to scop.
6846         * graphite.h (struct scop): Update comment.
6847
6848 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
6849
6850         * graphite.c (dot_all_scops_1): Fix some incorrect colors and add
6851         more colors.
6852
6853 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
6854
6855         * gcc.dg/graphite/scop-1.c: Update.
6856         * gcc.dg/graphite/scop-2.c: Update.
6857         * gcc.dg/graphite/scop-4.c: Update.
6858         * gcc.dg/graphite/scop-5.c: Add.
6859         * gcc.dg/graphite/scop-6.c: Add.
6860
6861 2008-05-06  Sebastian Pop  <sebastian.pop@amd.com>
6862
6863         * gcc.dg/graphite/scop-0.c: Add.
6864         * gcc.dg/graphite/scop-7.c: Add.
6865         * gcc.dg/graphite/scop-8.c: Add.
6866         * gcc.dg/graphite/scop-9.c: Add.
6867         * gcc.dg/graphite/scop-10.c: Add.
6868
6869 2008-05-06  Tobias Grosser  <grosser@fim.uni-passau.de>
6870
6871         * graphite.c (scop_affine_expr): Renamed to loop_affine_expr.
6872         Check affine expressions depending on the outermost loop
6873         instead of a scop.
6874         (stmt_simple_for_scop_p): Same.
6875         (harmfule_stmt_in_scop): Same.
6876
6877 2008-04-28  Tobias Grosser  <grosser@fim.uni-passau.de>
6878
6879         * graphite.c (dot_all_scops): Remove incorrect difficult bb coloring,
6880         mark entry and exit, that are not part of the SCoP and update HTML
6881         formatting.
6882
6883 2008-04-25  Sebastian Pop  <sebastian.pop@amd.com>
6884
6885         * graphite.c (basic_block_simple_for_scop_p): Renamed
6886         harmful_stmt_in_bb.
6887         (save_scop, preds_at_same_depth, test_for_scop_bound): Removed.
6888         (add_dominators_to_open_scops, build_scops_1): Reimplemented.
6889         (all_preds_visited_p, all_succs_visited_p,
6890         start_new_scop_for_each_succ, start_new_scop, stop_last_open_scop,
6891         scop_end_loop): New.
6892         (build_scops): Do not use dfs_enumerate_from.
6893
6894         * gcc.dg/graphite/scop-{1,2,4}.c: Updated.
6895
6896 2008-04-23  Sebastian Pop  <sebastian.pop@amd.com>
6897
6898         * graphite.c: Add comments to functions that are missing a
6899         description.
6900         (graphite_create_iv): Removed.  Merged in graphite_loop_to_gcc_loop.
6901
6902 2008-04-23  Sebastian Pop  <sebastian.pop@amd.com>
6903
6904         * graphite.c (nb_params_in_scop): Moved...
6905         (graphite_bb_from_bb, loop_body_to_cloog_stmts): New.
6906         (setup_cloog_loop): Call loop_body_to_cloog_stmts.
6907         (clast_to_gcc_expression): Reduce column size to less than 80.
6908         (graphite_create_iv): Return the new name of the IV.
6909         (find_transform): Set options->esp and options->cpp.
6910         (gloog): Comment out the invalidation of the old loop code.
6911         (initialize_dependence_polyhedron): Replace scop_nb_params with
6912         nb_params_in_scop.
6913
6914         * graphite.h (nb_params_in_scop): ... here.
6915         (scop_nb_params): Removed.
6916         (loop_domain_dim): Return something even when the loop was not
6917         found in the hash table: avoid ICEing on all the graphite.exp
6918         testcases.
6919
6920 2008-04-14  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
6921
6922         * tree-chrec.c (for_each_scev_op): SCEV can have 3 operands.
6923
6924         * graphite.c (build_scop_dynamic_schedules): Schedule is built
6925         according to nesting level.
6926         (find_scop_parameters): Call instantiate_parameters.
6927         (scan_tree_for_params): Extend it to handle general affine bounds.
6928         Inner loop bound can depend on outer loop induction variable.
6929         (setup_cloog_loop): tmp variable is allocated on stack. Call
6930         instantiate_parameters with respect to outermost_loop_in_scop.
6931         (loop_domain_dim, ref_nb_loops, loop_iteration_vector_dim): moved to
6932         graphite.h.
6933         (create_empty_loop): Function loopify should be given edge
6934         probability, instead of edge frequency. Dominance relation from
6935         switch_bb to loop_header.
6936         (clast_to_gcc_expression): Added handling of clast_reduction node.
6937         (gloog): New functionality for removing old loop.
6938         (test_dependence): Factored out from build_rdg_all_levels.
6939         (build_rdg_all_levels): Dependence testing factored out to
6940         test_dependence function.
6941
6942         * graphite.h (struct graphite_bb): Extended with dynamic_schedule.
6943         (loop_domain_dim, ref_nb_loops, loop_iteration_vector_dim): Moved
6944         from graphite.c
6945
6946 2008-04-07  Sebastian Pop  <sebastian.pop@amd.com>
6947
6948         * graphite.c (free_scop, param_index, initialize_cloog_names,
6949         nb_params_in_scop): Use name_tree map instead of just a tree
6950         for keeping track of the variable name associated to that tree.
6951         (create_empty_loop, gmp_cst_to_tree, clast_name_to_gcc,
6952         clast_to_gcc_expression, graphite_create_iv,
6953         graphite_loop_to_gcc_loop, graphite_cond_to_gcc_cond,
6954         graphite_stmt_to_gcc_stmt): New.
6955         (gloog): Call these.
6956         * graphite.h (struct name_tree): New.
6957         (struct scop): Use name_tree instead of tree for params.
6958         Store a vector of name_tree for new_ivs.
6959         (SCOP_NEWIVS): New.
6960         (scop_nb_params): Use name_tree instead of tree.
6961
6962 2008-04-05  Alexander Lamaison  <awl03@doc.ic.ac.uk>
6963             Sebastian Pop  <sebastian.pop@amd.com>
6964
6965         * tree-bounds.c: New.
6966         * tree-bounds.h: New.
6967         * tree-pass.h: Declare pass_bounds_early and pass_bounds_late.
6968         * passes.c: Schedule pass_bounds_early, pass_bounds_late.
6969         * builtins.c (expand_builtin_alloca): Add flag_bounds as for
6970         flag_mudflap.
6971         * gcc.c: Same.
6972         * toplev.c: Same.
6973         * c-cppbuiltin.c: Same.
6974         * c-pragma.c: Same.
6975         * common.opt: Same.
6976         * varasm.c: Same.
6977         * tree-outof-ssa.c: Same.
6978         * c-common.c: Same.
6979         * Makefile.in: Same.
6980
6981 2008-03-15  Antoniu Pop  <antoniu.pop@gmail.com>
6982             Sebastian Pop  <sebastian.pop@amd.com>
6983
6984         * tree-loop-distribution.c (remaining_stmts,
6985         upstream_mem_writes): Removed static variables.
6986         (copy_loop_before, create_bb_after_loop,
6987         mark_nodes_having_upstream_mem_writes, free_rdg_components,
6988         rdg_build_components, rdg_build_partitions,
6989         dump_rdg_partitions): Extern.
6990         (generate_loops_for_partition, generate_code_for_partition): Do not
6991         return a bool.
6992         (already_processed_vertex_p, predecessor_has_mem_write,
6993         mark_nodes_having_upstream_mem_writes, has_upstream_mem_writes,
6994         rdg_flag_all_uses, rdg_flag_uses, rdg_flag_vertex_and_dependent,
6995         rdg_flag_loop_exits, rdg_flag_similar_memory_accesses,
6996         build_rdg_partition_for_component, rdg_build_partitions, ldist_gen):
6997         Pass remaining_stmts and upstream_mem_writes as parameters.
6998         (rdg_component): Moved...
6999         (build_rdg_partition_for_component): Do not aggregate components when
7000         flag_streamize_loops is set.
7001         (gen_sequential_loops): New.
7002         (ldist_gen): Call gen_sequential_loops.
7003
7004         * tree-pass.h (pass_loop_streamization): Declared.
7005
7006         * omp-low.c (expand_omp_sections): Call add_bb_to_loop on created
7007         basic blocks when loops structures exist.
7008
7009         * builtin-types.def (BT_FN_VOID_PTR_PTR_INT): New.
7010
7011         * tree-ssa-loop-ivopts.c (expr_invariant_in_region_p): New.
7012
7013         * tree-parloops.c (take_address_of, eliminate_local_variables_1,
7014         eliminate_local_variables_stmt, eliminate_local_variables,
7015         separate_decls_in_loop_name, separate_decls_in_loop_stmt,
7016         separate_decls_in_loop, gen_parallel_loop): Make them work on a region
7017         of code delimited by two edges in the CFG.
7018         (separate_decls_in_loop_name): Renamed separate_decls_in_region_name.
7019         (separate_decls_in_loop_stmt): Renamed separate_decls_in_region_stmt.
7020         (separate_decls_in_loop): Renamed separate_decls_in_region.  Isolate
7021         the case of parallelisation of reductions.
7022         (create_loop_fn): Extern.
7023         (create_omp_parallel_region): New.
7024
7025         * tree-data-ref.c (dump_data_dependence_relation): Don't call
7026         dump_data_reference for printing dra and drb.
7027         (create_rdg_edge_for_ddr, create_rdg_edges_for_scalar): Initialise
7028         RDGE_RELATION.
7029         (build_rdg): Don't call free_dependence_relations for the moment, as
7030         we attach dependence relations on each edge of the RDG.
7031         To be fixed later.
7032
7033         * tree-data-ref.h (rdg_component): ...here.
7034         (struct rdg_edge): New field ddr_p relation.
7035         (RDGE_RELATION): New.
7036         (create_bb_after_loop, copy_loop_before,
7037         mark_nodes_having_upstream_mem_writes, rdg_build_components,
7038         rdg_build_partitions, dump_rdg_partitions,
7039         free_rdg_components): Declared.
7040
7041         * omp-builtins.def (BUILT_IN_GOMP_STREAM_ALIGN_PUSH,
7042         BUILT_IN_GOMP_STREAM_ALIGN_POP): New.
7043
7044         * tree-loop-streamization.c: New.
7045
7046         * tree-flow.h (gather_blocks_in_sese_region, create_loop_fn,
7047         create_omp_parallel_region, expr_invariant_in_region_p): Declared.
7048
7049         * Makefile.in (tree-loop-streamization.o): Added to OBJS-common.
7050
7051         * tree-cfg.c (gather_blocks_in_sese_region): Extern.
7052
7053         * passes.c: Schedule pass_loop_streamization.
7054
7055 2008-03-08  Tobias Grosser  <grosser@fmi.uni-passau.de>
7056
7057         * graphite.c (dot_all_scops_1): Fix formatting for difficult bbs and
7058         update comment.
7059
7060 2008-03-07  Tobias Grosser  <grosser@fim.uni-passau.de>
7061
7062         * graphite.c (dot_all_scops): Update formatting.
7063         Bbs can now be part of more than one SCoP.
7064
7065 2008-03-04  Sebastian Pop  <sebastian.pop@amd.com>
7066
7067         * graphite.c (new_loop_to_cloog_loop_str, setup_cloog_loop): Fix
7068         malloc problems.
7069         (loop_domain_dim): Check for unregistered toplev SCOP loop.
7070         * graphite.h (loop_to_cloog_loop): New.
7071
7072 2008-03-04  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7073
7074         * graphite.c (loop_domain_dim, ref_nb_loops,
7075         loop_iteration_vector_dim): New.
7076         (build_access_matrix_with_af, build_access_matrix,
7077         initialize_dependence_polyhedron): Fixed for new matrix layout.
7078         No longer assume that all iteration domains are of the same
7079         dimensionality.
7080
7081 2008-03-02  Sebastian Pop  <sebastian.pop@amd.com>
7082
7083         * tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME
7084         defined in a loop at depth 0 is invariant.
7085         * tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto.
7086         * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Should never
7087         be called at loop depth 0.
7088
7089         * graphite.c (basic_block_simple_for_scop_p): Take the scop as
7090         a parameter.
7091         (dot_all_scops_1): Update use of basic_block_simple_for_scop_p.
7092         (down_open_scop): Removed.
7093         (loop_in_scop_p): Redefined.
7094         (scop_affine_expr): New argument: scop.
7095         (stmt_simple_for_scop_p): New argument: scop.  RETURN_EXPR is not
7096         a harmful statement ending a scop.
7097         (basic_block_simple_for_scop_p): New argument: scop.
7098         (get_loop_start): Removed.
7099         (new_scop): Initialize SCOP_LOOPS.
7100         (free_scop): Free SCOP_LOOPS.
7101         (succs_at_same_depth, preds_at_same_depth): New.
7102         (end_scop): Test the validity of a scop.
7103         (add_dominators_to_open_scops): New.
7104         (test_for_scop_bound): Call add_dominators_to_open_scops.
7105         Add cases for opening and closing multiple scops.
7106         (build_scops, build_scop_bbs): Iterate over basic blocks in
7107         depth first order.
7108         (build_graphite_bb): Pass scop directly.
7109         (dfs_bb_in_scop_p): New.
7110         (scop_record_loop): Use SCOP_LOOPS for not recording the same loop
7111         several times.
7112         (nb_loops_around_gb): Use loop_in_scop_p.
7113         (schedule_to_scattering): Disabled for the moment the code computing
7114         the "textual order for outer loop".
7115
7116         * graphite.h (struct scop): New field loops.
7117         (SCOP_LOOPS): New.
7118         (scop_loop_index): Test that the given loop belongs to SCOP_LOOPS.
7119
7120         * gcc.dg/graphite/scop-{1,...,7}.c: Updated.
7121
7122 2008-02-27  Antoniu Pop  <antoniu.pop@gmail.com>
7123             Sebastian Pop  <sebastian.pop@amd.com>
7124
7125         * builtin-types.def (BT_FN_PTR_SIZE_UINT, BT_FN_BOOL_PTR): New.
7126         * common.opt (fstreamize-loops): New.
7127         * omp-builtins.def (BUILT_IN_GOMP_STREAM_CREATE,
7128         BUILT_IN_GOMP_STREAM_PUSH, BUILT_IN_GOMP_STREAM_HEAD,
7129         BUILT_IN_GOMP_STREAM_POP, BUILT_IN_GOMP_STREAM_EOS_P,
7130         BUILT_IN_GOMP_STREAM_SET_EOS, BUILT_IN_GOMP_STREAM_DESTROY): New.
7131
7132 2008-02-22  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7133
7134         * tree-data-ref.c (build_empty_rdg): New.
7135         (build_rdg): Use it.
7136         * tree-data-ref.h (build_empty_rdg): Declared.
7137         * graphite.c (free_scop): Free SCOP_LOOP2CLOOG_LOOP.
7138         (find_vertex_for_stmt): Removed.
7139         (build_rdg_all_levels): Use build_empty_rdg and rdg_vertex_for_stmt.
7140
7141 2008-02-21  Sebastian Pop  <sebastian.pop@amd.com>
7142
7143         * tree-loop-distribution.c (generate_builtin): After cancelling the
7144         loop tree, also delete basic blocks.
7145         (rdg_flag_uses): Stop recursion when a vertex has already been
7146         processed.
7147
7148 2008-02-15  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7149
7150         * graphite.c (build_scop_alpha): Removed.
7151         (graphite_transform_loops): Add a dummy call to build_all_rdg_levels
7152         and dump_dependence_graph to avoid compiler warnings.
7153
7154 2008-02-14  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7155
7156         * tree-data-ref.c (dr_may_alias_p, create_rdg_vertices): Extern.
7157         * tree-data-ref.h (dr_may_alias_p, create_rdg_vertices): Declared.
7158         * graphite.c (new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
7159         eq_loop_to_cloog_loop, del_loop_to_cloog_loop): New.
7160         (new_scop, setup_cloog_loop): Initialize SCOP_LOOP2CLOOG_LOOP.
7161         (initialize_dependence_polyhedron, find_vertex_for_stmt,
7162         initialize_data_dependence_polyhedron, is_empty_polyhedron,
7163         statement_precedes_p, build_rdg_all_levels, build_scop_alpha,
7164         dump_dependence_graph): New.
7165         * graphite.h (struct graphite_bb): New field compressed_alpha_matrix.
7166         (GBB_ALPHA): New.
7167         (struct scop): New field loop2cloog_loop.
7168         (SCOP_LOOP2CLOOG_LOOP, struct data_dependence_polyhedron,
7169         RDGE_DDP, ddp_p, struct loop_to_cloog_loop_str): New.
7170
7171 2008-02-10  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7172
7173         * graphite.c (build_graphite_bb): Fix initialization
7174         of the graphite basic block.
7175
7176 2008-02-05  Sebastian Pop  <sebastian.pop@amd.com>
7177
7178         * graphite.c (scan_tree_for_params): Rewrite for the new layout of
7179         loop domain matrix.  Pass in the number of loops contained in the
7180         constraint matrix.
7181         (nb_loops_around_gb): Moved before setup_cloog_loop that uses it.
7182         (setup_cloog_loop): Rewrite for the new layout of loop domain matrix:
7183         loops that are not surrounding the current loop are not represented
7184         in the domain constraint matrix.
7185         (build_scop_iteration_domain): Initial domain constraint matrix
7186         contains only the eq/ineq, cst, and scop parameters columns.
7187
7188 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
7189
7190         * graphite.c (schedule_to_scattering, nb_loops_around_gb): New.
7191         (print_graphite_bb): Print scattering.
7192
7193 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
7194
7195         * graphite.c (initialize_cloog_names): Initialize names of
7196         scattering variables.
7197
7198 2009-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
7199
7200         * graphite.c (dot_all_scops_1): Disable debug output while
7201         printing graph.
7202
7203 2008-01-29  Tobias Grosser  <grosser@fim.uni-passau.de>
7204
7205         * graphite.c (find_transform): Change cloog output language to C.
7206
7207 2008-01-27  Sebastian Pop  <sebastian.pop@amd.com>
7208
7209         * tree-loop-distribution.c (generate_memset_zero,
7210         generate_builtin, generate_code_for_partition,
7211         rdg_flag_all_uses): New.
7212         (rdg_flag_uses): Gather in the same partition the statements defining
7213         the VUSES of the current statement.
7214         (rdg_flag_similar_stores): Renamed rdg_flag_similar_memory_accesses.
7215         Gather in the same partition not only the stores to the same memory
7216         access, but also the reads.
7217         (ldist_generate_loops): Renamed ldist_gen.
7218
7219 2008-01-24  Sebastian Pop  <sebastian.pop@amd.com>
7220             Tobias Grosser  <grosser@fmi.uni-passau.de>
7221
7222         * graphite.c (setup_cloog_loop): Chain all cloog loops with the
7223         next pointer, don't use the inner pointer.
7224
7225 2008-01-20  Tobias Grosser  <grosser@fmi.uni-passau.de>
7226
7227         * graphite.c (dot_all_scops, dot_all_scops_1): New.
7228         (find_transform): Call dot_all_1.
7229         * graphite.h (dot_all_scops): Declared.
7230
7231 2007-12-14  Sebastian Pop  <sebastian.pop@amd.com>
7232
7233         * tree-loop-distribution.c: Fix apsi.f ICE.
7234         (create_bb_after_loop): New.
7235         (generate_loops_for_partition): Use it.
7236         * gfortran.dg/ldist-1.f90: New.
7237
7238         * tree-data-ref.c (dot_rdg): Use /tmp/rdg.dot for dotty format.
7239         * graphite.c (dot_scop): Use /tmp/scop.dot for dotty format.
7240
7241 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
7242
7243         * graphite.c (find_transform): Dump cloog program sent to cloog.
7244
7245 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
7246
7247         * graphite.c (initialize_cloog_names): Initialize cloog
7248         iterator names.
7249
7250 2007-12-13  Tobias Grosser  <grosser@fmi.uni-passau.de>
7251
7252         * graphite.c (build_scop_context): Fix typo, for the matrix
7253         format: insert '0 >= 0' instead of '-1 >= 0'.
7254
7255 2007-12-13  Sebastian Pop  <sebastian.pop@amd.com>
7256
7257         * Fix merge problems.
7258
7259 2007-12-13  Sebastian Pop  <sebastian.pop@amd.com>
7260
7261         * graphite.c (setup_cloog_loop): Fix typo.
7262
7263 2007-12-12  Sebastian Pop  <sebastian.pop@amd.com>
7264
7265         * doc/invoke.texi (-ftree-loop-distribution): Documented.
7266         * tree-loop-distribution.c: Reimplemented.
7267         * tree-pass.h (pass_loop_distribution): New.
7268         * tree-scalar-evolution.c (number_of_iterations_for_all_loops): Use
7269         print_loops.
7270         * graphds.h (struct graph): New field indexes.
7271         * timevar.def (TV_TREE_LOOP_DISTRIBUTION): New.
7272
7273         * tree-vect-analyze.c: Remove declaration of static functions when not
7274         needed.
7275         * tree-vectorizer.c: Same.
7276         (rename_variables_in_loop): Now extern.
7277         (slpeel_tree_duplicate_loop_to_edge_cfg): Renamed
7278         tree_duplicate_loop_to_edge_cfg.  Reset PENDING_STMT for edges after
7279         calling redirect_edge_and_branch_force.
7280
7281         * tree-vectorizer.h (tree_duplicate_loop_on_edge): Declared.
7282
7283         * tree-data-ref.c: Don't include tree-chrec.h.
7284         (debug_data_dependence_relations): New.
7285         (dump_data_dependence_relation): Call dump_data_reference on data refs
7286         in the relation.
7287         (same_access_functions): Moved...
7288         (find_vertex_for_stmt): Renamed rdg_vertex_for_stmt.
7289         (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
7290         debug_rdg_component, dump_rdg, debug_rdg, dot_rdg_1, dot_rdg,
7291         struct rdg_vertex_info, ): New.
7292         (create_rdg_edge_for_ddr): Compute the dependence level before looking
7293         at DDR_REVERSED_P.
7294         (create_rdg_vertices): Initialize the htab of graph->indexes.
7295         Initialize RDG_MEM_WRITE_STMT and RDG_MEM_READS_STMT.
7296         (stmts_from_loop): Don't save LABEL_EXPR.
7297         (hash_stmt_vertex_info, eq_stmt_vertex_info,
7298         hash_stmt_vertex_del): New.
7299         (build_rdg): Initialize rdg->indexes.
7300         (free_rdg, stores_from_loop, ref_base_address,
7301         rdg_defs_used_in_other_loops_p, have_similar_memory_accesses,
7302         have_similar_memory_accesses_1, ref_base_address_1,
7303         remove_similar_memory_refs): New.
7304
7305         * tree-data-ref.h: Include tree-chrec.h.
7306         (debug_data_dependence_relations): Declared.
7307         (same_access_functions): ...here.  Now static inline.
7308         (ddr_is_anti_dependent, ddrs_have_anti_deps,
7309         ddr_dependence_level): New.
7310         (struct rdg_vertex): New fields has_mem_write, has_mem_reads.
7311         (RDGV_HAS_MEM_WRITE, RDGV_HAS_MEM_READS, RDG_STMT, RDG_MEM_WRITE_STMT,
7312         RDG_MEM_READS_STMT): New.
7313         (dump_rdg_vertex, debug_rdg_vertex, dump_rdg_component,
7314         debug_rdg_component, dump_rdg, debug_rdg, dot_rdg,
7315         rdg_vertex_for_stmt): Declared.
7316         (struct rdg_edge): New field level.
7317         (RDGE_LEVEL, free_rdg): New.
7318         (stores_from_loop, remove_similar_memory_refs,
7319         rdg_defs_used_in_other_loops_p,
7320         have_similar_memory_accesses): Declared.
7321         (rdg_has_similar_memory_accesses): New.
7322
7323         * lambda.h (dependence_level): New.
7324         * common.opt (ftree-loop-distribution): New.
7325         * tree-flow.h (debug_loop_ir): Renamed debug_loops.
7326         (print_loop_ir): Renamed print_loops.
7327         (debug_loop, debug_loop_num, print_loops_bb, mark_virtual_ops_in_bb,
7328         tree_duplicate_loop_to_edge_cfg, rename_variables_in_loop): Declared.
7329         * Makefile.in (TREE_DATA_REF_H): Depends on tree-chrec.h.
7330         (tree-loop-distribution.o): Added.
7331         * tree-cfg.c (mark_virtual_ops_in_region): Use mark_virtual_ops_in_bb.
7332         (mark_virtual_ops_in_bb): New.
7333         (print_loops_bb, debug_loop_num, debug_loop): New.
7334         * passes.c: Scheduled pass_loop_distribution.
7335
7336 2007-12-12  Konrad Trifunovic  <konrad.trifunovic@inria.fr>
7337
7338         * graphite.c (scan_tree_for_params): Correct the number of columns
7339         for polylib format.
7340         (nb_flat_iterator): New.
7341         (setup_cloog_loop): Initialize to 1 the first column for inequalities.
7342         (build_scop_iteration_domain): Correct the number of columns for
7343         polylib format.
7344
7345 2007-12-12  Sebastian Pop  <sebastian.pop@amd.com>
7346
7347         * Merge from mainline (129697:130800).
7348
7349 2007-10-30  Sebastian Pop  <sebastian.pop@amd.com>
7350
7351         * graphite.c (build_graphite_bb): SCoP's basic blocks are post
7352         dominated by SCoP's exit.
7353         (graphite_transform_loops): Compute post dominators.
7354
7355 2007-10-28  Sebastian Pop  <sebastian.pop@amd.com>
7356
7357         * Merge from mainline (127169:129697).
7358
7359 2007-10-28  Sebastian Pop  <sebastian.pop@amd.com>
7360
7361         * graphite.c (affine_expr): Renamed scop_affine_expr.  Use an extra
7362         parameter for the basic block that contains the expression.  Use
7363         outermost_loop_in_scop for evolution_function_is_affine_multivariate_p.
7364         (stmt_simple_for_scop_p): Pass to scop_affine_expr the basic block of
7365         the expression.
7366         * graphite.h (gbb_loop): New.
7367         (GBB_LOOP): Removed.
7368
7369 2007-08-03  Sebastian Pop  <sebpop@gmail.com>
7370
7371         * Makefile.in: Fix merge problem.
7372
7373 2007-08-03  Sebastian Pop  <sebpop@gmail.com>
7374
7375         * Merge from mainline (125309:127169).
7376         * tree-loop-distribution.c: Disabled.
7377
7378 2007-06-05  Sebastian Pop  <sebpop@gmail.com>
7379
7380         * Merge from mainline (r123693:125309).
7381
7382 2007-05-30  Sebastian Pop  <sebpop@gmail.com>
7383
7384         * tree-loop-distribution.c (correct_modify_expr_p): Renamed
7385         correct_modify_p
7386         (correct_modify_p, check_statements, number_of_lvalue_uses,
7387         number_of_scalar_dependences, create_edges): Use GIMPLE_MODIFY_STMT
7388         instead of MODIFY_EXPR.
7389         (update_edge_with_ddv): Don't pass index_of_edge.  Initialize
7390         and push new edges.
7391
7392 2007-05-24  Sebastian Pop  <sebpop@gmail.com>
7393
7394         * tree-loop-distribution.c (struct rdg): Replace arrays by
7395         VECs for edges and vertices.
7396         (RDG_NBV, RDG_NBE, RDG_VERTEX, RDG_EDGE): Removed.
7397         (RDGV_NB_PARTITIONS): New.
7398         (PRDG_NBV, PRDG_NBE): Removed.
7399         (build_scc_graph, correct_partitions_p, mark_partitions, build_prdg,
7400         dump_rdg, find_vertex_with_stmt, create_vertices, free_rdg,
7401         number_of_scalar_dependences, create_edges, build_rdg): Use VECs.
7402
7403 2007-05-17  Georges-Andre Silber  <silber@cri.ensmp.fr>
7404             Sebastian Pop  <sebpop@gmail.com>
7405
7406         * doc/invoke.texi (-ftree-loop-distribution): Document.
7407         * tree-loop-distribution.c: New file.
7408         * tree-pass.h (pass_loop_distribution): Declared.
7409         * timevar.def (TV_TREE_LOOP_DISTRIBUTION): New.
7410         * tree-data-ref.c (initialize_data_dependence_relation): Initialize
7411         and set reversed_p.
7412         * tree-data-ref.h (data_dependence_relation): Add reversed_p.
7413         (DDR_REVERSED_P): New.
7414         * common.opt (-ftree-loop-distribution): New.
7415         * tree-flow.h (distribute_loops): Declared.
7416         * Makefile.in (OBJS-common): Depend on tree-loop-distribution.o.
7417         * passes.c (init_optimization_passes): Schedule loop distribution.
7418
7419 2007-05-12  Sebastian Pop  <sebastian.pop@inria.fr>
7420
7421         * graphite.c (print_graphite_bb): Don't call dump_data_references.
7422         (print_scop): Don't print when scop is NULL.
7423         (build_scop_context, find_transform): Don't output to stderr.
7424
7425 2007-05-09  Sebastian Pop  <sebastian.pop@inria.fr>
7426
7427         * tree-data-ref.c: Don't include graphite.h.
7428         Comment out the code for printing data reference's scop.
7429         (build_access_matrix_with_af): Moved...
7430         * tree-data-ref.h (build_access_matrix_with_af): Removed declaration.
7431         * graphite.c (build_access_matrix_with_af): ... here.  Now static.
7432         (print_graphite_bb): Print basic block's schedule.
7433         (print_scop): Don't print the schedule, call cloog's pretty printer.
7434         (bb_in_scop_p): A basic block is in a scop only if it is both
7435         dominated and postdominated by the scop's entry and exit basic blocks.
7436         (function_parameter_p): New.
7437         (invariant_in_scop_p): Use function_parameter_p.
7438         (new_scop, save_scop): New.
7439         (end_scop, test_for_scop_bound, build_scops): Use new_scop, and
7440         save_scop.
7441         (scan_tree_for_params): Directly build the constraint as CloogMatrix.
7442         (loop_in_scop_p): New.
7443         (scop_record_loop): Use loop_in_scop_p.
7444         (build_scop_domain): Renamed build_scop_iteration_domain.
7445         (setup_cloog_loop, initialize_cloog_names, find_scop_parameters,
7446         nb_params_in_scop, build_scop_context, first_loop_in_scop,
7447         setup_cloog_loop, dot_scop_1, dot_scop): New.
7448         * graphite.h (GBB_LOOP, SCOP_PROG, dot_scop): New.
7449         (struct scop): Add a pointer to cloog's representation of a program.
7450
7451 2007-04-14  Sebastian Pop  <sebastian.pop@inria.fr>
7452
7453         * doc/invoke.texi (-ftree-check-verbose): Renamed
7454         -ftree-checks-verbose.
7455         * common.opt (flag_tree_check_verbose): Renamed
7456         flag_tree_checks_verbose.
7457         * tree-check.c (tree_check_warning): Use flag_tree_checks_verbose.
7458
7459 2007-04-14  Sebastian Pop  <sebastian.pop@inria.fr>
7460
7461         * configure: Regenerated.
7462         * config.in: Regenerated.
7463         * tree-ssa-loop.c (graphite_transforms): Execute
7464         graphite_transform_loops only when HAVE_cloog.
7465         * configure.ac (HAVE_polylib, HAVE_cloog, GRAPHITE): Defined.
7466         * graphite.c: Include polylibgmp.h and cloog.h.
7467         (graphite_transform_loops): Removed loops parameter.
7468         * tree-flow.h (graphite_transform_loops): Update declaration.
7469         * Makefile.in (POLYLIBLIBS, POLYLIBINC, CLOOGLIBS, CLOOGINC): New.
7470         (LIBS): Depend on CLOOGLIBS and on POLYLIBLIBS.
7471         (INCLUDES): Depend on POLYLIBINC and on CLOOGINC.
7472         (OBJS-common): Remove dependence on graphite.o.
7473         (BACKEND): Depend on @GRAPHITE@.
7474
7475 2007-04-13  Sebastian Pop  <sebastian.pop@inria.fr>
7476
7477         * doc/invoke.texi (-ftree-check-verbose): Documented.
7478         * gcc.dg/tree-checker/tree-checks-1.c: New.
7479         * gcc.dg/tree-checker/tree-checks-2.c: New.
7480         * gcc.dg/tree-checker/tree-checks-3.c: New.
7481         * gcc.dg/tree-checker/tree-checks-4.c: New.
7482         * gcc.dg/tree-checker/tree-checks.exp: New.
7483         * gcc.dg/tree-checker/condates.crp: New.
7484         * common.opt (ftree-checks-verbose): New.
7485         * tree-check.c (tree_check_warning): Move extra stderr output
7486         under control of flag_tree_check_verbose.
7487
7488 2007-04-12  Sebastian Pop  <sebastian.pop@inria.fr>
7489
7490         * tree-match.c: Fix comments formatting.
7491         * tree-match.h: Fix comments formatting.
7492         * tree-check.c: Fix comments formatting.
7493         (tree_check_init): Restructure.
7494
7495 2007-04-12  Nic Volanschi  <nic.volanschi@free.fr>
7496
7497         * doc/invoke.texi (-ftree-check, -ftree-checks): Documented.
7498
7499 2007-04-10  Sebastian Pop  <sebastian.pop@inria.fr>
7500
7501         * Merge from mainline (r120733:123693).
7502
7503 2007-03-20  Nic Volanschi  <nic.volanschi@free.fr>
7504
7505         * condate.y: New file.
7506         * tree-match.h (struct patt_info_s): New field sign.
7507         (struct condate_s): New field msg.
7508         (normalize_condate, name_condate, add_condate): New.
7509         (conds[], condate_parse): Made extern.
7510         * tree-check.c (tree_check_warning): First arg changed to cond;
7511         warning reformatted.
7512         (tree_check_init): Reset the TREE_VISITED bit on every CFG node.
7513         (tree_scan): New.
7514         (tree_check): Process trivial condates.
7515         (read_delimited_string): Removed.
7516         (print_cond): Print name and msg.
7517         (conds[]): Made extern.
7518         (parse_tree_check_file_once): Rewritten to use the parser in
7519         condate.y.
7520         Processing of option --tree_check_string moved to tree_scan().
7521         * Makefile.in: Added condate.y
7522
7523 2007-03-12  Sebastian Pop  <sebastian.pop@inria.fr>
7524
7525         * tree-pretty-print.c (dump_generic_bb_buff, lazy_dump_generic_node):
7526         Use VECs instead of varrays.
7527         * diagnostic.h (lazy_dump_generic_node): Update declaration.
7528         * Makefile.in (pretty-print.o): Depend on vec.h.
7529         * pretty-print.c: Include tree.h and vec.h.
7530         (pp_clear_state, pp_write_list_to_stream, pp_base_format,
7531         pp_base_format, pp_construct, pp_base_string, pp_lazy_mode,
7532         new_tree_chunk, pp_add_tree, pp_add_string, pp_add_char, pp_write_list,
7533         pp_free_list): Use VECs instead of varrays.
7534         * pretty-print.h: Do not include varray.h.
7535         (struct tree_chunk_s): Declaration moved before its use.
7536         (output_buffer): Rename varray field to chunks.
7537         * tree-match.c (tree_equal, chunk_1st_char, chunks_lookahead,
7538         tree_1st_char, match_chunks_pattinfo, match_tree_pattinfo,
7539         save_global_holes): Use VECs instead of varrays.
7540         * tree-match.h: Declare VECs of cfg_node, and hole_p.
7541         * tree-check.c (scan_cfg_stmts, push_node,
7542         print_matching_stmt): Removed.
7543         (tree_check_instance, push_global_holes_if_new, tree_check,
7544         execute_tree_check): Use VECs instead of varrays.
7545         (gate_tree_check): Don't execute the CFG check when basic_block_info
7546         is not available.
7547
7548 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
7549
7550         * Merge from mainline (r115016:120733).
7551
7552 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
7553
7554         * Merge from mainline (r117632:117661).
7555
7556 2007-01-12  Sebastian Pop  <sebastian.pop@inria.fr>
7557
7558         * tree-dump.c (dump_option_value_in): Add TDF_DEBUG.
7559         * tree-pass.h (TDF_DEBUG, debug_p): New.
7560         * tree-scalar-evolution.c (set_scalar_evolution, get_scalar_evolution,
7561         get_scalar_evolution, add_to_evolution, set_nb_iterations_in_loop,
7562         get_loop_exit_condition, analyze_evolution_in_loop,
7563         analyze_initial_condition, analyze_scalar_evolution,
7564         instantiate_parameters, number_of_latch_executions): Use debug_p.
7565         * tree-chrec.c (chrec_apply): Use debug_p.
7566         * tree-data-ref.c: Include graphite.h.
7567         (dump_data_reference): Print also the access matrix.
7568         (analyze_array, analyze_indirect_ref, init_data_ref,
7569         analyze_offset_expr, address_analysis, object_analysis,
7570         create_data_ref, finalize_ddr_dependent,
7571         non_affine_dependence_relation, analyze_ziv_subscript,
7572         analyze_siv_subscript_cst_affine,
7573         compute_overlap_steps_for_affine_1_2, analyze_subscript_affine_affine,
7574         can_use_analyze_subscript_affine_affine, analyze_siv_subscript,
7575         analyze_miv_subscript, analyze_overlapping_iterations,
7576         build_classic_dist_vector, subscript_dependence_tester,
7577         compute_affine_dependence, analyze_all_data_dependences): Use debug_p.
7578         (build_access_matrix_with_af): No longer static.
7579         * tree-data-ref.h (scop_p): ... declaration here.
7580         (data_reference.scop): New field.
7581         (DR_SCOP, DR_ACCESS_MATRIX): New.
7582         (build_access_matrix_with_af, dr_num_subscripts): Declared.
7583         * graphite.c (print_graphite_bb): Call dump_data_references.
7584         (print_scop): Use scop_nb_loops and scop_dim_domain.
7585         (test_for_scop_bound): Use debug_p.
7586         (scan_tree_for_params): Use scop_nb_loops, scop_nb_loops and
7587         scop_nb_params.
7588         (scop_loop_index): Moved...
7589         (scop_record_loop): New.
7590         (build_scop_loop_nests): Use scop_record_loop.
7591         (build_scop_domain): Use scop_dim_domain.
7592         (build_access_matrix): Implemented.
7593         (build_scop_canonical_schedules): Use scop_nb_loops.
7594         (build_graphite_bb): Initialize GBB_SCOP.
7595         * graphite.h (scop_p): Moved...
7596         (graphite_bb.scop): New field.
7597         (graphite_bb.iteration_domain, GBB_DOMAIN, scop.nb_params,
7598         scop.nb_loops, scop.dim_domain, SCOP_NB_LOOPS, SCOP_NB_PARAMS,
7599         SCOP_DIM_DOMAIN, SCOP_STMTS): Removed.
7600         (scop_nb_params, scop_nb_loops, scop_dim_domain, gbb_dim_domain,
7601         scop_loop_index): New.
7602         * Makefile.in (tree-data-ref.o): Depends on graphite.h.
7603
7604 2007-01-05  Sebastian Pop  <sebastian.pop@inria.fr>
7605
7606         * Merge from mainline (r117661:120450).
7607
7608 2006-10-12  Sebastian Pop  <sebastian.pop@inria.fr>
7609
7610         * tree-scalar-evolution.c (instantiate_parameters_1): Don't stop
7611         at the first declaration outside the varying loop, instantiate as
7612         far as possible.
7613         * tree-chrec.c (for_each_scev_op): New.
7614         * tree-chrec.h (for_each_scev_op): Declared.
7615         * tree-ssa-loop.c (pass_graphite_trans): Don't dump the function.
7616         * tree-data-ref.c (get_references_in_stmt,
7617         find_data_references_in_stmt): New, from trunk.
7618         (find_data_references_in_loop): Use get_references_in_stmt
7619         and find_data_references_in_loop, modified as in trunk.
7620         (build_access_matrix_with_af): New.
7621         * tree-data-ref.h (data_reference): Add a field access_matrix.
7622         (data_ref_loc): New, as in trunk.
7623         * graphite.c (print_graphite_bb, bb_in_scop_p, stmt_in_scop_p,
7624         invariant_in_scop_p, param_index, scan_tree_for_params,
7625         scop_loop_index, build_scop_loop_nests, build_scop_domain, irp_data,
7626         idx_record_param, idx_record_params, build_access_matrix,
7627         build_scop_data_accesses, build_scop_canonical_schedules,
7628         build_graphite_bb, build_scop_bbs, find_params_in_bb,
7629         build_scop_params): New.
7630         * graphite.h (graphite_bb): New.
7631         (scop): Add fields static_schedule, params, loop_nest,
7632         iteration_domain.
7633         * lambda.h: Declare vecs of lambda_matrix.
7634         * tree-flow.h (print_loop_ir_bb): Declared.
7635         * tree-cfg.c (print_loop_ir_bb): New.
7636         (print_loop): Use print_loop_ir_bb.
7637
7638 2006-10-12  Sebastian Pop  <pop@cri.ensmp.fr>
7639
7640         * Merge from mainline (r115016:117632).
7641
7642 2006-10-11  Sebastian Pop  <pop@cri.ensmp.fr>
7643
7644         * graphite.c (debug_scops): Adjust definition for avoiding a bootstrap
7645         break due to a warning.
7646
7647 2006-10-10  Sebastian Pop  <pop@cri.ensmp.fr>
7648
7649         * graphite.c (print_scops, debug_scops): New.
7650         (graphite_transform): Renamed graphite_find_transform.
7651         * graphite.h (debug_scops): Declared.
7652
7653 2006-08-17  Sebastian Pop  <pop@cri.ensmp.fr>
7654
7655         * tree-match.c: Reformat following the GNU style.
7656         * tree-match.h: Reformat following the GNU style.
7657         * tree-pattern.h: Removed empty file.
7658         * Makefile.in: Remove references to tree-pattern.h.
7659         * tree-check.c: Reformat following the GNU style.
7660         (execute_tree_check): Move gate condition code to...
7661         (gate_tree_check): ...here.  New function.
7662         (pass_check): Use the gate function.
7663
7664 2006-07-04  Nic Volanschi <nic.volanschi@free.fr>
7665
7666         * tree-pattern.h: New. Tree pattern matching and checking using
7667         concrete syntax.
7668         * tree-check.c: New. Tree/CFG checking pass.
7669         * tree-match.c: New. Library for tree pattern matching.
7670         * opts.c, common.opt: Add options --ftree-check & --ftree-checks.
7671         * toplev.c, flags.h: Add globals for tree-check pass.
7672         * Makefile.in: Integrate the files in tree-check pass.
7673         * timevar.def, tree-optimize.c, tree-pass.h: Register tree-check pass.
7674         * pretty-print.c, pretty-print.h, tree-pretty-print.c, diagnostic.h:
7675         Introduce a "lazy" pretty-print mode.
7676         * tree.c, tree.h: Add tree_name.
7677
7678 2006-07-04  Sebastian Pop  <pop@cri.ensmp.fr>
7679
7680         * doc/invoke.texi (-fgraphite): Correct typo.
7681         * tree-scalar-evolution.c (number_of_iterations_for_all_loops): Update
7682         use of print_loop_ir.
7683         * gcc.dg/graphite/scop-1.c: New.
7684         * gcc.dg/graphite/scop-2.c: New.
7685         * gcc.dg/graphite/graphite.exp: New.
7686         * graphite.c: Include domwalk.h.
7687         (print_scop): Print only the entry and exit blocks.
7688         (debug_scop): No longer static.
7689         (affine_expr): Fix formating.  Return also true when the expression is
7690         constant.
7691         (stmt_simple_for_scop_p): Fix formating.
7692         (build_scops): Use domwalk.
7693         (get_loop_start, end_scop, test_for_scop_bound): New.
7694         (graphite_transform_loops): Avoid printing on stderr.
7695         * graphite.h (debug_scop): Declared.
7696         * tree-flow.h (debug_loop_ir, print_loop_ir): Update declarations.
7697         * Makefile.in (graphite.o): Depend on domwalk.h.
7698         * tree-cfg.c (print_loop, print_pred_bbs, print_succ_bbs): Remove
7699         declarations for static functions.
7700         (print_loop, print_loop_ir, debug_loop_ir): Use an extra parameter for
7701         controlling output verbosity.
7702
7703 2006-06-26  Sebastian Pop  <pop@cri.ensmp.fr>
7704             Plesco Alexandru  <shurikx@gmail.com>
7705
7706         * doc/invoke.texi (-fgraphite): Document.
7707         * tree-pass.h (pass_graphite_transforms): Declared.
7708         * timevar.def (TV_GRAPHITE_TRANSFORMS): New.
7709         * tree-ssa-loop.c (graphite_transforms, gate_graphite_transforms): New.
7710         (pass_graphite_transforms): Defined.
7711         * tree-data-ref.c (free_data_ref, data_reference): Extern.
7712         * tree-data-ref.h (free_data_ref, data_reference): Declared.
7713         * graphite.c, graphite.h: New.
7714         * common.opt (fgraphite): Declared.
7715         * tree-flow.h (graphite_transform_loops): Declared.
7716         * Makefile.in (OBJS-common): Add graphite.o.
7717         (graphite.o): New rule.
7718         * passes.c (pass_graphite_transforms): Scheduled.
7719