[Polly][Isl] Move to the new-polly-generator branch version of isl-noexceptions.h. NFCI

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.

With this commit we are moving from the `polly-generator` branch to the `new-polly-generator` branch that is more mantainable and is based on the official C++ interface `cpp-checked.h`.

Changes made:
 - There are now many sublcasses for `isl::ast_node` representing different isl types. Use `isl::ast_node_for`, `isl::ast_node_user`, `isl::ast_node_block` and `isl::ast_node_mark` where needed.
 - There are now many sublcasses for `isl::schedule_node` representing different isl types. Use `isl::schedule_node_mark`, `isl::schedule_node_extension`, `isl::schedule_node_band` and `isl::schedule_node_filter` where needed.
 - Replace the `isl::*::dump` with `dumpIslObj` since the isl dump method is not exposed in the C++ interface.
 - `isl::schedule_node::get_child` has been renamed to `isl::schedule_node::child`
 - `isl::pw_multi_aff::get_pw_aff` has been renamed to `isl::pw_multi_aff::at`
 - The constructor `isl::union_map(isl::union_pw_multi_aff)` has been replaced with the static method `isl::union_map::from()`
 - Replace usages of `isl::val::add_ui` with `isl::val::add`
 - `isl::union_set_list::alloc` is now a constructor
 - All the `isl_size` values are now wrapped inside the class `isl::size` use `isl::size::release` to get the internal `isl_size` value where needed.
 - `isl-noexceptions.h` has been generated by 73f5ed1f4d

No functional change intended.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D107225
This commit is contained in:
Riccardo Mori 2021-08-16 15:52:24 +02:00
parent c019142a89
commit d3fdbda6b0
23 changed files with 11479 additions and 9438 deletions

View file

@ -217,7 +217,8 @@ protected:
// of loop iterations.
//
// 3. With the existing code, upper bounds have been easier to implement.
isl::ast_expr getUpperBound(isl::ast_node For, CmpInst::Predicate &Predicate);
isl::ast_expr getUpperBound(isl::ast_node_for For,
CmpInst::Predicate &Predicate);
/// Return non-negative number of iterations in case of the following form
/// of a loop and -1 otherwise.
@ -228,7 +229,7 @@ protected:
///
/// NumIter is a non-negative integer value. Condition can have
/// isl_ast_op_lt type.
int getNumberOfIterations(isl::ast_node For);
int getNumberOfIterations(isl::ast_node_for For);
/// Compute the values and loops referenced in this subtree.
///
@ -317,7 +318,7 @@ protected:
bool preloadInvariantEquivClass(InvariantEquivClassTy &IAClass);
void createForVector(__isl_take isl_ast_node *For, int VectorWidth);
void createForSequential(isl::ast_node For, bool MarkParallel);
void createForSequential(isl::ast_node_for For, bool MarkParallel);
/// Create LLVM-IR that executes a for node thread parallel.
///

View file

@ -134,7 +134,7 @@ struct RecursiveScheduleTreeVisitor
/// By default, recursively visit the child nodes.
RetTy visitNode(const isl::schedule_node &Node, Args... args) {
isl_size NumChildren = Node.n_children();
isl_size NumChildren = Node.n_children().release();
for (isl_size i = 0; i < NumChildren; i += 1)
getDerived().visit(Node.child(i), std::forward<Args>(args)...);
return RetTy();

View file

@ -186,6 +186,51 @@ ISL_OBJECT_TO_STRING(union_pw_aff)
ISL_OBJECT_TO_STRING(union_pw_multi_aff)
//@}
/// C++ wrapper for isl_*_dump() functions.
//@{
#define ISL_DUMP_OBJECT(name) \
inline void dumpIslObj(const isl::name &Obj) { isl_##name##_dump(Obj.get()); }
ISL_DUMP_OBJECT(aff)
ISL_DUMP_OBJECT(aff_list)
ISL_DUMP_OBJECT(ast_expr)
ISL_DUMP_OBJECT(ast_node)
ISL_DUMP_OBJECT(ast_node_list)
ISL_DUMP_OBJECT(basic_map)
ISL_DUMP_OBJECT(basic_map_list)
ISL_DUMP_OBJECT(basic_set)
ISL_DUMP_OBJECT(basic_set_list)
ISL_DUMP_OBJECT(constraint)
ISL_DUMP_OBJECT(id)
ISL_DUMP_OBJECT(id_list)
ISL_DUMP_OBJECT(id_to_ast_expr)
ISL_DUMP_OBJECT(local_space)
ISL_DUMP_OBJECT(map)
ISL_DUMP_OBJECT(map_list)
ISL_DUMP_OBJECT(multi_aff)
ISL_DUMP_OBJECT(multi_pw_aff)
ISL_DUMP_OBJECT(multi_union_pw_aff)
ISL_DUMP_OBJECT(multi_val)
ISL_DUMP_OBJECT(point)
ISL_DUMP_OBJECT(pw_aff)
ISL_DUMP_OBJECT(pw_aff_list)
ISL_DUMP_OBJECT(pw_multi_aff)
ISL_DUMP_OBJECT(schedule)
ISL_DUMP_OBJECT(schedule_constraints)
ISL_DUMP_OBJECT(schedule_node)
ISL_DUMP_OBJECT(set)
ISL_DUMP_OBJECT(set_list)
ISL_DUMP_OBJECT(space)
ISL_DUMP_OBJECT(union_map)
ISL_DUMP_OBJECT(union_pw_aff)
ISL_DUMP_OBJECT(union_pw_aff_list)
ISL_DUMP_OBJECT(union_pw_multi_aff)
ISL_DUMP_OBJECT(union_set)
ISL_DUMP_OBJECT(union_set_list)
ISL_DUMP_OBJECT(val)
ISL_DUMP_OBJECT(val_list)
//@}
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
__isl_keep isl_union_map *Map) {
OS << polly::stringFromIslObj(Map, "null");

View file

@ -32,7 +32,7 @@ struct isl_iterator
using ElementT = list_element_type<ListT>;
explicit isl_iterator(const ListT &List)
: List(&List), Position(std::max(List.size(), 0)) {}
: List(&List), Position(std::max(List.size().release(), 0)) {}
isl_iterator(const ListT &List, int Position)
: List(&List), Position(Position) {}

View file

@ -190,7 +190,7 @@ static void collectInfo(Scop &S, isl_union_map *&Read,
/// Fix all dimension of @p Zero to 0 and add it to @p user
static void fixSetToZero(isl::set Zero, isl::union_set *User) {
for (auto i : seq<isl_size>(0, Zero.tuple_dim()))
for (auto i : seq<isl_size>(0, Zero.tuple_dim().release()))
Zero = Zero.fix_si(isl::dim::set, i, 0);
*User = User->unite(Zero);
}
@ -667,7 +667,7 @@ bool Dependences::isValidSchedule(
Dependences = Dependences.apply_range(Schedule);
isl::set Zero = isl::set::universe(ScheduleSpace);
for (auto i : seq<isl_size>(0, Zero.tuple_dim()))
for (auto i : seq<isl_size>(0, Zero.tuple_dim().release()))
Zero = Zero.fix_si(isl::dim::set, i, 0);
isl::union_set UDeltas = Dependences.deltas();

View file

@ -202,7 +202,7 @@ static bool containsErrorBlock(RegionNode *RN, const Region &R, LoopInfo &LI,
static isl::map createNextIterationMap(isl::space SetSpace, unsigned Dim) {
isl::space MapSpace = SetSpace.map_from_set();
isl::map NextIterationMap = isl::map::universe(MapSpace);
for (auto u : seq<isl_size>(0, NextIterationMap.domain_tuple_dim()))
for (auto u : seq<isl_size>(0, NextIterationMap.domain_tuple_dim().release()))
if (u != (isl_size)Dim)
NextIterationMap =
NextIterationMap.equate(isl::dim::in, u, isl::dim::out, u);
@ -230,10 +230,10 @@ static isl::set collectBoundedParts(isl::set S) {
/// both with regards to the dimension @p Dim.
static std::pair<isl::set, isl::set> partitionSetParts(isl::set S,
unsigned Dim) {
for (unsigned u = 0, e = S.tuple_dim(); u < e; u++)
for (unsigned u = 0, e = S.tuple_dim().release(); u < e; u++)
S = S.lower_bound_si(isl::dim::set, u, 0);
unsigned NumDimsS = S.tuple_dim();
unsigned NumDimsS = S.tuple_dim().release();
isl::set OnlyDimS = S;
// Remove dimensions that are greater than Dim as they are not interesting.
@ -328,7 +328,7 @@ isl::set ScopBuilder::adjustDomainDimensions(isl::set Dom, Loop *OldL,
} else {
assert(OldDepth > NewDepth);
int Diff = OldDepth - NewDepth;
int NumDim = Dom.tuple_dim();
int NumDim = Dom.tuple_dim().release();
assert(NumDim >= Diff);
Dom = Dom.project_out(isl::dim::set, NumDim - Diff, Diff);
}
@ -838,7 +838,7 @@ bool ScopBuilder::buildDomains(
isl_set_universe(isl_space_set_alloc(scop->getIslCtx().get(), 0, LD + 1));
InvalidDomainMap[EntryBB] = isl::manage(isl_set_empty(isl_set_get_space(S)));
isl::noexceptions::set Domain = isl::manage(S);
isl::set Domain = isl::manage(S);
scop->setDomain(EntryBB, Domain);
if (IsOnlyNonAffineRegion)
@ -909,7 +909,7 @@ bool ScopBuilder::buildDomainsWithBranchConstraints(
continue;
isl::set Domain = scop->getDomainConditions(BB);
scop->updateMaxLoopDepth(Domain.tuple_dim());
scop->updateMaxLoopDepth(Domain.tuple_dim().release());
auto *BBLoop = getRegionNodeLoop(RN, LI);
// Propagate the domain from BB directly to blocks that have a superset
@ -983,7 +983,7 @@ bool ScopBuilder::buildDomainsWithBranchConstraints(
// Check if the maximal number of domain disjunctions was reached.
// In case this happens we will clean up and bail.
if (SuccDomain.n_basic_set() < MaxDisjunctsInDomain)
if (SuccDomain.n_basic_set().release() < MaxDisjunctsInDomain)
continue;
scop->invalidate(COMPLEXITY, DebugLoc());
@ -1063,7 +1063,7 @@ bool ScopBuilder::propagateInvalidStmtDomains(
// Check if the maximal number of domain disjunctions was reached.
// In case this happens we will bail.
if (SuccInvalidDomain.n_basic_set() < MaxDisjunctsInDomain)
if (SuccInvalidDomain.n_basic_set().release() < MaxDisjunctsInDomain)
continue;
InvalidDomainMap.erase(BB);
@ -1162,7 +1162,7 @@ static isl::multi_union_pw_aff mapToDimension(isl::union_set USet, int N) {
auto Result = isl::union_pw_multi_aff::empty(USet.get_space());
for (isl::set S : USet.get_set_list()) {
int Dim = S.tuple_dim();
int Dim = S.tuple_dim().release();
auto PMA = isl::pw_multi_aff::project_out_map(S.get_space(), isl::dim::set,
N, Dim - N);
if (N > 1)
@ -1307,10 +1307,8 @@ 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.is_null())
Schedule = Schedule.get_root()
.get_child(0)
.insert_mark(IslLoopId)
.get_schedule();
Schedule =
Schedule.get_root().child(0).insert_mark(IslLoopId).get_schedule();
LoopData->Schedule = combineInSequence(LoopData->Schedule, Schedule);
}
@ -2405,7 +2403,7 @@ void ScopBuilder::foldSizeConstantsToRight() {
isl::map Transform = isl::map::universe(Array->getSpace().map_from_set());
std::vector<int> Int;
int Dims = Elements.tuple_dim();
int Dims = Elements.tuple_dim().release();
for (int i = 0; i < Dims; i++) {
isl::set DimOnly = isl::set(Elements).project_out(isl::dim::set, 0, i);
DimOnly = DimOnly.project_out(isl::dim::set, 1, Dims - i - 1);
@ -2419,7 +2417,7 @@ void ScopBuilder::foldSizeConstantsToRight() {
continue;
}
if (DimHull.dim(isl::dim::div) == 1) {
if (DimHull.dim(isl::dim::div).release() == 1) {
isl::aff Diff = DimHull.get_div(0);
isl::val Val = Diff.get_denominator_val();
@ -2839,8 +2837,8 @@ static bool isAccessRangeTooComplex(isl::set AccessRange) {
int NumTotalDims = 0;
for (isl::basic_set BSet : AccessRange.get_basic_set_list()) {
NumTotalDims += BSet.dim(isl::dim::div);
NumTotalDims += BSet.dim(isl::dim::set);
NumTotalDims += BSet.dim(isl::dim::div).release();
NumTotalDims += BSet.dim(isl::dim::set).release();
}
if (NumTotalDims > MaxDimensionsInAccessRange)
@ -2869,7 +2867,8 @@ void ScopBuilder::addUserContext() {
isl::set UserContext = isl::set(scop->getIslCtx(), UserContextStr.c_str());
isl::space Space = scop->getParamSpace();
if (Space.dim(isl::dim::param) != UserContext.dim(isl::dim::param)) {
if (Space.dim(isl::dim::param).release() !=
UserContext.dim(isl::dim::param).release()) {
std::string SpaceStr = stringFromIslObj(Space, "null");
errs() << "Error: the context provided in -polly-context has not the same "
<< "number of dimensions than the computed context. Due to this "
@ -2878,7 +2877,7 @@ void ScopBuilder::addUserContext() {
return;
}
for (auto i : seq<isl_size>(0, Space.dim(isl::dim::param))) {
for (auto i : seq<isl_size>(0, Space.dim(isl::dim::param).release())) {
std::string NameContext =
scop->getContext().get_dim_name(isl::dim::param, i);
std::string NameUserContext = UserContext.get_dim_name(isl::dim::param, i);
@ -2962,7 +2961,7 @@ isl::set ScopBuilder::getNonHoistableCtx(MemoryAccess *Access,
return WrittenCtx;
WrittenCtx = WrittenCtx.remove_divs();
bool TooComplex = WrittenCtx.n_basic_set() >= MaxDisjunctsInDomain;
bool TooComplex = WrittenCtx.n_basic_set().release() >= MaxDisjunctsInDomain;
if (TooComplex || !isRequiredInvariantLoad(LI))
return {};
@ -3028,7 +3027,7 @@ void ScopBuilder::addInvariantLoads(ScopStmt &Stmt,
isl::set DomainCtx = Stmt.getDomain().params();
DomainCtx = DomainCtx.subtract(StmtInvalidCtx);
if (DomainCtx.n_basic_set() >= MaxDisjunctsInDomain) {
if (DomainCtx.n_basic_set().release() >= MaxDisjunctsInDomain) {
auto *AccInst = InvMAs.front().MA->getAccessInstruction();
scop->invalidate(COMPLEXITY, AccInst->getDebugLoc(), AccInst->getParent());
return;
@ -3304,7 +3303,7 @@ static bool buildMinMaxAccess(isl::set Set,
Set = Set.remove_divs();
polly::simplify(Set);
if (Set.n_basic_set() > RunTimeChecksMaxAccessDisjuncts)
if (Set.n_basic_set().release() > RunTimeChecksMaxAccessDisjuncts)
Set = Set.simple_hull();
// Restrict the number of parameters involved in the access as the lexmin/
@ -3342,11 +3341,11 @@ 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.is_null() || MaxPMA.dim(isl::dim::out)) &&
assert((MaxPMA.is_null() || MaxPMA.dim(isl::dim::out).release()) &&
"Assumed at least one output dimension");
Pos = MaxPMA.dim(isl::dim::out) - 1;
LastDimAff = MaxPMA.get_pw_aff(Pos);
Pos = MaxPMA.dim(isl::dim::out).release() - 1;
LastDimAff = MaxPMA.at(Pos);
OneAff = isl::aff(isl::local_space(LastDimAff.get_domain_space()));
OneAff = OneAff.add_constant_si(1);
LastDimAff = LastDimAff.add(OneAff);
@ -3386,7 +3385,7 @@ bool ScopBuilder::calculateMinMaxAccess(AliasGroupTy AliasGroup,
static isl::set getAccessDomain(MemoryAccess *MA) {
isl::set Domain = MA->getStatement()->getDomain();
Domain = Domain.project_out(isl::dim::set, 0, Domain.tuple_dim());
Domain = Domain.project_out(isl::dim::set, 0, Domain.tuple_dim().release());
return Domain.reset_tuple_id();
}

View file

@ -185,7 +185,7 @@ static isl::set addRangeBoundsToSet(isl::set S, const ConstantRange &Range,
if (Range.isFullSet())
return S;
if (S.n_basic_set() > MaxDisjunctsInContext)
if (S.n_basic_set().release() > MaxDisjunctsInContext)
return S;
// In case of signed wrapping, we can refine the set of valid values by
@ -473,8 +473,8 @@ void MemoryAccess::updateDimensionality() {
isl::space AccessSpace = AccessRelation.get_space().range();
isl::ctx Ctx = ArraySpace.ctx();
auto DimsArray = ArraySpace.dim(isl::dim::set);
auto DimsAccess = AccessSpace.dim(isl::dim::set);
auto DimsArray = ArraySpace.dim(isl::dim::set).release();
auto DimsAccess = AccessSpace.dim(isl::dim::set).release();
auto DimsMissing = DimsArray - DimsAccess;
auto *BB = getStatement()->getEntryBlock();
@ -671,14 +671,14 @@ isl::set MemoryAccess::assumeNoOutOfBound() {
auto *SAI = getScopArrayInfo();
isl::space Space = getOriginalAccessRelationSpace().range();
isl::set Outside = isl::set::empty(Space);
for (int i = 1, Size = Space.dim(isl::dim::set); i < Size; ++i) {
for (int i = 1, Size = Space.dim(isl::dim::set).release(); i < Size; ++i) {
isl::local_space LS(Space);
isl::pw_aff Var = isl::pw_aff::var_on_domain(LS, isl::dim::set, i);
isl::pw_aff Zero = isl::pw_aff(LS);
isl::set DimOutside = Var.lt_set(Zero);
isl::pw_aff SizeE = SAI->getDimensionSizePw(i);
SizeE = SizeE.add_dims(isl::dim::in, Space.dim(isl::dim::set));
SizeE = SizeE.add_dims(isl::dim::in, Space.dim(isl::dim::set).release());
SizeE = SizeE.set_tuple_id(isl::dim::in, Space.get_tuple_id(isl::dim::set));
DimOutside = DimOutside.unite(SizeE.le_set(Var));
@ -830,8 +830,8 @@ void MemoryAccess::foldAccessRelation() {
// Access dimension folding might in certain cases increase the number of
// disjuncts in the memory access, which can possibly complicate the generated
// run-time checks and can lead to costly compilation.
if (!PollyPreciseFoldAccesses &&
NewAccessRelation.n_basic_map() > AccessRelation.n_basic_map()) {
if (!PollyPreciseFoldAccesses && NewAccessRelation.n_basic_map().release() >
AccessRelation.n_basic_map().release()) {
} else {
AccessRelation = NewAccessRelation;
}
@ -1006,7 +1006,7 @@ isl::pw_aff MemoryAccess::getPwAff(const SCEV *E) {
static isl::map getEqualAndLarger(isl::space SetDomain) {
isl::space Space = SetDomain.map_from_set();
isl::map Map = isl::map::universe(Space);
unsigned lastDimension = Map.domain_tuple_dim() - 1;
unsigned lastDimension = Map.domain_tuple_dim().release() - 1;
// Set all but the last dimension to be equal for the input and output
//
@ -1046,9 +1046,10 @@ bool MemoryAccess::isStrideX(isl::map Schedule, int StrideWidth) const {
Stride = getStride(Schedule);
StrideX = isl::set::universe(Stride.get_space());
for (auto i : seq<isl_size>(0, StrideX.tuple_dim() - 1))
for (auto i : seq<isl_size>(0, StrideX.tuple_dim().release() - 1))
StrideX = StrideX.fix_si(isl::dim::set, i, 0);
StrideX = StrideX.fix_si(isl::dim::set, StrideX.tuple_dim() - 1, StrideWidth);
StrideX = StrideX.fix_si(isl::dim::set, StrideX.tuple_dim().release() - 1,
StrideWidth);
IsStrideX = Stride.is_subset(StrideX);
return IsStrideX;
@ -1108,7 +1109,7 @@ void MemoryAccess::setNewAccessRelation(isl::map NewAccess) {
// Check whether access dimensions correspond to number of dimensions of the
// accesses array.
isl_size Dims = SAI->getNumberOfDimensions();
assert(NewAccessSpace.dim(isl::dim::set) == Dims &&
assert(NewAccessSpace.dim(isl::dim::set).release() == Dims &&
"Access dims must match array dims");
#endif
@ -2143,10 +2144,10 @@ void Scop::intersectDefinedBehavior(isl::set Set, AssumptionSign Sign) {
// Limit the complexity of the context. If complexity is exceeded, simplify
// the set and check again.
if (DefinedBehaviorContext.n_basic_set() >
if (DefinedBehaviorContext.n_basic_set().release() >
MaxDisjunktsInDefinedBehaviourContext) {
simplify(DefinedBehaviorContext);
if (DefinedBehaviorContext.n_basic_set() >
if (DefinedBehaviorContext.n_basic_set().release() >
MaxDisjunktsInDefinedBehaviourContext)
DefinedBehaviorContext = {};
}

View file

@ -688,13 +688,12 @@ void BlockGenerator::generateBeginStmtTrace(ScopStmt &Stmt, LoopToScevMapT &LTS,
Values.push_back(RuntimeDebugBuilder::getPrintableString(Builder, "("));
// Add the coordinate of the statement instance.
int DomDims = ScheduleMultiPwAff.dim(isl::dim::out);
int DomDims = ScheduleMultiPwAff.dim(isl::dim::out).release();
for (int i = 0; i < DomDims; i += 1) {
if (i > 0)
Values.push_back(RuntimeDebugBuilder::getPrintableString(Builder, ","));
isl::ast_expr IsInSet =
RestrictedBuild.expr_from(ScheduleMultiPwAff.get_pw_aff(i));
isl::ast_expr IsInSet = RestrictedBuild.expr_from(ScheduleMultiPwAff.at(i));
Values.push_back(ExprBuilder->create(IsInSet.copy()));
}

View file

@ -678,8 +678,8 @@ static __isl_give isl_printer *cbPrintUser(__isl_take isl_printer *P,
__isl_take isl_ast_print_options *O,
__isl_keep isl_ast_node *Node,
void *User) {
isl::ast_node AstNode = isl::manage_copy(Node);
isl::ast_expr NodeExpr = AstNode.user_get_expr();
isl::ast_node_user AstNode = isl::manage_copy(Node).as<isl::ast_node_user>();
isl::ast_expr NodeExpr = AstNode.expr();
isl::ast_expr CallExpr = NodeExpr.get_op_arg(0);
isl::id CallExprId = CallExpr.get_id();
ScopStmt *AccessStmt = (ScopStmt *)CallExprId.get_user();

View file

@ -107,10 +107,10 @@ static cl::opt<OpenMPBackend> PollyOmpBackend(
clEnumValN(OpenMPBackend::LLVM, "LLVM", "LLVM OpenMP")),
cl::Hidden, cl::init(OpenMPBackend::GNU), cl::cat(PollyCategory));
isl::ast_expr IslNodeBuilder::getUpperBound(isl::ast_node For,
isl::ast_expr IslNodeBuilder::getUpperBound(isl::ast_node_for For,
ICmpInst::Predicate &Predicate) {
isl::ast_expr Cond = For.for_get_cond();
isl::ast_expr Iterator = For.for_get_iterator();
isl::ast_expr Cond = For.cond();
isl::ast_expr Iterator = For.iterator();
assert(isl_ast_expr_get_type(Cond.get()) == isl_ast_expr_op &&
"conditional expression is not an atomic upper bound");
@ -163,16 +163,17 @@ static bool checkIslAstExprInt(__isl_take isl_ast_expr *Expr,
return true;
}
int IslNodeBuilder::getNumberOfIterations(isl::ast_node For) {
int IslNodeBuilder::getNumberOfIterations(isl::ast_node_for For) {
assert(isl_ast_node_get_type(For.get()) == isl_ast_node_for);
isl::ast_node Body = For.for_get_body();
isl::ast_node Body = For.body();
// First, check if we can actually handle this code.
switch (isl_ast_node_get_type(Body.get())) {
case isl_ast_node_user:
break;
case isl_ast_node_block: {
isl::ast_node_list List = Body.block_get_children();
isl::ast_node_block BodyBlock = Body.as<isl::ast_node_block>();
isl::ast_node_list List = BodyBlock.children();
for (isl::ast_node Node : List) {
isl_ast_node_type NodeType = isl_ast_node_get_type(Node.get());
if (NodeType != isl_ast_node_user)
@ -184,10 +185,10 @@ int IslNodeBuilder::getNumberOfIterations(isl::ast_node For) {
return -1;
}
isl::ast_expr Init = For.for_get_init();
isl::ast_expr Init = For.init();
if (!checkIslAstExprInt(Init.release(), isl_val_is_zero))
return -1;
isl::ast_expr Inc = For.for_get_inc();
isl::ast_expr Inc = For.inc();
if (!checkIslAstExprInt(Inc.release(), isl_val_is_one))
return -1;
CmpInst::Predicate Predicate;
@ -413,11 +414,12 @@ void IslNodeBuilder::createMark(__isl_take isl_ast_node *Node) {
if (strcmp(isl_id_get_name(Id), "SIMD") == 0 &&
isl_ast_node_get_type(Child) == isl_ast_node_for) {
bool Vector = PollyVectorizerChoice == VECTORIZER_POLLY;
int VectorWidth = getNumberOfIterations(isl::manage_copy(Child));
int VectorWidth =
getNumberOfIterations(isl::manage_copy(Child).as<isl::ast_node_for>());
if (Vector && 1 < VectorWidth && VectorWidth <= 16)
createForVector(Child, VectorWidth);
else
createForSequential(isl::manage(Child), true);
createForSequential(isl::manage(Child).as<isl::ast_node_for>(), true);
isl_id_free(Id);
return;
}
@ -518,18 +520,21 @@ void IslNodeBuilder::createForVector(__isl_take isl_ast_node *For,
///
/// @param Node The band node to be modified.
/// @return The modified schedule node.
static bool IsLoopVectorizerDisabled(isl::ast_node Node) {
static bool IsLoopVectorizerDisabled(isl::ast_node_for Node) {
assert(isl_ast_node_get_type(Node.get()) == isl_ast_node_for);
auto Body = Node.for_get_body();
isl::ast_node Body = Node.body();
if (isl_ast_node_get_type(Body.get()) != isl_ast_node_mark)
return false;
auto Id = Body.mark_get_id();
isl::ast_node_mark BodyMark = Body.as<isl::ast_node_mark>();
auto Id = BodyMark.id();
if (strcmp(Id.get_name().c_str(), "Loop Vectorizer Disabled") == 0)
return true;
return false;
}
void IslNodeBuilder::createForSequential(isl::ast_node For, bool MarkParallel) {
void IslNodeBuilder::createForSequential(isl::ast_node_for For,
bool MarkParallel) {
Value *ValueLB, *ValueUB, *ValueInc;
Type *MaxType;
BasicBlock *ExitBlock;
@ -538,7 +543,7 @@ void IslNodeBuilder::createForSequential(isl::ast_node For, bool MarkParallel) {
bool LoopVectorizerDisabled = IsLoopVectorizerDisabled(For);
isl::ast_node Body = For.for_get_body();
isl::ast_node Body = For.body();
// isl_ast_node_for_is_degenerate(For)
//
@ -546,9 +551,9 @@ void IslNodeBuilder::createForSequential(isl::ast_node For, bool MarkParallel) {
// However, for now we just reuse the logic for normal loops, which will
// create a loop with a single iteration.
isl::ast_expr Init = For.for_get_init();
isl::ast_expr Inc = For.for_get_inc();
isl::ast_expr Iterator = For.for_get_iterator();
isl::ast_expr Init = For.init();
isl::ast_expr Inc = For.inc();
isl::ast_expr Iterator = For.iterator();
isl::id IteratorID = Iterator.get_id();
isl::ast_expr UB = getUpperBound(For, Predicate);
@ -654,7 +659,8 @@ void IslNodeBuilder::createForParallel(__isl_take isl_ast_node *For) {
Inc = isl_ast_node_for_get_inc(For);
Iterator = isl_ast_node_for_get_iterator(For);
IteratorID = isl_ast_expr_get_id(Iterator);
UB = getUpperBound(isl::manage_copy(For), Predicate).release();
UB = getUpperBound(isl::manage_copy(For).as<isl::ast_node_for>(), Predicate)
.release();
ValueLB = ExprBuilder.create(Init);
ValueUB = ExprBuilder.create(UB);
@ -782,7 +788,8 @@ void IslNodeBuilder::createFor(__isl_take isl_ast_node *For) {
if (Vector && IslAstInfo::isInnermostParallel(isl::manage_copy(For)) &&
!IslAstInfo::isReductionParallel(isl::manage_copy(For))) {
int VectorWidth = getNumberOfIterations(isl::manage_copy(For));
int VectorWidth =
getNumberOfIterations(isl::manage_copy(For).as<isl::ast_node_for>());
if (1 < VectorWidth && VectorWidth <= 16 && !hasPartialAccesses(For)) {
createForVector(For, VectorWidth);
return;
@ -795,7 +802,7 @@ void IslNodeBuilder::createFor(__isl_take isl_ast_node *For) {
}
bool Parallel = (IslAstInfo::isParallel(isl::manage_copy(For)) &&
!IslAstInfo::isReductionParallel(isl::manage_copy(For)));
createForSequential(isl::manage(For), Parallel);
createForSequential(isl::manage(For).as<isl::ast_node_for>(), Parallel);
}
void IslNodeBuilder::createIf(__isl_take isl_ast_node *If) {

View file

@ -1124,11 +1124,11 @@ Value *GPUNodeBuilder::getArraySize(gpu_array_info *Array) {
if (!gpu_array_is_scalar(Array)) {
isl::multi_pw_aff ArrayBound = isl::manage_copy(Array->bound);
isl::pw_aff OffsetDimZero = ArrayBound.get_pw_aff(0);
isl::pw_aff OffsetDimZero = ArrayBound.at(0);
isl::ast_expr Res = Build.expr_from(OffsetDimZero);
for (unsigned int i = 1; i < Array->n_index; i++) {
isl::pw_aff Bound_I = ArrayBound.get_pw_aff(i);
isl::pw_aff Bound_I = ArrayBound.at(i);
isl::ast_expr Expr = Build.expr_from(Bound_I);
Res = Res.mul(Expr);
}
@ -1151,7 +1151,7 @@ Value *GPUNodeBuilder::getArrayOffset(gpu_array_info *Array) {
isl::set ZeroSet = isl::set::universe(Min.get_space());
for (long i = 0, n = Min.tuple_dim(); i < n; i++)
for (long i = 0, n = Min.tuple_dim().release(); i < n; i++)
ZeroSet = ZeroSet.fix_si(isl::dim::set, i, 0);
if (Min.is_subset(ZeroSet)) {
@ -1160,7 +1160,7 @@ Value *GPUNodeBuilder::getArrayOffset(gpu_array_info *Array) {
isl::ast_expr Result = isl::ast_expr::from_val(isl::val(Min.ctx(), 0));
for (long i = 0, n = Min.tuple_dim(); i < n; i++) {
for (long i = 0, n = Min.tuple_dim().release(); i < n; i++) {
if (i > 0) {
isl::pw_aff Bound_I =
isl::manage(isl_multi_pw_aff_get_pw_aff(Array->bound, i - 1));
@ -1307,7 +1307,7 @@ void GPUNodeBuilder::createUser(__isl_take isl_ast_node *UserStmt) {
}
void GPUNodeBuilder::createFor(__isl_take isl_ast_node *Node) {
createForSequential(isl::manage(Node), false);
createForSequential(isl::manage(Node).as<isl::ast_node_for>(), false);
}
void GPUNodeBuilder::createKernelCopy(ppcg_kernel_stmt *KernelStmt) {
@ -1596,7 +1596,7 @@ std::tuple<Value *, Value *> GPUNodeBuilder::getGridSizes(ppcg_kernel *Kernel) {
isl::multi_pw_aff GridSizePwAffs = isl::manage_copy(Kernel->grid_size);
for (long i = 0; i < Kernel->n_grid; i++) {
isl::pw_aff Size = GridSizePwAffs.get_pw_aff(i);
isl::pw_aff Size = GridSizePwAffs.at(i);
isl::ast_expr GridSize = Context.expr_from(Size);
Value *Res = ExprBuilder.create(GridSize.release());
Res = Builder.CreateTrunc(Res, Builder.getInt32Ty());
@ -2885,8 +2885,8 @@ public:
isl::pw_aff Val = isl::aff::var_on_domain(LS, isl::dim::set, 0);
isl::pw_aff OuterMin = AccessSet.dim_min(0);
isl::pw_aff OuterMax = AccessSet.dim_max(0);
OuterMin = OuterMin.add_dims(isl::dim::in, Val.dim(isl::dim::in));
OuterMax = OuterMax.add_dims(isl::dim::in, Val.dim(isl::dim::in));
OuterMin = OuterMin.add_dims(isl::dim::in, Val.dim(isl::dim::in).release());
OuterMax = OuterMax.add_dims(isl::dim::in, Val.dim(isl::dim::in).release());
OuterMin = OuterMin.set_tuple_id(isl::dim::in, Array->getBasePtrId());
OuterMax = OuterMax.set_tuple_id(isl::dim::in, Array->getBasePtrId());
@ -2910,7 +2910,7 @@ public:
isl::pw_aff Val = isl::aff::var_on_domain(
isl::local_space(Array->getSpace()), isl::dim::set, i);
PwAff = PwAff.add_dims(isl::dim::in, Val.dim(isl::dim::in));
PwAff = PwAff.add_dims(isl::dim::in, Val.dim(isl::dim::in).release());
PwAff = PwAff.set_tuple_id(isl::dim::in, Val.get_tuple_id(isl::dim::in));
isl::set Set = PwAff.gt_set(Val);
Extent = Set.intersect(Extent);

View file

@ -230,8 +230,8 @@ static bool importContext(Scop &S, const json::Object &JScop) {
return false;
}
unsigned OldContextDim = OldContext.dim(isl::dim::param);
unsigned NewContextDim = NewContext.dim(isl::dim::param);
unsigned OldContextDim = OldContext.dim(isl::dim::param).release();
unsigned NewContextDim = NewContext.dim(isl::dim::param).release();
// Check if the imported context has the right number of parameters.
if (OldContextDim != NewContextDim) {

File diff suppressed because it is too large Load diff

View file

@ -199,49 +199,43 @@ std::string polly::getIslCompatibleName(const std::string &Prefix,
/// not know that it is never called, and therefore must ensure the existence of
/// the dump functions.
void neverCalled() {
isl::aff().dump();
isl::aff_list().dump();
isl::ast_expr().dump();
isl::ast_expr_list().dump();
isl::ast_node().dump();
isl::ast_node_list().dump();
isl::basic_map().dump();
isl::basic_map_list().dump();
isl::basic_set().dump();
isl::basic_set_list().dump();
isl::constraint().dump();
isl::constraint_list().dump();
isl::id().dump();
isl::id_list().dump();
isl::id_to_ast_expr().dump();
isl::local_space().dump();
isl::map().dump();
isl::map_list().dump();
isl::multi_aff().dump();
isl::multi_pw_aff().dump();
isl::multi_union_pw_aff().dump();
isl::multi_val().dump();
isl::point().dump();
isl::pw_aff().dump();
isl::pw_aff_list().dump();
isl::pw_multi_aff().dump();
isl::pw_qpolynomial().dump();
isl::qpolynomial().dump();
isl::schedule().dump();
isl::schedule_constraints().dump();
isl::schedule_node().dump();
isl::set().dump();
isl::set_list().dump();
isl::space().dump();
isl::union_map().dump();
isl::union_map_list().dump();
isl::union_pw_aff().dump();
isl::union_pw_aff_list().dump();
isl::union_pw_multi_aff().dump();
isl::union_pw_multi_aff_list().dump();
isl::union_set().dump();
isl::union_set_list().dump();
isl::val().dump();
isl::val_list().dump();
polly::dumpIslObj(isl::aff());
polly::dumpIslObj(isl::aff_list());
polly::dumpIslObj(isl::ast_expr());
polly::dumpIslObj(isl::ast_node());
polly::dumpIslObj(isl::ast_node_list());
polly::dumpIslObj(isl::basic_map());
polly::dumpIslObj(isl::basic_map_list());
polly::dumpIslObj(isl::basic_set());
polly::dumpIslObj(isl::basic_set_list());
polly::dumpIslObj(isl::constraint());
polly::dumpIslObj(isl::id());
polly::dumpIslObj(isl::id_list());
polly::dumpIslObj(isl::id_to_ast_expr());
polly::dumpIslObj(isl::local_space());
polly::dumpIslObj(isl::map());
polly::dumpIslObj(isl::map_list());
polly::dumpIslObj(isl::multi_aff());
polly::dumpIslObj(isl::multi_pw_aff());
polly::dumpIslObj(isl::multi_union_pw_aff());
polly::dumpIslObj(isl::multi_val());
polly::dumpIslObj(isl::point());
polly::dumpIslObj(isl::pw_aff());
polly::dumpIslObj(isl::pw_aff_list());
polly::dumpIslObj(isl::pw_multi_aff());
polly::dumpIslObj(isl::schedule());
polly::dumpIslObj(isl::schedule_constraints());
polly::dumpIslObj(isl::schedule_node());
polly::dumpIslObj(isl::set());
polly::dumpIslObj(isl::set_list());
polly::dumpIslObj(isl::space());
polly::dumpIslObj(isl::union_map());
polly::dumpIslObj(isl::union_pw_aff());
polly::dumpIslObj(isl::union_pw_aff_list());
polly::dumpIslObj(isl::union_pw_multi_aff());
polly::dumpIslObj(isl::union_set());
polly::dumpIslObj(isl::union_set_list());
polly::dumpIslObj(isl::val());
polly::dumpIslObj(isl::val_list());
}
#endif

View file

@ -36,7 +36,7 @@ isl::multi_aff makeShiftDimAff(isl::space Space, int Pos, int Amount) {
auto Identity = isl::multi_aff::identity(Space);
if (Amount == 0)
return Identity;
auto ShiftAff = Identity.get_aff(Pos);
auto ShiftAff = Identity.at(Pos);
ShiftAff = ShiftAff.set_constant_si(Amount);
return Identity.set_aff(Pos, ShiftAff);
}
@ -56,8 +56,8 @@ isl::basic_map makeTupleSwapBasicMap(isl::space FromSpace1,
assert(FromSpace1.is_set());
assert(FromSpace2.is_set());
unsigned Dims1 = FromSpace1.dim(isl::dim::set);
unsigned Dims2 = FromSpace2.dim(isl::dim::set);
unsigned Dims1 = FromSpace1.dim(isl::dim::set).release();
unsigned Dims2 = FromSpace2.dim(isl::dim::set).release();
isl::space FromSpace =
FromSpace1.map_from_domain_and_range(FromSpace2).wrap();
@ -166,7 +166,7 @@ isl_size polly::getNumScatterDims(const isl::union_map &Schedule) {
if (Map.is_null())
continue;
Dims = std::max(Dims, Map.range_tuple_dim());
Dims = std::max(Dims, Map.range_tuple_dim().release());
}
return Dims;
}
@ -214,7 +214,7 @@ isl::union_map polly::reverseDomain(const isl::union_map &UMap) {
}
isl::set polly::shiftDim(isl::set Set, int Pos, int Amount) {
int NumDims = Set.tuple_dim();
int NumDims = Set.tuple_dim().release();
if (Pos < 0)
Pos = NumDims + Pos;
assert(Pos < NumDims && "Dimension index must be in range");
@ -235,7 +235,7 @@ isl::union_set polly::shiftDim(isl::union_set USet, int Pos, int Amount) {
}
isl::map polly::shiftDim(isl::map Map, isl::dim Dim, int Pos, int Amount) {
int NumDims = Map.dim(Dim);
int NumDims = Map.dim(Dim).release();
if (Pos < 0)
Pos = NumDims + Pos;
assert(Pos < NumDims && "Dimension index must be in range");
@ -449,16 +449,16 @@ isl::map polly::distributeDomain(isl::map Map) {
isl::space DomainSpace = Space.domain();
if (DomainSpace.is_null())
return {};
unsigned DomainDims = DomainSpace.dim(isl::dim::set);
unsigned DomainDims = DomainSpace.dim(isl::dim::set).release();
isl::space RangeSpace = Space.range().unwrap();
isl::space Range1Space = RangeSpace.domain();
if (Range1Space.is_null())
return {};
unsigned Range1Dims = Range1Space.dim(isl::dim::set);
unsigned Range1Dims = Range1Space.dim(isl::dim::set).release();
isl::space Range2Space = RangeSpace.range();
if (Range2Space.is_null())
return {};
unsigned Range2Dims = Range2Space.dim(isl::dim::set);
unsigned Range2Dims = Range2Space.dim(isl::dim::set).release();
isl::space OutputSpace =
DomainSpace.map_from_domain_and_range(Range1Space)
@ -606,17 +606,17 @@ static int flatCompare(const isl::basic_set &A, const isl::basic_set &B) {
if (A.is_null() || B.is_null())
return 0;
unsigned ALen = A.dim(isl::dim::set);
unsigned BLen = B.dim(isl::dim::set);
unsigned ALen = A.dim(isl::dim::set).release();
unsigned BLen = B.dim(isl::dim::set).release();
unsigned Len = std::min(ALen, BLen);
for (unsigned i = 0; i < Len; i += 1) {
isl::basic_set ADim =
A.project_out(isl::dim::param, 0, A.dim(isl::dim::param))
A.project_out(isl::dim::param, 0, A.dim(isl::dim::param).release())
.project_out(isl::dim::set, i + 1, ALen - i - 1)
.project_out(isl::dim::set, 0, i);
isl::basic_set BDim =
B.project_out(isl::dim::param, 0, B.dim(isl::dim::param))
B.project_out(isl::dim::param, 0, B.dim(isl::dim::param).release())
.project_out(isl::dim::set, i + 1, BLen - i - 1)
.project_out(isl::dim::set, 0, i);
@ -687,7 +687,8 @@ static int structureCompare(const isl::space &ASpace, const isl::space &BSpace,
return NameCompare;
if (ConsiderTupleLen) {
int LenCompare = BSpace.dim(isl::dim::set) - ASpace.dim(isl::dim::set);
int LenCompare = BSpace.dim(isl::dim::set).release() -
ASpace.dim(isl::dim::set).release();
if (LenCompare != 0)
return LenCompare;
}
@ -782,14 +783,14 @@ static void printSortedPolyhedra(isl::union_set USet, llvm::raw_ostream &OS,
}
static void recursiveExpand(isl::basic_set BSet, int Dim, isl::set &Expanded) {
int Dims = BSet.dim(isl::dim::set);
int Dims = BSet.dim(isl::dim::set).release();
if (Dim >= Dims) {
Expanded = Expanded.unite(BSet);
return;
}
isl::basic_set DimOnly =
BSet.project_out(isl::dim::param, 0, BSet.dim(isl::dim::param))
BSet.project_out(isl::dim::param, 0, BSet.dim(isl::dim::param).release())
.project_out(isl::dim::set, Dim + 1, Dims - Dim - 1)
.project_out(isl::dim::set, 0, Dim);
if (!DimOnly.is_bounded()) {

View file

@ -26,10 +26,10 @@ namespace {
/// i.e. there are two constants Min and Max, such that every value x of the
/// chosen dimensions is Min <= x <= Max.
bool isDimBoundedByConstant(isl::set Set, unsigned dim) {
auto ParamDims = Set.dim(isl::dim::param);
auto ParamDims = Set.dim(isl::dim::param).release();
Set = Set.project_out(isl::dim::param, 0, ParamDims);
Set = Set.project_out(isl::dim::set, 0, dim);
auto SetDims = Set.tuple_dim();
auto SetDims = Set.tuple_dim().release();
Set = Set.project_out(isl::dim::set, 1, SetDims - 1);
return bool(Set.is_bounded());
}
@ -40,7 +40,7 @@ bool isDimBoundedByConstant(isl::set Set, unsigned dim) {
/// Min_p <= x <= Max_p.
bool isDimBoundedByParameter(isl::set Set, unsigned dim) {
Set = Set.project_out(isl::dim::set, 0, dim);
auto SetDims = Set.tuple_dim();
auto SetDims = Set.tuple_dim().release();
Set = Set.project_out(isl::dim::set, 1, SetDims - 1);
return bool(Set.is_bounded());
}
@ -135,7 +135,7 @@ isl_size scheduleScatterDims(const isl::union_map &Schedule) {
if (Map.is_null())
continue;
Dims = std::max(Dims, Map.range_tuple_dim());
Dims = std::max(Dims, Map.range_tuple_dim().release());
}
return Dims;
}
@ -144,7 +144,7 @@ isl_size scheduleScatterDims(const isl::union_map &Schedule) {
isl::union_pw_aff scheduleExtractDimAff(isl::union_map UMap, unsigned pos) {
auto SingleUMap = isl::union_map::empty(UMap.ctx());
for (isl::map Map : UMap.get_map_list()) {
unsigned MapDims = Map.range_tuple_dim();
unsigned MapDims = Map.range_tuple_dim().release();
isl::map SingleMap = Map.project_out(isl::dim::out, 0, pos);
SingleMap = SingleMap.project_out(isl::dim::out, 1, MapDims - pos - 1);
SingleUMap = SingleUMap.unite(SingleMap);
@ -152,7 +152,7 @@ isl::union_pw_aff scheduleExtractDimAff(isl::union_map UMap, unsigned pos) {
auto UAff = isl::union_pw_multi_aff(SingleUMap);
auto FirstMAff = isl::multi_union_pw_aff(UAff);
return FirstMAff.get_union_pw_aff(0);
return FirstMAff.at(0);
}
/// Flatten a sequence-like first dimension.
@ -179,7 +179,7 @@ isl::union_map tryFlattenSequence(isl::union_map Schedule) {
auto ScatterSet = isl::set(Schedule.range());
auto ParamSpace = Schedule.get_space().params();
auto Dims = ScatterSet.tuple_dim();
auto Dims = ScatterSet.tuple_dim().release();
assert(Dims >= 2);
// Would cause an infinite loop.
@ -238,8 +238,10 @@ isl::union_map tryFlattenSequence(isl::union_map Schedule) {
auto FirstScheduleAffWithOffset =
FirstScheduleAffNormalized.add(AllCounter);
auto ScheduleWithOffset = isl::union_map(FirstScheduleAffWithOffset)
.flat_range_product(RemainingSubSchedule);
auto ScheduleWithOffset =
isl::union_map::from(
isl::union_pw_multi_aff(FirstScheduleAffWithOffset))
.flat_range_product(RemainingSubSchedule);
NewSchedule = NewSchedule.unite(ScheduleWithOffset);
ScatterSet = ScatterSet.subtract(ScatterFirst);
@ -269,7 +271,7 @@ isl::union_map tryFlattenLoop(isl::union_map Schedule) {
auto SubDims = scheduleScatterDims(SubSchedule);
auto SubExtent = isl::set(SubSchedule.range());
auto SubExtentDims = SubExtent.dim(isl::dim::param);
auto SubExtentDims = SubExtent.dim(isl::dim::param).release();
SubExtent = SubExtent.project_out(isl::dim::param, 0, SubExtentDims);
SubExtent = SubExtent.project_out(isl::dim::set, 1, SubDims - 1);
@ -294,15 +296,15 @@ isl::union_map tryFlattenLoop(isl::union_map Schedule) {
auto FirstSubScheduleAff = scheduleExtractDimAff(SubSchedule, 0);
auto RemainingSubSchedule = scheduleProjectOut(std::move(SubSchedule), 0, 1);
auto LenVal = MaxVal.sub(MinVal).add_ui(1);
auto LenVal = MaxVal.sub(MinVal).add(1);
auto FirstSubScheduleNormalized = subtract(FirstSubScheduleAff, MinVal);
// TODO: Normalize FirstAff to zero (convert to isl_map, determine minimum,
// subtract it)
auto FirstAff = scheduleExtractDimAff(Schedule, 0);
auto Offset = multiply(FirstAff, LenVal);
auto Index = FirstSubScheduleNormalized.add(Offset);
auto IndexMap = isl::union_map(Index);
isl::union_pw_multi_aff Index = FirstSubScheduleNormalized.add(Offset);
auto IndexMap = isl::union_map::from(Index);
auto Result = IndexMap.flat_range_product(RemainingSubSchedule);
LLVM_DEBUG(dbgs() << "Loop-flatten result is:\n " << Result << "\n");

View file

@ -188,8 +188,8 @@ static isl::union_set getUnrollIsolatedSetOptions(isl::ctx Ctx) {
/// @return The modified map.
static isl::map permuteDimensions(isl::map Map, isl::dim DimType,
unsigned DstPos, unsigned SrcPos) {
assert((isl_size)DstPos < Map.dim(DimType) &&
(isl_size)SrcPos < Map.dim(DimType));
assert((isl_size)DstPos < Map.dim(DimType).release() &&
(isl_size)SrcPos < Map.dim(DimType).release());
if (DstPos == SrcPos)
return Map;
isl::id DimId;
@ -229,7 +229,7 @@ static bool isMatMulOperandAcc(isl::set Domain, isl::map AccMap, int &FirstPos,
isl::space Space = AccMap.get_space();
isl::map Universe = isl::map::universe(Space);
if (Space.dim(isl::dim::out) != 2)
if (Space.dim(isl::dim::out).release() != 2)
return false;
// MatMul has the form:
@ -317,7 +317,7 @@ static bool containsOnlyMatrMultAcc(isl::map PartialSchedule,
MatMulInfoTy &MMI) {
auto InputDimId = PartialSchedule.get_tuple_id(isl::dim::in);
auto *Stmt = static_cast<ScopStmt *>(InputDimId.get_user());
isl_size OutDimNum = PartialSchedule.range_tuple_dim();
isl_size OutDimNum = PartialSchedule.range_tuple_dim().release();
assert(OutDimNum > 2 && "In case of the matrix multiplication the loop nest "
"and, consequently, the corresponding scheduling "
"functions have at least three dimensions.");
@ -363,7 +363,7 @@ static bool containsOnlyMatMulDep(isl::map Schedule, const Dependences *D,
auto DomainSpace = Schedule.get_space().domain();
auto Space = DomainSpace.map_from_domain_and_range(DomainSpace);
auto Deltas = Dep.extract_map(Space).deltas();
isl_size DeltasDimNum = Deltas.dim(isl::dim::set);
isl_size DeltasDimNum = Deltas.dim(isl::dim::set).release();
for (int i = 0; i < DeltasDimNum; i++) {
auto Val = Deltas.plain_get_val_if_fixed(isl::dim::set, i);
Pos = Pos < 0 && Val.is_one() ? i : Pos;
@ -445,8 +445,8 @@ static isl::schedule_node permuteBandNodeDimensions(isl::schedule_node Node,
std::max(FirstDim, SecondDim));
auto PartialSchedule =
isl::manage(isl_schedule_node_band_get_partial_schedule(Node.get()));
auto PartialScheduleFirstDim = PartialSchedule.get_union_pw_aff(FirstDim);
auto PartialScheduleSecondDim = PartialSchedule.get_union_pw_aff(SecondDim);
auto PartialScheduleFirstDim = PartialSchedule.at(FirstDim);
auto PartialScheduleSecondDim = PartialSchedule.at(SecondDim);
PartialSchedule =
PartialSchedule.set_union_pw_aff(SecondDim, PartialScheduleFirstDim);
PartialSchedule =
@ -492,7 +492,7 @@ createMacroKernel(isl::schedule_node Node,
Node = permuteBandNodeDimensions(Node, DimOutNum - 3, DimOutNum - 1);
// Mark the outermost loop as parallelizable.
Node = Node.band_member_set_coincident(0, true);
Node = Node.as<isl::schedule_node_band>().member_set_coincident(0, true);
return Node.child(0).child(0);
}
@ -729,7 +729,7 @@ static isl::schedule_node optimizePackedB(isl::schedule_node Node,
// Insert into the schedule tree.
isl::map ExtMap = MapOldIndVar.project_out(
isl::dim::out, 2, MapOldIndVar.range_tuple_dim() - 2);
isl::dim::out, 2, MapOldIndVar.range_tuple_dim().release() - 2);
ExtMap = ExtMap.reverse();
ExtMap = ExtMap.fix_si(isl::dim::out, MMI.i, 0);
ExtMap = ExtMap.intersect_range(Domain);
@ -870,9 +870,9 @@ getInductionVariablesSubstitution(isl::schedule_node Node,
auto Child = Node.child(0);
auto UnMapOldIndVar = Child.get_prefix_schedule_union_map();
auto MapOldIndVar = isl::map::from_union_map(UnMapOldIndVar);
if (MapOldIndVar.range_tuple_dim() > 9)
return MapOldIndVar.project_out(isl::dim::out, 0,
MapOldIndVar.range_tuple_dim() - 9);
if (MapOldIndVar.range_tuple_dim().release() > 9)
return MapOldIndVar.project_out(
isl::dim::out, 0, MapOldIndVar.range_tuple_dim().release() - 9);
return MapOldIndVar;
}
@ -893,10 +893,10 @@ getInductionVariablesSubstitution(isl::schedule_node Node,
static isl::schedule_node
isolateAndUnrollMatMulInnerLoops(isl::schedule_node Node,
struct MicroKernelParamsTy MicroKernelParams) {
isl::schedule_node Child = Node.get_child(0);
isl::schedule_node Child = Node.child(0);
isl::union_map UnMapOldIndVar = Child.get_prefix_schedule_relation();
isl::set Prefix = isl::map::from_union_map(UnMapOldIndVar).range();
isl_size Dims = Prefix.tuple_dim();
isl_size Dims = Prefix.tuple_dim().release();
Prefix = Prefix.project_out(isl::dim::set, Dims - 1, 1);
Prefix = getPartialTilePrefixes(Prefix, MicroKernelParams.Nr);
Prefix = getPartialTilePrefixes(Prefix, MicroKernelParams.Mr);
@ -906,11 +906,11 @@ isolateAndUnrollMatMulInnerLoops(isl::schedule_node Node,
isl::ctx Ctx = Node.ctx();
auto Options = IsolateOption.unite(getDimOptions(Ctx, "unroll"));
Options = Options.unite(getUnrollIsolatedSetOptions(Ctx));
Node = Node.band_set_ast_build_options(Options);
Node = Node.as<isl::schedule_node_band>().set_ast_build_options(Options);
Node = Node.parent().parent().parent();
IsolateOption = getIsolateOptions(Prefix, 3);
Options = IsolateOption.unite(getDimOptions(Ctx, "separate"));
Node = Node.band_set_ast_build_options(Options);
Node = Node.as<isl::schedule_node_band>().set_ast_build_options(Options);
Node = Node.child(0).child(0).child(0);
return Node;
}
@ -953,8 +953,8 @@ getBandNodeWithOriginDimOrder(isl::schedule_node Node) {
return Node;
auto Domain = Node.get_universe_domain();
assert(isl_union_set_n_set(Domain.get()) == 1);
if (Node.get_schedule_depth() != 0 ||
(isl::set(Domain).tuple_dim() !=
if (Node.get_schedule_depth().release() != 0 ||
(isl::set(Domain).tuple_dim().release() !=
isl_schedule_node_band_n_member(Node.get())))
return Node;
Node = isl::manage(isl_schedule_node_delete(Node.copy()));
@ -1029,7 +1029,7 @@ static bool isMatrMultPattern(isl::schedule_node Node, const Dependences *D,
Node = Node.parent();
if (LeafType != isl_schedule_node_leaf ||
isl_schedule_node_band_n_member(Node.get()) < 3 ||
Node.get_schedule_depth() != 0 ||
Node.get_schedule_depth().release() != 0 ||
isl_union_map_n_map(PartialSchedule.get()) != 1)
return false;
auto NewPartialSchedule = isl::map::from_union_map(PartialSchedule);

View file

@ -118,10 +118,10 @@ private:
/// i.e. there are two constants Min and Max, such that every value x of the
/// chosen dimensions is Min <= x <= Max.
static bool isDimBoundedByConstant(isl::set Set, unsigned dim) {
auto ParamDims = Set.dim(isl::dim::param);
auto ParamDims = Set.dim(isl::dim::param).release();
Set = Set.project_out(isl::dim::param, 0, ParamDims);
Set = Set.project_out(isl::dim::set, 0, dim);
auto SetDims = Set.tuple_dim();
auto SetDims = Set.tuple_dim().release();
Set = Set.project_out(isl::dim::set, 1, SetDims - 1);
return bool(Set.is_bounded());
}
@ -350,7 +350,7 @@ ScopArrayInfo *MaximalStaticExpander::expandAccess(Scop &S, MemoryAccess *MA) {
// Get the current AM.
auto CurrentAccessMap = MA->getAccessRelation();
unsigned in_dimensions = CurrentAccessMap.domain_tuple_dim();
unsigned in_dimensions = CurrentAccessMap.domain_tuple_dim().release();
// Get domain from the current AM.
auto Domain = CurrentAccessMap.domain();
@ -405,7 +405,7 @@ ScopArrayInfo *MaximalStaticExpander::expandAccess(Scop &S, MemoryAccess *MA) {
// Add constraints to linked output with input id.
auto SpaceMap = NewAccessMap.get_space();
auto ConstraintBasicMap =
isl::basic_map::equal(SpaceMap, SpaceMap.dim(isl::dim::in));
isl::basic_map::equal(SpaceMap, SpaceMap.dim(isl::dim::in).release());
NewAccessMap = isl::map(ConstraintBasicMap);
// Set the new access relation map.

View file

@ -366,8 +366,9 @@ ScheduleTreeOptimizer::isolateFullPartialTiles(isl::schedule_node Node,
isl::union_set IsolateOption = getIsolateOptions(IsolateDomain, 1);
Node = Node.parent().parent();
isl::union_set Options = IsolateOption.unite(AtomicOption);
Node = Node.band_set_ast_build_options(Options);
return Node;
isl::schedule_node_band Result =
Node.as<isl::schedule_node_band>().set_ast_build_options(Options);
return Result;
}
isl::schedule_node ScheduleTreeOptimizer::prevectSchedBand(
@ -375,7 +376,7 @@ isl::schedule_node ScheduleTreeOptimizer::prevectSchedBand(
assert(isl_schedule_node_get_type(Node.get()) == isl_schedule_node_band);
auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
isl_size ScheduleDimensions = Space.dim(isl::dim::set);
isl_size ScheduleDimensions = Space.dim(isl::dim::set).release();
assert((isl_size)DimToVectorize < ScheduleDimensions);
if (DimToVectorize > 0) {
@ -394,9 +395,10 @@ isl::schedule_node ScheduleTreeOptimizer::prevectSchedBand(
Node = Node.child(0);
// Make sure the "trivially vectorizable loop" is not unrolled. Otherwise,
// we will have troubles to match it in the backend.
Node = Node.band_set_ast_build_options(
isl::union_set(Node.ctx(), "{ unroll[x]: 1 = 0 }"));
Node = isl::manage(isl_schedule_node_band_sink(Node.release()));
isl::schedule_node_band NodeBand =
Node.as<isl::schedule_node_band>().set_ast_build_options(
isl::union_set(Node.ctx(), "{ unroll[x]: 1 = 0 }"));
Node = isl::manage(isl_schedule_node_band_sink(NodeBand.release()));
Node = Node.child(0);
if (isl_schedule_node_get_type(Node.get()) == isl_schedule_node_leaf)
Node = Node.parent();
@ -442,7 +444,7 @@ bool ScheduleTreeOptimizer::isTileableBandNode(isl::schedule_node Node) {
return false;
auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
auto Dims = Space.dim(isl::dim::set);
auto Dims = Space.dim(isl::dim::set).release();
if (Dims <= 1)
return false;
@ -474,10 +476,10 @@ ScheduleTreeOptimizer::standardBandOpts(isl::schedule_node Node, void *User) {
return Node;
auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
auto Dims = Space.dim(isl::dim::set);
auto Dims = Space.dim(isl::dim::set).release();
for (int i = Dims - 1; i >= 0; i--)
if (Node.band_member_get_coincident(i)) {
if (Node.as<isl::schedule_node_band>().member_get_coincident(i)) {
Node = prevectSchedBand(Node, i, PrevectorWidth);
break;
}
@ -615,7 +617,7 @@ static void walkScheduleTreeForStatistics(isl::schedule Schedule, int Version) {
int CountMembers = isl_schedule_node_band_n_member(Node.get());
NumBandMembers[Version] += CountMembers;
for (int i = 0; i < CountMembers; i += 1) {
if (Node.band_member_get_coincident(i))
if (Node.as<isl::schedule_node_band>().member_get_coincident(i))
NumCoincident[Version]++;
}
break;

View file

@ -80,7 +80,7 @@ struct ScheduleTreeRewriter
isl::schedule NewChild =
getDerived().visit(Band.child(0), std::forward<Args>(args)...);
isl::schedule_node NewNode =
NewChild.insert_partial_schedule(PartialSched).get_root().get_child(0);
NewChild.insert_partial_schedule(PartialSched).get_root().child(0);
// Reapply permutability and coincidence attributes.
NewNode = isl::manage(isl_schedule_node_band_set_permutable(
@ -123,7 +123,8 @@ struct ScheduleTreeRewriter
}
isl::schedule visitMark(const isl::schedule_node &Mark, Args... args) {
isl::id TheMark = Mark.mark_get_id();
isl::id TheMark = Mark.as<isl::schedule_node_mark>().get_id();
isl::schedule_node NewChild =
getDerived()
.visit(Mark.first_child(), std::forward<Args>(args)...)
@ -134,7 +135,8 @@ struct ScheduleTreeRewriter
isl::schedule visitExtension(const isl::schedule_node &Extension,
Args... args) {
isl::union_map TheExtension = Extension.extension_get_extension();
isl::union_map TheExtension =
Extension.as<isl::schedule_node_extension>().get_extension();
isl::schedule_node NewChild = getDerived()
.visit(Extension.child(0), args...)
.get_root()
@ -145,7 +147,8 @@ struct ScheduleTreeRewriter
}
isl::schedule visitFilter(const isl::schedule_node &Filter, Args... args) {
isl::union_set FilterDomain = Filter.filter_get_filter();
isl::union_set FilterDomain =
Filter.as<isl::schedule_node_filter>().get_filter();
isl::schedule NewSchedule =
getDerived().visit(Filter.child(0), std::forward<Args>(args)...);
return NewSchedule.intersect_domain(FilterDomain);
@ -236,7 +239,7 @@ struct ExtensionNodeRewriter
isl::union_map NewPartialSchedMap = isl::union_map::from(PartialSched);
unsigned BandDims = isl_schedule_node_band_n_member(OldNode.get());
for (isl::map Ext : NewChildExtensions.get_map_list()) {
unsigned ExtDims = Ext.domain_tuple_dim();
unsigned ExtDims = Ext.domain_tuple_dim().release();
assert(ExtDims >= BandDims);
unsigned OuterDims = ExtDims - BandDims;
@ -256,7 +259,7 @@ struct ExtensionNodeRewriter
isl::schedule_node NewNode =
NewChild.insert_partial_schedule(NewPartialSchedAsAsMultiUnionPwAff)
.get_root()
.get_child(0);
.child(0);
// Reapply permutability and coincidence attributes.
NewNode = isl::manage(isl_schedule_node_band_set_permutable(
@ -274,7 +277,8 @@ struct ExtensionNodeRewriter
isl::schedule visitFilter(const isl::schedule_node &Filter,
const isl::union_set &Domain,
isl::union_map &Extensions) {
isl::union_set FilterDomain = Filter.filter_get_filter();
isl::union_set FilterDomain =
Filter.as<isl::schedule_node_filter>().get_filter();
isl::union_set NewDomain = Domain.intersect(FilterDomain);
// A filter is added implicitly if necessary when joining schedule trees.
@ -284,7 +288,8 @@ struct ExtensionNodeRewriter
isl::schedule visitExtension(const isl::schedule_node &Extension,
const isl::union_set &Domain,
isl::union_map &Extensions) {
isl::union_map ExtDomain = Extension.extension_get_extension();
isl::union_map ExtDomain =
Extension.as<isl::schedule_node_extension>().get_extension();
isl::union_set NewDomain = Domain.unite(ExtDomain.range());
isl::union_map ChildExtensions;
isl::schedule NewChild =
@ -340,7 +345,8 @@ struct ApplyASTBuildOptions
isl::schedule_node visitBand(const isl::schedule_node &Band) {
isl::schedule_node Result =
Band.band_set_ast_build_options(ASTBuildOptions[Pos]);
Band.as<isl::schedule_node_band>().set_ast_build_options(
ASTBuildOptions[Pos]);
Pos += 1;
return getBase().visitBand(Result);
}
@ -412,7 +418,7 @@ static isl::id createGeneratedLoopAttr(isl::ctx Ctx, MDNode *FollowupLoopMD) {
/// start with either the mark or the band.
static isl::schedule_node moveToBandMark(isl::schedule_node BandOrMark) {
if (isBandMark(BandOrMark)) {
assert(isBandWithSingleLoop(BandOrMark.get_child(0)));
assert(isBandWithSingleLoop(BandOrMark.child(0)));
return BandOrMark;
}
assert(isBandWithSingleLoop(BandOrMark));
@ -431,7 +437,7 @@ static isl::schedule_node removeMark(isl::schedule_node MarkOrBand,
isl::schedule_node Band;
if (isMark(MarkOrBand)) {
Attr = getLoopAttr(MarkOrBand.mark_get_id());
Attr = getLoopAttr(MarkOrBand.as<isl::schedule_node_mark>().get_id());
Band = isl::manage(isl_schedule_node_delete(MarkOrBand.release()));
} else {
Attr = nullptr;
@ -453,7 +459,7 @@ static isl::schedule_node insertMark(isl::schedule_node Band, isl::id Mark) {
assert(moveToBandMark(Band).is_equal(Band) &&
"Don't add a two marks for a band");
return Band.insert_mark(Mark).get_child(0);
return Band.insert_mark(Mark).child(0);
}
/// Return the (one-dimensional) set of numbers that are divisible by @p Factor
@ -484,7 +490,7 @@ static isl::basic_set isDivisibleBySet(isl::ctx &Ctx, long Factor,
/// @param Set A set, which should be modified.
/// @param VectorWidth A parameter, which determines the constraint.
static isl::set addExtentConstraints(isl::set Set, int VectorWidth) {
unsigned Dims = Set.tuple_dim();
unsigned Dims = Set.tuple_dim().release();
isl::space Space = Set.get_space();
isl::local_space LocalSpace = isl::local_space(Space);
isl::constraint ExtConstr = isl::constraint::alloc_inequality(LocalSpace);
@ -499,7 +505,8 @@ static isl::set addExtentConstraints(isl::set Set, int VectorWidth) {
} // namespace
bool polly::isBandMark(const isl::schedule_node &Node) {
return isMark(Node) && isLoopAttr(Node.mark_get_id());
return isMark(Node) &&
isLoopAttr(Node.as<isl::schedule_node_mark>().get_id());
}
BandAttr *polly::getBandAttr(isl::schedule_node MarkOrBand) {
@ -507,7 +514,7 @@ BandAttr *polly::getBandAttr(isl::schedule_node MarkOrBand) {
if (!isMark(MarkOrBand))
return nullptr;
return getLoopAttr(MarkOrBand.mark_get_id());
return getLoopAttr(MarkOrBand.as<isl::schedule_node_mark>().get_id());
}
isl::schedule polly::hoistExtensionNodes(isl::schedule Sched) {
@ -543,13 +550,14 @@ isl::schedule polly::applyFullUnroll(isl::schedule_node BandToUnroll) {
isl::multi_union_pw_aff PartialSched = isl::manage(
isl_schedule_node_band_get_partial_schedule(BandToUnroll.get()));
assert(PartialSched.dim(isl::dim::out) == 1 &&
assert(PartialSched.dim(isl::dim::out).release() == 1 &&
"Can only unroll a single dimension");
isl::union_pw_aff PartialSchedUAff = PartialSched.get_union_pw_aff(0);
isl::union_pw_aff PartialSchedUAff = PartialSched.at(0);
isl::union_set Domain = BandToUnroll.get_domain();
PartialSchedUAff = PartialSchedUAff.intersect_domain(Domain);
isl::union_map PartialSchedUMap = isl::union_map(PartialSchedUAff);
isl::union_map PartialSchedUMap =
isl::union_map::from(isl::union_pw_multi_aff(PartialSchedUAff));
// Enumerator only the scatter elements.
isl::union_set ScatterList = PartialSchedUMap.range();
@ -570,7 +578,7 @@ isl::schedule polly::applyFullUnroll(isl::schedule_node BandToUnroll) {
});
// Convert the points to a sequence of filters.
isl::union_set_list List = isl::union_set_list::alloc(Ctx, Elts.size());
isl::union_set_list List = isl::union_set_list(Ctx, Elts.size());
for (isl::point P : Elts) {
// Determine the domains that map this scatter element.
isl::union_set DomainFilter = PartialSchedUMap.intersect_range(P).domain();
@ -599,7 +607,7 @@ isl::schedule polly::applyPartialUnroll(isl::schedule_node BandToUnroll,
isl_schedule_node_band_get_partial_schedule(BandToUnroll.get()));
// { Stmt[] -> [x] }
isl::union_pw_aff PartialSchedUAff = PartialSched.get_union_pw_aff(0);
isl::union_pw_aff PartialSchedUAff = PartialSched.at(0);
// Here we assume the schedule stride is one and starts with 0, which is not
// necessarily the case.
@ -616,10 +624,11 @@ isl::schedule polly::applyPartialUnroll(isl::schedule_node BandToUnroll,
return isl::stat::ok();
});
isl::union_set_list List = isl::union_set_list::alloc(Ctx, Factor);
isl::union_set_list List = isl::union_set_list(Ctx, Factor);
for (auto i : seq<int>(0, Factor)) {
// { Stmt[] -> [x] }
isl::union_map UMap{PartialSchedUAff};
isl::union_map UMap =
isl::union_map::from(isl::union_pw_multi_aff(PartialSchedUAff));
// { [x] }
isl::basic_set Divisible = isDivisibleBySet(Ctx, Factor, i);
@ -650,7 +659,7 @@ isl::schedule polly::applyPartialUnroll(isl::schedule_node BandToUnroll,
isl::set polly::getPartialTilePrefixes(isl::set ScheduleRange,
int VectorWidth) {
isl_size Dims = ScheduleRange.tuple_dim();
isl_size Dims = ScheduleRange.tuple_dim().release();
isl::set LoopPrefixes =
ScheduleRange.drop_constraints_involving_dims(isl::dim::set, Dims - 1, 1);
auto ExtentPrefixes = addExtentConstraints(LoopPrefixes, VectorWidth);
@ -662,7 +671,7 @@ isl::set polly::getPartialTilePrefixes(isl::set ScheduleRange,
isl::union_set polly::getIsolateOptions(isl::set IsolateDomain,
isl_size OutDimsNum) {
isl_size Dims = IsolateDomain.tuple_dim();
isl_size Dims = IsolateDomain.tuple_dim().release();
assert(OutDimsNum <= Dims &&
"The isl::set IsolateDomain is used to describe the range of schedule "
"dimensions values, which should be isolated. Consequently, the "
@ -693,7 +702,7 @@ isl::schedule_node polly::tileNode(isl::schedule_node Node,
auto Dims = Space.dim(isl::dim::set);
auto Sizes = isl::multi_val::zero(Space);
std::string IdentifierString(Identifier);
for (auto i : seq<isl_size>(0, Dims)) {
for (auto i : seq<isl_size>(0, Dims.release())) {
auto tileSize =
i < (isl_size)TileSizes.size() ? TileSizes[i] : DefaultTileSize;
Sizes = Sizes.set_val(i, isl::val(Node.ctx(), tileSize));
@ -717,5 +726,6 @@ isl::schedule_node polly::applyRegisterTiling(isl::schedule_node Node,
int DefaultTileSize) {
Node = tileNode(Node, "Register tiling", TileSizes, DefaultTileSize);
auto Ctx = Node.ctx();
return Node.band_set_ast_build_options(isl::union_set(Ctx, "{unroll[x]}"));
return Node.as<isl::schedule_node_band>().set_ast_build_options(
isl::union_set(Ctx, "{unroll[x]}"));
}

View file

@ -101,7 +101,7 @@ static isl::union_map underapproximatedAddMap(isl::union_map UMap,
isl::map Result = isl::map::empty(PrevMap.get_space());
for (isl::basic_map BMap : PrevMap.get_basic_map_list()) {
if (Result.n_basic_map() > SimplifyMaxDisjuncts)
if (Result.n_basic_map().release() > SimplifyMaxDisjuncts)
break;
Result = Result.unite(BMap);
}

View file

@ -246,7 +246,8 @@ static isl::map makeUnknownForDomain(isl::set Domain) {
static bool isMapToUnknown(const isl::map &Map) {
isl::space Space = Map.get_space().range();
return Space.has_tuple_id(isl::dim::set).is_false() &&
Space.is_wrapping().is_false() && Space.dim(isl::dim::set) == 0;
Space.is_wrapping().is_false() &&
Space.dim(isl::dim::set).release() == 0;
}
isl::union_map polly::filterKnownValInst(const isl::union_map &UMap) {
@ -685,10 +686,12 @@ isl::map ZoneAlgorithm::getDefToTarget(ScopStmt *DefStmt,
TargetStmt->getSurroundingLoop())) {
isl::set DefDomain = getDomainFor(DefStmt);
isl::set TargetDomain = getDomainFor(TargetStmt);
assert(DefDomain.tuple_dim() <= TargetDomain.tuple_dim());
assert(DefDomain.tuple_dim().release() <=
TargetDomain.tuple_dim().release());
Result = isl::map::from_domain_and_range(DefDomain, TargetDomain);
for (unsigned i = 0, DefDims = DefDomain.tuple_dim(); i < DefDims; i += 1)
for (unsigned i = 0, DefDims = DefDomain.tuple_dim().release(); i < DefDims;
i += 1)
Result = Result.equate(isl::dim::in, i, isl::dim::out, i);
}

View file

@ -19,7 +19,7 @@ TEST(Support, isl_iterator) {
Ctx, "{ [x, y] : 0 <= x <= 5 and y >= 0 and x <= 4 and y <= 3 + x }");
isl::set S = A.unite(B);
ASSERT_EQ(S.n_basic_set(), 2);
ASSERT_EQ(S.n_basic_set().release(), 2);
std::vector<isl::basic_set> Sets;
for (auto BS : S.get_basic_set_list())
Sets.push_back(BS);