isl_ast_graft.c: store_guard: coalesce guard after taking gist
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 4 Apr 2013 13:22:10 +0000 (15:22 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 9 Apr 2013 10:44:03 +0000 (12:44 +0200)
On rare occasions, coalescing may simplify the gisted guard.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_graft.c

index c0fe818..4ac773d 100644 (file)
@@ -686,7 +686,8 @@ static __isl_give isl_basic_set *extract_shared_enforced(
 /* Record "guard" in "graft" so that it will be enforced somewhere
  * up the tree.  If the graft already has a guard, then it may be partially
  * redundant in combination with the new guard and in the context
- * of build->domain.  We therefore (re)compute the gist of the intersection.
+ * of build->domain.  We therefore (re)compute the gist of the intersection
+ * and coalesce the result.
  */
 static __isl_give isl_ast_graft *store_guard(__isl_take isl_ast_graft *graft,
        __isl_take isl_set *guard, __isl_keep isl_ast_build *build)
@@ -706,6 +707,7 @@ static __isl_give isl_ast_graft *store_guard(__isl_take isl_ast_graft *graft,
 
        graft->guard = isl_set_intersect(graft->guard, guard);
        graft->guard = isl_ast_build_compute_gist(build, graft->guard);
+       graft->guard = isl_set_coalesce(graft->guard);
        if (!graft->guard)
                return isl_ast_graft_free(graft);