OSDN Git Service

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