[polly] r310230 - [ScopInfo] Move Scop::getDomains to isl++ [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 14:42:25 PDT 2017


Author: grosser
Date: Sun Aug  6 14:42:25 2017
New Revision: 310230

URL: http://llvm.org/viewvc/llvm-project?rev=310230&view=rev
Log:
[ScopInfo] Move Scop::getDomains to isl++ [NFC]

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
    polly/trunk/lib/Transform/DeadCodeElimination.cpp
    polly/trunk/lib/Transform/FlattenSchedule.cpp
    polly/trunk/lib/Transform/ScheduleOptimizer.cpp
    polly/trunk/lib/Transform/ZoneAlgo.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug  6 14:42:25 2017
@@ -2885,7 +2885,7 @@ public:
   __isl_give isl_set *getDomainConditions(BasicBlock *BB) const;
 
   /// Get a union set containing the iteration domains of all statements.
-  __isl_give isl_union_set *getDomains() const;
+  isl::union_set getDomains() const;
 
   /// Get a union map of all may-writes performed in the SCoP.
   isl::union_map getMayWrites();

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug  6 14:42:25 2017
@@ -2200,7 +2200,7 @@ isl::id Scop::getIdForParam(const SCEV *
 }
 
 isl::set Scop::addNonEmptyDomainConstraints(isl::set C) const {
-  isl_set *DomainContext = isl_union_set_params(getDomains());
+  isl_set *DomainContext = isl_union_set_params(getDomains().release());
   return isl::manage(isl_set_intersect_params(C.release(), DomainContext));
 }
 
@@ -2435,7 +2435,7 @@ simplifyAssumptionContext(__isl_take isl
   // domains, thus we cannot use the remaining domain to simplify the
   // assumptions.
   if (!S.hasErrorBlock()) {
-    isl_set *DomainParameters = isl_union_set_params(S.getDomains());
+    isl_set *DomainParameters = isl_union_set_params(S.getDomains().release());
     AssumptionContext =
         isl_set_gist_params(AssumptionContext, DomainParameters);
   }
@@ -2558,7 +2558,7 @@ static bool calculateMinMaxAccess(Scop::
 
   MinMaxAccesses.reserve(AliasGroup.size());
 
-  isl::union_set Domains = give(S.getDomains());
+  isl::union_set Domains = S.getDomains();
   isl::union_map Accesses = isl::union_map::empty(S.getParamSpace());
 
   for (MemoryAccess *MA : AliasGroup)
@@ -4347,7 +4347,7 @@ bool Scop::hasFeasibleRuntimeContext() c
     return false;
   }
 
-  auto *DomainContext = isl_union_set_params(getDomains());
+  auto *DomainContext = isl_union_set_params(getDomains().release());
   IsFeasible = !isl_set_is_subset(DomainContext, NegativeContext);
   IsFeasible &= !isl_set_is_subset(Context, NegativeContext);
   isl_set_free(NegativeContext);
@@ -4666,14 +4666,14 @@ __isl_give PWACtx Scop::getPwAff(const S
   return Affinator.getPwAff(SE->getZero(E->getType()), BB);
 }
 
-__isl_give isl_union_set *Scop::getDomains() const {
+isl::union_set Scop::getDomains() const {
   isl_space *EmptySpace = isl_space_params_alloc(getIslCtx(), 0);
   isl_union_set *Domain = isl_union_set_empty(EmptySpace);
 
   for (const ScopStmt &Stmt : *this)
     Domain = isl_union_set_add_set(Domain, Stmt.getDomain().release());
 
-  return Domain;
+  return isl::manage(Domain);
 }
 
 __isl_give isl_pw_aff *Scop::getPwAffOnly(const SCEV *E, BasicBlock *BB) {
@@ -4749,11 +4749,11 @@ __isl_give isl_union_map *Scop::getSched
 
 __isl_give isl_schedule *Scop::getScheduleTree() const {
   return isl_schedule_intersect_domain(isl_schedule_copy(Schedule),
-                                       getDomains());
+                                       getDomains().release());
 }
 
 void Scop::setSchedule(__isl_take isl_union_map *NewSchedule) {
-  auto *S = isl_schedule_from_domain(getDomains());
+  auto *S = isl_schedule_from_domain(getDomains().release());
   S = isl_schedule_insert_partial_schedule(
       S, isl_multi_union_pw_aff_from_union_map(NewSchedule));
   isl_schedule_free(Schedule);

Modified: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp Sun Aug  6 14:42:25 2017
@@ -2629,7 +2629,7 @@ public:
     PPCGScop->end = 0;
 
     PPCGScop->context = S->getContext().release();
-    PPCGScop->domain = S->getDomains();
+    PPCGScop->domain = S->getDomains().release();
     // TODO: investigate this further. PPCG calls collect_call_domains.
     PPCGScop->call = isl_union_set_from_set(S->getContext().release());
     PPCGScop->tagged_reads = getTaggedReads();
@@ -2740,7 +2740,8 @@ public:
   __isl_give isl_set *getExtent(ScopArrayInfo *Array) {
     unsigned NumDims = Array->getNumberOfDimensions();
     isl_union_map *Accesses = S->getAccesses().release();
-    Accesses = isl_union_map_intersect_domain(Accesses, S->getDomains());
+    Accesses =
+        isl_union_map_intersect_domain(Accesses, S->getDomains().release());
     Accesses = isl_union_map_detect_equalities(Accesses);
     isl_union_set *AccessUSet = isl_union_map_range(Accesses);
     AccessUSet = isl_union_set_coalesce(AccessUSet);

Modified: polly/trunk/lib/Transform/DeadCodeElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/DeadCodeElimination.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/Transform/DeadCodeElimination.cpp (original)
+++ polly/trunk/lib/Transform/DeadCodeElimination.cpp Sun Aug  6 14:42:25 2017
@@ -132,7 +132,7 @@ bool DeadCodeElim::eliminateDeadCode(Sco
   if (PreciseSteps == -1)
     Live = Live.affine_hull();
 
-  isl::union_set OriginalDomain = isl::manage(S.getDomains());
+  isl::union_set OriginalDomain = S.getDomains();
   int Steps = 0;
   while (true) {
     Steps++;

Modified: polly/trunk/lib/Transform/FlattenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/FlattenSchedule.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/Transform/FlattenSchedule.cpp (original)
+++ polly/trunk/lib/Transform/FlattenSchedule.cpp Sun Aug  6 14:42:25 2017
@@ -63,7 +63,7 @@ public:
     OldSchedule = give(S.getSchedule());
     DEBUG(printSchedule(dbgs(), OldSchedule, 2));
 
-    auto Domains = give(S.getDomains());
+    auto Domains = S.getDomains();
     auto RestrictedOldSchedule = OldSchedule.intersect_domain(Domains);
     DEBUG(dbgs() << "Old schedule with domains:\n");
     DEBUG(printSchedule(dbgs(), RestrictedOldSchedule, 2));

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Sun Aug  6 14:42:25 2017
@@ -1370,7 +1370,7 @@ bool IslScheduleOptimizer::runOnScop(Sco
         Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW;
   }
 
-  isl::union_set Domain = give(S.getDomains());
+  isl::union_set Domain = S.getDomains();
 
   if (!Domain)
     return false;

Modified: polly/trunk/lib/Transform/ZoneAlgo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ZoneAlgo.cpp?rev=310230&r1=310229&r2=310230&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ZoneAlgo.cpp (original)
+++ polly/trunk/lib/Transform/ZoneAlgo.cpp Sun Aug  6 14:42:25 2017
@@ -252,7 +252,7 @@ static std::string printInstruction(Inst
 ZoneAlgorithm::ZoneAlgorithm(const char *PassName, Scop *S, LoopInfo *LI)
     : PassName(PassName), IslCtx(S->getSharedIslCtx()), S(S), LI(LI),
       Schedule(give(S->getSchedule())) {
-  auto Domains = give(S->getDomains());
+  auto Domains = S->getDomains();
 
   Schedule =
       give(isl_union_map_intersect_domain(Schedule.take(), Domains.take()));




More information about the llvm-commits mailing list