From bef9d96f09c3e8d90ec202fa7d8963f14c0ba9d4 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 25 Sep 2013 14:01:25 +0200 Subject: [PATCH] ppcg_scop: replace union map schedule by schedule tree In a subsequent commit we will use the schedule tree directly during dependence analysis. We therefore first need to keep track of the schedule tree instead of immediately converting it to a union map. Signed-off-by: Sven Verdoolaege --- cpu.c | 2 +- ppcg.c | 19 ++++++++++--------- ppcg.h | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cpu.c b/cpu.c index a21c335..d251e5c 100644 --- a/cpu.c +++ b/cpu.c @@ -441,7 +441,7 @@ static __isl_give isl_printer *print_scop(struct ppcg_scop *scop, context = isl_set_copy(scop->context); domain_set = isl_union_set_copy(scop->domain); - schedule_map = isl_union_map_copy(scop->schedule); + schedule_map = isl_schedule_get_map(scop->schedule); schedule_map = isl_union_map_intersect_domain(schedule_map, domain_set); isl_union_map_foreach_map(schedule_map, &set_depth, &depth); diff --git a/ppcg.c b/ppcg.c index 8c5628b..4c475c6 100644 --- a/ppcg.c +++ b/ppcg.c @@ -354,7 +354,7 @@ static void compute_live_out(struct ppcg_scop *ps) isl_union_flow *flow; tagger = isl_union_map_copy(ps->tagger); - schedule = isl_union_map_copy(ps->schedule); + schedule = isl_schedule_get_map(ps->schedule); schedule = isl_union_map_apply_domain(schedule, tagger); kills = isl_union_map_union(isl_union_map_copy(ps->tagged_must_writes), isl_union_map_copy(ps->tagged_must_kills)); @@ -401,7 +401,7 @@ static void compute_tagged_flow_dep(struct ppcg_scop *ps) isl_union_map *tagged_flow; tagger = isl_union_map_copy(ps->tagger); - schedule = isl_union_map_copy(ps->schedule); + schedule = isl_schedule_get_map(ps->schedule); schedule = isl_union_map_apply_domain(schedule, tagger); kills = isl_union_map_copy(ps->tagged_must_kills); must_source = isl_union_map_copy(ps->tagged_must_writes); @@ -539,10 +539,11 @@ static void compute_external_false_dependences(struct ppcg_scop *ps, static void compute_live_range_reordering_dependences(struct ppcg_scop *ps) { isl_union_map *before; + isl_union_map *schedule; - before = isl_union_map_lex_lt_union_map( - isl_union_map_copy(ps->schedule), - isl_union_map_copy(ps->schedule)); + schedule = isl_schedule_get_map(ps->schedule); + before = isl_union_map_lex_lt_union_map(schedule, + isl_union_map_copy(schedule)); compute_tagged_flow_dep(ps); compute_order_dependences(ps, isl_union_map_copy(before)); @@ -563,7 +564,7 @@ static void compute_flow_dep(struct ppcg_scop *ps) access = isl_union_access_info_set_may_source(access, isl_union_map_copy(ps->may_writes)); access = isl_union_access_info_set_schedule_map(access, - isl_union_map_copy(ps->schedule)); + isl_schedule_get_map(ps->schedule)); flow = isl_union_access_info_compute_flow(access); ps->dep_flow = isl_union_flow_get_may_dependence(flow); @@ -608,7 +609,7 @@ static void compute_dependences(struct ppcg_scop *scop) isl_union_map_copy(scop->must_writes)); access = isl_union_access_info_set_may_source(access, may_source); access = isl_union_access_info_set_schedule_map(access, - isl_union_map_copy(scop->schedule)); + isl_schedule_get_map(scop->schedule)); flow = isl_union_access_info_compute_flow(access); scop->dep_false = isl_union_flow_get_may_dependence(flow); @@ -721,7 +722,7 @@ static void *ppcg_scop_free(struct ppcg_scop *ps) isl_union_map_free(ps->dep_external); isl_union_map_free(ps->tagged_dep_order); isl_union_map_free(ps->dep_order); - isl_union_map_free(ps->schedule); + isl_schedule_free(ps->schedule); isl_union_map_free(ps->tagger); isl_union_map_free(ps->independence); isl_id_to_ast_expr_free(ps->names); @@ -767,7 +768,7 @@ static struct ppcg_scop *ppcg_scop_from_pet_scop(struct pet_scop *scop, ps->tagged_must_writes = pet_scop_collect_tagged_must_writes(scop); ps->must_writes = pet_scop_collect_must_writes(scop); ps->tagged_must_kills = pet_scop_collect_tagged_must_kills(scop); - ps->schedule = isl_schedule_get_map(scop->schedule); + ps->schedule = isl_schedule_copy(scop->schedule); ps->pet = scop; ps->independence = isl_union_map_empty(isl_set_get_space(ps->context)); for (i = 0; i < scop->n_independence; ++i) diff --git a/ppcg.h b/ppcg.h index bb545ec..13c022e 100644 --- a/ppcg.h +++ b/ppcg.h @@ -1,6 +1,7 @@ #ifndef PPCG_H #define PPCG_H +#include #include #include #include @@ -93,7 +94,7 @@ struct ppcg_scop { isl_union_map *dep_external; isl_union_map *dep_order; isl_union_map *tagged_dep_order; - isl_union_map *schedule; + isl_schedule *schedule; isl_id_to_ast_expr *names; -- 2.11.4.GIT