1 /* Translation of CLAST (CLooG AST) to Gimple.
2 Copyright (C) 2009, 2010 Free Software Foundation, Inc.
3 Contributed by Sebastian Pop <sebastian.pop@amd.com>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
28 #include "basic-block.h"
29 #include "diagnostic.h"
30 #include "tree-flow.h"
32 #include "tree-dump.h"
35 #include "tree-chrec.h"
36 #include "tree-data-ref.h"
37 #include "tree-scalar-evolution.h"
38 #include "tree-pass.h"
40 #include "value-prof.h"
41 #include "pointer-set.h"
43 #include "langhooks.h"
47 #include "cloog/cloog.h"
49 #include "graphite-ppl.h"
51 #include "graphite-poly.h"
52 #include "graphite-scop-detection.h"
53 #include "graphite-clast-to-gimple.h"
54 #include "graphite-dependences.h"
56 /* This flag is set when an error occurred during the translation of
58 static bool gloog_error
;
60 /* Verifies properties that GRAPHITE should maintain during translation. */
63 graphite_verify (void)
65 #ifdef ENABLE_CHECKING
66 verify_loop_structure ();
67 verify_dominators (CDI_DOMINATORS
);
68 verify_dominators (CDI_POST_DOMINATORS
);
69 verify_loop_closed_ssa (true);
73 /* Stores the INDEX in a vector for a given clast NAME. */
75 typedef struct clast_name_index
{
78 } *clast_name_index_p
;
80 /* Returns a pointer to a new element of type clast_name_index_p built
81 from NAME and INDEX. */
83 static inline clast_name_index_p
84 new_clast_name_index (const char *name
, int index
)
86 clast_name_index_p res
= XNEW (struct clast_name_index
);
93 /* For a given clast NAME, returns -1 if it does not correspond to any
94 parameter, or otherwise, returns the index in the PARAMS or
95 SCATTERING_DIMENSIONS vector. */
98 clast_name_to_index (const char *name
, htab_t index_table
)
100 struct clast_name_index tmp
;
104 slot
= htab_find_slot (index_table
, &tmp
, NO_INSERT
);
107 return ((struct clast_name_index
*) *slot
)->index
;
112 /* Records in INDEX_TABLE the INDEX for NAME. */
115 save_clast_name_index (htab_t index_table
, const char *name
, int index
)
117 struct clast_name_index tmp
;
121 slot
= htab_find_slot (index_table
, &tmp
, INSERT
);
128 *slot
= new_clast_name_index (name
, index
);
132 /* Print to stderr the element ELT. */
135 debug_clast_name_index (clast_name_index_p elt
)
137 fprintf (stderr
, "(index = %d, name = %s)\n", elt
->index
, elt
->name
);
140 /* Helper function for debug_rename_map. */
143 debug_clast_name_indexes_1 (void **slot
, void *s ATTRIBUTE_UNUSED
)
145 struct clast_name_index
*entry
= (struct clast_name_index
*) *slot
;
146 debug_clast_name_index (entry
);
150 /* Print to stderr all the elements of MAP. */
153 debug_clast_name_indexes (htab_t map
)
155 htab_traverse (map
, debug_clast_name_indexes_1
, NULL
);
158 /* Computes a hash function for database element ELT. */
160 static inline hashval_t
161 clast_name_index_elt_info (const void *elt
)
163 return htab_hash_pointer (((const struct clast_name_index
*) elt
)->name
);
166 /* Compares database elements E1 and E2. */
169 eq_clast_name_indexes (const void *e1
, const void *e2
)
171 const struct clast_name_index
*elt1
= (const struct clast_name_index
*) e1
;
172 const struct clast_name_index
*elt2
= (const struct clast_name_index
*) e2
;
174 return (elt1
->name
== elt2
->name
);
178 /* For a given loop DEPTH in the loop nest of the original black box
179 PBB, return the old induction variable associated to that loop. */
182 pbb_to_depth_to_oldiv (poly_bb_p pbb
, int depth
)
184 gimple_bb_p gbb
= PBB_BLACK_BOX (pbb
);
185 sese region
= SCOP_REGION (PBB_SCOP (pbb
));
186 loop_p loop
= gbb_loop_at_index (gbb
, region
, depth
);
188 return loop
->single_iv
;
191 /* For a given scattering dimension, return the new induction variable
195 newivs_to_depth_to_newiv (VEC (tree
, heap
) *newivs
, int depth
)
197 return VEC_index (tree
, newivs
, depth
);
202 /* Returns the tree variable from the name NAME that was given in
203 Cloog representation. */
206 clast_name_to_gcc (const char *name
, sese region
, VEC (tree
, heap
) *newivs
,
207 htab_t newivs_index
, htab_t params_index
)
210 VEC (tree
, heap
) *params
= SESE_PARAMS (region
);
212 if (params
&& params_index
)
214 index
= clast_name_to_index (name
, params_index
);
217 return VEC_index (tree
, params
, index
);
220 gcc_assert (newivs
&& newivs_index
);
221 index
= clast_name_to_index (name
, newivs_index
);
222 gcc_assert (index
>= 0);
224 return newivs_to_depth_to_newiv (newivs
, index
);
227 /* Returns the signed maximal precision type for expressions TYPE1 and TYPE2. */
230 max_signed_precision_type (tree type1
, tree type2
)
232 int p1
= TYPE_PRECISION (type1
);
233 int p2
= TYPE_PRECISION (type2
);
238 precision
= TYPE_UNSIGNED (type1
) ? p1
* 2 : p1
;
240 precision
= TYPE_UNSIGNED (type2
) ? p2
* 2 : p2
;
242 type
= lang_hooks
.types
.type_for_size (precision
, false);
247 return integer_type_node
;
252 /* Returns the maximal precision type for expressions TYPE1 and TYPE2. */
255 max_precision_type (tree type1
, tree type2
)
257 if (POINTER_TYPE_P (type1
))
260 if (POINTER_TYPE_P (type2
))
263 if (!TYPE_UNSIGNED (type1
)
264 || !TYPE_UNSIGNED (type2
))
265 return max_signed_precision_type (type1
, type2
);
267 return TYPE_PRECISION (type1
) > TYPE_PRECISION (type2
) ? type1
: type2
;
271 clast_to_gcc_expression (tree
, struct clast_expr
*, sese
, VEC (tree
, heap
) *,
274 /* Converts a Cloog reduction expression R with reduction operation OP
275 to a GCC expression tree of type TYPE. */
278 clast_to_gcc_expression_red (tree type
, enum tree_code op
,
279 struct clast_reduction
*r
,
280 sese region
, VEC (tree
, heap
) *newivs
,
281 htab_t newivs_index
, htab_t params_index
)
284 tree res
= clast_to_gcc_expression (type
, r
->elts
[0], region
, newivs
,
285 newivs_index
, params_index
);
286 tree operand_type
= (op
== POINTER_PLUS_EXPR
) ? sizetype
: type
;
288 for (i
= 1; i
< r
->n
; i
++)
290 tree t
= clast_to_gcc_expression (operand_type
, r
->elts
[i
], region
,
291 newivs
, newivs_index
, params_index
);
292 res
= fold_build2 (op
, type
, res
, t
);
298 /* Converts a Cloog AST expression E back to a GCC expression tree of
302 clast_to_gcc_expression (tree type
, struct clast_expr
*e
,
303 sese region
, VEC (tree
, heap
) *newivs
,
304 htab_t newivs_index
, htab_t params_index
)
310 struct clast_term
*t
= (struct clast_term
*) e
;
314 if (mpz_cmp_si (t
->val
, 1) == 0)
316 tree name
= clast_name_to_gcc (t
->var
, region
, newivs
,
317 newivs_index
, params_index
);
319 if (POINTER_TYPE_P (TREE_TYPE (name
)) != POINTER_TYPE_P (type
))
320 name
= fold_convert (sizetype
, name
);
322 name
= fold_convert (type
, name
);
326 else if (mpz_cmp_si (t
->val
, -1) == 0)
328 tree name
= clast_name_to_gcc (t
->var
, region
, newivs
,
329 newivs_index
, params_index
);
331 if (POINTER_TYPE_P (TREE_TYPE (name
)) != POINTER_TYPE_P (type
))
332 name
= fold_convert (sizetype
, name
);
334 name
= fold_convert (type
, name
);
336 return fold_build1 (NEGATE_EXPR
, type
, name
);
340 tree name
= clast_name_to_gcc (t
->var
, region
, newivs
,
341 newivs_index
, params_index
);
342 tree cst
= gmp_cst_to_tree (type
, t
->val
);
344 if (POINTER_TYPE_P (TREE_TYPE (name
)) != POINTER_TYPE_P (type
))
345 name
= fold_convert (sizetype
, name
);
347 name
= fold_convert (type
, name
);
349 if (!POINTER_TYPE_P (type
))
350 return fold_build2 (MULT_EXPR
, type
, cst
, name
);
357 return gmp_cst_to_tree (type
, t
->val
);
362 struct clast_reduction
*r
= (struct clast_reduction
*) e
;
367 return clast_to_gcc_expression_red
368 (type
, POINTER_TYPE_P (type
) ? POINTER_PLUS_EXPR
: PLUS_EXPR
,
369 r
, region
, newivs
, newivs_index
, params_index
);
372 return clast_to_gcc_expression_red (type
, MIN_EXPR
, r
, region
,
373 newivs
, newivs_index
,
377 return clast_to_gcc_expression_red (type
, MAX_EXPR
, r
, region
,
378 newivs
, newivs_index
,
389 struct clast_binary
*b
= (struct clast_binary
*) e
;
390 struct clast_expr
*lhs
= (struct clast_expr
*) b
->LHS
;
391 tree tl
= clast_to_gcc_expression (type
, lhs
, region
, newivs
,
392 newivs_index
, params_index
);
393 tree tr
= gmp_cst_to_tree (type
, b
->RHS
);
398 return fold_build2 (FLOOR_DIV_EXPR
, type
, tl
, tr
);
401 return fold_build2 (CEIL_DIV_EXPR
, type
, tl
, tr
);
404 return fold_build2 (EXACT_DIV_EXPR
, type
, tl
, tr
);
407 return fold_build2 (TRUNC_MOD_EXPR
, type
, tl
, tr
);
421 /* Return the precision needed to represent the value VAL. */
424 precision_for_value (mpz_t val
)
433 value_assign (y
, val
);
434 value_set_si (two
, 2);
440 while (value_gt (y
, x
))
442 value_multiply (x
, x
, two
);
453 /* Return the precision needed to represent the values between LOW and
457 precision_for_interval (mpz_t low
, mpz_t up
)
462 gcc_assert (value_le (low
, up
));
465 value_subtract (diff
, up
, low
);
466 precision
= precision_for_value (diff
);
472 /* Return a type that could represent the integer value VAL. */
475 gcc_type_for_interval (mpz_t low
, mpz_t up
)
477 bool unsigned_p
= true;
478 int precision
, prec_up
, prec_int
;
480 enum machine_mode mode
;
482 gcc_assert (value_le (low
, up
));
484 if (value_neg_p (low
))
487 prec_up
= precision_for_value (up
);
488 prec_int
= precision_for_interval (low
, up
);
489 precision
= MAX (prec_up
, prec_int
);
491 if (precision
> BITS_PER_WORD
)
494 return integer_type_node
;
497 mode
= smallest_mode_for_size (precision
, MODE_INT
);
498 precision
= GET_MODE_PRECISION (mode
);
499 type
= build_nonstandard_integer_type (precision
, unsigned_p
);
504 return integer_type_node
;
510 /* Return a type that could represent the integer value VAL, or
511 otherwise return NULL_TREE. */
514 gcc_type_for_value (mpz_t val
)
516 return gcc_type_for_interval (val
, val
);
519 /* Return the type for the clast_term T used in STMT. */
522 gcc_type_for_clast_term (struct clast_term
*t
,
523 sese region
, VEC (tree
, heap
) *newivs
,
524 htab_t newivs_index
, htab_t params_index
)
526 gcc_assert (t
->expr
.type
== expr_term
);
529 return gcc_type_for_value (t
->val
);
531 return TREE_TYPE (clast_name_to_gcc (t
->var
, region
, newivs
,
532 newivs_index
, params_index
));
536 gcc_type_for_clast_expr (struct clast_expr
*, sese
,
537 VEC (tree
, heap
) *, htab_t
, htab_t
);
539 /* Return the type for the clast_reduction R used in STMT. */
542 gcc_type_for_clast_red (struct clast_reduction
*r
, sese region
,
543 VEC (tree
, heap
) *newivs
,
544 htab_t newivs_index
, htab_t params_index
)
547 tree type
= NULL_TREE
;
550 return gcc_type_for_clast_expr (r
->elts
[0], region
, newivs
,
551 newivs_index
, params_index
);
558 type
= gcc_type_for_clast_expr (r
->elts
[0], region
, newivs
,
559 newivs_index
, params_index
);
560 for (i
= 1; i
< r
->n
; i
++)
561 type
= max_precision_type (type
, gcc_type_for_clast_expr
562 (r
->elts
[i
], region
, newivs
,
563 newivs_index
, params_index
));
575 /* Return the type for the clast_binary B used in STMT. */
578 gcc_type_for_clast_bin (struct clast_binary
*b
,
579 sese region
, VEC (tree
, heap
) *newivs
,
580 htab_t newivs_index
, htab_t params_index
)
582 tree l
= gcc_type_for_clast_expr ((struct clast_expr
*) b
->LHS
, region
,
583 newivs
, newivs_index
, params_index
);
584 tree r
= gcc_type_for_value (b
->RHS
);
585 return max_signed_precision_type (l
, r
);
588 /* Returns the type for the CLAST expression E when used in statement
592 gcc_type_for_clast_expr (struct clast_expr
*e
,
593 sese region
, VEC (tree
, heap
) *newivs
,
594 htab_t newivs_index
, htab_t params_index
)
599 return gcc_type_for_clast_term ((struct clast_term
*) e
, region
,
600 newivs
, newivs_index
, params_index
);
603 return gcc_type_for_clast_red ((struct clast_reduction
*) e
, region
,
604 newivs
, newivs_index
, params_index
);
607 return gcc_type_for_clast_bin ((struct clast_binary
*) e
, region
,
608 newivs
, newivs_index
, params_index
);
617 /* Returns the type for the equation CLEQ. */
620 gcc_type_for_clast_eq (struct clast_equation
*cleq
,
621 sese region
, VEC (tree
, heap
) *newivs
,
622 htab_t newivs_index
, htab_t params_index
)
624 tree l
= gcc_type_for_clast_expr (cleq
->LHS
, region
, newivs
,
625 newivs_index
, params_index
);
626 tree r
= gcc_type_for_clast_expr (cleq
->RHS
, region
, newivs
,
627 newivs_index
, params_index
);
628 return max_precision_type (l
, r
);
631 /* Translates a clast equation CLEQ to a tree. */
634 graphite_translate_clast_equation (sese region
,
635 struct clast_equation
*cleq
,
636 VEC (tree
, heap
) *newivs
,
637 htab_t newivs_index
, htab_t params_index
)
640 tree type
= gcc_type_for_clast_eq (cleq
, region
, newivs
, newivs_index
,
642 tree lhs
= clast_to_gcc_expression (type
, cleq
->LHS
, region
, newivs
,
643 newivs_index
, params_index
);
644 tree rhs
= clast_to_gcc_expression (type
, cleq
->RHS
, region
, newivs
,
645 newivs_index
, params_index
);
650 else if (cleq
->sign
> 0)
656 return fold_build2 (comp
, boolean_type_node
, lhs
, rhs
);
659 /* Creates the test for the condition in STMT. */
662 graphite_create_guard_cond_expr (sese region
, struct clast_guard
*stmt
,
663 VEC (tree
, heap
) *newivs
,
664 htab_t newivs_index
, htab_t params_index
)
669 for (i
= 0; i
< stmt
->n
; i
++)
671 tree eq
= graphite_translate_clast_equation (region
, &stmt
->eq
[i
],
672 newivs
, newivs_index
,
676 cond
= fold_build2 (TRUTH_AND_EXPR
, TREE_TYPE (eq
), cond
, eq
);
684 /* Creates a new if region corresponding to Cloog's guard. */
687 graphite_create_new_guard (sese region
, edge entry_edge
,
688 struct clast_guard
*stmt
,
689 VEC (tree
, heap
) *newivs
,
690 htab_t newivs_index
, htab_t params_index
)
692 tree cond_expr
= graphite_create_guard_cond_expr (region
, stmt
, newivs
,
693 newivs_index
, params_index
);
694 edge exit_edge
= create_empty_if_region_on_edge (entry_edge
, cond_expr
);
698 /* Compute the lower bound LOW and upper bound UP for the induction
699 variable at LEVEL for the statement PBB, based on the transformed
700 scattering of PBB: T|I|G|Cst, with T the scattering transform, I
701 the iteration domain, and G the context parameters. */
704 compute_bounds_for_level (poly_bb_p pbb
, int level
, mpz_t low
, mpz_t up
)
706 ppl_Pointset_Powerset_C_Polyhedron_t ps
;
707 ppl_Linear_Expression_t le
;
709 combine_context_id_scat (&ps
, pbb
, false);
711 /* Prepare the linear expression corresponding to the level that we
712 want to maximize/minimize. */
714 ppl_dimension_type dim
= pbb_nb_scattering_transform (pbb
)
715 + pbb_dim_iter_domain (pbb
) + pbb_nb_params (pbb
);
717 ppl_new_Linear_Expression_with_dimension (&le
, dim
);
718 ppl_set_coef (le
, 2 * level
+ 1, 1);
721 ppl_max_for_le_pointset (ps
, le
, up
);
722 ppl_min_for_le_pointset (ps
, le
, low
);
725 /* Compute the type for the induction variable at LEVEL for the
726 statement PBB, based on the transformed schedule of PBB. */
729 compute_type_for_level (poly_bb_p pbb
, int level
)
737 compute_bounds_for_level (pbb
, level
, low
, up
);
738 type
= gcc_type_for_interval (low
, up
);
745 /* Walks a CLAST and returns the first statement in the body of a
748 static struct clast_user_stmt
*
749 clast_get_body_of_loop (struct clast_stmt
*stmt
)
752 || CLAST_STMT_IS_A (stmt
, stmt_user
))
753 return (struct clast_user_stmt
*) stmt
;
755 if (CLAST_STMT_IS_A (stmt
, stmt_for
))
756 return clast_get_body_of_loop (((struct clast_for
*) stmt
)->body
);
758 if (CLAST_STMT_IS_A (stmt
, stmt_guard
))
759 return clast_get_body_of_loop (((struct clast_guard
*) stmt
)->then
);
761 if (CLAST_STMT_IS_A (stmt
, stmt_block
))
762 return clast_get_body_of_loop (((struct clast_block
*) stmt
)->body
);
767 /* Returns the type for the induction variable for the loop translated
771 gcc_type_for_iv_of_clast_loop (struct clast_for
*stmt_for
, int level
,
772 tree lb_type
, tree ub_type
)
774 struct clast_stmt
*stmt
= (struct clast_stmt
*) stmt_for
;
775 struct clast_user_stmt
*body
= clast_get_body_of_loop (stmt
);
776 CloogStatement
*cs
= body
->statement
;
777 poly_bb_p pbb
= (poly_bb_p
) cloog_statement_usr (cs
);
779 return max_signed_precision_type (lb_type
, max_precision_type
780 (ub_type
, compute_type_for_level
784 /* Creates a new LOOP corresponding to Cloog's STMT. Inserts an
785 induction variable for the new LOOP. New LOOP is attached to CFG
786 starting at ENTRY_EDGE. LOOP is inserted into the loop tree and
787 becomes the child loop of the OUTER_LOOP. NEWIVS_INDEX binds
788 CLooG's scattering name to the induction variable created for the
789 loop of STMT. The new induction variable is inserted in the NEWIVS
793 graphite_create_new_loop (sese region
, edge entry_edge
,
794 struct clast_for
*stmt
,
795 loop_p outer
, VEC (tree
, heap
) **newivs
,
796 htab_t newivs_index
, htab_t params_index
, int level
)
798 tree lb_type
= gcc_type_for_clast_expr (stmt
->LB
, region
, *newivs
,
799 newivs_index
, params_index
);
800 tree ub_type
= gcc_type_for_clast_expr (stmt
->UB
, region
, *newivs
,
801 newivs_index
, params_index
);
802 tree type
= gcc_type_for_iv_of_clast_loop (stmt
, level
, lb_type
, ub_type
);
803 tree lb
= clast_to_gcc_expression (type
, stmt
->LB
, region
, *newivs
,
804 newivs_index
, params_index
);
805 tree ub
= clast_to_gcc_expression (type
, stmt
->UB
, region
, *newivs
,
806 newivs_index
, params_index
);
807 tree stride
= gmp_cst_to_tree (type
, stmt
->stride
);
808 tree ivvar
= create_tmp_var (type
, "graphite_IV");
809 tree iv
, iv_after_increment
;
810 loop_p loop
= create_empty_loop_on_edge
811 (entry_edge
, lb
, stride
, ub
, ivvar
, &iv
, &iv_after_increment
,
812 outer
? outer
: entry_edge
->src
->loop_father
);
814 add_referenced_var (ivvar
);
816 save_clast_name_index (newivs_index
, stmt
->iterator
,
817 VEC_length (tree
, *newivs
));
818 VEC_safe_push (tree
, heap
, *newivs
, iv
);
822 /* Inserts in MAP a tuple (OLD_NAME, NEW_NAME) for the induction
823 variables of the loops around GBB in SESE. */
826 build_iv_mapping (htab_t map
, sese region
,
827 VEC (tree
, heap
) *newivs
, htab_t newivs_index
,
828 struct clast_user_stmt
*user_stmt
,
831 struct clast_stmt
*t
;
833 CloogStatement
*cs
= user_stmt
->statement
;
834 poly_bb_p pbb
= (poly_bb_p
) cloog_statement_usr (cs
);
836 for (t
= user_stmt
->substitutions
; t
; t
= t
->next
, index
++)
838 struct clast_expr
*expr
= (struct clast_expr
*)
839 ((struct clast_assignment
*)t
)->RHS
;
840 tree type
= gcc_type_for_clast_expr (expr
, region
, newivs
,
841 newivs_index
, params_index
);
842 tree old_name
= pbb_to_depth_to_oldiv (pbb
, index
);
843 tree e
= clast_to_gcc_expression (type
, expr
, region
, newivs
,
844 newivs_index
, params_index
);
845 set_rename (map
, old_name
, e
);
849 /* Helper function for htab_traverse. */
852 copy_renames (void **slot
, void *s
)
854 struct rename_map_elt_s
*entry
= (struct rename_map_elt_s
*) *slot
;
855 htab_t res
= (htab_t
) s
;
856 tree old_name
= entry
->old_name
;
857 tree expr
= entry
->expr
;
858 struct rename_map_elt_s tmp
;
861 tmp
.old_name
= old_name
;
862 x
= htab_find_slot (res
, &tmp
, INSERT
);
865 *x
= new_rename_map_elt (old_name
, expr
);
870 /* Construct bb_pbb_def with BB and PBB. */
873 new_bb_pbb_def (basic_block bb
, poly_bb_p pbb
)
875 bb_pbb_def
*bb_pbb_p
;
877 bb_pbb_p
= XNEW (bb_pbb_def
);
884 /* Mark BB with it's relevant PBB via hashing table BB_PBB_MAPPING. */
887 mark_bb_with_pbb (poly_bb_p pbb
, basic_block bb
, htab_t bb_pbb_mapping
)
893 x
= htab_find_slot (bb_pbb_mapping
, &tmp
, INSERT
);
896 *x
= new_bb_pbb_def (bb
, pbb
);
899 /* Find BB's related poly_bb_p in hash table BB_PBB_MAPPING. */
902 find_pbb_via_hash (htab_t bb_pbb_mapping
, basic_block bb
)
908 slot
= htab_find_slot (bb_pbb_mapping
, &tmp
, NO_INSERT
);
911 return ((bb_pbb_def
*) *slot
)->pbb
;
916 /* Check data dependency in LOOP at scattering level LEVEL.
917 BB_PBB_MAPPING is a basic_block and it's related poly_bb_p
921 dependency_in_loop_p (loop_p loop
, htab_t bb_pbb_mapping
, int level
)
924 basic_block
*bbs
= get_loop_body_in_dom_order (loop
);
926 for (i
= 0; i
< loop
->num_nodes
; i
++)
928 poly_bb_p pbb1
= find_pbb_via_hash (bb_pbb_mapping
, bbs
[i
]);
933 for (j
= 0; j
< loop
->num_nodes
; j
++)
935 poly_bb_p pbb2
= find_pbb_via_hash (bb_pbb_mapping
, bbs
[j
]);
940 if (dependency_between_pbbs_p (pbb1
, pbb2
, level
))
954 translate_clast (sese
, loop_p
, struct clast_stmt
*, edge
, htab_t
,
955 VEC (tree
, heap
) **, htab_t
, htab_t
, int, htab_t
);
957 /* Translates a clast user statement STMT to gimple.
959 - REGION is the sese region we used to generate the scop.
960 - NEXT_E is the edge where new generated code should be attached.
961 - CONTEXT_LOOP is the loop in which the generated code will be placed
962 - RENAME_MAP contains a set of tuples of new names associated to
963 the original variables names.
964 - BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
965 - PARAMS_INDEX connects the cloog parameters with the gimple parameters in
968 translate_clast_user (sese region
, struct clast_user_stmt
*stmt
, edge next_e
,
969 htab_t rename_map
, VEC (tree
, heap
) **newivs
,
970 htab_t newivs_index
, htab_t bb_pbb_mapping
,
975 poly_bb_p pbb
= (poly_bb_p
) cloog_statement_usr (stmt
->statement
);
976 gbb
= PBB_BLACK_BOX (pbb
);
978 if (GBB_BB (gbb
) == ENTRY_BLOCK_PTR
)
981 build_iv_mapping (rename_map
, region
, *newivs
, newivs_index
, stmt
,
983 next_e
= copy_bb_and_scalar_dependences (GBB_BB (gbb
), region
,
985 new_bb
= next_e
->src
;
986 mark_bb_with_pbb (pbb
, new_bb
, bb_pbb_mapping
);
987 update_ssa (TODO_update_ssa
);
992 /* Creates a new if region protecting the loop to be executed, if the execution
993 count is zero (lb > ub). */
996 graphite_create_new_loop_guard (sese region
, edge entry_edge
,
997 struct clast_for
*stmt
,
998 VEC (tree
, heap
) *newivs
,
999 htab_t newivs_index
, htab_t params_index
)
1003 tree lb_type
= gcc_type_for_clast_expr (stmt
->LB
, region
, newivs
,
1004 newivs_index
, params_index
);
1005 tree ub_type
= gcc_type_for_clast_expr (stmt
->UB
, region
, newivs
,
1006 newivs_index
, params_index
);
1007 tree type
= max_precision_type (lb_type
, ub_type
);
1008 tree lb
= clast_to_gcc_expression (type
, stmt
->LB
, region
, newivs
,
1009 newivs_index
, params_index
);
1010 tree ub
= clast_to_gcc_expression (type
, stmt
->UB
, region
, newivs
,
1011 newivs_index
, params_index
);
1012 tree one
= POINTER_TYPE_P (type
) ? size_one_node
1013 : fold_convert (type
, integer_one_node
);
1014 /* Adding +1 and using LT_EXPR helps with loop latches that have a
1015 loop iteration count of "PARAMETER - 1". For PARAMETER == 0 this becomes
1016 2^{32|64}, and the condition lb <= ub is true, even if we do not want this.
1017 However lb < ub + 1 is false, as expected. */
1018 tree ub_one
= fold_build2 (POINTER_TYPE_P (type
) ? POINTER_PLUS_EXPR
1019 : PLUS_EXPR
, type
, ub
, one
);
1021 /* When ub + 1 wraps around, use lb <= ub. */
1022 if (integer_zerop (ub_one
))
1023 cond_expr
= fold_build2 (LE_EXPR
, boolean_type_node
, lb
, ub
);
1025 cond_expr
= fold_build2 (LT_EXPR
, boolean_type_node
, lb
, ub_one
);
1027 exit_edge
= create_empty_if_region_on_edge (entry_edge
, cond_expr
);
1033 /* Create the loop for a clast for statement.
1035 - REGION is the sese region we used to generate the scop.
1036 - NEXT_E is the edge where new generated code should be attached.
1037 - RENAME_MAP contains a set of tuples of new names associated to
1038 the original variables names.
1039 - BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
1040 - PARAMS_INDEX connects the cloog parameters with the gimple parameters in
1043 translate_clast_for_loop (sese region
, loop_p context_loop
,
1044 struct clast_for
*stmt
, edge next_e
,
1045 htab_t rename_map
, VEC (tree
, heap
) **newivs
,
1046 htab_t newivs_index
, htab_t bb_pbb_mapping
,
1047 int level
, htab_t params_index
)
1049 struct loop
*loop
= graphite_create_new_loop (region
, next_e
, stmt
,
1050 context_loop
, newivs
,
1051 newivs_index
, params_index
,
1053 edge last_e
= single_exit (loop
);
1054 edge to_body
= single_succ_edge (loop
->header
);
1055 basic_block after
= to_body
->dest
;
1057 /* Create a basic block for loop close phi nodes. */
1058 last_e
= single_succ_edge (split_edge (last_e
));
1060 /* Translate the body of the loop. */
1061 next_e
= translate_clast (region
, loop
, stmt
->body
, to_body
, rename_map
,
1062 newivs
, newivs_index
, bb_pbb_mapping
, level
+ 1,
1064 redirect_edge_succ_nodup (next_e
, after
);
1065 set_immediate_dominator (CDI_DOMINATORS
, next_e
->dest
, next_e
->src
);
1067 /* Remove from rename_map all the tuples containing variables
1068 defined in loop's body. */
1069 insert_loop_close_phis (rename_map
, loop
);
1071 if (flag_loop_parallelize_all
1072 && !dependency_in_loop_p (loop
, bb_pbb_mapping
,
1073 get_scattering_level (level
)))
1074 loop
->can_be_parallel
= true;
1079 /* Translates a clast for statement STMT to gimple. First a guard is created
1080 protecting the loop, if it is executed zero times. In this guard we create
1081 the real loop structure.
1083 - REGION is the sese region we used to generate the scop.
1084 - NEXT_E is the edge where new generated code should be attached.
1085 - RENAME_MAP contains a set of tuples of new names associated to
1086 the original variables names.
1087 - BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
1088 - PARAMS_INDEX connects the cloog parameters with the gimple parameters in
1091 translate_clast_for (sese region
, loop_p context_loop
, struct clast_for
*stmt
,
1092 edge next_e
, htab_t rename_map
, VEC (tree
, heap
) **newivs
,
1093 htab_t newivs_index
, htab_t bb_pbb_mapping
, int level
,
1094 htab_t params_index
)
1096 edge last_e
= graphite_create_new_loop_guard (region
, next_e
, stmt
, *newivs
,
1097 newivs_index
, params_index
);
1099 edge true_e
= get_true_edge_from_guard_bb (next_e
->dest
);
1100 edge false_e
= get_false_edge_from_guard_bb (next_e
->dest
);
1101 edge exit_true_e
= single_succ_edge (true_e
->dest
);
1102 edge exit_false_e
= single_succ_edge (false_e
->dest
);
1104 htab_t before_guard
= htab_create (10, rename_map_elt_info
,
1105 eq_rename_map_elts
, free
);
1106 htab_traverse (rename_map
, copy_renames
, before_guard
);
1108 next_e
= translate_clast_for_loop (region
, context_loop
, stmt
, true_e
,
1110 newivs_index
, bb_pbb_mapping
, level
,
1113 insert_guard_phis (last_e
->src
, exit_true_e
, exit_false_e
,
1114 before_guard
, rename_map
);
1116 htab_delete (before_guard
);
1121 /* Translates a clast guard statement STMT to gimple.
1123 - REGION is the sese region we used to generate the scop.
1124 - NEXT_E is the edge where new generated code should be attached.
1125 - CONTEXT_LOOP is the loop in which the generated code will be placed
1126 - RENAME_MAP contains a set of tuples of new names associated to
1127 the original variables names.
1128 - BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
1129 - PARAMS_INDEX connects the cloog parameters with the gimple parameters in
1132 translate_clast_guard (sese region
, loop_p context_loop
,
1133 struct clast_guard
*stmt
, edge next_e
,
1134 htab_t rename_map
, VEC (tree
, heap
) **newivs
,
1135 htab_t newivs_index
, htab_t bb_pbb_mapping
, int level
,
1136 htab_t params_index
)
1138 edge last_e
= graphite_create_new_guard (region
, next_e
, stmt
, *newivs
,
1139 newivs_index
, params_index
);
1141 edge true_e
= get_true_edge_from_guard_bb (next_e
->dest
);
1142 edge false_e
= get_false_edge_from_guard_bb (next_e
->dest
);
1143 edge exit_true_e
= single_succ_edge (true_e
->dest
);
1144 edge exit_false_e
= single_succ_edge (false_e
->dest
);
1146 htab_t before_guard
= htab_create (10, rename_map_elt_info
,
1147 eq_rename_map_elts
, free
);
1148 htab_traverse (rename_map
, copy_renames
, before_guard
);
1150 next_e
= translate_clast (region
, context_loop
, stmt
->then
, true_e
,
1151 rename_map
, newivs
, newivs_index
, bb_pbb_mapping
,
1152 level
, params_index
);
1154 insert_guard_phis (last_e
->src
, exit_true_e
, exit_false_e
,
1155 before_guard
, rename_map
);
1157 htab_delete (before_guard
);
1162 /* Translates a CLAST statement STMT to GCC representation in the
1165 - NEXT_E is the edge where new generated code should be attached.
1166 - CONTEXT_LOOP is the loop in which the generated code will be placed
1167 - RENAME_MAP contains a set of tuples of new names associated to
1168 the original variables names.
1169 - BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping. */
1171 translate_clast (sese region
, loop_p context_loop
, struct clast_stmt
*stmt
,
1172 edge next_e
, htab_t rename_map
, VEC (tree
, heap
) **newivs
,
1173 htab_t newivs_index
, htab_t bb_pbb_mapping
, int level
,
1174 htab_t params_index
)
1179 if (CLAST_STMT_IS_A (stmt
, stmt_root
))
1182 else if (CLAST_STMT_IS_A (stmt
, stmt_user
))
1183 next_e
= translate_clast_user (region
, (struct clast_user_stmt
*) stmt
,
1184 next_e
, rename_map
, newivs
, newivs_index
,
1185 bb_pbb_mapping
, params_index
);
1187 else if (CLAST_STMT_IS_A (stmt
, stmt_for
))
1188 next_e
= translate_clast_for (region
, context_loop
,
1189 (struct clast_for
*) stmt
, next_e
,
1190 rename_map
, newivs
, newivs_index
,
1191 bb_pbb_mapping
, level
, params_index
);
1193 else if (CLAST_STMT_IS_A (stmt
, stmt_guard
))
1194 next_e
= translate_clast_guard (region
, context_loop
,
1195 (struct clast_guard
*) stmt
, next_e
,
1196 rename_map
, newivs
, newivs_index
,
1197 bb_pbb_mapping
, level
, params_index
);
1199 else if (CLAST_STMT_IS_A (stmt
, stmt_block
))
1200 next_e
= translate_clast (region
, context_loop
,
1201 ((struct clast_block
*) stmt
)->body
,
1202 next_e
, rename_map
, newivs
, newivs_index
,
1203 bb_pbb_mapping
, level
, params_index
);
1207 recompute_all_dominators ();
1210 return translate_clast (region
, context_loop
, stmt
->next
, next_e
,
1211 rename_map
, newivs
, newivs_index
,
1212 bb_pbb_mapping
, level
, params_index
);
1215 /* Free the SCATTERING domain list. */
1218 free_scattering (CloogDomainList
*scattering
)
1222 CloogDomain
*dom
= cloog_domain (scattering
);
1223 CloogDomainList
*next
= cloog_next_domain (scattering
);
1225 cloog_domain_free (dom
);
1231 /* Initialize Cloog's parameter names from the names used in GIMPLE.
1232 Initialize Cloog's iterator names, using 'graphite_iterator_%d'
1233 from 0 to scop_nb_loops (scop). */
1236 initialize_cloog_names (scop_p scop
, CloogProgram
*prog
)
1238 sese region
= SCOP_REGION (scop
);
1240 int nb_iterators
= scop_max_loop_depth (scop
);
1241 int nb_scattering
= cloog_program_nb_scattdims (prog
);
1242 int nb_parameters
= VEC_length (tree
, SESE_PARAMS (region
));
1243 char **iterators
= XNEWVEC (char *, nb_iterators
* 2);
1244 char **scattering
= XNEWVEC (char *, nb_scattering
);
1245 char **parameters
= XNEWVEC (char *, nb_parameters
);
1247 cloog_program_set_names (prog
, cloog_names_malloc ());
1249 for (i
= 0; i
< nb_parameters
; i
++)
1251 tree param
= VEC_index (tree
, SESE_PARAMS(region
), i
);
1252 const char *name
= get_name (param
);
1258 len
= strlen (name
);
1260 parameters
[i
] = XNEWVEC (char, len
+ 1);
1261 snprintf (parameters
[i
], len
, "%s_%d", name
, SSA_NAME_VERSION (param
));
1264 cloog_names_set_nb_parameters (cloog_program_names (prog
), nb_parameters
);
1265 cloog_names_set_parameters (cloog_program_names (prog
), parameters
);
1267 for (i
= 0; i
< nb_iterators
; i
++)
1270 iterators
[i
] = XNEWVEC (char, len
);
1271 snprintf (iterators
[i
], len
, "git_%d", i
);
1274 cloog_names_set_nb_iterators (cloog_program_names (prog
),
1276 cloog_names_set_iterators (cloog_program_names (prog
),
1279 for (i
= 0; i
< nb_scattering
; i
++)
1282 scattering
[i
] = XNEWVEC (char, len
);
1283 snprintf (scattering
[i
], len
, "scat_%d", i
);
1286 cloog_names_set_nb_scattering (cloog_program_names (prog
),
1288 cloog_names_set_scattering (cloog_program_names (prog
),
1292 /* Build cloog program for SCoP. */
1295 build_cloog_prog (scop_p scop
, CloogProgram
*prog
)
1298 int max_nb_loops
= scop_max_loop_depth (scop
);
1300 CloogLoop
*loop_list
= NULL
;
1301 CloogBlockList
*block_list
= NULL
;
1302 CloogDomainList
*scattering
= NULL
;
1303 int nbs
= 2 * max_nb_loops
+ 1;
1306 cloog_program_set_context
1307 (prog
, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop
)));
1308 nbs
= unify_scattering_dimensions (scop
);
1309 scaldims
= (int *) xmalloc (nbs
* (sizeof (int)));
1310 cloog_program_set_nb_scattdims (prog
, nbs
);
1311 initialize_cloog_names (scop
, prog
);
1313 for (i
= 0; VEC_iterate (poly_bb_p
, SCOP_BBS (scop
), i
, pbb
); i
++)
1315 CloogStatement
*stmt
;
1318 /* Dead code elimination: when the domain of a PBB is empty,
1319 don't generate code for the PBB. */
1320 if (ppl_Pointset_Powerset_C_Polyhedron_is_empty (PBB_DOMAIN (pbb
)))
1323 /* Build the new statement and its block. */
1324 stmt
= cloog_statement_alloc (pbb_index (pbb
));
1325 block
= cloog_block_alloc (stmt
, 0, NULL
, pbb_dim_iter_domain (pbb
));
1326 cloog_statement_set_usr (stmt
, pbb
);
1328 /* Build loop list. */
1330 CloogLoop
*new_loop_list
= cloog_loop_malloc ();
1331 cloog_loop_set_next (new_loop_list
, loop_list
);
1332 cloog_loop_set_domain
1334 new_Cloog_Domain_from_ppl_Pointset_Powerset (PBB_DOMAIN (pbb
)));
1335 cloog_loop_set_block (new_loop_list
, block
);
1336 loop_list
= new_loop_list
;
1339 /* Build block list. */
1341 CloogBlockList
*new_block_list
= cloog_block_list_malloc ();
1343 cloog_block_list_set_next (new_block_list
, block_list
);
1344 cloog_block_list_set_block (new_block_list
, block
);
1345 block_list
= new_block_list
;
1348 /* Build scattering list. */
1350 /* XXX: Replace with cloog_domain_list_alloc(), when available. */
1351 CloogDomainList
*new_scattering
1352 = (CloogDomainList
*) xmalloc (sizeof (CloogDomainList
));
1353 ppl_Polyhedron_t scat
;
1356 scat
= PBB_TRANSFORMED_SCATTERING (pbb
);
1357 dom
= new_Cloog_Domain_from_ppl_Polyhedron (scat
);
1359 cloog_set_next_domain (new_scattering
, scattering
);
1360 cloog_set_domain (new_scattering
, dom
);
1361 scattering
= new_scattering
;
1365 cloog_program_set_loop (prog
, loop_list
);
1366 cloog_program_set_blocklist (prog
, block_list
);
1368 for (i
= 0; i
< nbs
; i
++)
1371 cloog_program_set_scaldims (prog
, scaldims
);
1373 /* Extract scalar dimensions to simplify the code generation problem. */
1374 cloog_program_extract_scalars (prog
, scattering
);
1376 /* Apply scattering. */
1377 cloog_program_scatter (prog
, scattering
);
1378 free_scattering (scattering
);
1380 /* Iterators corresponding to scalar dimensions have to be extracted. */
1381 cloog_names_scalarize (cloog_program_names (prog
), nbs
,
1382 cloog_program_scaldims (prog
));
1384 /* Free blocklist. */
1386 CloogBlockList
*next
= cloog_program_blocklist (prog
);
1390 CloogBlockList
*toDelete
= next
;
1391 next
= cloog_block_list_next (next
);
1392 cloog_block_list_set_next (toDelete
, NULL
);
1393 cloog_block_list_set_block (toDelete
, NULL
);
1394 cloog_block_list_free (toDelete
);
1396 cloog_program_set_blocklist (prog
, NULL
);
1400 /* Return the options that will be used in GLOOG. */
1402 static CloogOptions
*
1403 set_cloog_options (void)
1405 CloogOptions
*options
= cloog_options_malloc ();
1407 /* Change cloog output language to C. If we do use FORTRAN instead, cloog
1408 will stop e.g. with "ERROR: unbounded loops not allowed in FORTRAN.", if
1409 we pass an incomplete program to cloog. */
1410 options
->language
= LANGUAGE_C
;
1412 /* Enable complex equality spreading: removes dummy statements
1413 (assignments) in the generated code which repeats the
1414 substitution equations for statements. This is useless for
1418 /* Enable C pretty-printing mode: normalizes the substitution
1419 equations for statements. */
1422 /* Allow cloog to build strides with a stride width different to one.
1423 This example has stride = 4:
1425 for (i = 0; i < 20; i += 4)
1427 options
->strides
= 1;
1429 /* Disable optimizations and make cloog generate source code closer to the
1430 input. This is useful for debugging, but later we want the optimized
1433 XXX: We can not disable optimizations, as loop blocking is not working
1438 options
->l
= INT_MAX
;
1444 /* Prints STMT to STDERR. */
1447 print_clast_stmt (FILE *file
, struct clast_stmt
*stmt
)
1449 CloogOptions
*options
= set_cloog_options ();
1451 pprint (file
, stmt
, 0, options
);
1452 cloog_options_free (options
);
1455 /* Prints STMT to STDERR. */
1458 debug_clast_stmt (struct clast_stmt
*stmt
)
1460 print_clast_stmt (stderr
, stmt
);
1463 /* Translate SCOP to a CLooG program and clast. These two
1464 representations should be freed together: a clast cannot be used
1465 without a program. */
1468 scop_to_clast (scop_p scop
)
1470 CloogOptions
*options
= set_cloog_options ();
1471 cloog_prog_clast pc
;
1473 /* Connect new cloog prog generation to graphite. */
1474 pc
.prog
= cloog_program_malloc ();
1475 build_cloog_prog (scop
, pc
.prog
);
1476 pc
.prog
= cloog_program_generate (pc
.prog
, options
);
1477 pc
.stmt
= cloog_clast_create (pc
.prog
, options
);
1479 cloog_options_free (options
);
1483 /* Prints to FILE the code generated by CLooG for SCOP. */
1486 print_generated_program (FILE *file
, scop_p scop
)
1488 CloogOptions
*options
= set_cloog_options ();
1489 cloog_prog_clast pc
= scop_to_clast (scop
);
1491 fprintf (file
, " (prog: \n");
1492 cloog_program_print (file
, pc
.prog
);
1493 fprintf (file
, " )\n");
1495 fprintf (file
, " (clast: \n");
1496 pprint (file
, pc
.stmt
, 0, options
);
1497 fprintf (file
, " )\n");
1499 cloog_options_free (options
);
1500 cloog_clast_free (pc
.stmt
);
1501 cloog_program_free (pc
.prog
);
1504 /* Prints to STDERR the code generated by CLooG for SCOP. */
1507 debug_generated_program (scop_p scop
)
1509 print_generated_program (stderr
, scop
);
1512 /* Add CLooG names to parameter index. The index is used to translate
1513 back from CLooG names to GCC trees. */
1516 create_params_index (htab_t index_table
, CloogProgram
*prog
) {
1517 CloogNames
* names
= cloog_program_names (prog
);
1518 int nb_parameters
= cloog_names_nb_parameters (names
);
1519 char **parameters
= cloog_names_parameters (names
);
1522 for (i
= 0; i
< nb_parameters
; i
++)
1523 save_clast_name_index (index_table
, parameters
[i
], i
);
1526 /* GIMPLE Loop Generator: generates loops from STMT in GIMPLE form for
1527 the given SCOP. Return true if code generation succeeded.
1528 BB_PBB_MAPPING is a basic_block and it's related poly_bb_p mapping.
1532 gloog (scop_p scop
, VEC (scop_p
, heap
) *scops
, htab_t bb_pbb_mapping
)
1534 VEC (tree
, heap
) *newivs
= VEC_alloc (tree
, heap
, 10);
1535 loop_p context_loop
;
1536 sese region
= SCOP_REGION (scop
);
1537 ifsese if_region
= NULL
;
1538 htab_t rename_map
, newivs_index
, params_index
;
1539 cloog_prog_clast pc
;
1542 timevar_push (TV_GRAPHITE_CODE_GEN
);
1543 gloog_error
= false;
1545 pc
= scop_to_clast (scop
);
1547 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
1549 fprintf (dump_file
, "\nCLAST generated by CLooG: \n");
1550 print_clast_stmt (dump_file
, pc
.stmt
);
1551 fprintf (dump_file
, "\n");
1554 recompute_all_dominators ();
1557 if_region
= move_sese_in_condition (region
);
1558 sese_insert_phis_for_liveouts (region
,
1559 if_region
->region
->exit
->src
,
1560 if_region
->false_region
->exit
,
1561 if_region
->true_region
->exit
);
1562 recompute_all_dominators ();
1565 context_loop
= SESE_ENTRY (region
)->src
->loop_father
;
1566 rename_map
= htab_create (10, rename_map_elt_info
, eq_rename_map_elts
, free
);
1567 newivs_index
= htab_create (10, clast_name_index_elt_info
,
1568 eq_clast_name_indexes
, free
);
1569 params_index
= htab_create (10, clast_name_index_elt_info
,
1570 eq_clast_name_indexes
, free
);
1572 create_params_index (params_index
, pc
.prog
);
1574 translate_clast (region
, context_loop
, pc
.stmt
,
1575 if_region
->true_region
->entry
,
1576 rename_map
, &newivs
, newivs_index
,
1577 bb_pbb_mapping
, 1, params_index
);
1579 sese_adjust_liveout_phis (region
, rename_map
,
1580 if_region
->region
->exit
->src
,
1581 if_region
->false_region
->exit
,
1582 if_region
->true_region
->exit
);
1584 rename_nb_iterations (rename_map
);
1586 for (i
= 0; VEC_iterate (scop_p
, scops
, i
, scop
); i
++)
1587 rename_sese_parameters (rename_map
, SCOP_REGION (scop
));
1589 recompute_all_dominators ();
1593 set_ifsese_condition (if_region
, integer_zero_node
);
1595 free (if_region
->true_region
);
1596 free (if_region
->region
);
1599 htab_delete (rename_map
);
1600 htab_delete (newivs_index
);
1601 htab_delete (params_index
);
1602 VEC_free (tree
, heap
, newivs
);
1603 cloog_clast_free (pc
.stmt
);
1604 cloog_program_free (pc
.prog
);
1605 timevar_pop (TV_GRAPHITE_CODE_GEN
);
1607 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
1611 int num_no_dependency
= 0;
1613 FOR_EACH_LOOP (li
, loop
, 0)
1614 if (loop
->can_be_parallel
)
1615 num_no_dependency
++;
1617 fprintf (dump_file
, "\n%d loops carried no dependency.\n",
1621 return !gloog_error
;