[ScopInfo] Move ScopStmt::getSchedule to isl++

llvm-svn: 310215
This commit is contained in:
Tobias Grosser 2017-08-06 17:45:28 +00:00
parent 2f3041fc6a
commit 6ad1640a1d
5 changed files with 15 additions and 13 deletions

View File

@ -1334,7 +1334,7 @@ public:
///
/// @return The schedule function of this ScopStmt, if it does not contain
/// extension nodes, and nullptr, otherwise.
__isl_give isl_map *getSchedule() const;
isl::map getSchedule() const;
/// Get an isl string representing this schedule.
///

View File

@ -156,7 +156,7 @@ static void collectInfo(Scop &S, isl_union_map *&Read,
} else {
accdom = tag(accdom, MA, Level);
if (Level > Dependences::AL_Statement) {
auto *StmtScheduleMap = Stmt.getSchedule();
isl_map *StmtScheduleMap = Stmt.getSchedule().release();
assert(StmtScheduleMap &&
"Schedules that contain extension nodes require special "
"handling.");
@ -174,7 +174,8 @@ static void collectInfo(Scop &S, isl_union_map *&Read,
}
if (!ReductionArrays.empty() && Level == Dependences::AL_Statement)
StmtSchedule = isl_union_map_add_map(StmtSchedule, Stmt.getSchedule());
StmtSchedule =
isl_union_map_add_map(StmtSchedule, Stmt.getSchedule().release());
}
StmtSchedule =
@ -743,7 +744,7 @@ bool Dependences::isValidSchedule(Scop &S,
isl_map *StmtScat;
if (NewSchedule->find(&Stmt) == NewSchedule->end())
StmtScat = Stmt.getSchedule();
StmtScat = Stmt.getSchedule().release();
else
StmtScat = isl_map_copy((*NewSchedule)[&Stmt]);
assert(StmtScat &&

View File

@ -131,7 +131,7 @@ __isl_give isl_union_map *PolyhedralInfo::getScheduleForLoop(const Scop *S,
unsigned int MaxDim = SS.getNumIterators();
DEBUG(dbgs() << "Maximum depth of Stmt:\t" << MaxDim << "\n");
auto *ScheduleMap = SS.getSchedule();
isl_map *ScheduleMap = SS.getSchedule().release();
assert(
ScheduleMap &&
"Schedules that contain extension nodes require special handling.");

View File

@ -1221,12 +1221,12 @@ bool MemoryAccess::isLatestPartialAccess() const {
//===----------------------------------------------------------------------===//
__isl_give isl_map *ScopStmt::getSchedule() const {
isl::map ScopStmt::getSchedule() const {
isl_set *Domain = getDomain().release();
if (isl_set_is_empty(Domain)) {
isl_set_free(Domain);
return isl_map_from_aff(isl_aff_zero_on_domain(
isl_local_space_from_space(getDomainSpace().release())));
return isl::manage(isl_map_from_aff(isl_aff_zero_on_domain(
isl_local_space_from_space(getDomainSpace().release()))));
}
auto *Schedule = getParent()->getSchedule();
if (!Schedule) {
@ -1238,14 +1238,14 @@ __isl_give isl_map *ScopStmt::getSchedule() const {
if (isl_union_map_is_empty(Schedule)) {
isl_set_free(Domain);
isl_union_map_free(Schedule);
return isl_map_from_aff(isl_aff_zero_on_domain(
isl_local_space_from_space(getDomainSpace().release())));
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 M;
return isl::manage(M);
}
void ScopStmt::restrictDomain(isl::set NewDomain) {
@ -1881,7 +1881,7 @@ void ScopStmt::checkForReductions() {
std::string ScopStmt::getDomainStr() const { return Domain.to_str(); }
std::string ScopStmt::getScheduleStr() const {
auto *S = getSchedule();
auto *S = getSchedule().release();
if (!S)
return "";
auto Str = stringFromIslObj(S);

View File

@ -396,7 +396,8 @@ bool JSONImporter::importSchedule(Scop &S, Json::Value &JScop,
if (NewSchedule.find(&Stmt) != NewSchedule.end())
ScheduleMap = isl_union_map_add_map(ScheduleMap, NewSchedule[&Stmt]);
else
ScheduleMap = isl_union_map_add_map(ScheduleMap, Stmt.getSchedule());
ScheduleMap =
isl_union_map_add_map(ScheduleMap, Stmt.getSchedule().release());
}
S.setSchedule(ScheduleMap);