Skip to content

Commit

Permalink
Move ScopStmt::getSchedule to islpp. NFC.
Browse files Browse the repository at this point in the history
Reviewers: grosser, Meinersbur, bollu

Differential Revision: https://reviews.llvm.org/D36660

llvm-svn: 310815
  • Loading branch information
tobiasgrosser committed Aug 14, 2017
1 parent 990cbb4 commit 1e09c13
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions polly/lib/Analysis/ScopInfo.cpp
Expand Up @@ -1222,30 +1222,20 @@ bool MemoryAccess::isLatestPartialAccess() const {
//===----------------------------------------------------------------------===//

isl::map ScopStmt::getSchedule() const {
isl_set *Domain = getDomain().release();
if (isl_set_is_empty(Domain)) {
isl_set_free(Domain);
return isl::manage(isl_map_from_aff(isl_aff_zero_on_domain(
isl_local_space_from_space(getDomainSpace().release()))));
}
auto *Schedule = getParent()->getSchedule().release();
if (!Schedule) {
isl_set_free(Domain);
isl::set Domain = getDomain();
if (Domain.is_empty())
return isl::map::from_aff(isl::aff(isl::local_space(getDomainSpace())));
auto Schedule = getParent()->getSchedule();
if (!Schedule)
return nullptr;
}
Schedule = isl_union_map_intersect_domain(
Schedule, isl_union_set_from_set(isl_set_copy(Domain)));
if (isl_union_map_is_empty(Schedule)) {
isl_set_free(Domain);
isl_union_map_free(Schedule);
return isl::manage(isl_map_from_aff(isl_aff_zero_on_domain(
isl_local_space_from_space(getDomainSpace().release()))));
}
auto *M = isl_map_from_union_map(Schedule);
M = isl_map_coalesce(M);
M = isl_map_gist_domain(M, Domain);
M = isl_map_coalesce(M);
return isl::manage(M);
Schedule = Schedule.intersect_domain(isl::union_set(Domain));
if (Schedule.is_empty())
return isl::map::from_aff(isl::aff(isl::local_space(getDomainSpace())));
isl::map M = M.from_union_map(Schedule);
M = M.coalesce();
M = M.gist_domain(Domain);
M = M.coalesce();
return M;
}

void ScopStmt::restrictDomain(isl::set NewDomain) {
Expand Down

0 comments on commit 1e09c13

Please sign in to comment.