/// 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.
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).
///
// 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.
// 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();
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.
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())
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";
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();