Index: polly/trunk/include/polly/ScopInfo.h =================================================================== --- polly/trunk/include/polly/ScopInfo.h +++ polly/trunk/include/polly/ScopInfo.h @@ -2935,7 +2935,7 @@ /// Intersects the domains of all statements in the SCoP. /// /// @return true if a change was made - bool restrictDomains(__isl_take isl_union_set *Domain); + bool restrictDomains(isl::union_set Domain); /// Get the depth of a loop relative to the outermost loop in the Scop. /// Index: polly/trunk/lib/Analysis/ScopInfo.cpp =================================================================== --- polly/trunk/lib/Analysis/ScopInfo.cpp +++ polly/trunk/lib/Analysis/ScopInfo.cpp @@ -4766,32 +4766,24 @@ Schedule = NewSchedule; } -bool Scop::restrictDomains(__isl_take isl_union_set *Domain) { +bool Scop::restrictDomains(isl::union_set Domain) { bool Changed = false; for (ScopStmt &Stmt : *this) { - isl_union_set *StmtDomain = - isl_union_set_from_set(Stmt.getDomain().release()); - isl_union_set *NewStmtDomain = isl_union_set_intersect( - isl_union_set_copy(StmtDomain), isl_union_set_copy(Domain)); - - if (isl_union_set_is_subset(StmtDomain, NewStmtDomain)) { - isl_union_set_free(StmtDomain); - isl_union_set_free(NewStmtDomain); + isl::union_set StmtDomain = isl::union_set(Stmt.getDomain()); + isl::union_set NewStmtDomain = StmtDomain.intersect(Domain); + + if (StmtDomain.is_subset(NewStmtDomain)) continue; - } Changed = true; - isl_union_set_free(StmtDomain); - NewStmtDomain = isl_union_set_coalesce(NewStmtDomain); + NewStmtDomain = NewStmtDomain.coalesce(); - if (isl_union_set_is_empty(NewStmtDomain)) { + if (NewStmtDomain.is_empty()) Stmt.restrictDomain(isl::set::empty(Stmt.getDomainSpace())); - isl_union_set_free(NewStmtDomain); - } else - Stmt.restrictDomain(isl::manage(isl_set_from_union_set(NewStmtDomain))); + else + Stmt.restrictDomain(isl::set(NewStmtDomain)); } - isl_union_set_free(Domain); return Changed; } Index: polly/trunk/lib/Transform/DeadCodeElimination.cpp =================================================================== --- polly/trunk/lib/Transform/DeadCodeElimination.cpp +++ polly/trunk/lib/Transform/DeadCodeElimination.cpp @@ -154,7 +154,7 @@ Live = Live.coalesce(); - bool Changed = S.restrictDomains(Live.copy()); + bool Changed = S.restrictDomains(Live); // FIXME: We can probably avoid the recomputation of all dependences by // updating them explicitly.