From e5bb7b901035f4b2e8e15a80bea8c5c8ef38c779 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 24 Apr 2014 14:28:01 +0200 Subject: [PATCH] tree2scop.c: move up apply_affine_continue This allows us to reuse apply_affine_continue from scop_add_inc. Signed-off-by: Sven Verdoolaege --- tree2scop.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tree2scop.c b/tree2scop.c index 344c925..e1965fc 100644 --- a/tree2scop.c +++ b/tree2scop.c @@ -593,6 +593,24 @@ static struct pet_scop *scop_from_non_affine_condition( return scop_from_evaluated_expr(expr, stmt_nr, loc, pc); } +/* Given that "scop" has an affine skip condition of type pet_skip_now, + * apply this skip condition to the domain of "pc". + * That is, remove the elements satisfying the skip condition from + * the domain of "pc". + */ +static __isl_give pet_context *apply_affine_continue(__isl_take pet_context *pc, + struct pet_scop *scop) +{ + isl_set *domain, *skip; + + skip = pet_scop_get_affine_skip_domain(scop, pet_skip_now); + domain = pet_context_get_domain(pc); + domain = isl_set_subtract(domain, skip); + pc = pet_context_intersect_domain(pc, domain); + + return pc; +} + /* Add a scop for evaluating the loop increment "inc" add the end * of a loop body "scop" within the context "pc". * @@ -2107,24 +2125,6 @@ static struct pet_scop *mark_exposed(struct pet_scop *scop) return scop; } -/* Given that "scop" has an affine skip condition of type pet_skip_now, - * apply this skip condition to the domain of "pc". - * That is, remove the elements satisfying the skip condition from - * the domain of "pc". - */ -static __isl_give pet_context *apply_affine_continue(__isl_take pet_context *pc, - struct pet_scop *scop) -{ - isl_set *domain, *skip; - - skip = pet_scop_get_affine_skip_domain(scop, pet_skip_now); - domain = pet_context_get_domain(pc); - domain = isl_set_subtract(domain, skip); - pc = pet_context_intersect_domain(pc, domain); - - return pc; -} - /* Try and construct a pet_scop corresponding to (part of) * a sequence of statements within the context "pc". * -- 2.11.4.GIT