From 3c6a99b8186dd827828a0c8ef378c763b3876408 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 9 Apr 2016 21:55:23 +0000 Subject: [PATCH] Add __isl_give annotations to return types [NFC] llvm-svn: 265882 --- polly/lib/Analysis/DependenceInfo.cpp | 5 +++-- polly/lib/Analysis/ScopInfo.cpp | 23 +++++++++++++---------- polly/lib/CodeGen/IslAst.cpp | 5 +++-- polly/lib/Transform/DeadCodeElimination.cpp | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index 1359748..04a8021 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -716,7 +716,7 @@ void Dependences::releaseMemory() { ReductionDependences.clear(); } -isl_union_map *Dependences::getDependences(int Kinds) const { +__isl_give isl_union_map *Dependences::getDependences(int Kinds) const { assert(hasValidDependences() && "No valid dependences available"); isl_space *Space = isl_union_map_get_space(RAW); isl_union_map *Deps = isl_union_map_empty(Space); @@ -745,7 +745,8 @@ bool Dependences::hasValidDependences() const { return (RAW != nullptr) && (WAR != nullptr) && (WAW != nullptr); } -isl_map *Dependences::getReductionDependences(MemoryAccess *MA) const { +__isl_give isl_map * +Dependences::getReductionDependences(MemoryAccess *MA) const { return isl_map_copy(ReductionDependences.lookup(MA)); } diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 48eb01d..1ff27b2 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -243,7 +243,9 @@ int ScopArrayInfo::getElemSizeInBytes() const { return DL.getTypeAllocSize(ElementType); } -isl_id *ScopArrayInfo::getBasePtrId() const { return isl_id_copy(Id); } +__isl_give isl_id *ScopArrayInfo::getBasePtrId() const { + return isl_id_copy(Id); +} void ScopArrayInfo::dump() const { print(errs()); } @@ -942,7 +944,7 @@ void MemoryAccess::setNewAccessRelation(isl_map *NewAccess) { //===----------------------------------------------------------------------===// -isl_map *ScopStmt::getSchedule() const { +__isl_give isl_map *ScopStmt::getSchedule() const { isl_set *Domain = getDomain(); if (isl_set_is_empty(Domain)) { isl_set_free(Domain); @@ -1763,7 +1765,7 @@ __isl_give isl_id *Scop::getIdForParam(const SCEV *Parameter) { const_cast((const void *)Parameter)); } -isl_set *Scop::addNonEmptyDomainConstraints(isl_set *C) const { +__isl_give isl_set *Scop::addNonEmptyDomainConstraints(isl_set *C) const { isl_set *DomainContext = isl_union_set_params(getDomains()); return isl_set_intersect_params(C, DomainContext); } @@ -2109,11 +2111,11 @@ 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_set *Scop::getDomainConditions(ScopStmt *Stmt) { +__isl_give isl_set *Scop::getDomainConditions(ScopStmt *Stmt) { return getDomainConditions(Stmt->getEntryBlock()); } -isl_set *Scop::getDomainConditions(BasicBlock *BB) { +__isl_give isl_set *Scop::getDomainConditions(BasicBlock *BB) { auto DIt = DomainMap.find(BB); if (DIt != DomainMap.end()) return isl_set_copy(DIt->getSecond()); @@ -2449,10 +2451,11 @@ bool Scop::buildDomainsWithBranchConstraints(Region *R, ScopDetection &SD, return true; } -isl_set *Scop::getPredecessorDomainConstraints(BasicBlock *BB, isl_set *Domain, - ScopDetection &SD, - DominatorTree &DT, - LoopInfo &LI) { +__isl_give isl_set *Scop::getPredecessorDomainConstraints(BasicBlock *BB, + isl_set *Domain, + ScopDetection &SD, + DominatorTree &DT, + LoopInfo &LI) { // If @p BB is the ScopEntry we are done if (R.getEntry() == BB) return isl_set_universe(isl_set_get_space(Domain)); @@ -3066,7 +3069,7 @@ const InvariantEquivClassTy *Scop::lookupInvariantEquivClass(Value *Val) const { return nullptr; } -isl_set *Scop::getErrorCtxReachingStmt(ScopStmt &Stmt) { +__isl_give isl_set *Scop::getErrorCtxReachingStmt(ScopStmt &Stmt) { auto *BB = Stmt.getEntryBlock(); return isl_set_copy(ErrorDomainCtxMap.lookup(BB)); } diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 739fc7e..465a05b 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -536,12 +536,13 @@ bool IslAstInfo::isExecutedInParallel(__isl_keep isl_ast_node *Node) { return isOutermostParallel(Node) && !isReductionParallel(Node); } -isl_union_map *IslAstInfo::getSchedule(__isl_keep isl_ast_node *Node) { +__isl_give isl_union_map * +IslAstInfo::getSchedule(__isl_keep isl_ast_node *Node) { IslAstUserPayload *Payload = getNodePayload(Node); return Payload ? isl_ast_build_get_schedule(Payload->Build) : nullptr; } -isl_pw_aff * +__isl_give isl_pw_aff * IslAstInfo::getMinimalDependenceDistance(__isl_keep isl_ast_node *Node) { IslAstUserPayload *Payload = getNodePayload(Node); return Payload ? isl_pw_aff_copy(Payload->MinimalDependenceDistance) diff --git a/polly/lib/Transform/DeadCodeElimination.cpp b/polly/lib/Transform/DeadCodeElimination.cpp index 4fe6317..fae723b 100644 --- a/polly/lib/Transform/DeadCodeElimination.cpp +++ b/polly/lib/Transform/DeadCodeElimination.cpp @@ -90,7 +90,7 @@ char DeadCodeElim::ID = 0; // bounded write accesses can not overwrite all of the data-locations. As // 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_give isl_union_set *DeadCodeElim::getLiveOut(Scop &S) { isl_union_map *Schedule = S.getSchedule(); isl_union_map *WriteIterations = isl_union_map_reverse(S.getMustWrites()); isl_union_map *WriteTimes = -- 2.7.4