From 3c596a3b85dd32d0c3b335b4494aadacc346b1de Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 28 Mar 2015 10:27:08 +0100 Subject: [PATCH] ppcg_scop: rename dep_external to dep_forced The next commit will introduce additional schedule constraints that need to be unconditionally enforced even when live-range reordering is used and the name "external" does not suit these additional constraints. Signed-off-by: Sven Verdoolaege --- gpu.c | 2 +- ppcg.c | 18 ++++++++++-------- ppcg.h | 6 ++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gpu.c b/gpu.c index 322895d..cf3887b 100644 --- a/gpu.c +++ b/gpu.c @@ -4243,7 +4243,7 @@ static void compute_schedule(struct gpu_gen *gen) proximity = isl_union_map_copy(gen->prog->scop->dep_flow); validity = isl_union_map_copy(proximity); validity = isl_union_map_union(validity, - isl_union_map_copy(gen->prog->scop->dep_external)); + isl_union_map_copy(gen->prog->scop->dep_forced)); proximity = isl_union_map_union(proximity, isl_union_map_copy(gen->prog->scop->dep_false)); coincidence = isl_union_map_copy(validity); diff --git a/ppcg.c b/ppcg.c index 31a182d..8d91d57 100644 --- a/ppcg.c +++ b/ppcg.c @@ -486,11 +486,13 @@ static void compute_order_dependences(struct ppcg_scop *ps, ps->tagged_dep_order = shared_access; } -/* Compute the external false dependences of the program represented by "scop" - * in case live range reordering is allowed. +/* Compute those validity dependences of the program represented by "scop" + * that should be unconditionally enforced even when live-range reordering + * is used. * "before" contains all pairs of statement iterations where * the first is executed before the second according to the original schedule. * + * In particular, compute the external false dependences. * The anti-dependences are already taken care of by the order dependences. * The external false dependences are only used to ensure that live-in and * live-out data is not overwritten by any writes inside the scop. @@ -509,7 +511,7 @@ static void compute_order_dependences(struct ppcg_scop *ps, * an overapproximation. There may therefore be potential writes * before a live-in access and after a live-out access. */ -static void compute_external_false_dependences(struct ppcg_scop *ps, +static void compute_forced_dependences(struct ppcg_scop *ps, __isl_take isl_union_map *before) { isl_union_map *shared_access; @@ -522,13 +524,13 @@ static void compute_external_false_dependences(struct ppcg_scop *ps, shared_access = isl_union_map_copy(ps->may_writes); shared_access = isl_union_map_apply_range(shared_access, exposed); - ps->dep_external = shared_access; + ps->dep_forced = shared_access; live_in = isl_union_map_apply_range(isl_union_map_copy(ps->live_in), isl_union_map_reverse(isl_union_map_copy(ps->may_writes))); - ps->dep_external = isl_union_map_union(ps->dep_external, live_in); - ps->dep_external = isl_union_map_intersect(ps->dep_external, before); + ps->dep_forced = isl_union_map_union(ps->dep_forced, live_in); + ps->dep_forced = isl_union_map_intersect(ps->dep_forced, before); } /* Compute the dependences of the program represented by "scop" @@ -548,7 +550,7 @@ static void compute_live_range_reordering_dependences(struct ppcg_scop *ps) compute_tagged_flow_dep(ps); compute_order_dependences(ps, isl_union_map_copy(before)); - compute_external_false_dependences(ps, before); + compute_forced_dependences(ps, before); } /* Compute the potential flow dependences and the potential live in @@ -723,7 +725,7 @@ static void *ppcg_scop_free(struct ppcg_scop *ps) isl_union_map_free(ps->tagged_dep_flow); isl_union_map_free(ps->dep_flow); isl_union_map_free(ps->dep_false); - isl_union_map_free(ps->dep_external); + isl_union_map_free(ps->dep_forced); isl_union_map_free(ps->tagged_dep_order); isl_union_map_free(ps->dep_order); isl_schedule_free(ps->schedule); diff --git a/ppcg.h b/ppcg.h index 6ed9c66..ebf24c1 100644 --- a/ppcg.h +++ b/ppcg.h @@ -50,7 +50,9 @@ int ppcg_extract_base_name(char *name, const char *input); * range are wrapped relations mapping an iteration domain to * a reference identifier. May be NULL if not computed. * "dep_false" represents the potential false (anti and output) dependences. - * "dep_external" represents the constraints that ensure that all live-in + * "dep_forced" represents the validity constraints that should be enforced + * even when live-range reordering is used. + * In particular, these constraints ensure that all live-in * accesses remain live-in and that all live-out accesses remain live-out. * "dep_order"/"tagged_dep_order" represents the order dependences between * the live range intervals in "dep_flow"/"tagged_dep_flow". @@ -91,7 +93,7 @@ struct ppcg_scop { isl_union_map *dep_flow; isl_union_map *tagged_dep_flow; isl_union_map *dep_false; - isl_union_map *dep_external; + isl_union_map *dep_forced; isl_union_map *dep_order; isl_union_map *tagged_dep_order; isl_schedule *schedule; -- 2.11.4.GIT