From cf1f8936cc6d0fc3b1e0a784f6887972559e83c6 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 22 Aug 2013 10:39:01 +0200 Subject: [PATCH] ppcg.c: extract out flow dependence computation This computation will become slightly more complicated when we consider may accesses. Signed-off-by: Sven Verdoolaege --- ppcg.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ppcg.c b/ppcg.c index bf04bb5..a5b9d82 100644 --- a/ppcg.c +++ b/ppcg.c @@ -164,6 +164,19 @@ static __isl_give isl_union_set *collect_call_domains(struct pet_scop *scop) return collect_domains(scop, &has_call); } +/* Compute the flow dependences and the live in accesses. + */ +static void compute_flow_dep(struct ppcg_scop *ps) +{ + isl_union_map *empty; + + empty = isl_union_map_empty(isl_union_set_get_space(ps->domain)); + isl_union_map_compute_flow(isl_union_map_copy(ps->reads), + isl_union_map_copy(ps->writes), empty, + isl_union_map_copy(ps->schedule), + &ps->dep_flow, NULL, &ps->live_in, NULL); +} + /* Compute the dependences of the program represented by "scop". * Store the computed flow dependences * in scop->dep_flow and the reads with no corresponding writes in @@ -172,17 +185,12 @@ static __isl_give isl_union_set *collect_call_domains(struct pet_scop *scop) */ static void compute_dependences(struct ppcg_scop *scop) { - isl_union_map *empty; isl_union_map *dep1, *dep2; if (!scop) return; - empty = isl_union_map_empty(isl_union_set_get_space(scop->domain)); - isl_union_map_compute_flow(isl_union_map_copy(scop->reads), - isl_union_map_copy(scop->writes), empty, - isl_union_map_copy(scop->schedule), - &scop->dep_flow, NULL, &scop->live_in, NULL); + compute_flow_dep(scop); isl_union_map_compute_flow(isl_union_map_copy(scop->writes), isl_union_map_copy(scop->writes), -- 2.11.4.GIT