[polly] r310231 - [ScopInfo] Move Scop::getPwAffOnly to isl++ [NFC]

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


Author: grosser
Date: Sun Aug  6 14:42:38 2017
New Revision: 310231

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

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Analysis/DependenceInfo.cpp
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/CodeGen/IslAst.cpp
    polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
    polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
    polly/trunk/lib/Support/SCEVAffinator.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=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug  6 14:42:38 2017
@@ -2872,17 +2872,17 @@ public:
   ///
   /// This function is like @see Scop::getPwAff() but strips away the invalid
   /// domain part associated with the piecewise affine function.
-  __isl_give isl_pw_aff *getPwAffOnly(const SCEV *E, BasicBlock *BB = nullptr);
+  isl::pw_aff getPwAffOnly(const SCEV *E, BasicBlock *BB = nullptr);
 
   /// Return the domain of @p Stmt.
   ///
   /// @param Stmt The statement for which the conditions should be returned.
-  __isl_give isl_set *getDomainConditions(const ScopStmt *Stmt) const;
+  isl::set getDomainConditions(const ScopStmt *Stmt) const;
 
   /// Return the domain of @p BB.
   ///
   /// @param BB The block for which the conditions should be returned.
-  __isl_give isl_set *getDomainConditions(BasicBlock *BB) const;
+  isl::set getDomainConditions(BasicBlock *BB) const;
 
   /// Get a union set containing the iteration domains of all statements.
   isl::union_set getDomains() const;
@@ -2906,10 +2906,10 @@ public:
   ///
   /// @return The schedule of all the statements in the SCoP, if the schedule of
   /// the Scop does not contain extension nodes, and nullptr, otherwise.
-  __isl_give isl_union_map *getSchedule() const;
+  isl::union_map getSchedule() const;
 
   /// Get a schedule tree describing the schedule of all statements.
-  __isl_give isl_schedule *getScheduleTree() const;
+  isl::schedule getScheduleTree() const;
 
   /// Update the current schedule
   ///

Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Sun Aug  6 14:42:38 2017
@@ -420,7 +420,7 @@ void Dependences::calculateDependences(S
         dbgs() << "ReductionTagMap: " << ReductionTagMap << '\n';
         dbgs() << "TaggedStmtDomain: " << TaggedStmtDomain << '\n';);
 
-  Schedule = S.getScheduleTree();
+  Schedule = S.getScheduleTree().release();
 
   if (!HasReductions) {
     isl_union_map_free(ReductionTagMap);

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug  6 14:42:38 2017
@@ -382,7 +382,7 @@ bool ScopArrayInfo::updateSizes(ArrayRef
       DimensionSizesPw.push_back(nullptr);
       continue;
     }
-    isl::pw_aff Size = isl::manage(S.getPwAffOnly(Expr));
+    isl::pw_aff Size = S.getPwAffOnly(Expr);
     DimensionSizesPw.push_back(Size);
   }
   return true;
@@ -1228,7 +1228,7 @@ isl::map ScopStmt::getSchedule() const {
     return isl::manage(isl_map_from_aff(isl_aff_zero_on_domain(
         isl_local_space_from_space(getDomainSpace().release()))));
   }
-  auto *Schedule = getParent()->getSchedule();
+  auto *Schedule = getParent()->getSchedule().release();
   if (!Schedule) {
     isl_set_free(Domain);
     return nullptr;
@@ -1688,7 +1688,7 @@ buildConditionSets(Scop &S, BasicBlock *
 void ScopStmt::buildDomain() {
   isl::id Id = isl::id::alloc(getIslCtx(), getBaseName(), this);
 
-  Domain = isl::manage(getParent()->getDomainConditions(this));
+  Domain = getParent()->getDomainConditions(this);
   Domain = Domain.set_tuple_id(Id);
 }
 
@@ -2681,14 +2681,14 @@ static inline __isl_give isl_set *addDom
   return isl_set_set_dim_id(Domain, isl_dim_set, Dim, DimId);
 }
 
-__isl_give isl_set *Scop::getDomainConditions(const ScopStmt *Stmt) const {
+isl::set Scop::getDomainConditions(const ScopStmt *Stmt) const {
   return getDomainConditions(Stmt->getEntryBlock());
 }
 
-__isl_give isl_set *Scop::getDomainConditions(BasicBlock *BB) const {
+isl::set Scop::getDomainConditions(BasicBlock *BB) const {
   auto DIt = DomainMap.find(BB);
   if (DIt != DomainMap.end())
-    return DIt->getSecond().copy();
+    return DIt->getSecond();
 
   auto &RI = *R.getRegionInfo();
   auto *BBR = RI.getRegionFor(BB);
@@ -3096,7 +3096,7 @@ isl::set Scop::getPredecessorDomainConst
       PropagatedRegions.insert(PredR);
     }
 
-    auto *PredBBDom = getDomainConditions(PredBB);
+    auto *PredBBDom = getDomainConditions(PredBB).release();
     Loop *PredBBLoop = getFirstNonBoxedLoopFor(PredBB, LI, getBoxedLoops());
 
     PredBBDom = adjustDomainDimensions(*this, PredBBDom, PredBBLoop, BBLoop);
@@ -4499,7 +4499,7 @@ void Scop::addRecordedAssumptions() {
     }
 
     // If the domain was deleted the assumptions are void.
-    isl_set *Dom = getDomainConditions(AS.BB);
+    isl_set *Dom = getDomainConditions(AS.BB).release();
     if (!Dom) {
       isl_set_free(AS.Set);
       continue;
@@ -4676,10 +4676,10 @@ isl::union_set Scop::getDomains() const
   return isl::manage(Domain);
 }
 
-__isl_give isl_pw_aff *Scop::getPwAffOnly(const SCEV *E, BasicBlock *BB) {
+isl::pw_aff Scop::getPwAffOnly(const SCEV *E, BasicBlock *BB) {
   PWACtx PWAC = getPwAff(E, BB);
   isl_set_free(PWAC.second);
-  return PWAC.first;
+  return isl::manage(PWAC.first);
 }
 
 isl::union_map
@@ -4736,20 +4736,20 @@ bool Scop::containsExtensionNode(__isl_k
                                                      nullptr) == isl_stat_error;
 }
 
-__isl_give isl_union_map *Scop::getSchedule() const {
-  auto *Tree = getScheduleTree();
+isl::union_map Scop::getSchedule() const {
+  auto *Tree = getScheduleTree().release();
   if (containsExtensionNode(Tree)) {
     isl_schedule_free(Tree);
     return nullptr;
   }
   auto *S = isl_schedule_get_map(Tree);
   isl_schedule_free(Tree);
-  return S;
+  return isl::manage(S);
 }
 
-__isl_give isl_schedule *Scop::getScheduleTree() const {
-  return isl_schedule_intersect_domain(isl_schedule_copy(Schedule),
-                                       getDomains().release());
+isl::schedule Scop::getScheduleTree() const {
+  return isl::manage(isl_schedule_intersect_domain(isl_schedule_copy(Schedule),
+                                                   getDomains().release()));
 }
 
 void Scop::setSchedule(__isl_take isl_union_map *NewSchedule) {

Modified: polly/trunk/lib/CodeGen/IslAst.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslAst.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslAst.cpp (original)
+++ polly/trunk/lib/CodeGen/IslAst.cpp Sun Aug  6 14:42:38 2017
@@ -412,7 +412,7 @@ void IslAst::init(const Dependences &D)
   // We can not perform the dependence analysis and, consequently,
   // the parallel code generation in case the schedule tree contains
   // extension nodes.
-  auto *ScheduleTree = S.getScheduleTree();
+  auto *ScheduleTree = S.getScheduleTree().release();
   PerformParallelTest =
       PerformParallelTest && !S.containsExtensionNode(ScheduleTree);
   isl_schedule_free(ScheduleTree);
@@ -453,7 +453,7 @@ void IslAst::init(const Dependences &D)
 
   RunCondition = buildRunCondition(S, Build);
 
-  Root = isl_ast_build_node_from_schedule(Build, S.getScheduleTree());
+  Root = isl_ast_build_node_from_schedule(Build, S.getScheduleTree().release());
 
   isl_ast_build_free(Build);
 }
@@ -654,7 +654,7 @@ void IslAstInfo::print(raw_ostream &OS)
   P = isl_ast_node_print(RootNode, P, Options);
   AstStr = isl_printer_get_str(P);
 
-  auto *Schedule = S.getScheduleTree();
+  auto *Schedule = S.getScheduleTree().release();
 
   DEBUG({
     dbgs() << S.getContextStr() << "\n";

Modified: polly/trunk/lib/CodeGen/IslNodeBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslNodeBuilder.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslNodeBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IslNodeBuilder.cpp Sun Aug  6 14:42:38 2017
@@ -1010,7 +1010,7 @@ bool IslNodeBuilder::materializeValue(is
           } else if (S.getStmtFor(Inst)) {
             IsDead = false;
           } else {
-            auto *Domain = S.getDomainConditions(Inst->getParent());
+            auto *Domain = S.getDomainConditions(Inst->getParent()).release();
             IsDead = isl_set_is_empty(Domain);
             isl_set_free(Domain);
           }

Modified: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp Sun Aug  6 14:42:38 2017
@@ -2653,7 +2653,7 @@ public:
     PPCGScop->dep_order = nullptr;
     PPCGScop->tagged_dep_order = nullptr;
 
-    PPCGScop->schedule = S->getScheduleTree();
+    PPCGScop->schedule = S->getScheduleTree().release();
     // If we have something non-trivial to kill, add it to the schedule
     if (KillsInfo.KillsSchedule.get())
       PPCGScop->schedule = isl_schedule_sequence(

Modified: polly/trunk/lib/Support/SCEVAffinator.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/SCEVAffinator.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Support/SCEVAffinator.cpp (original)
+++ polly/trunk/lib/Support/SCEVAffinator.cpp Sun Aug  6 14:42:38 2017
@@ -134,7 +134,7 @@ __isl_give PWACtx SCEVAffinator::getPwAf
   this->BB = BB;
 
   if (BB) {
-    auto *DC = S->getDomainConditions(BB);
+    auto *DC = S->getDomainConditions(BB).release();
     NumIterators = isl_set_n_dim(DC);
     isl_set_free(DC);
   } else

Modified: polly/trunk/lib/Transform/DeadCodeElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/DeadCodeElimination.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Transform/DeadCodeElimination.cpp (original)
+++ polly/trunk/lib/Transform/DeadCodeElimination.cpp Sun Aug  6 14:42:38 2017
@@ -94,7 +94,7 @@ char DeadCodeElim::ID = 0;
 // this means may-writes are in the current situation always live, there is
 // no point in trying to remove them from the live-out set.
 isl::union_set DeadCodeElim::getLiveOut(Scop &S) {
-  isl::union_map Schedule = isl::manage(S.getSchedule());
+  isl::union_map Schedule = S.getSchedule();
   isl::union_map MustWrites = S.getMustWrites();
   isl::union_map WriteIterations = MustWrites.reverse();
   isl::union_map WriteTimes = WriteIterations.apply_range(Schedule);

Modified: polly/trunk/lib/Transform/FlattenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/FlattenSchedule.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Transform/FlattenSchedule.cpp (original)
+++ polly/trunk/lib/Transform/FlattenSchedule.cpp Sun Aug  6 14:42:38 2017
@@ -60,7 +60,7 @@ public:
     IslCtx = S.getSharedIslCtx();
 
     DEBUG(dbgs() << "Going to flatten old schedule:\n");
-    OldSchedule = give(S.getSchedule());
+    OldSchedule = S.getSchedule();
     DEBUG(printSchedule(dbgs(), OldSchedule, 2));
 
     auto Domains = S.getDomains();
@@ -87,7 +87,7 @@ public:
     OS << "}\n\n";
 
     OS << "Schedule after flattening {\n";
-    printSchedule(OS, give(S.getSchedule()), 4);
+    printSchedule(OS, S.getSchedule(), 4);
     OS << "}\n";
   }
 

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Sun Aug  6 14:42:38 2017
@@ -1294,7 +1294,7 @@ bool ScheduleTreeOptimizer::isProfitable
   if (S.containsExtensionNode(NewSchedule.get()))
     return true;
   auto NewScheduleMap = NewSchedule.get_map();
-  auto OldSchedule = isl::manage(S.getSchedule());
+  auto OldSchedule = S.getSchedule();
   assert(OldSchedule && "Only IslScheduleOptimizer can insert extension nodes "
                         "that make Scop::getSchedule() return nullptr.");
   bool changed = !OldSchedule.is_equal(NewScheduleMap);

Modified: polly/trunk/lib/Transform/ZoneAlgo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ZoneAlgo.cpp?rev=310231&r1=310230&r2=310231&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ZoneAlgo.cpp (original)
+++ polly/trunk/lib/Transform/ZoneAlgo.cpp Sun Aug  6 14:42:38 2017
@@ -251,7 +251,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())) {
+      Schedule(S->getSchedule()) {
   auto Domains = S->getDomains();
 
   Schedule =




More information about the llvm-commits mailing list