From 63dfaeb3d3d5030b1bef6b062885dc69e43d34c0 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 13 Sep 2017 14:29:26 +0200 Subject: [PATCH] isl_scheduler.c: extract_edge: extract out skip_edge This function will be reused in the next commit. Signed-off-by: Sven Verdoolaege --- isl_scheduler.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/isl_scheduler.c b/isl_scheduler.c index 42db1d74..e3dbb764 100644 --- a/isl_scheduler.c +++ b/isl_scheduler.c @@ -1177,6 +1177,18 @@ static struct isl_sched_node *find_range_node(isl_ctx *ctx, return node; } +/* Refrain from adding a new edge based on "map". + * Instead, just free the map. + * "tagged" is either a copy of "map" with additional tags or NULL. + */ +static isl_stat skip_edge(__isl_take isl_map *map, __isl_take isl_map *tagged) +{ + isl_map_free(map); + isl_map_free(tagged); + + return isl_stat_ok; +} + /* Add a new edge to the graph based on the given map * and add it to data->graph->edge_table[data->type]. * If a dependence relation of a given type happens to be identical @@ -1222,11 +1234,8 @@ static isl_stat extract_edge(__isl_take isl_map *map, void *user) src = find_domain_node(ctx, graph, map); dst = find_range_node(ctx, graph, map); - if (!src || !dst) { - isl_map_free(map); - isl_map_free(tagged); - return isl_stat_ok; - } + if (!src || !dst) + return skip_edge(map, tagged); if (src->compressed || dst->compressed) { isl_map *hull; -- 2.11.4.GIT