From: Sven Verdoolaege Date: Tue, 7 Feb 2012 11:19:20 +0000 (+0100) Subject: isl_pw_*_union_add: don't subtract non-overlapping cells X-Git-Tag: isl-0.10~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be75156f10fd796a985b117892787af180347470;p=platform%2Fupstream%2Fisl.git isl_pw_*_union_add: don't subtract non-overlapping cells There is no point in subtracting a cell from another if their intersection is empty. It can only lead to a further subdivision of the other cell. Signed-off-by: Sven Verdoolaege --- diff --git a/isl_pw_templ.c b/isl_pw_templ.c index 10bc4b8..448b082 100644 --- a/isl_pw_templ.c +++ b/isl_pw_templ.c @@ -371,14 +371,14 @@ static __isl_give PW *FN(PW,union_add_aligned)(__isl_take PW *pw1, for (j = 0; j < pw2->n; ++j) { struct isl_set *common; EL *sum; - set = isl_set_subtract(set, - isl_set_copy(pw2->p[j].set)); common = isl_set_intersect(isl_set_copy(pw1->p[i].set), isl_set_copy(pw2->p[j].set)); if (isl_set_plain_is_empty(common)) { isl_set_free(common); continue; } + set = isl_set_subtract(set, + isl_set_copy(pw2->p[j].set)); sum = FN(EL,add_on_domain)(common, FN(EL,copy)(pw1->p[i].FIELD),