isl_pw_aff_on_shared_domain: perform gist on results wrt shared domains
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 12 Jan 2012 10:10:04 +0000 (11:10 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 12 Jan 2012 10:10:04 +0000 (11:10 +0100)
The shared domain may have extra constraints compared to the original
domains, which may help to simplify some of the integer divisions involved.
As a side effect, the gist operation may also simplify integer divisions
that could have been simplified even on a universe domain.
We should probably handle such cases much earlier during the construction
of isl_affs.

Reported-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_pw_templ.c

index 65bdf46..10bc4b8 100644 (file)
@@ -549,6 +549,7 @@ static __isl_give PW *FN(PW,on_shared_domain)(__isl_take PW *pw1,
 
                        res_ij = fn(FN(EL,copy)(pw1->p[i].FIELD),
                                    FN(EL,copy)(pw2->p[j].FIELD));
+                       res_ij = FN(EL,gist)(res_ij, isl_set_copy(common));
 
                        res = FN(PW,add_piece)(res, common, res_ij);
                }