diff options
author | Tobias Grosser <tobias@grosser.es> | 2017-08-06 21:42:38 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2017-08-06 21:42:38 +0000 |
commit | 61bd3a4840f78ab8b3ecfa633d14e92f95acd0e5 (patch) | |
tree | 06613ba2f67433becc1dff1a5ca0ca04aba48f1c | |
parent | 31df6f31c0813fa7a93b1c195e2182a2527965a4 (diff) | |
download | bcm5719-llvm-61bd3a4840f78ab8b3ecfa633d14e92f95acd0e5.tar.gz bcm5719-llvm-61bd3a4840f78ab8b3ecfa633d14e92f95acd0e5.zip |
[ScopInfo] Move Scop::getPwAffOnly to isl++ [NFC]
llvm-svn: 310231
-rw-r--r-- | polly/include/polly/ScopInfo.h | 10 | ||||
-rw-r--r-- | polly/lib/Analysis/DependenceInfo.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 32 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslAst.cpp | 6 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslNodeBuilder.cpp | 2 | ||||
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Support/SCEVAffinator.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Transform/DeadCodeElimination.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Transform/FlattenSchedule.cpp | 4 | ||||
-rw-r--r-- | polly/lib/Transform/ScheduleOptimizer.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Transform/ZoneAlgo.cpp | 2 |
11 files changed, 33 insertions, 33 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index ef13384e555..7bdf6d363e0 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -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 /// diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index b1b97a9dd6b..1b09e4fafe0 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -420,7 +420,7 @@ void Dependences::calculateDependences(Scop &S) { dbgs() << "ReductionTagMap: " << ReductionTagMap << '\n'; dbgs() << "TaggedStmtDomain: " << TaggedStmtDomain << '\n';); - Schedule = S.getScheduleTree(); + Schedule = S.getScheduleTree().release(); if (!HasReductions) { isl_union_map_free(ReductionTagMap); diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index b5fda02e5c5..c3c676fc5a1 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -382,7 +382,7 @@ bool ScopArrayInfo::updateSizes(ArrayRef<const SCEV *> NewSizes, 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 *BB, TerminatorInst *TI, Loop *L, 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 *addDomainDimId(__isl_take isl_set *Domain, 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::getPredecessorDomainConstraints(BasicBlock *BB, isl::set Domain, 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_keep isl_schedule *Schedule) { 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) { diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index e515ac4ec3c..fd2581f37f0 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -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"; diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index a35d0337bf1..849caf4c736 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -1010,7 +1010,7 @@ bool IslNodeBuilder::materializeValue(isl_id *Id) { } 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); } diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 3da159e8a2b..637106af552 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -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( diff --git a/polly/lib/Support/SCEVAffinator.cpp b/polly/lib/Support/SCEVAffinator.cpp index 30939f9e104..c8811e68c8e 100644 --- a/polly/lib/Support/SCEVAffinator.cpp +++ b/polly/lib/Support/SCEVAffinator.cpp @@ -134,7 +134,7 @@ __isl_give PWACtx SCEVAffinator::getPwAff(const SCEV *Expr, BasicBlock *BB) { 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 diff --git a/polly/lib/Transform/DeadCodeElimination.cpp b/polly/lib/Transform/DeadCodeElimination.cpp index a23a60699da..8ca7e0ace56 100644 --- a/polly/lib/Transform/DeadCodeElimination.cpp +++ b/polly/lib/Transform/DeadCodeElimination.cpp @@ -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); diff --git a/polly/lib/Transform/FlattenSchedule.cpp b/polly/lib/Transform/FlattenSchedule.cpp index bae02263438..daea1d5ddbc 100644 --- a/polly/lib/Transform/FlattenSchedule.cpp +++ b/polly/lib/Transform/FlattenSchedule.cpp @@ -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"; } diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index fd3e92d84cf..26b22344163 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -1294,7 +1294,7 @@ bool ScheduleTreeOptimizer::isProfitableSchedule(Scop &S, 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); diff --git a/polly/lib/Transform/ZoneAlgo.cpp b/polly/lib/Transform/ZoneAlgo.cpp index 2dbe504819b..63ac92f023b 100644 --- a/polly/lib/Transform/ZoneAlgo.cpp +++ b/polly/lib/Transform/ZoneAlgo.cpp @@ -251,7 +251,7 @@ static std::string printInstruction(Instruction *Instr, 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 = |