static bool graphite_legal_transform_bb (poly_bb_p pbb1, poly_bb_p pbb2) { int i, j; poly_dr_p pdr1, pdr2; for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr1); i++) for (j = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), j, pdr2); j++) if (!graphite_legal_transform_dr (pbb1, pbb2, pdr1, pdr2)) return false; return true; }
bool dependency_between_pbbs_p (poly_bb_p pbb1, poly_bb_p pbb2, int level) { int i, j; poly_dr_p pdr1, pdr2; for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr1); i++) for (j = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), j, pdr2); j++) if (graphite_carried_dependence_level_k (pdr1, pdr2, level)) return true; return false; }
void new_poly_dr (poly_bb_p pbb, gimple *stmt, enum poly_dr_type type, isl_map *acc, isl_set *subscript_sizes) { static int id = 0; poly_dr_p pdr = XNEW (struct poly_dr); pdr->stmt = stmt; PDR_ID (pdr) = id++; PDR_NB_REFS (pdr) = 1; PDR_PBB (pdr) = pbb; pdr->accesses = acc; pdr->subscript_sizes = subscript_sizes; PDR_TYPE (pdr) = type; PBB_DRS (pbb).safe_push (pdr); if (dump_file) { fprintf (dump_file, "Converting dr: "); print_pdr (dump_file, pdr); fprintf (dump_file, "To polyhedral representation:\n"); fprintf (dump_file, " - access functions: "); print_isl_map (dump_file, acc); fprintf (dump_file, " - subscripts: "); print_isl_set (dump_file, subscript_sizes); } }
void pbb_remove_duplicate_pdrs (poly_bb_p pbb) { int i, j; poly_dr_p pdr1, pdr2; unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb)); VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n); for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr1); i++) for (j = 0; VEC_iterate (poly_dr_p, collapsed, j, pdr2); j++) if (!can_collapse_pdrs (pdr1, pdr2)) VEC_quick_push (poly_dr_p, collapsed, pdr1); VEC_free (poly_dr_p, heap, collapsed); PBB_PDR_DUPLICATES_REMOVED (pbb) = true; }
void new_poly_dr (poly_bb_p pbb, gimple *stmt, enum poly_dr_type type, isl_map *acc, isl_set *subscript_sizes) { static int id = 0; poly_dr_p pdr = XNEW (struct poly_dr); pdr->stmt = stmt; PDR_ID (pdr) = id++; PDR_NB_REFS (pdr) = 1; PDR_PBB (pdr) = pbb; pdr->accesses = acc; pdr->subscript_sizes = subscript_sizes; PDR_TYPE (pdr) = type; PBB_DRS (pbb).safe_push (pdr); }
void new_poly_dr (poly_bb_p pbb, int dr_base_object_set, ppl_Pointset_Powerset_C_Polyhedron_t accesses, enum poly_dr_type type, void *cdr, graphite_dim_t nb_subscripts) { static int id = 0; poly_dr_p pdr = XNEW (struct poly_dr); PDR_ID (pdr) = id++; PDR_BASE_OBJECT_SET (pdr) = dr_base_object_set; PDR_NB_REFS (pdr) = 1; PDR_PBB (pdr) = pbb; PDR_ACCESSES (pdr) = accesses; PDR_TYPE (pdr) = type; PDR_CDR (pdr) = cdr; PDR_NB_SUBSCRIPTS (pdr) = nb_subscripts; VEC_safe_push (poly_dr_p, heap, PBB_DRS (pbb), pdr); }
void new_poly_dr (poly_bb_p pbb, enum poly_dr_type type, data_reference_p cdr, graphite_dim_t nb_subscripts, isl_map *acc, isl_set *subscript_sizes) { static int id = 0; poly_dr_p pdr = XNEW (struct poly_dr); PDR_ID (pdr) = id++; PDR_NB_REFS (pdr) = 1; PDR_PBB (pdr) = pbb; pdr->accesses = acc; pdr->subscript_sizes = subscript_sizes; PDR_TYPE (pdr) = type; PDR_CDR (pdr) = cdr; PDR_NB_SUBSCRIPTS (pdr) = nb_subscripts; PBB_DRS (pbb).safe_push (pdr); }
static void memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, mpz_t strides) { int i, j; lst_p l; poly_dr_p pdr; mpz_t s, n; mpz_init (s); mpz_init (n); FOR_EACH_VEC_ELT (LST_SEQ (loop), j, l) if (LST_LOOP_P (l)) memory_strides_in_loop_1 (l, depth, strides); else FOR_EACH_VEC_ELT (PBB_DRS (LST_PBB (l)), i, pdr) { pdr_stride_in_loop (s, depth, pdr); mpz_set_si (n, PDR_NB_REFS (pdr)); mpz_mul (s, s, n); mpz_add (strides, strides, s); }