From 90b03fd6d1ba37c9d3b0f1d78663aa8d35877547 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 20 Nov 2012 15:39:39 +0100 Subject: [PATCH] isl_ast_build_eliminate_divs: remove unknown divs before divs involving depth Occasionally, eliminating unknown divs may turn other unknown divs into known divs, which may depend on the current depth. Signed-off-by: Sven Verdoolaege --- isl_ast_build.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/isl_ast_build.c b/isl_ast_build.c index 5209f1f2..a1941f8c 100644 --- a/isl_ast_build.c +++ b/isl_ast_build.c @@ -1982,6 +1982,11 @@ __isl_give isl_set *isl_ast_build_eliminate_inner( } /* Eliminate unknown divs and divs that depend on the current dimension. + * + * Note that during the elimination of unknown divs, we may discover + * an explicit representation of some other unknown divs, which may + * depend on the current dimension. We therefore need to eliminate + * unknown divs first. */ __isl_give isl_set *isl_ast_build_eliminate_divs( __isl_keep isl_ast_build *build, __isl_take isl_set *set) @@ -1991,9 +1996,9 @@ __isl_give isl_set *isl_ast_build_eliminate_divs( if (!build) return isl_set_free(set); + set = isl_set_remove_unknown_divs(set); depth = build->depth; set = isl_set_remove_divs_involving_dims(set, isl_dim_set, depth, 1); - set = isl_set_remove_unknown_divs(set); return set; } -- 2.11.4.GIT