[polly] r310215 - [ScopInfo] Move ScopStmt::getSchedule to isl++

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 10:45:28 PDT 2017


Author: grosser
Date: Sun Aug  6 10:45:28 2017
New Revision: 310215

URL: http://llvm.org/viewvc/llvm-project?rev=310215&view=rev
Log:
[ScopInfo] Move ScopStmt::getSchedule to isl++

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/DependenceInfo.cpp
    polly/trunk/lib/Analysis/PolyhedralInfo.cpp
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/Exchange/JSONExporter.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=310215&r1=310214&r2=310215&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug  6 10:45:28 2017
@@ -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.
   ///

Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=310215&r1=310214&r2=310215&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Sun Aug  6 10:45:28 2017
@@ -156,7 +156,7 @@ static void collectInfo(Scop &S, isl_uni
       } 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_uni
     }
 
     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 &
     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 &&

Modified: polly/trunk/lib/Analysis/PolyhedralInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/PolyhedralInfo.cpp?rev=310215&r1=310214&r2=310215&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/PolyhedralInfo.cpp (original)
+++ polly/trunk/lib/Analysis/PolyhedralInfo.cpp Sun Aug  6 10:45:28 2017
@@ -131,7 +131,7 @@ __isl_give isl_union_map *PolyhedralInfo
 
       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.");

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=310215&r1=310214&r2=310215&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug  6 10:45:28 2017
@@ -1221,12 +1221,12 @@ bool MemoryAccess::isLatestPartialAccess
 
 //===----------------------------------------------------------------------===//
 
-__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::getSchedul
   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);

Modified: polly/trunk/lib/Exchange/JSONExporter.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/JSONExporter.cpp?rev=310215&r1=310214&r2=310215&view=diff
==============================================================================
--- polly/trunk/lib/Exchange/JSONExporter.cpp (original)
+++ polly/trunk/lib/Exchange/JSONExporter.cpp Sun Aug  6 10:45:28 2017
@@ -396,7 +396,8 @@ bool JSONImporter::importSchedule(Scop &
     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);




More information about the llvm-commits mailing list