[Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC.

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Removing explicit operator bool() from all the classes in the isl C++ bindings.
 - Replace each call to operator bool() to method `is_null()`.
 - isl-noexceptions.h has been generated by this 27396daac5

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D103976
This commit is contained in:
patacca 2021-06-11 13:13:07 +02:00
parent cd2e500e55
commit 7c7978a122
19 changed files with 135 additions and 350 deletions

View File

@ -2253,7 +2253,7 @@ public:
/// Return the define behavior context, or if not available, its approximation
/// from all other contexts.
isl::set getBestKnownDefinedBehaviorContext() const {
if (DefinedBehaviorContext)
if (!DefinedBehaviorContext.is_null())
return DefinedBehaviorContext;
return Context.intersect_params(AssumedContext).subtract(InvalidContext);

View File

@ -658,7 +658,7 @@ bool Dependences::isValidSchedule(
assert(!StmtScat.is_null() &&
"Schedules that contain extension nodes require special handling.");
if (!ScheduleSpace)
if (ScheduleSpace.is_null())
ScheduleSpace = StmtScat.get_space().range();
Schedule = Schedule.add_map(StmtScat);

View File

@ -612,7 +612,7 @@ bool ScopBuilder::propagateDomainConstraints(
BasicBlock *BB = getRegionNodeBasicBlock(RN);
isl::set &Domain = scop->getOrInitEmptyDomain(BB);
assert(Domain);
assert(!Domain.is_null());
// Under the union of all predecessor conditions we can reach this block.
isl::set PredDom = getPredecessorDomainConstraints(BB, Domain);
@ -653,7 +653,7 @@ void ScopBuilder::propagateDomainConstraintsToRegionExit(
}
isl::set Domain = scop->getOrInitEmptyDomain(BB);
assert(Domain && "Cannot propagate a nullptr");
assert(!Domain.is_null() && "Cannot propagate a nullptr");
Loop *ExitBBLoop = getFirstNonBoxedLoopFor(ExitBB, LI, scop->getBoxedLoops());
@ -664,7 +664,8 @@ void ScopBuilder::propagateDomainConstraintsToRegionExit(
// If the exit domain is not yet created we set it otherwise we "add" the
// current domain.
ExitDomain = ExitDomain ? AdjustedDomain.unite(ExitDomain) : AdjustedDomain;
ExitDomain =
!ExitDomain.is_null() ? AdjustedDomain.unite(ExitDomain) : AdjustedDomain;
// Initialize the invalid domain.
InvalidDomainMap[ExitBB] = ExitDomain.empty(ExitDomain.get_space());
@ -970,7 +971,7 @@ bool ScopBuilder::buildDomainsWithBranchConstraints(
// successor block.
isl::set &SuccDomain = scop->getOrInitEmptyDomain(SuccBB);
if (SuccDomain) {
if (!SuccDomain.is_null()) {
SuccDomain = SuccDomain.unite(CondSet).coalesce();
} else {
// Initialize the invalid domain.
@ -1013,7 +1014,7 @@ bool ScopBuilder::propagateInvalidStmtDomains(
bool ContainsErrorBlock = containsErrorBlock(RN, scop->getRegion(), LI, DT);
BasicBlock *BB = getRegionNodeBasicBlock(RN);
isl::set &Domain = scop->getOrInitEmptyDomain(BB);
assert(Domain && "Cannot propagate a nullptr");
assert(!Domain.is_null() && "Cannot propagate a nullptr");
isl::set InvalidDomain = InvalidDomainMap[BB];
@ -1131,9 +1132,9 @@ void ScopBuilder::buildScalarDependences(ScopStmt *UserStmt,
// interpreted as the empty schedule. Can also return null if both schedules are
// empty.
static isl::schedule combineInSequence(isl::schedule Prev, isl::schedule Succ) {
if (!Prev)
if (Prev.is_null())
return Succ;
if (!Succ)
if (Succ.is_null())
return Prev;
return Prev.sequence(Succ);
@ -1155,7 +1156,7 @@ static isl::schedule combineInSequence(isl::schedule Prev, isl::schedule Succ) {
// @returns A mapping from USet to its N-th dimension.
static isl::multi_union_pw_aff mapToDimension(isl::union_set USet, int N) {
assert(N >= 0);
assert(USet);
assert(!USet.is_null());
assert(!USet.is_empty());
auto Result = isl::union_pw_multi_aff::empty(USet.get_space());
@ -1288,7 +1289,7 @@ void ScopBuilder::buildSchedule(RegionNode *RN, LoopStackTy &LoopStack) {
++LoopData;
--Dimension;
if (Schedule) {
if (!Schedule.is_null()) {
isl::union_set Domain = Schedule.get_domain();
isl::multi_union_pw_aff MUPA = mapToDimension(Domain, Dimension);
Schedule = Schedule.insert_partial_schedule(MUPA);
@ -1305,7 +1306,7 @@ void ScopBuilder::buildSchedule(RegionNode *RN, LoopStackTy &LoopStack) {
// It is easier to insert the marks here that do it retroactively.
isl::id IslLoopId = createIslLoopAttr(scop->getIslCtx(), L);
if (IslLoopId)
if (!IslLoopId.is_null())
Schedule = Schedule.get_root()
.get_child(0)
.insert_mark(IslLoopId)
@ -2808,9 +2809,11 @@ void ScopBuilder::hoistInvariantLoads() {
for (ScopStmt &Stmt : *scop) {
InvariantAccessesTy InvariantAccesses;
for (MemoryAccess *Access : Stmt)
if (isl::set NHCtx = getNonHoistableCtx(Access, Writes))
for (MemoryAccess *Access : Stmt) {
isl::set NHCtx = getNonHoistableCtx(Access, Writes);
if (!NHCtx.is_null())
InvariantAccesses.push_back({Access, NHCtx});
}
// Transfer the memory access from the statement to the SCoP.
for (auto InvMA : InvariantAccesses)
@ -3046,7 +3049,8 @@ void ScopBuilder::addInvariantLoads(ScopStmt &Stmt,
if (!Values.count(AccInst))
continue;
if (isl::id ParamId = scop->getIdForParam(Parameter)) {
isl::id ParamId = scop->getIdForParam(Parameter);
if (!ParamId.is_null()) {
int Dim = DomainCtx.find_dim_by_id(isl::dim::param, ParamId);
if (Dim >= 0)
DomainCtx = DomainCtx.eliminate(isl::dim::param, Dim, 1);
@ -3110,7 +3114,7 @@ void ScopBuilder::addInvariantLoads(ScopStmt &Stmt,
// Unify the execution context of the class and this statement.
isl::set IAClassDomainCtx = IAClass.ExecutionContext;
if (IAClassDomainCtx)
if (!IAClassDomainCtx.is_null())
IAClassDomainCtx = IAClassDomainCtx.unite(MACtx).coalesce();
else
IAClassDomainCtx = MACtx;
@ -3337,7 +3341,7 @@ static bool buildMinMaxAccess(isl::set Set,
// enclose the accessed memory region by MinPMA and MaxPMA. The pointer
// we test during code generation might now point after the end of the
// allocated array but we will never dereference it anyway.
assert((!MaxPMA || MaxPMA.dim(isl::dim::out)) &&
assert((MaxPMA.is_null() || MaxPMA.dim(isl::dim::out)) &&
"Assumed at least one output dimension");
Pos = MaxPMA.dim(isl::dim::out) - 1;
@ -3347,7 +3351,7 @@ static bool buildMinMaxAccess(isl::set Set,
LastDimAff = LastDimAff.add(OneAff);
MaxPMA = MaxPMA.set_pw_aff(Pos, LastDimAff);
if (!MinPMA || !MaxPMA)
if (MinPMA.is_null() || MaxPMA.is_null())
return false;
MinMaxAccesses.push_back(std::make_pair(MinPMA, MaxPMA));

View File

@ -307,7 +307,7 @@ void ScopArrayInfo::applyAndSetFAD(Value *FAD) {
return;
}
assert(DimensionSizesPw.size() > 0 && !DimensionSizesPw[0]);
assert(DimensionSizesPw.size() > 0 && DimensionSizesPw[0].is_null());
assert(!this->FAD);
this->FAD = FAD;
@ -1068,7 +1068,7 @@ void MemoryAccess::setAccessRelation(isl::map NewAccess) {
}
void MemoryAccess::setNewAccessRelation(isl::map NewAccess) {
assert(NewAccess);
assert(!NewAccess.is_null());
#ifndef NDEBUG
// Check domain space compatibility.
@ -1132,7 +1132,7 @@ isl::map ScopStmt::getSchedule() const {
if (Domain.is_empty())
return isl::map::from_aff(isl::aff(isl::local_space(getDomainSpace())));
auto Schedule = getParent()->getSchedule();
if (!Schedule)
if (Schedule.is_null())
return {};
Schedule = Schedule.intersect_domain(isl::union_set(Domain));
if (Schedule.is_empty())
@ -1281,14 +1281,14 @@ void ScopStmt::print(raw_ostream &OS, bool PrintInstructions) const {
OS << "\t" << getBaseName() << "\n";
OS.indent(12) << "Domain :=\n";
if (Domain) {
if (!Domain.is_null()) {
OS.indent(16) << getDomainStr() << ";\n";
} else
OS.indent(16) << "n/a\n";
OS.indent(12) << "Schedule :=\n";
if (Domain) {
if (!Domain.is_null()) {
OS.indent(16) << getScheduleStr() << ";\n";
} else
OS.indent(16) << "n/a\n";
@ -1584,7 +1584,7 @@ static std::vector<isl::id> getFortranArrayIds(Scop::array_range Arrays) {
// TODO: actually need to check if it has a FAD, but for now this works.
if (Array->getNumberOfDimensions() > 0) {
isl::pw_aff PwAff = Array->getDimensionSizePw(0);
if (!PwAff)
if (PwAff.is_null())
continue;
isl::id Id = PwAff.get_dim_id(isl::dim::param, 0);
@ -1784,7 +1784,7 @@ void Scop::removeStmts(function_ref<bool(ScopStmt &)> ShouldDelete,
void Scop::removeStmtNotInDomainMap() {
removeStmts([this](ScopStmt &Stmt) -> bool {
isl::set Domain = DomainMap.lookup(Stmt.getEntryBlock());
if (!Domain)
if (Domain.is_null())
return true;
return Domain.is_empty();
});
@ -1895,7 +1895,7 @@ ScopArrayInfo *Scop::getScopArrayInfo(Value *BasePtr, MemoryKind Kind) {
std::string Scop::getContextStr() const { return getContext().to_str(); }
std::string Scop::getAssumedContextStr() const {
assert(AssumedContext && "Assumed context not yet built");
assert(!AssumedContext.is_null() && "Assumed context not yet built");
return AssumedContext.to_str();
}
@ -1950,7 +1950,7 @@ isl::space Scop::getFullParamSpace() const {
}
isl::set Scop::getAssumedContext() const {
assert(AssumedContext && "Assumed context not yet built");
assert(!AssumedContext.is_null() && "Assumed context not yet built");
return AssumedContext;
}
@ -2134,7 +2134,7 @@ void Scop::addAssumption(AssumptionKind Kind, isl::set Set, DebugLoc Loc,
}
void Scop::intersectDefinedBehavior(isl::set Set, AssumptionSign Sign) {
if (!DefinedBehaviorContext)
if (DefinedBehaviorContext.is_null())
return;
if (Sign == AS_ASSUMPTION)
@ -2171,7 +2171,7 @@ void Scop::printContext(raw_ostream &OS) const {
OS.indent(4) << InvalidContext << "\n";
OS.indent(4) << "Defined Behavior Context:\n";
if (DefinedBehaviorContext)
if (!DefinedBehaviorContext.is_null())
OS.indent(4) << DefinedBehaviorContext << "\n";
else
OS.indent(4) << "<unavailable>\n";
@ -2284,7 +2284,7 @@ __isl_give PWACtx Scop::getPwAff(const SCEV *E, BasicBlock *BB,
// the SCoP and return a dummy value. This way we do not need to add error
// handling code to all users of this function.
auto PWAC = Affinator.getPwAff(E, BB, RecordedAssumptions);
if (PWAC.first) {
if (!PWAC.first.is_null()) {
// TODO: We could use a heuristic and either use:
// SCEVAffinator::takeNonNegativeAssumption
// or

View File

@ -570,7 +570,7 @@ isl::ast_expr IslAstInfo::getRunCondition() { return Ast.getRunCondition(); }
IslAstUserPayload *IslAstInfo::getNodePayload(const isl::ast_node &Node) {
isl::id Id = Node.get_annotation();
if (!Id)
if (Id.is_null())
return nullptr;
IslAstUserPayload *Payload = (IslAstUserPayload *)Id.get_user();
return Payload;

View File

@ -278,7 +278,7 @@ static MustKillsInfo computeMustKillsInfo(const Scop &S) {
isl::union_set KillStmtDomain = isl::set::universe(KillStmtSpace);
isl::schedule KillSchedule = isl::schedule::from_domain(KillStmtDomain);
if (Info.KillsSchedule)
if (!Info.KillsSchedule.is_null())
Info.KillsSchedule = isl::manage(
isl_schedule_set(Info.KillsSchedule.release(), KillSchedule.copy()));
else

View File

@ -219,7 +219,7 @@ static bool importContext(Scop &S, const json::Object &JScop) {
JScop.getString("context").getValue().str()};
// Check whether the context was parsed successfully.
if (!NewContext) {
if (NewContext.is_null()) {
errs() << "The context was not parsed successfully by ISL.\n";
return false;
}

View File

@ -246,7 +246,6 @@ public:
inline __isl_keep isl_aff *get() const;
inline __isl_give isl_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -349,7 +348,6 @@ public:
inline __isl_keep isl_aff_list *get() const;
inline __isl_give isl_aff_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -394,7 +392,6 @@ public:
inline __isl_keep isl_ast_build *get() const;
inline __isl_give isl_ast_build *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline ast_expr access_from(multi_pw_aff mpa) const;
@ -434,7 +431,6 @@ public:
inline __isl_keep isl_ast_expr *get() const;
inline __isl_give isl_ast_expr *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -492,7 +488,6 @@ public:
inline __isl_keep isl_ast_expr_list *get() const;
inline __isl_give isl_ast_expr_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -536,7 +531,6 @@ public:
inline __isl_keep isl_ast_node *get() const;
inline __isl_give isl_ast_node *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -586,7 +580,6 @@ public:
inline __isl_keep isl_ast_node_list *get() const;
inline __isl_give isl_ast_node_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -631,7 +624,6 @@ public:
inline __isl_keep isl_basic_map *get() const;
inline __isl_give isl_basic_map *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -764,7 +756,6 @@ public:
inline __isl_keep isl_basic_map_list *get() const;
inline __isl_give isl_basic_map_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -810,7 +801,6 @@ public:
inline __isl_keep isl_basic_set *get() const;
inline __isl_give isl_basic_set *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -914,7 +904,6 @@ public:
inline __isl_keep isl_basic_set_list *get() const;
inline __isl_give isl_basic_set_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -959,7 +948,6 @@ public:
inline __isl_keep isl_constraint *get() const;
inline __isl_give isl_constraint *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -1007,7 +995,6 @@ public:
inline __isl_keep isl_constraint_list *get() const;
inline __isl_give isl_constraint_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1051,7 +1038,6 @@ public:
inline __isl_keep isl_fixed_box *get() const;
inline __isl_give isl_fixed_box *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1085,7 +1071,6 @@ public:
inline __isl_keep isl_id *get() const;
inline __isl_give isl_id *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1118,7 +1103,6 @@ public:
inline __isl_keep isl_id_list *get() const;
inline __isl_give isl_id_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1162,7 +1146,6 @@ public:
inline __isl_keep isl_id_to_ast_expr *get() const;
inline __isl_give isl_id_to_ast_expr *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -1197,7 +1180,6 @@ public:
inline __isl_keep isl_local_space *get() const;
inline __isl_give isl_local_space *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -1251,7 +1233,6 @@ public:
inline __isl_keep isl_map *get() const;
inline __isl_give isl_map *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1465,7 +1446,6 @@ public:
inline __isl_keep isl_map_list *get() const;
inline __isl_give isl_map_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1509,7 +1489,6 @@ public:
inline __isl_keep isl_mat *get() const;
inline __isl_give isl_mat *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -1580,7 +1559,6 @@ public:
inline __isl_keep isl_multi_aff *get() const;
inline __isl_give isl_multi_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1686,7 +1664,6 @@ public:
inline __isl_keep isl_multi_id *get() const;
inline __isl_give isl_multi_id *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1741,7 +1718,6 @@ public:
inline __isl_keep isl_multi_pw_aff *get() const;
inline __isl_give isl_multi_pw_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1858,7 +1834,6 @@ public:
inline __isl_keep isl_multi_union_pw_aff *get() const;
inline __isl_give isl_multi_union_pw_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -1954,7 +1929,6 @@ public:
inline __isl_keep isl_multi_val *get() const;
inline __isl_give isl_multi_val *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2037,7 +2011,6 @@ public:
inline __isl_keep isl_point *get() const;
inline __isl_give isl_point *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2076,7 +2049,6 @@ public:
inline __isl_keep isl_pw_aff *get() const;
inline __isl_give isl_pw_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2197,7 +2169,6 @@ public:
inline __isl_keep isl_pw_aff_list *get() const;
inline __isl_give isl_pw_aff_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2252,7 +2223,6 @@ public:
inline __isl_keep isl_pw_multi_aff *get() const;
inline __isl_give isl_pw_multi_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2358,7 +2328,6 @@ public:
inline __isl_keep isl_pw_multi_aff_list *get() const;
inline __isl_give isl_pw_multi_aff_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2403,7 +2372,6 @@ public:
inline __isl_keep isl_pw_qpolynomial *get() const;
inline __isl_give isl_pw_qpolynomial *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2482,7 +2450,6 @@ public:
inline __isl_keep isl_pw_qpolynomial_fold_list *get() const;
inline __isl_give isl_pw_qpolynomial_fold_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2511,7 +2478,6 @@ public:
inline __isl_keep isl_pw_qpolynomial_list *get() const;
inline __isl_give isl_pw_qpolynomial_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2555,7 +2521,6 @@ public:
inline __isl_keep isl_qpolynomial *get() const;
inline __isl_give isl_qpolynomial *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -2623,7 +2588,6 @@ public:
inline __isl_keep isl_qpolynomial_list *get() const;
inline __isl_give isl_qpolynomial_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2668,7 +2632,6 @@ public:
inline __isl_keep isl_schedule *get() const;
inline __isl_give isl_schedule *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2713,7 +2676,6 @@ public:
inline __isl_keep isl_schedule_constraints *get() const;
inline __isl_give isl_schedule_constraints *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2757,7 +2719,6 @@ public:
inline __isl_keep isl_schedule_node *get() const;
inline __isl_give isl_schedule_node *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -2850,7 +2811,6 @@ public:
inline __isl_keep isl_set *get() const;
inline __isl_give isl_set *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3032,7 +2992,6 @@ public:
inline __isl_keep isl_set_list *get() const;
inline __isl_give isl_set_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3079,7 +3038,6 @@ public:
inline __isl_keep isl_space *get() const;
inline __isl_give isl_space *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3182,7 +3140,6 @@ public:
inline __isl_keep isl_term *get() const;
inline __isl_give isl_term *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline isl_size dim(isl::dim type) const;
@ -3214,7 +3171,6 @@ public:
inline __isl_keep isl_union_access_info *get() const;
inline __isl_give isl_union_access_info *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
@ -3248,7 +3204,6 @@ public:
inline __isl_keep isl_union_flow *get() const;
inline __isl_give isl_union_flow *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
@ -3286,7 +3241,6 @@ public:
inline __isl_keep isl_union_map *get() const;
inline __isl_give isl_union_map *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3426,7 +3380,6 @@ public:
inline __isl_keep isl_union_map_list *get() const;
inline __isl_give isl_union_map_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3474,7 +3427,6 @@ public:
inline __isl_keep isl_union_pw_aff *get() const;
inline __isl_give isl_union_pw_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3546,7 +3498,6 @@ public:
inline __isl_keep isl_union_pw_aff_list *get() const;
inline __isl_give isl_union_pw_aff_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3598,7 +3549,6 @@ public:
inline __isl_keep isl_union_pw_multi_aff *get() const;
inline __isl_give isl_union_pw_multi_aff *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3675,7 +3625,6 @@ public:
inline __isl_keep isl_union_pw_multi_aff_list *get() const;
inline __isl_give isl_union_pw_multi_aff_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3720,7 +3669,6 @@ public:
inline __isl_keep isl_union_pw_qpolynomial *get() const;
inline __isl_give isl_union_pw_qpolynomial *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
@ -3790,7 +3738,6 @@ public:
inline __isl_keep isl_union_set *get() const;
inline __isl_give isl_union_set *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3880,7 +3827,6 @@ public:
inline __isl_keep isl_union_set_list *get() const;
inline __isl_give isl_union_set_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -3927,7 +3873,6 @@ public:
inline __isl_keep isl_val *get() const;
inline __isl_give isl_val *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -4010,7 +3955,6 @@ public:
inline __isl_keep isl_val_list *get() const;
inline __isl_give isl_val_list *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline std::string to_str() const;
inline void dump() const;
@ -4054,7 +3998,6 @@ public:
inline __isl_keep isl_vec *get() const;
inline __isl_give isl_vec *release();
inline bool is_null() const;
inline explicit operator bool() const;
inline ctx get_ctx() const;
inline void dump() const;
@ -4149,9 +4092,6 @@ __isl_give isl_aff *aff::release() {
bool aff::is_null() const {
return ptr == nullptr;
}
aff::operator bool() const {
return !is_null();
}
ctx aff::get_ctx() const {
@ -4667,9 +4607,6 @@ __isl_give isl_aff_list *aff_list::release() {
bool aff_list::is_null() const {
return ptr == nullptr;
}
aff_list::operator bool() const {
return !is_null();
}
ctx aff_list::get_ctx() const {
@ -4843,9 +4780,6 @@ __isl_give isl_ast_build *ast_build::release() {
bool ast_build::is_null() const {
return ptr == nullptr;
}
ast_build::operator bool() const {
return !is_null();
}
ctx ast_build::get_ctx() const {
@ -4981,9 +4915,6 @@ __isl_give isl_ast_expr *ast_expr::release() {
bool ast_expr::is_null() const {
return ptr == nullptr;
}
ast_expr::operator bool() const {
return !is_null();
}
ctx ast_expr::get_ctx() const {
@ -5230,9 +5161,6 @@ __isl_give isl_ast_expr_list *ast_expr_list::release() {
bool ast_expr_list::is_null() const {
return ptr == nullptr;
}
ast_expr_list::operator bool() const {
return !is_null();
}
ctx ast_expr_list::get_ctx() const {
@ -5401,9 +5329,6 @@ __isl_give isl_ast_node *ast_node::release() {
bool ast_node::is_null() const {
return ptr == nullptr;
}
ast_node::operator bool() const {
return !is_null();
}
ctx ast_node::get_ctx() const {
@ -5602,9 +5527,6 @@ __isl_give isl_ast_node_list *ast_node_list::release() {
bool ast_node_list::is_null() const {
return ptr == nullptr;
}
ast_node_list::operator bool() const {
return !is_null();
}
ctx ast_node_list::get_ctx() const {
@ -5778,9 +5700,6 @@ __isl_give isl_basic_map *basic_map::release() {
bool basic_map::is_null() const {
return ptr == nullptr;
}
basic_map::operator bool() const {
return !is_null();
}
ctx basic_map::get_ctx() const {
@ -6485,9 +6404,6 @@ __isl_give isl_basic_map_list *basic_map_list::release() {
bool basic_map_list::is_null() const {
return ptr == nullptr;
}
basic_map_list::operator bool() const {
return !is_null();
}
ctx basic_map_list::get_ctx() const {
@ -6666,9 +6582,6 @@ __isl_give isl_basic_set *basic_set::release() {
bool basic_set::is_null() const {
return ptr == nullptr;
}
basic_set::operator bool() const {
return !is_null();
}
ctx basic_set::get_ctx() const {
@ -7207,9 +7120,6 @@ __isl_give isl_basic_set_list *basic_set_list::release() {
bool basic_set_list::is_null() const {
return ptr == nullptr;
}
basic_set_list::operator bool() const {
return !is_null();
}
ctx basic_set_list::get_ctx() const {
@ -7384,9 +7294,6 @@ __isl_give isl_constraint *constraint::release() {
bool constraint::is_null() const {
return ptr == nullptr;
}
constraint::operator bool() const {
return !is_null();
}
ctx constraint::get_ctx() const {
@ -7569,9 +7476,6 @@ __isl_give isl_constraint_list *constraint_list::release() {
bool constraint_list::is_null() const {
return ptr == nullptr;
}
constraint_list::operator bool() const {
return !is_null();
}
ctx constraint_list::get_ctx() const {
@ -7740,9 +7644,6 @@ __isl_give isl_fixed_box *fixed_box::release() {
bool fixed_box::is_null() const {
return ptr == nullptr;
}
fixed_box::operator bool() const {
return !is_null();
}
ctx fixed_box::get_ctx() const {
@ -7842,9 +7743,6 @@ __isl_give isl_id *id::release() {
bool id::is_null() const {
return ptr == nullptr;
}
id::operator bool() const {
return !is_null();
}
ctx id::get_ctx() const {
@ -7940,9 +7838,6 @@ __isl_give isl_id_list *id_list::release() {
bool id_list::is_null() const {
return ptr == nullptr;
}
id_list::operator bool() const {
return !is_null();
}
ctx id_list::get_ctx() const {
@ -8111,9 +8006,6 @@ __isl_give isl_id_to_ast_expr *id_to_ast_expr::release() {
bool id_to_ast_expr::is_null() const {
return ptr == nullptr;
}
id_to_ast_expr::operator bool() const {
return !is_null();
}
ctx id_to_ast_expr::get_ctx() const {
@ -8224,9 +8116,6 @@ __isl_give isl_local_space *local_space::release() {
bool local_space::is_null() const {
return ptr == nullptr;
}
local_space::operator bool() const {
return !is_null();
}
ctx local_space::get_ctx() const {
@ -8443,9 +8332,6 @@ __isl_give isl_map *map::release() {
bool map::is_null() const {
return ptr == nullptr;
}
map::operator bool() const {
return !is_null();
}
ctx map::get_ctx() const {
@ -9636,9 +9522,6 @@ __isl_give isl_map_list *map_list::release() {
bool map_list::is_null() const {
return ptr == nullptr;
}
map_list::operator bool() const {
return !is_null();
}
ctx map_list::get_ctx() const {
@ -9807,9 +9690,6 @@ __isl_give isl_mat *mat::release() {
bool mat::is_null() const {
return ptr == nullptr;
}
mat::operator bool() const {
return !is_null();
}
ctx mat::get_ctx() const {
@ -10126,9 +10006,6 @@ __isl_give isl_multi_aff *multi_aff::release() {
bool multi_aff::is_null() const {
return ptr == nullptr;
}
multi_aff::operator bool() const {
return !is_null();
}
ctx multi_aff::get_ctx() const {
@ -10660,9 +10537,6 @@ __isl_give isl_multi_id *multi_id::release() {
bool multi_id::is_null() const {
return ptr == nullptr;
}
multi_id::operator bool() const {
return !is_null();
}
ctx multi_id::get_ctx() const {
@ -10883,9 +10757,6 @@ __isl_give isl_multi_pw_aff *multi_pw_aff::release() {
bool multi_pw_aff::is_null() const {
return ptr == nullptr;
}
multi_pw_aff::operator bool() const {
return !is_null();
}
ctx multi_pw_aff::get_ctx() const {
@ -11480,9 +11351,6 @@ __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::release() {
bool multi_union_pw_aff::is_null() const {
return ptr == nullptr;
}
multi_union_pw_aff::operator bool() const {
return !is_null();
}
ctx multi_union_pw_aff::get_ctx() const {
@ -11954,9 +11822,6 @@ __isl_give isl_multi_val *multi_val::release() {
bool multi_val::is_null() const {
return ptr == nullptr;
}
multi_val::operator bool() const {
return !is_null();
}
ctx multi_val::get_ctx() const {
@ -12351,9 +12216,6 @@ __isl_give isl_point *point::release() {
bool point::is_null() const {
return ptr == nullptr;
}
point::operator bool() const {
return !is_null();
}
ctx point::get_ctx() const {
@ -12480,9 +12342,6 @@ __isl_give isl_pw_aff *pw_aff::release() {
bool pw_aff::is_null() const {
return ptr == nullptr;
}
pw_aff::operator bool() const {
return !is_null();
}
ctx pw_aff::get_ctx() const {
@ -13114,9 +12973,6 @@ __isl_give isl_pw_aff_list *pw_aff_list::release() {
bool pw_aff_list::is_null() const {
return ptr == nullptr;
}
pw_aff_list::operator bool() const {
return !is_null();
}
ctx pw_aff_list::get_ctx() const {
@ -13348,9 +13204,6 @@ __isl_give isl_pw_multi_aff *pw_multi_aff::release() {
bool pw_multi_aff::is_null() const {
return ptr == nullptr;
}
pw_multi_aff::operator bool() const {
return !is_null();
}
ctx pw_multi_aff::get_ctx() const {
@ -13893,9 +13746,6 @@ __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::release() {
bool pw_multi_aff_list::is_null() const {
return ptr == nullptr;
}
pw_multi_aff_list::operator bool() const {
return !is_null();
}
ctx pw_multi_aff_list::get_ctx() const {
@ -14069,9 +13919,6 @@ __isl_give isl_pw_qpolynomial *pw_qpolynomial::release() {
bool pw_qpolynomial::is_null() const {
return ptr == nullptr;
}
pw_qpolynomial::operator bool() const {
return !is_null();
}
ctx pw_qpolynomial::get_ctx() const {
@ -14450,9 +14297,6 @@ __isl_give isl_pw_qpolynomial_fold_list *pw_qpolynomial_fold_list::release() {
bool pw_qpolynomial_fold_list::is_null() const {
return ptr == nullptr;
}
pw_qpolynomial_fold_list::operator bool() const {
return !is_null();
}
ctx pw_qpolynomial_fold_list::get_ctx() const {
@ -14524,9 +14368,6 @@ __isl_give isl_pw_qpolynomial_list *pw_qpolynomial_list::release() {
bool pw_qpolynomial_list::is_null() const {
return ptr == nullptr;
}
pw_qpolynomial_list::operator bool() const {
return !is_null();
}
ctx pw_qpolynomial_list::get_ctx() const {
@ -14695,9 +14536,6 @@ __isl_give isl_qpolynomial *qpolynomial::release() {
bool qpolynomial::is_null() const {
return ptr == nullptr;
}
qpolynomial::operator bool() const {
return !is_null();
}
ctx qpolynomial::get_ctx() const {
@ -15015,9 +14853,6 @@ __isl_give isl_qpolynomial_list *qpolynomial_list::release() {
bool qpolynomial_list::is_null() const {
return ptr == nullptr;
}
qpolynomial_list::operator bool() const {
return !is_null();
}
ctx qpolynomial_list::get_ctx() const {
@ -15191,9 +15026,6 @@ __isl_give isl_schedule *schedule::release() {
bool schedule::is_null() const {
return ptr == nullptr;
}
schedule::operator bool() const {
return !is_null();
}
ctx schedule::get_ctx() const {
@ -15359,9 +15191,6 @@ __isl_give isl_schedule_constraints *schedule_constraints::release() {
bool schedule_constraints::is_null() const {
return ptr == nullptr;
}
schedule_constraints::operator bool() const {
return !is_null();
}
ctx schedule_constraints::get_ctx() const {
@ -15522,9 +15351,6 @@ __isl_give isl_schedule_node *schedule_node::release() {
bool schedule_node::is_null() const {
return ptr == nullptr;
}
schedule_node::operator bool() const {
return !is_null();
}
ctx schedule_node::get_ctx() const {
@ -15983,9 +15809,6 @@ __isl_give isl_set *set::release() {
bool set::is_null() const {
return ptr == nullptr;
}
set::operator bool() const {
return !is_null();
}
ctx set::get_ctx() const {
@ -16992,9 +16815,6 @@ __isl_give isl_set_list *set_list::release() {
bool set_list::is_null() const {
return ptr == nullptr;
}
set_list::operator bool() const {
return !is_null();
}
ctx set_list::get_ctx() const {
@ -17179,9 +16999,6 @@ __isl_give isl_space *space::release() {
bool space::is_null() const {
return ptr == nullptr;
}
space::operator bool() const {
return !is_null();
}
ctx space::get_ctx() const {
@ -17698,9 +17515,6 @@ __isl_give isl_term *term::release() {
bool term::is_null() const {
return ptr == nullptr;
}
term::operator bool() const {
return !is_null();
}
ctx term::get_ctx() const {
@ -17787,9 +17601,6 @@ __isl_give isl_union_access_info *union_access_info::release() {
bool union_access_info::is_null() const {
return ptr == nullptr;
}
union_access_info::operator bool() const {
return !is_null();
}
ctx union_access_info::get_ctx() const {
@ -17892,9 +17703,6 @@ __isl_give isl_union_flow *union_flow::release() {
bool union_flow::is_null() const {
return ptr == nullptr;
}
union_flow::operator bool() const {
return !is_null();
}
ctx union_flow::get_ctx() const {
@ -18017,9 +17825,6 @@ __isl_give isl_union_map *union_map::release() {
bool union_map::is_null() const {
return ptr == nullptr;
}
union_map::operator bool() const {
return !is_null();
}
ctx union_map::get_ctx() const {
@ -18764,9 +18569,6 @@ __isl_give isl_union_map_list *union_map_list::release() {
bool union_map_list::is_null() const {
return ptr == nullptr;
}
union_map_list::operator bool() const {
return !is_null();
}
ctx union_map_list::get_ctx() const {
@ -18955,9 +18757,6 @@ __isl_give isl_union_pw_aff *union_pw_aff::release() {
bool union_pw_aff::is_null() const {
return ptr == nullptr;
}
union_pw_aff::operator bool() const {
return !is_null();
}
ctx union_pw_aff::get_ctx() const {
@ -19294,9 +19093,6 @@ __isl_give isl_union_pw_aff_list *union_pw_aff_list::release() {
bool union_pw_aff_list::is_null() const {
return ptr == nullptr;
}
union_pw_aff_list::operator bool() const {
return !is_null();
}
ctx union_pw_aff_list::get_ctx() const {
@ -19505,9 +19301,6 @@ __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::release() {
bool union_pw_multi_aff::is_null() const {
return ptr == nullptr;
}
union_pw_multi_aff::operator bool() const {
return !is_null();
}
ctx union_pw_multi_aff::get_ctx() const {
@ -19874,9 +19667,6 @@ __isl_give isl_union_pw_multi_aff_list *union_pw_multi_aff_list::release() {
bool union_pw_multi_aff_list::is_null() const {
return ptr == nullptr;
}
union_pw_multi_aff_list::operator bool() const {
return !is_null();
}
ctx union_pw_multi_aff_list::get_ctx() const {
@ -20050,9 +19840,6 @@ __isl_give isl_union_pw_qpolynomial *union_pw_qpolynomial::release() {
bool union_pw_qpolynomial::is_null() const {
return ptr == nullptr;
}
union_pw_qpolynomial::operator bool() const {
return !is_null();
}
ctx union_pw_qpolynomial::get_ctx() const {
@ -20375,9 +20162,6 @@ __isl_give isl_union_set *union_set::release() {
bool union_set::is_null() const {
return ptr == nullptr;
}
union_set::operator bool() const {
return !is_null();
}
ctx union_set::get_ctx() const {
@ -20830,9 +20614,6 @@ __isl_give isl_union_set_list *union_set_list::release() {
bool union_set_list::is_null() const {
return ptr == nullptr;
}
union_set_list::operator bool() const {
return !is_null();
}
ctx union_set_list::get_ctx() const {
@ -21017,9 +20798,6 @@ __isl_give isl_val *val::release() {
bool val::is_null() const {
return ptr == nullptr;
}
val::operator bool() const {
return !is_null();
}
ctx val::get_ctx() const {
@ -21414,9 +21192,6 @@ __isl_give isl_val_list *val_list::release() {
bool val_list::is_null() const {
return ptr == nullptr;
}
val_list::operator bool() const {
return !is_null();
}
ctx val_list::get_ctx() const {
@ -21585,9 +21360,6 @@ __isl_give isl_vec *vec::release() {
bool vec::is_null() const {
return ptr == nullptr;
}
vec::operator bool() const {
return !is_null();
}
ctx vec::get_ctx() const {

View File

@ -49,7 +49,7 @@ isl::multi_aff makeShiftDimAff(isl::space Space, int Pos, int Amount) {
isl::basic_map makeTupleSwapBasicMap(isl::space FromSpace1,
isl::space FromSpace2) {
// Fast-path on out-of-quota.
if (!FromSpace1 || !FromSpace2)
if (FromSpace1.is_null() || FromSpace2.is_null())
return {};
assert(FromSpace1.is_set());
@ -132,27 +132,29 @@ isl::union_map polly::betweenScatter(isl::union_map From, isl::union_map To,
}
isl::map polly::singleton(isl::union_map UMap, isl::space ExpectedSpace) {
if (!UMap)
if (UMap.is_null())
return {};
if (isl_union_map_n_map(UMap.get()) == 0)
return isl::map::empty(ExpectedSpace);
isl::map Result = isl::map::from_union_map(UMap);
assert(!Result || Result.get_space().has_equal_tuples(ExpectedSpace));
assert(Result.is_null() ||
Result.get_space().has_equal_tuples(ExpectedSpace));
return Result;
}
isl::set polly::singleton(isl::union_set USet, isl::space ExpectedSpace) {
if (!USet)
if (USet.is_null())
return {};
if (isl_union_set_n_set(USet.get()) == 0)
return isl::set::empty(ExpectedSpace);
isl::set Result(USet);
assert(!Result || Result.get_space().has_equal_tuples(ExpectedSpace));
assert(Result.is_null() ||
Result.get_space().has_equal_tuples(ExpectedSpace));
return Result;
}
@ -160,7 +162,7 @@ isl::set polly::singleton(isl::union_set USet, isl::space ExpectedSpace) {
isl_size polly::getNumScatterDims(const isl::union_map &Schedule) {
isl_size Dims = 0;
for (isl::map Map : Schedule.get_map_list()) {
if (!Map)
if (Map.is_null())
continue;
Dims = std::max(Dims, Map.dim(isl::dim::out));
@ -169,7 +171,7 @@ isl_size polly::getNumScatterDims(const isl::union_map &Schedule) {
}
isl::space polly::getScatterSpace(const isl::union_map &Schedule) {
if (!Schedule)
if (Schedule.is_null())
return {};
unsigned Dims = getNumScatterDims(Schedule);
isl::space ScatterSpace = Schedule.get_space().set_from_params();
@ -444,16 +446,16 @@ isl::map polly::distributeDomain(isl::map Map) {
isl::space Space = Map.get_space();
isl::space DomainSpace = Space.domain();
if (!DomainSpace)
if (DomainSpace.is_null())
return {};
unsigned DomainDims = DomainSpace.dim(isl::dim::set);
isl::space RangeSpace = Space.range().unwrap();
isl::space Range1Space = RangeSpace.domain();
if (!Range1Space)
if (Range1Space.is_null())
return {};
unsigned Range1Dims = Range1Space.dim(isl::dim::set);
isl::space Range2Space = RangeSpace.range();
if (!Range2Space)
if (Range2Space.is_null())
return {};
unsigned Range2Dims = Range2Space.dim(isl::dim::set);
@ -539,7 +541,7 @@ isl::val polly::getConstant(isl::pw_aff PwAff, bool Max, bool Min) {
isl::val Result;
isl::stat Stat = PwAff.foreach_piece(
[=, &Result](isl::set Set, isl::aff Aff) -> isl::stat {
if (Result && Result.is_nan())
if (!Result.is_null() && Result.is_nan())
return isl::stat::ok();
// TODO: If Min/Max, we can also determine a minimum/maximum value if
@ -550,7 +552,7 @@ isl::val polly::getConstant(isl::pw_aff PwAff, bool Max, bool Min) {
}
isl::val ThisVal = Aff.get_constant_val();
if (!Result) {
if (Result.is_null()) {
Result = ThisVal;
return isl::stat::ok();
}
@ -600,7 +602,7 @@ static void foreachPoint(isl::basic_set BSet,
/// dimensions are considered first.
static int flatCompare(const isl::basic_set &A, const isl::basic_set &B) {
// Quick bail-out on out-of-quota.
if (!A || !B)
if (A.is_null() || B.is_null())
return 0;
unsigned ALen = A.dim(isl::dim::set);
@ -728,7 +730,7 @@ static bool orderComparer(const isl::basic_set &A, const isl::basic_set &B) {
/// unwrapped before printing to again appear as a map.
static void printSortedPolyhedra(isl::union_set USet, llvm::raw_ostream &OS,
bool Simplify, bool IsMap) {
if (!USet) {
if (USet.is_null()) {
OS << "<null>\n";
return;
}

View File

@ -197,7 +197,7 @@ PWACtx SCEVAffinator::visit(const SCEV *Expr) {
auto Key = std::make_pair(Expr, BB);
PWACtx PWAC = CachedExpressions[Key];
if (PWAC.first)
if (!PWAC.first.is_null())
return PWAC;
auto ConstantAndLeftOverPair = extractConstantFactor(Expr, SE);

View File

@ -239,15 +239,16 @@ private:
void checkConsistency() const {
#ifndef NDEBUG
// Default-initialized object
if (!Occupied && !Unused && !Known && !Written)
if (Occupied.is_null() && Unused.is_null() && Known.is_null() &&
Written.is_null())
return;
assert(Occupied || Unused);
assert(Known);
assert(Written);
assert(!Occupied.is_null() || !Unused.is_null());
assert(!Known.is_null());
assert(!Written.is_null());
// If not all fields are defined, we cannot derived the universe.
if (!Occupied || !Unused)
if (Occupied.is_null() || Unused.is_null())
return;
assert(Occupied.is_disjoint(Unused));
@ -272,16 +273,19 @@ public:
}
/// Return whether this object was not default-constructed.
bool isUsable() const { return (Occupied || Unused) && Known && Written; }
bool isUsable() const {
return (Occupied.is_null() || Unused.is_null()) && !Known.is_null() &&
!Written.is_null();
}
/// Print the content of this object to @p OS.
void print(llvm::raw_ostream &OS, unsigned Indent = 0) const {
if (isUsable()) {
if (Occupied)
if (!Occupied.is_null())
OS.indent(Indent) << "Occupied: " << Occupied << "\n";
else
OS.indent(Indent) << "Occupied: <Everything else not in Unused>\n";
if (Unused)
if (!Unused.is_null())
OS.indent(Indent) << "Unused: " << Unused << "\n";
else
OS.indent(Indent) << "Unused: <Everything else not in Occupied>\n";
@ -295,13 +299,13 @@ public:
/// Combine two knowledges, this and @p That.
void learnFrom(Knowledge That) {
assert(!isConflicting(*this, That));
assert(Unused && That.Occupied);
assert(!Unused.is_null() && !That.Occupied.is_null());
assert(
!That.Unused &&
That.Unused.is_null() &&
"This function is only prepared to learn occupied elements from That");
assert(!Occupied && "This function does not implement "
"`this->Occupied = "
"this->Occupied.unite(That.Occupied);`");
assert(Occupied.is_null() && "This function does not implement "
"`this->Occupied = "
"this->Occupied.unite(That.Occupied);`");
Unused = Unused.subtract(That.Occupied);
Known = Known.unite(That.Known);
@ -332,11 +336,11 @@ public:
const Knowledge &Proposed,
llvm::raw_ostream *OS = nullptr,
unsigned Indent = 0) {
assert(Existing.Unused);
assert(Proposed.Occupied);
assert(!Existing.Unused.is_null());
assert(!Proposed.Occupied.is_null());
#ifndef NDEBUG
if (Existing.Occupied && Proposed.Unused) {
if (!Existing.Occupied.is_null() && !Proposed.Unused.is_null()) {
auto ExistingUniverse = Existing.Occupied.unite(Existing.Unused);
auto ProposedUniverse = Proposed.Occupied.unite(Proposed.Unused);
assert(ExistingUniverse.is_equal(ProposedUniverse) &&
@ -867,7 +871,7 @@ private:
// { DomainRead[] -> DomainWrite[] }
auto PerPHIWrites = computePerPHI(SAI);
if (!PerPHIWrites) {
if (PerPHIWrites.is_null()) {
LLVM_DEBUG(
dbgs() << " Reject because cannot determine incoming values\n");
return false;
@ -1203,7 +1207,7 @@ public:
}
DeLICMAnalyzed++;
if (!EltUnused || !EltKnown || !EltWritten) {
if (EltUnused.is_null() || EltKnown.is_null() || EltWritten.is_null()) {
assert(isl_ctx_last_error(IslCtx.get()) == isl_error_quota &&
"The only reason that these things have not been computed should "
"be if the max-operations limit hit");

View File

@ -48,7 +48,7 @@ bool isDimBoundedByParameter(isl::set Set, unsigned dim) {
/// Whether BMap's first out-dimension is not a constant.
bool isVariableDim(const isl::basic_map &BMap) {
auto FixedVal = BMap.plain_get_val_if_fixed(isl::dim::out, 0);
return !FixedVal || FixedVal.is_nan();
return FixedVal.is_null() || FixedVal.is_nan();
}
/// Whether Map's first out dimension is no constant nor piecewise constant.
@ -132,7 +132,7 @@ isl::union_map scheduleProjectOut(const isl::union_map &UMap, unsigned first,
isl_size scheduleScatterDims(const isl::union_map &Schedule) {
isl_size Dims = 0;
for (isl::map Map : Schedule.get_map_list()) {
if (!Map)
if (Map.is_null())
continue;
Dims = std::max(Dims, Map.dim(isl::dim::out));
@ -285,7 +285,8 @@ isl::union_map tryFlattenLoop(isl::union_map Schedule) {
LLVM_DEBUG(dbgs() << "Max bound:\n " << Max << "\n");
auto MaxVal = getConstant(Max, true, false);
if (!MinVal || !MaxVal || MinVal.is_nan() || MaxVal.is_nan()) {
if (MinVal.is_null() || MaxVal.is_null() || MinVal.is_nan() ||
MaxVal.is_nan()) {
LLVM_DEBUG(dbgs() << "Abort; dimension bounds could not be determined\n");
return {};
}
@ -328,20 +329,20 @@ isl::union_map polly::flattenSchedule(isl::union_map Schedule) {
if (!isVariableDim(Schedule)) {
LLVM_DEBUG(dbgs() << "Fixed dimension; try sequence flattening\n");
auto NewScheduleSequence = tryFlattenSequence(Schedule);
if (NewScheduleSequence)
if (!NewScheduleSequence.is_null())
return NewScheduleSequence;
}
// Constant stride
LLVM_DEBUG(dbgs() << "Try loop flattening\n");
auto NewScheduleLoop = tryFlattenLoop(Schedule);
if (NewScheduleLoop)
if (!NewScheduleLoop.is_null())
return NewScheduleLoop;
// Try again without loop condition (may blow up the number of pieces!!)
LLVM_DEBUG(dbgs() << "Try sequence flattening again\n");
auto NewScheduleSequence = tryFlattenSequence(Schedule);
if (NewScheduleSequence)
if (!NewScheduleSequence.is_null())
return NewScheduleSequence;
// Cannot flatten

View File

@ -363,7 +363,7 @@ public:
Translator = makeIdentityMap(Known.range(), false);
}
if (!Known || !Translator || !NormalizeMap) {
if (Known.is_null() || Translator.is_null() || NormalizeMap.is_null()) {
assert(isl_ctx_last_error(IslCtx.get()) == isl_error_quota);
Known = {};
Translator = {};
@ -525,7 +525,7 @@ public:
isl::union_map Candidates = findSameContentElements(TranslatedExpectedVal);
isl::map SameVal = singleLocation(Candidates, getDomainFor(TargetStmt));
if (!SameVal)
if (SameVal.is_null())
return ForwardingAction::notApplicable();
LLVM_DEBUG(dbgs() << " expected values where " << TargetExpectedVal
@ -571,7 +571,7 @@ public:
LLVM_DEBUG(dbgs() << " local translator is " << LocalTranslator
<< "\n");
if (!LocalTranslator)
if (LocalTranslator.is_null())
return ForwardingAction::notApplicable();
}
@ -583,7 +583,7 @@ public:
<< Access << "\n");
(void)Access;
if (LocalTranslator)
if (!LocalTranslator.is_null())
Translator = Translator.add_map(LocalTranslator);
NumKnownLoadsForwarded++;
@ -634,7 +634,7 @@ public:
isl::map SameVal = singleLocation(Candidates, getDomainFor(TargetStmt));
simplify(SameVal);
if (!SameVal)
if (SameVal.is_null())
return ForwardingAction::notApplicable();
auto ExecAction = [this, TargetStmt, Inst, SameVal]() {

View File

@ -55,7 +55,7 @@ static isl::schedule applyLoopUnroll(MDNode *LoopMD,
if (UnrollMode & TM_Disable)
return {};
assert(BandToUnroll);
assert(!BandToUnroll.is_null());
// TODO: Isl's codegen also supports unrolling by isl_ast_build via
// isl_schedule_node_band_set_ast_build_options({ unroll[x] }) which would be
// more efficient because the content duplication is delayed. However, the
@ -111,7 +111,7 @@ public:
void visitBand(const isl::schedule_node &Band) {
// Transform inner loops first (depth-first search).
getBase().visitBand(Band);
if (Result)
if (!Result.is_null())
return;
// Since it is (currently) not possible to have a BandAttr marker that is
@ -144,7 +144,7 @@ public:
AttrName == "llvm.loop.unroll.count" ||
AttrName == "llvm.loop.unroll.full") {
Result = applyLoopUnroll(LoopMD, Band);
if (Result)
if (!Result.is_null())
return;
}
@ -154,7 +154,7 @@ public:
}
void visitNode(const isl::schedule_node &Other) {
if (Result)
if (!Result.is_null())
return;
getBase().visitNode(Other);
}
@ -167,7 +167,7 @@ isl::schedule polly::applyManualTransformations(Scop *S, isl::schedule Sched) {
while (true) {
isl::schedule Result =
SearchTransformVisitor::applyOneTransformation(Sched);
if (!Result) {
if (Result.is_null()) {
// No (more) transformation has been found.
break;
}

View File

@ -205,9 +205,9 @@ static isl::map permuteDimensions(isl::map Map, isl::dim DimType,
Map = Map.move_dims(FreeDim, 0, DimType, MinDim, 1);
Map = Map.move_dims(DimType, MinDim, FreeDim, 1, 1);
Map = Map.move_dims(DimType, MaxDim, FreeDim, 0, 1);
if (DimId)
if (!DimId.is_null())
Map = Map.set_tuple_id(DimType, DimId);
if (FreeDimId)
if (!FreeDimId.is_null())
Map = Map.set_tuple_id(FreeDim, FreeDimId);
return Map;
}
@ -358,7 +358,7 @@ static bool containsOnlyMatMulDep(isl::map Schedule, const Dependences *D,
int &Pos) {
isl::union_map Dep = D->getDependences(Dependences::TYPE_RAW);
isl::union_map Red = D->getDependences(Dependences::TYPE_RED);
if (Red)
if (!Red.is_null())
Dep = Dep.unite(Red);
auto DomainSpace = Schedule.get_space().domain();
auto Space = DomainSpace.map_from_domain_and_range(DomainSpace);
@ -993,7 +993,7 @@ static isl::schedule_node optimizeMatMulPattern(isl::schedule_node Node,
return Node;
auto MapOldIndVar = getInductionVariablesSubstitution(Node, MicroKernelParams,
MacroKernelParams);
if (!MapOldIndVar)
if (MapOldIndVar.is_null())
return Node;
Node = markLoopVectorizerDisabled(Node.parent()).child(0);
Node = isolateAndUnrollMatMulInnerLoops(Node, MicroKernelParams);

View File

@ -495,8 +495,9 @@ ScheduleTreeOptimizer::optimizeBand(__isl_take isl_schedule_node *Node,
static_cast<const OptimizerAdditionalInfoTy *>(User);
if (PMBasedOpts && User) {
if (isl::schedule_node PatternOptimizedSchedule = tryOptimizeMatMulPattern(
isl::manage_copy(Node), OAI->TTI, OAI->D)) {
isl::schedule_node PatternOptimizedSchedule =
tryOptimizeMatMulPattern(isl::manage_copy(Node), OAI->TTI, OAI->D);
if (!PatternOptimizedSchedule.is_null()) {
MatMulOpts++;
isl_schedule_node_free(Node);
return PatternOptimizedSchedule.release();
@ -535,8 +536,9 @@ bool ScheduleTreeOptimizer::isProfitableSchedule(Scop &S,
// (e.g., #stride-one accesses)
auto NewScheduleMap = NewSchedule.get_map();
auto OldSchedule = S.getSchedule();
assert(OldSchedule && "Only IslScheduleOptimizer can insert extension nodes "
"that make Scop::getSchedule() return nullptr.");
assert(!OldSchedule.is_null() &&
"Only IslScheduleOptimizer can insert extension nodes "
"that make Scop::getSchedule() return nullptr.");
bool changed = !OldSchedule.is_equal(NewScheduleMap);
return changed;
}
@ -594,7 +596,7 @@ static void printSchedule(llvm::raw_ostream &OS, const isl::schedule &Schedule,
/// (tiling, pattern matching)
static void walkScheduleTreeForStatistics(isl::schedule Schedule, int Version) {
auto Root = Schedule.get_root();
if (!Root)
if (Root.is_null())
return;
isl_schedule_node_foreach_descendant_top_down(
@ -662,7 +664,7 @@ static bool runIslScheduleOptimizer(
if (PragmaBasedOpts) {
isl::schedule ManuallyTransformed =
applyManualTransformations(&S, Schedule);
if (!ManuallyTransformed) {
if (ManuallyTransformed.is_null()) {
LLVM_DEBUG(dbgs() << "Error during manual optimization\n");
return false;
}
@ -724,7 +726,7 @@ static bool runIslScheduleOptimizer(
isl::union_set Domain = S.getDomains();
if (!Domain)
if (Domain.is_null())
return false;
isl::union_map Validity = D.getDependences(ValidityKinds);
@ -817,7 +819,7 @@ static bool runIslScheduleOptimizer(
// In cases the scheduler is not able to optimize the code, we just do not
// touch the schedule.
if (!Schedule)
if (Schedule.is_null())
return false;
// Apply post-rescheduling optimizations.
@ -869,7 +871,7 @@ static void runScheduleOptimizerPrinter(raw_ostream &OS,
OS << "Calculated schedule:\n";
if (!LastSchedule) {
if (LastSchedule.is_null()) {
OS << "n/a\n";
return;
}

View File

@ -179,7 +179,7 @@ struct ExtensionNodeRewriter
isl::union_map Extensions;
isl::schedule Result =
visit(Schedule.get_root(), Schedule.get_domain(), Extensions);
assert(Extensions && Extensions.is_empty());
assert(!Extensions.is_null() && Extensions.is_empty());
return Result;
}
@ -643,7 +643,7 @@ isl::schedule polly::applyPartialUnroll(isl::schedule_node BandToUnroll,
findOptionalNodeOperand(Attr->Metadata, LLVMLoopUnrollFollowupUnrolled);
isl::id NewBandId = createGeneratedLoopAttr(Ctx, FollowupMD);
if (NewBandId)
if (!NewBandId.is_null())
NewLoop = insertMark(NewLoop, NewBandId);
return NewLoop.get_schedule();

View File

@ -459,7 +459,7 @@ void ZoneAlgorithm::addArrayWriteAccess(MemoryAccess *MA) {
// { Domain[] -> ValInst[] }
isl::union_map WriteValInstance = getWrittenValue(MA, AccRel);
if (!WriteValInstance)
if (WriteValInstance.is_null())
WriteValInstance = makeUnknownForDomain(Stmt);
// { Domain[] -> [Element[] -> Domain[]] }
@ -545,7 +545,7 @@ isl::union_map ZoneAlgorithm::computePerPHI(const ScopArrayInfo *SAI) {
// bail out if we do not know. This in particular applies to undefined control
// flow.
isl::set DefinedContext = S->getDefinedBehaviorContext();
if (!DefinedContext)
if (DefinedContext.is_null())
return {};
assert(SAI->isPHIKind());
@ -630,7 +630,7 @@ isl::map ZoneAlgorithm::getScatterFor(isl::set Domain) const {
auto UDomain = isl::union_set(Domain);
auto UResult = getScatterFor(std::move(UDomain));
auto Result = singleton(std::move(UResult), std::move(ResultSpace));
assert(!Result || Result.domain().is_equal(Domain) == isl_bool_true);
assert(Result.is_null() || Result.domain().is_equal(Domain) == isl_bool_true);
return Result;
}
@ -680,7 +680,7 @@ isl::map ZoneAlgorithm::getDefToTarget(ScopStmt *DefStmt,
// { DefStmt[i] -> TargetStmt[i,j] }
//
// In practice, this should cover the majority of cases.
if (!Result && S->isOriginalSchedule() &&
if (Result.is_null() && S->isOriginalSchedule() &&
isInsideLoop(DefStmt->getSurroundingLoop(),
TargetStmt->getSurroundingLoop())) {
isl::set DefDomain = getDomainFor(DefStmt);
@ -693,7 +693,7 @@ isl::map ZoneAlgorithm::getDefToTarget(ScopStmt *DefStmt,
Result = Result.equate(isl::dim::in, i, isl::dim::out, i);
}
if (!Result) {
if (Result.is_null()) {
// { DomainDef[] -> DomainTarget[] }
Result = computeUseToDefFlowDependency(TargetStmt, DefStmt).reverse();
simplify(Result);
@ -704,7 +704,7 @@ isl::map ZoneAlgorithm::getDefToTarget(ScopStmt *DefStmt,
isl::map ZoneAlgorithm::getScalarReachingDefinition(ScopStmt *Stmt) {
auto &Result = ScalarReachDefZone[Stmt];
if (Result)
if (!Result.is_null())
return Result;
auto Domain = getDomainFor(Stmt);
@ -1035,7 +1035,7 @@ void ZoneAlgorithm::computeNormalizedPHIs() {
// incoming value. Skip if we cannot determine PHI predecessors.
// { PHIDomain[] -> IncomingDomain[] }
isl::union_map PerPHI = computePerPHI(SAI);
if (!PerPHI)
if (PerPHI.is_null())
continue;
// { PHIDomain[] -> PHIValInst[] }
@ -1084,7 +1084,7 @@ void ZoneAlgorithm::computeNormalizedPHIs() {
ComputedPHIs = AllPHIs;
NormalizeMap = AllPHIMaps;
assert(!NormalizeMap || isNormalized(NormalizeMap));
assert(NormalizeMap.is_null() || isNormalized(NormalizeMap));
}
void ZoneAlgorithm::printAccesses(llvm::raw_ostream &OS, int Indent) const {

View File

@ -37,17 +37,17 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown,
isl::union_set &Undef) {
auto ParamSpace = Universe.get_space();
if (Undef && !Occupied) {
assert(!Occupied);
if (!Undef.is_null() && Occupied.is_null()) {
assert(Occupied.is_null());
Occupied = Universe.subtract(Undef);
}
if (OccupiedAndKnown) {
assert(!Known);
if (!OccupiedAndKnown.is_null()) {
assert(Known.is_null());
Known = isl::union_map::empty(ParamSpace);
if (!Occupied)
if (Occupied.is_null())
Occupied = OccupiedAndKnown.domain();
for (isl::map Map : OccupiedAndKnown.get_map_list()) {
@ -57,19 +57,19 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown,
}
}
if (!Undef) {
assert(Occupied);
if (Undef.is_null()) {
assert(!Occupied.is_null());
Undef = Universe.subtract(Occupied);
}
if (!Known) { // By default, nothing is known.
if (Known.is_null()) { // By default, nothing is known.
Known = isl::union_map::empty(ParamSpace);
}
// Conditions that must hold when returning.
assert(Occupied);
assert(Undef);
assert(Known);
assert(!Occupied.is_null());
assert(!Undef.is_null());
assert(!Known.is_null());
}
typedef struct {
@ -97,17 +97,17 @@ bool checkIsConflictingNonsymmetricCommon(
isl::union_map ProposedWritten) {
// Determine universe (set of all possible domains).
auto Universe = isl::union_set::empty(isl::space::params_alloc(Ctx, 0));
if (ExistingOccupiedAndKnown)
if (!ExistingOccupiedAndKnown.is_null())
Universe = Universe.unite(ExistingOccupiedAndKnown.domain());
if (ExistingUnused)
if (!ExistingUnused.is_null())
Universe = Universe.unite(ExistingUnused);
if (ExistingWritten)
if (!ExistingWritten.is_null())
Universe = Universe.unite(ExistingWritten.domain());
if (ProposedOccupiedAndKnown)
if (!ProposedOccupiedAndKnown.is_null())
Universe = Universe.unite(ProposedOccupiedAndKnown.domain());
if (ProposedUnused)
if (!ProposedUnused.is_null())
Universe = Universe.unite(ProposedUnused);
if (ProposedWritten)
if (!ProposedWritten.is_null())
Universe = Universe.unite(ProposedWritten.domain());
Universe = unionSpace(Universe);