[polly] r310203 - [ScopInfo] Move InvalidDomain to isl++ [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 6 08:36:48 PDT 2017
Author: grosser
Date: Sun Aug 6 08:36:48 2017
New Revision: 310203
URL: http://llvm.org/viewvc/llvm-project?rev=310203&view=rev
Log:
[ScopInfo] Move InvalidDomain to isl++ [NFC]
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopBuilder.cpp
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=310203&r1=310202&r2=310203&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug 6 08:36:48 2017
@@ -1201,7 +1201,7 @@ private:
/// The invalid domain for a statement describes all parameter combinations
/// under which the statement looks to be executed but is in fact not because
/// some assumption/restriction makes the statement/scop invalid.
- isl_set *InvalidDomain;
+ isl::set InvalidDomain;
/// The iteration domain describes the set of iterations for which this
/// statement is executed.
@@ -1343,17 +1343,13 @@ public:
std::string getScheduleStr() const;
/// Get the invalid domain for this statement.
- __isl_give isl_set *getInvalidDomain() const {
- return isl_set_copy(InvalidDomain);
- }
+ isl::set getInvalidDomain() const { return InvalidDomain; }
/// Get the invalid context for this statement.
- __isl_give isl_set *getInvalidContext() const {
- return isl_set_params(getInvalidDomain());
- }
+ isl::set getInvalidContext() const { return getInvalidDomain().params(); }
/// Set the invalid context for this statement to @p ID.
- void setInvalidDomain(__isl_take isl_set *ID);
+ void setInvalidDomain(isl::set ID);
/// Get the BasicBlock represented by this ScopStmt (if any).
///
Modified: polly/trunk/lib/Analysis/ScopBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopBuilder.cpp?rev=310203&r1=310202&r2=310203&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopBuilder.cpp (original)
+++ polly/trunk/lib/Analysis/ScopBuilder.cpp Sun Aug 6 08:36:48 2017
@@ -966,11 +966,10 @@ void ScopBuilder::buildScop(Region &R, A
// Initialize the invalid domain.
for (ScopStmt &Stmt : scop->Stmts)
if (Stmt.isBlockStmt())
- Stmt.setInvalidDomain(InvalidDomainMap[Stmt.getEntryBlock()].copy());
+ Stmt.setInvalidDomain(InvalidDomainMap[Stmt.getEntryBlock()]);
else
- Stmt.setInvalidDomain(
- InvalidDomainMap[getRegionNodeBasicBlock(Stmt.getRegion()->getNode())]
- .copy());
+ Stmt.setInvalidDomain(InvalidDomainMap[getRegionNodeBasicBlock(
+ Stmt.getRegion()->getNode())]);
// Remove empty statements.
// Exit early in case there are no executable statements left in this scop.
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=310203&r1=310202&r2=310203&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug 6 08:36:48 2017
@@ -946,7 +946,7 @@ void MemoryAccess::buildAccessRelation(c
// Initialize the invalid domain which describes all iterations for which the
// access relation is not modeled correctly.
- isl::set StmtInvalidDomain = isl::manage(getStatement()->getInvalidDomain());
+ isl::set StmtInvalidDomain = getStatement()->getInvalidDomain();
InvalidDomain = isl::set::empty(StmtInvalidDomain.get_space());
isl::ctx Ctx = Id.get_ctx();
@@ -1316,9 +1316,9 @@ void ScopStmt::realignParams() {
for (MemoryAccess *MA : *this)
MA->realignParams();
- auto *Ctx = Parent.getContext();
- InvalidDomain = isl_set_gist_params(InvalidDomain, isl_set_copy(Ctx));
- Domain = isl_set_gist_params(Domain, Ctx);
+ isl::set Ctx = isl::manage(Parent.getContext());
+ InvalidDomain = InvalidDomain.gist_params(Ctx);
+ Domain = isl_set_gist_params(Domain, Ctx.get());
}
/// Add @p BSet to the set @p User if @p BSet is bounded.
@@ -1895,10 +1895,7 @@ std::string ScopStmt::getScheduleStr() c
return Str;
}
-void ScopStmt::setInvalidDomain(__isl_take isl_set *ID) {
- isl_set_free(InvalidDomain);
- InvalidDomain = ID;
-}
+void ScopStmt::setInvalidDomain(isl::set ID) { InvalidDomain = ID; }
BasicBlock *ScopStmt::getEntryBlock() const {
if (isBlockStmt())
@@ -1926,10 +1923,7 @@ __isl_give isl_id *ScopStmt::getDomainId
return isl_set_get_tuple_id(Domain);
}
-ScopStmt::~ScopStmt() {
- isl_set_free(Domain);
- isl_set_free(InvalidDomain);
-}
+ScopStmt::~ScopStmt() { isl_set_free(Domain); }
void ScopStmt::printInstructions(raw_ostream &OS) const {
OS << "Instructions {\n";
@@ -3890,13 +3884,13 @@ void Scop::addInvariantLoads(ScopStmt &S
if (InvMAs.empty())
return;
- auto *StmtInvalidCtx = Stmt.getInvalidContext();
- bool StmtInvalidCtxIsEmpty = isl_set_is_empty(StmtInvalidCtx);
+ isl::set StmtInvalidCtx = Stmt.getInvalidContext();
+ bool StmtInvalidCtxIsEmpty = StmtInvalidCtx.is_empty();
// Get the context under which the statement is executed but remove the error
// context under which this statement is reached.
isl_set *DomainCtx = isl_set_params(Stmt.getDomain());
- DomainCtx = isl_set_subtract(DomainCtx, StmtInvalidCtx);
+ DomainCtx = isl_set_subtract(DomainCtx, StmtInvalidCtx.copy());
if (isl_set_n_basic_set(DomainCtx) >= MaxDisjunctsInDomain) {
auto *AccInst = InvMAs.front().MA->getAccessInstruction();
More information about the llvm-commits
mailing list