OSDN Git Service

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