extern void debug_iteration_domain (poly_bb_p, int);
extern void debug_iteration_domains (scop_p, int);
extern bool scop_do_interchange (scop_p);
-extern bool scop_do_strip_mine (scop_p);
+extern bool scop_do_strip_mine (scop_p, int);
extern bool scop_do_block (scop_p);
-extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, mpz_t);
+extern bool flatten_all_loops (scop_p);
extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, mpz_t);
extern void pbb_remove_duplicate_pdrs (poly_bb_p);
return loop;
}
-/* Return the first lst representing a PBB statement in LST. */
+/* Return the first LST representing a PBB statement in LST. */
static inline lst_p
lst_find_first_pbb (lst_p lst)
return NULL;
}
-/* Returns true when LST is a loop that does not contains
+/* Returns true when LST is a loop that does not contain
statements. */
static inline bool
return !lst_find_first_pbb (lst);
}
-/* Return the last lst representing a PBB statement in LST. */
+/* Return the last LST representing a PBB statement in LST. */
static inline lst_p
lst_find_last_pbb (lst_p lst)
LST_LOOP_FATHER (lst) = NULL;
}
+/* Removes the loop LST and inline its body in the father loop. */
+
+static inline void
+lst_remove_loop_and_inline_stmts_in_loop_father (lst_p lst)
+{
+ lst_p l, father = LST_LOOP_FATHER (lst);
+ int i, dewey = lst_dewey_number (lst);
+
+ gcc_assert (lst && father && dewey >= 0);
+
+ VEC_ordered_remove (lst_p, LST_SEQ (father), dewey);
+ LST_LOOP_FATHER (lst) = NULL;
+
+ FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
+ {
+ VEC_safe_insert (lst_p, heap, LST_SEQ (father), dewey + i, l);
+ LST_LOOP_FATHER (l) = father;
+ }
+}
+
/* Sets NITER to the upper bound approximation of the number of
iterations of loop LST. */
pbb_update_scattering (LST_PBB (lst), level, dewey);
}
-/* Updates the scattering of all the PBBs under LST and in sequence
- with LST. */
-
-static inline void
-lst_update_scattering_seq (lst_p lst)
-{
- int i;
- lst_p l;
- lst_p father = LST_LOOP_FATHER (lst);
- int dewey = lst_dewey_number (lst);
- int level = lst_depth (lst);
-
- gcc_assert (lst && father && dewey >= 0 && level >= 0);
-
- for (i = dewey; VEC_iterate (lst_p, LST_SEQ (father), i, l); i++)
- lst_update_scattering_under (l, level, i);
-}
-
/* Updates the all the scattering levels of all the PBBs under
LST. */
int i;
lst_p l;
- if (!lst || !LST_LOOP_P (lst))
+ if (!lst)
return;
if (LST_LOOP_FATHER (lst))
- lst_update_scattering_seq (lst);
+ {
+ lst_p father = LST_LOOP_FATHER (lst);
+ int dewey = lst_dewey_number (lst);
+ int level = lst_depth (lst);
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
- lst_update_scattering (l);
+ gcc_assert (lst && father && dewey >= 0 && level >= 0);
+
+ for (i = dewey; VEC_iterate (lst_p, LST_SEQ (father), i, l); i++)
+ lst_update_scattering_under (l, level, i);
+ }
+
+ if (LST_LOOP_P (lst))
+ for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ lst_update_scattering (l);
}
/* Inserts LST1 before LST2 if BEFORE is true; inserts LST1 after LST2
extern int unify_scattering_dimensions (scop_p);
extern bool apply_poly_transforms (scop_p);
extern bool graphite_legal_transform (scop_p);
+extern void cloog_checksum (scop_p);
/* Set the region of SCOP to REGION. */