Index: include/polly/DeLICM.h =================================================================== --- include/polly/DeLICM.h +++ include/polly/DeLICM.h @@ -32,12 +32,9 @@ /// Determine whether two lifetimes are conflicting. /// /// Used by unittesting. -bool isConflicting(IslPtr ExistingOccupied, - IslPtr ExistingUnused, - IslPtr ExistingWrites, - IslPtr ProposedOccupied, - IslPtr ProposedUnused, - IslPtr ProposedWrites, +bool isConflicting(isl::UnionSet ExistingOccupied, isl::UnionSet ExistingUnused, + isl::UnionSet ExistingWrites, isl::UnionSet ProposedOccupied, + isl::UnionSet ProposedUnused, isl::UnionSet ProposedWrites, llvm::raw_ostream *OS = nullptr, unsigned Indent = 0); } // namespace polly Index: include/polly/FlattenAlgo.h =================================================================== --- include/polly/FlattenAlgo.h +++ include/polly/FlattenAlgo.h @@ -32,7 +32,7 @@ /// @param Schedule The input schedule. /// /// @return The flattened schedule. -IslPtr flattenSchedule(IslPtr Schedule); +isl::UnionMap flattenSchedule(isl::UnionMap Schedule); } // namespace polly #endif /* POLLY_FLATTENALGO_H */ Index: include/polly/Support/GICHelper.h =================================================================== --- include/polly/Support/GICHelper.h +++ include/polly/Support/GICHelper.h @@ -24,6 +24,9 @@ #include "isl/set.h" #include "isl/union_map.h" #include "isl/union_set.h" + +#include "isl-noexceptions.h" + #include #include @@ -176,151 +179,14 @@ const std::string &Middle, const std::string &Suffix); -/// IslObjTraits is a static class to invoke common functions that all -/// ISL objects have: isl_*_copy, isl_*_free, isl_*_get_ctx and isl_*_to_str. -/// These functions follow a common naming scheme, but not a base class -/// hierarchy (as ISL is written in C). As such, the functions are accessible -/// only by constructing the function name using the preprocessor. This class -/// serves to make these names accessible to a C++ template scheme. -/// -/// There is an isl_obj polymorphism layer, but its implementation is -/// incomplete. -template class IslObjTraits; - -#define DECLARE_TRAITS(TYPE) \ - template <> class IslObjTraits { \ - public: \ - static __isl_give isl_##TYPE *copy(__isl_keep isl_##TYPE *Obj) { \ - return isl_##TYPE##_copy(Obj); \ - } \ - static void free(__isl_take isl_##TYPE *Obj) { isl_##TYPE##_free(Obj); } \ - static isl_ctx *get_ctx(__isl_keep isl_##TYPE *Obj) { \ - return isl_##TYPE##_get_ctx(Obj); \ - } \ - static std::string to_str(__isl_keep isl_##TYPE *Obj) { \ - if (!Obj) \ - return "null"; \ - char *cstr = isl_##TYPE##_to_str(Obj); \ - if (!cstr) \ - return "null"; \ - std::string Result{cstr}; \ - ::free(cstr); \ - return Result; \ - } \ - }; - -DECLARE_TRAITS(id) -DECLARE_TRAITS(val) -DECLARE_TRAITS(space) -DECLARE_TRAITS(basic_map) -DECLARE_TRAITS(map) -DECLARE_TRAITS(union_map) -DECLARE_TRAITS(basic_set) -DECLARE_TRAITS(set) -DECLARE_TRAITS(union_set) -DECLARE_TRAITS(aff) -DECLARE_TRAITS(multi_aff) -DECLARE_TRAITS(pw_aff) -DECLARE_TRAITS(pw_multi_aff) -DECLARE_TRAITS(multi_pw_aff) -DECLARE_TRAITS(union_pw_aff) -DECLARE_TRAITS(multi_union_pw_aff) -DECLARE_TRAITS(union_pw_multi_aff) - -/// Smart pointer to an ISL object. -/// -/// An object of this class owns an reference of an ISL object, meaning if will -/// free it when destroyed. Most ISL objects are reference counted such that we -/// gain an automatic memory management. -/// -/// Function parameters in the ISL API are annotated using either __isl_keep -/// __isl_take. Return values that are objects are annotated using __is_give, -/// meaning the caller is responsible for releasing the object. When annotated -/// with __isl_keep, use the keep() function to pass a plain pointer to the ISL -/// object. For __isl_take-annotated parameters, use either copy() to increase -/// the reference counter by one, or take() to pass the ownership to the called -/// function. When IslPtr loses ownership, it cannot be used anymore and won't -/// free the object when destroyed. Use the give() function to wrap the -/// ownership of a returned isl_* object into an IstPtr. -/// -/// There is purposefully no implicit conversion from/to plain isl_* pointers to -/// avoid difficult to find bugs because keep/copy/take would have been -/// required. -template class IslPtr { - typedef IslPtr ThisTy; - typedef IslObjTraits Traits; - -private: - T *Obj; - - explicit IslPtr(__isl_take T *Obj) : Obj(Obj) {} - -public: - IslPtr() : Obj(nullptr) {} - /* implicit */ IslPtr(std::nullptr_t That) : IslPtr() {} - - /* implicit */ IslPtr(const ThisTy &That) - : IslPtr(IslObjTraits::copy(That.Obj)) {} - /* implicit */ IslPtr(ThisTy &&That) : IslPtr(That.Obj) { - That.Obj = nullptr; - } - ~IslPtr() { - if (Obj) - Traits::free(Obj); - } - - ThisTy &operator=(const ThisTy &That) { - if (Obj) - Traits::free(Obj); - this->Obj = Traits::copy(That.Obj); - return *this; - } - ThisTy &operator=(ThisTy &&That) { - swap(*this, That); - return *this; - } - - explicit operator bool() const { return Obj; } - - static void swap(ThisTy &LHS, ThisTy &RHS) { std::swap(LHS.Obj, RHS.Obj); } - - static ThisTy give(__isl_take T *Obj) { return ThisTy(Obj); } - T *keep() const { return Obj; } - __isl_give T *take() { - auto *Result = Obj; - Obj = nullptr; - return Result; - } - __isl_give T *copy() const { return Traits::copy(Obj); } - - isl_ctx *getCtx() const { return Traits::get_ctx(Obj); } - std::string toStr() const { return Traits::to_str(Obj); } - - /// Print a string representation of this ISL object to stderr. - /// - /// This function is meant to be called from a debugger and therefore must - /// not be declared inline: The debugger needs a valid function pointer to - /// call, even if the method is not used. - /// - /// Note that the string representation of isl_*_dump is different than the - /// one for isl_printer/isl_*_to_str(). - void dump() const; -}; +// Make isl::give available in polly namespace. We do this as there was +// previously a function polly::give() which did the very same thing and we +// did not want yet to introduce the isl:: prefix to each call of give. +using isl::give; -template static IslPtr give(__isl_take T *Obj) { - return IslPtr::give(Obj); -} - -template -llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const IslPtr &Obj) { - OS << IslObjTraits::to_str(Obj.keep()); - return OS; -} - -template -llvm::DiagnosticInfoOptimizationBase & -operator<<(llvm::DiagnosticInfoOptimizationBase &OS, const IslPtr &Obj) { - OS << IslObjTraits::to_str(Obj.keep()); +inline llvm::DiagnosticInfoOptimizationBase & +operator<<(llvm::DiagnosticInfoOptimizationBase &OS, const isl::UnionMap &Obj) { + OS << Obj.getStr(); return OS; } @@ -328,36 +194,36 @@ /// /// This basically wraps isl_map_foreach_basic_map() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &Map, - const std::function)> &F); +void foreachElt(const isl::Map &Map, + const std::function &F); /// Enumerate all isl_basic_sets of an isl_set. /// /// This basically wraps isl_set_foreach_basic_set() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &Set, - const std::function)> &F); +void foreachElt(const isl::Set &Set, + const std::function &F); /// Enumerate all isl_maps of an isl_union_map. /// /// This basically wraps isl_union_map_foreach_map() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &UMap, - const std::function Map)> &F); +void foreachElt(const isl::UnionMap &UMap, + const std::function &F); /// Enumerate all isl_sets of an isl_union_set. /// /// This basically wraps isl_union_set_foreach_set() and allows to call back /// C++11 closures. -void foreachElt(const IslPtr &USet, - const std::function Set)> &F); +void foreachElt(const isl::UnionSet &USet, + const std::function &F); /// Enumerate all isl_pw_aff of an isl_union_pw_aff. /// /// This basically wraps isl_union_pw_aff(), but also allows to call back C++11 /// closures. -void foreachElt(const IslPtr &UPwAff, - const std::function)> &F); +void foreachElt(const isl::UnionPwAff &UPwAff, + const std::function &F); /// Enumerate all polyhedra of an isl_map. /// @@ -371,9 +237,8 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was empty. -isl_stat -foreachEltWithBreak(const IslPtr &Map, - const std::function)> &F); +isl_stat foreachEltWithBreak(const isl::Map &Map, + const std::function &F); /// Enumerate all isl_maps of an isl_union_map. /// @@ -388,9 +253,8 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was initially empty. -isl_stat -foreachEltWithBreak(const IslPtr &UMap, - const std::function Map)> &F); +isl_stat foreachEltWithBreak(const isl::UnionMap &UMap, + const std::function &F); /// Enumerate all pieces of an isl_pw_aff. /// @@ -404,9 +268,9 @@ /// /// @return The isl_stat returned by the last callback invocation; isl_stat_ok /// if the collection was initially empty. -isl_stat foreachPieceWithBreak( - const IslPtr &PwAff, - const std::function, IslPtr)> &F); +isl_stat +foreachPieceWithBreak(const isl::PwAff &PwAff, + const std::function &F); /// Scoped limit of ISL operations. /// Index: include/polly/Support/ISLTools.h =================================================================== --- include/polly/Support/ISLTools.h +++ include/polly/Support/ISLTools.h @@ -28,10 +28,10 @@ /// @return { Space[] -> Scatter[] } /// A map to all timepoints that happen before the timepoints the input /// mapped to. -IslPtr beforeScatter(IslPtr Map, bool Strict); +isl::Map beforeScatter(isl::Map Map, bool Strict); -/// Piecewise beforeScatter(IslPtr,bool). -IslPtr beforeScatter(IslPtr UMap, bool Strict); +/// Piecewise beforeScatter(isl::Map,bool). +isl::UnionMap beforeScatter(isl::UnionMap UMap, bool Strict); /// Return the range elements that are lexicographically larger. /// @@ -42,11 +42,10 @@ /// @return { Space[] -> Scatter[] } /// A map to all timepoints that happen after the timepoints the input /// map originally mapped to. -IslPtr afterScatter(IslPtr Map, bool Strict); +isl::Map afterScatter(isl::Map Map, bool Strict); -/// Piecewise afterScatter(IslPtr,bool). -IslPtr afterScatter(const IslPtr &UMap, - bool Strict); +/// Piecewise afterScatter(isl::Map,bool). +isl::UnionMap afterScatter(const isl::UnionMap &UMap, bool Strict); /// Construct a range of timepoints between two timepoints. /// @@ -74,13 +73,11 @@ /// A map for each domain element of timepoints between two extreme /// points, or nullptr if @p From or @p To is nullptr, or the isl max /// operations is exceeded. -IslPtr betweenScatter(IslPtr From, IslPtr To, - bool InclFrom, bool InclTo); +isl::Map betweenScatter(isl::Map From, isl::Map To, bool InclFrom, bool InclTo); -/// Piecewise betweenScatter(IslPtr,IslPtr,bool,bool). -IslPtr betweenScatter(IslPtr From, - IslPtr To, bool InclFrom, - bool InclTo); +/// Piecewise betweenScatter(isl::Map,isl::Map,bool,bool). +isl::UnionMap betweenScatter(isl::UnionMap From, isl::UnionMap To, + bool InclFrom, bool InclTo); /// If by construction a union map is known to contain only a single map, return /// it. @@ -91,8 +88,7 @@ /// isl_union_map_extract_map() on the other hand does not check whether there /// is (at most) one isl_map in the union, i.e. how it has been constructed is /// probably wrong. -IslPtr singleton(IslPtr UMap, - IslPtr ExpectedSpace); +isl::Map singleton(isl::UnionMap UMap, isl::Space ExpectedSpace); /// If by construction an isl_union_set is known to contain only a single /// isl_set, return it. @@ -103,8 +99,7 @@ /// isl_union_set_extract_set() on the other hand does not check whether there /// is (at most) one isl_set in the union, i.e. how it has been constructed is /// probably wrong. -IslPtr singleton(IslPtr USet, - IslPtr ExpectedSpace); +isl::Set singleton(isl::UnionSet USet, isl::Space ExpectedSpace); /// Determine how many dimensions the scatter space of @p Schedule has. /// @@ -114,13 +109,13 @@ /// The implementation currently returns the maximum number of dimensions it /// encounters, if different, and 0 if none is encountered. However, most other /// code will most likely fail if one of these happen. -unsigned getNumScatterDims(const IslPtr &Schedule); +unsigned getNumScatterDims(const isl::UnionMap &Schedule); /// Return the scatter space of a @p Schedule. /// /// This is basically the range space of the schedule map, but harder to /// determine because it is an isl_union_map. -IslPtr getScatterSpace(const IslPtr &Schedule); +isl::Space getScatterSpace(const isl::UnionMap &Schedule); /// Construct an identity map for the given domain values. /// @@ -136,18 +131,17 @@ /// /// @return { Space[] -> Space[] } /// A map that maps each value of @p USet to itself. -IslPtr makeIdentityMap(const IslPtr &USet, - bool RestrictDomain); +isl::UnionMap makeIdentityMap(const isl::UnionSet &USet, bool RestrictDomain); /// Reverse the nested map tuple in @p Map's domain. /// /// @param Map { [Space1[] -> Space2[]] -> Space3[] } /// /// @return { [Space2[] -> Space1[]] -> Space3[] } -IslPtr reverseDomain(IslPtr Map); +isl::Map reverseDomain(isl::Map Map); -/// Piecewise reverseDomain(IslPtr). -IslPtr reverseDomain(const IslPtr &UMap); +/// Piecewise reverseDomain(isl::Map). +isl::UnionMap reverseDomain(const isl::UnionMap &UMap); /// Add a constant to one dimension of a set. /// @@ -158,22 +152,22 @@ /// @param Amount The offset to add to the specified dimension. /// /// @return The modified set. -IslPtr shiftDim(IslPtr Set, int Pos, int Amount); +isl::Set shiftDim(isl::Set Set, int Pos, int Amount); -/// Piecewise shiftDim(IslPtr,int,int). -IslPtr shiftDim(IslPtr USet, int Pos, int Amount); +/// Piecewise shiftDim(isl::Set,int,int). +isl::UnionSet shiftDim(isl::UnionSet USet, int Pos, int Amount); /// Simplify a set inplace. -void simplify(IslPtr &Set); +void simplify(isl::Set &Set); /// Simplify a union set inplace. -void simplify(IslPtr &USet); +void simplify(isl::UnionSet &USet); /// Simplify a map inplace. -void simplify(IslPtr &Map); +void simplify(isl::Map &Map); /// Simplify a union map inplace. -void simplify(IslPtr &UMap); +void simplify(isl::UnionMap &UMap); /// Compute the reaching definition statement or the next overwrite for each /// definition of an array element. @@ -228,10 +222,9 @@ /// The reaching definitions or future overwrite as described above, or /// nullptr if either @p Schedule or @p Writes is nullptr, or the isl /// max operations count has exceeded. -IslPtr computeReachingWrite(IslPtr Schedule, - IslPtr Writes, - bool Reverse, bool InclPrevDef, - bool InclNextDef); +isl::UnionMap computeReachingWrite(isl::UnionMap Schedule, isl::UnionMap Writes, + bool Reverse, bool InclPrevDef, + bool InclNextDef); /// Compute the timepoints where the contents of an array element are not used. /// @@ -293,11 +286,9 @@ /// The unused timepoints as defined above, or nullptr if either @p /// Schedule, @p Writes are @p Reads is nullptr, or the ISL max /// operations count is exceeded. -IslPtr computeArrayUnused(IslPtr Schedule, - IslPtr Writes, - IslPtr Reads, - bool ReadEltInSameInst, - bool InclLastRead, bool InclWrite); +isl::UnionMap computeArrayUnused(isl::UnionMap Schedule, isl::UnionMap Writes, + isl::UnionMap Reads, bool ReadEltInSameInst, + bool InclLastRead, bool InclWrite); /// Convert a zone (range between timepoints) to timepoints. /// @@ -344,8 +335,8 @@ /// @param InclEnd Include timepoints adjacent to the ending of a zone. /// /// @return { Scatter[] } -IslPtr convertZoneToTimepoints(IslPtr Zone, - bool InclStart, bool InclEnd); +isl::UnionSet convertZoneToTimepoints(isl::UnionSet Zone, bool InclStart, + bool InclEnd); } // namespace polly #endif /* POLLY_ISLTOOLS_H */ Index: lib/External/isl/include/isl-noexceptions.h =================================================================== --- /dev/null +++ lib/External/isl/include/isl-noexceptions.h @@ -0,0 +1,3080 @@ +/// These are automatically generated C++ bindings for isl. +/// +/// +/// isl is a library for computing with integer sets and maps described by +/// Presburger formula. On top of this, isl provides various tools for +/// Polyhedral compilation ranging from dependence analysis over scheduling +/// to AST generation. +/// +/// +/// WARNING: Even though these bindings have been throughly tested and the +/// design has been reviewed by various members of the isl community, +/// we do not yet provide any stability guarantees for this interface. +/// We do not expect any larger changes to the interface, but want to +/// reserve the freedom to improve the bindings based on insights that +/// only become visible after shipping these bindings with isl itself. + +#ifndef ISL_CPP_ALL +#define ISL_CPP_ALL + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace isl { + +inline namespace noexceptions { + +// forward declarations +class Aff; +class AstBuild; +class AstExpr; +class AstNode; +class BasicMap; +class BasicSet; +class Id; +class Map; +class MultiAff; +class MultiPwAff; +class MultiUnionPwAff; +class MultiVal; +class Point; +class PwAff; +class PwMultiAff; +class Schedule; +class ScheduleConstraints; +class ScheduleNode; +class Set; +class Space; +class UnionAccessInfo; +class UnionFlow; +class UnionMap; +class UnionPwAff; +class UnionPwMultiAff; +class UnionSet; +class Val; + +// declarations for isl::Aff +inline Aff manage(__isl_take isl_aff *ptr); + +inline Aff give(__isl_take isl_aff *ptr); + +class Aff { + friend inline Aff manage(__isl_take isl_aff *ptr); + +inline Aff give(__isl_take isl_aff *ptr); + + isl_aff *ptr = nullptr; + + inline explicit Aff(__isl_take isl_aff *ptr); + +public: + inline Aff(); + inline Aff(const Aff &obj); + inline Aff(std::nullptr_t); + inline Aff &operator=(Aff obj); + inline ~Aff(); + inline __isl_give isl_aff *copy() const &; + inline __isl_give isl_aff *copy() && = delete; + inline __isl_keep isl_aff *get() const; + inline __isl_give isl_aff *release(); + inline __isl_keep isl_aff *keep() const; + inline __isl_give isl_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::AstBuild +inline AstBuild manage(__isl_take isl_ast_build *ptr); + +inline AstBuild give(__isl_take isl_ast_build *ptr); + +class AstBuild { + friend inline AstBuild manage(__isl_take isl_ast_build *ptr); + +inline AstBuild give(__isl_take isl_ast_build *ptr); + + isl_ast_build *ptr = nullptr; + + inline explicit AstBuild(__isl_take isl_ast_build *ptr); + +public: + inline AstBuild(); + inline AstBuild(const AstBuild &obj); + inline AstBuild(std::nullptr_t); + inline AstBuild &operator=(AstBuild obj); + inline ~AstBuild(); + inline __isl_give isl_ast_build *copy() const &; + inline __isl_give isl_ast_build *copy() && = delete; + inline __isl_keep isl_ast_build *get() const; + inline __isl_give isl_ast_build *release(); + inline __isl_keep isl_ast_build *keep() const; + inline __isl_give isl_ast_build *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; +}; + +// declarations for isl::AstExpr +inline AstExpr manage(__isl_take isl_ast_expr *ptr); + +inline AstExpr give(__isl_take isl_ast_expr *ptr); + +class AstExpr { + friend inline AstExpr manage(__isl_take isl_ast_expr *ptr); + +inline AstExpr give(__isl_take isl_ast_expr *ptr); + + isl_ast_expr *ptr = nullptr; + + inline explicit AstExpr(__isl_take isl_ast_expr *ptr); + +public: + inline AstExpr(); + inline AstExpr(const AstExpr &obj); + inline AstExpr(std::nullptr_t); + inline AstExpr &operator=(AstExpr obj); + inline ~AstExpr(); + inline __isl_give isl_ast_expr *copy() const &; + inline __isl_give isl_ast_expr *copy() && = delete; + inline __isl_keep isl_ast_expr *get() const; + inline __isl_give isl_ast_expr *release(); + inline __isl_keep isl_ast_expr *keep() const; + inline __isl_give isl_ast_expr *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::AstNode +inline AstNode manage(__isl_take isl_ast_node *ptr); + +inline AstNode give(__isl_take isl_ast_node *ptr); + +class AstNode { + friend inline AstNode manage(__isl_take isl_ast_node *ptr); + +inline AstNode give(__isl_take isl_ast_node *ptr); + + isl_ast_node *ptr = nullptr; + + inline explicit AstNode(__isl_take isl_ast_node *ptr); + +public: + inline AstNode(); + inline AstNode(const AstNode &obj); + inline AstNode(std::nullptr_t); + inline AstNode &operator=(AstNode obj); + inline ~AstNode(); + inline __isl_give isl_ast_node *copy() const &; + inline __isl_give isl_ast_node *copy() && = delete; + inline __isl_keep isl_ast_node *get() const; + inline __isl_give isl_ast_node *release(); + inline __isl_keep isl_ast_node *keep() const; + inline __isl_give isl_ast_node *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::BasicMap +inline BasicMap manage(__isl_take isl_basic_map *ptr); + +inline BasicMap give(__isl_take isl_basic_map *ptr); + +class BasicMap { + friend inline BasicMap manage(__isl_take isl_basic_map *ptr); + +inline BasicMap give(__isl_take isl_basic_map *ptr); + + isl_basic_map *ptr = nullptr; + + inline explicit BasicMap(__isl_take isl_basic_map *ptr); + +public: + inline BasicMap(); + inline BasicMap(const BasicMap &obj); + inline BasicMap(std::nullptr_t); + inline BasicMap &operator=(BasicMap obj); + inline ~BasicMap(); + inline __isl_give isl_basic_map *copy() const &; + inline __isl_give isl_basic_map *copy() && = delete; + inline __isl_keep isl_basic_map *get() const; + inline __isl_give isl_basic_map *release(); + inline __isl_keep isl_basic_map *keep() const; + inline __isl_give isl_basic_map *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::BasicSet +inline BasicSet manage(__isl_take isl_basic_set *ptr); + +inline BasicSet give(__isl_take isl_basic_set *ptr); + +class BasicSet { + friend inline BasicSet manage(__isl_take isl_basic_set *ptr); + +inline BasicSet give(__isl_take isl_basic_set *ptr); + + isl_basic_set *ptr = nullptr; + + inline explicit BasicSet(__isl_take isl_basic_set *ptr); + +public: + inline BasicSet(); + inline BasicSet(const BasicSet &obj); + inline BasicSet(std::nullptr_t); + inline BasicSet &operator=(BasicSet obj); + inline ~BasicSet(); + inline __isl_give isl_basic_set *copy() const &; + inline __isl_give isl_basic_set *copy() && = delete; + inline __isl_keep isl_basic_set *get() const; + inline __isl_give isl_basic_set *release(); + inline __isl_keep isl_basic_set *keep() const; + inline __isl_give isl_basic_set *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Id +inline Id manage(__isl_take isl_id *ptr); + +inline Id give(__isl_take isl_id *ptr); + +class Id { + friend inline Id manage(__isl_take isl_id *ptr); + +inline Id give(__isl_take isl_id *ptr); + + isl_id *ptr = nullptr; + + inline explicit Id(__isl_take isl_id *ptr); + +public: + inline Id(); + inline Id(const Id &obj); + inline Id(std::nullptr_t); + inline Id &operator=(Id obj); + inline ~Id(); + inline __isl_give isl_id *copy() const &; + inline __isl_give isl_id *copy() && = delete; + inline __isl_keep isl_id *get() const; + inline __isl_give isl_id *release(); + inline __isl_keep isl_id *keep() const; + inline __isl_give isl_id *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Map +inline Map manage(__isl_take isl_map *ptr); + +inline Map give(__isl_take isl_map *ptr); + +class Map { + friend inline Map manage(__isl_take isl_map *ptr); + +inline Map give(__isl_take isl_map *ptr); + + isl_map *ptr = nullptr; + + inline explicit Map(__isl_take isl_map *ptr); + +public: + inline Map(); + inline Map(const Map &obj); + inline Map(std::nullptr_t); + inline Map &operator=(Map obj); + inline ~Map(); + inline __isl_give isl_map *copy() const &; + inline __isl_give isl_map *copy() && = delete; + inline __isl_keep isl_map *get() const; + inline __isl_give isl_map *release(); + inline __isl_keep isl_map *keep() const; + inline __isl_give isl_map *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::MultiAff +inline MultiAff manage(__isl_take isl_multi_aff *ptr); + +inline MultiAff give(__isl_take isl_multi_aff *ptr); + +class MultiAff { + friend inline MultiAff manage(__isl_take isl_multi_aff *ptr); + +inline MultiAff give(__isl_take isl_multi_aff *ptr); + + isl_multi_aff *ptr = nullptr; + + inline explicit MultiAff(__isl_take isl_multi_aff *ptr); + +public: + inline MultiAff(); + inline MultiAff(const MultiAff &obj); + inline MultiAff(std::nullptr_t); + inline MultiAff &operator=(MultiAff obj); + inline ~MultiAff(); + inline __isl_give isl_multi_aff *copy() const &; + inline __isl_give isl_multi_aff *copy() && = delete; + inline __isl_keep isl_multi_aff *get() const; + inline __isl_give isl_multi_aff *release(); + inline __isl_keep isl_multi_aff *keep() const; + inline __isl_give isl_multi_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::MultiPwAff +inline MultiPwAff manage(__isl_take isl_multi_pw_aff *ptr); + +inline MultiPwAff give(__isl_take isl_multi_pw_aff *ptr); + +class MultiPwAff { + friend inline MultiPwAff manage(__isl_take isl_multi_pw_aff *ptr); + +inline MultiPwAff give(__isl_take isl_multi_pw_aff *ptr); + + isl_multi_pw_aff *ptr = nullptr; + + inline explicit MultiPwAff(__isl_take isl_multi_pw_aff *ptr); + +public: + inline MultiPwAff(); + inline MultiPwAff(const MultiPwAff &obj); + inline MultiPwAff(std::nullptr_t); + inline MultiPwAff &operator=(MultiPwAff obj); + inline ~MultiPwAff(); + inline __isl_give isl_multi_pw_aff *copy() const &; + inline __isl_give isl_multi_pw_aff *copy() && = delete; + inline __isl_keep isl_multi_pw_aff *get() const; + inline __isl_give isl_multi_pw_aff *release(); + inline __isl_keep isl_multi_pw_aff *keep() const; + inline __isl_give isl_multi_pw_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::MultiUnionPwAff +inline MultiUnionPwAff manage(__isl_take isl_multi_union_pw_aff *ptr); + +inline MultiUnionPwAff give(__isl_take isl_multi_union_pw_aff *ptr); + +class MultiUnionPwAff { + friend inline MultiUnionPwAff manage(__isl_take isl_multi_union_pw_aff *ptr); + +inline MultiUnionPwAff give(__isl_take isl_multi_union_pw_aff *ptr); + + isl_multi_union_pw_aff *ptr = nullptr; + + inline explicit MultiUnionPwAff(__isl_take isl_multi_union_pw_aff *ptr); + +public: + inline MultiUnionPwAff(); + inline MultiUnionPwAff(const MultiUnionPwAff &obj); + inline MultiUnionPwAff(std::nullptr_t); + inline MultiUnionPwAff &operator=(MultiUnionPwAff obj); + inline ~MultiUnionPwAff(); + inline __isl_give isl_multi_union_pw_aff *copy() const &; + inline __isl_give isl_multi_union_pw_aff *copy() && = delete; + inline __isl_keep isl_multi_union_pw_aff *get() const; + inline __isl_give isl_multi_union_pw_aff *release(); + inline __isl_keep isl_multi_union_pw_aff *keep() const; + inline __isl_give isl_multi_union_pw_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::MultiVal +inline MultiVal manage(__isl_take isl_multi_val *ptr); + +inline MultiVal give(__isl_take isl_multi_val *ptr); + +class MultiVal { + friend inline MultiVal manage(__isl_take isl_multi_val *ptr); + +inline MultiVal give(__isl_take isl_multi_val *ptr); + + isl_multi_val *ptr = nullptr; + + inline explicit MultiVal(__isl_take isl_multi_val *ptr); + +public: + inline MultiVal(); + inline MultiVal(const MultiVal &obj); + inline MultiVal(std::nullptr_t); + inline MultiVal &operator=(MultiVal obj); + inline ~MultiVal(); + inline __isl_give isl_multi_val *copy() const &; + inline __isl_give isl_multi_val *copy() && = delete; + inline __isl_keep isl_multi_val *get() const; + inline __isl_give isl_multi_val *release(); + inline __isl_keep isl_multi_val *keep() const; + inline __isl_give isl_multi_val *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Point +inline Point manage(__isl_take isl_point *ptr); + +inline Point give(__isl_take isl_point *ptr); + +class Point { + friend inline Point manage(__isl_take isl_point *ptr); + +inline Point give(__isl_take isl_point *ptr); + + isl_point *ptr = nullptr; + + inline explicit Point(__isl_take isl_point *ptr); + +public: + inline Point(); + inline Point(const Point &obj); + inline Point(std::nullptr_t); + inline Point &operator=(Point obj); + inline ~Point(); + inline __isl_give isl_point *copy() const &; + inline __isl_give isl_point *copy() && = delete; + inline __isl_keep isl_point *get() const; + inline __isl_give isl_point *release(); + inline __isl_keep isl_point *keep() const; + inline __isl_give isl_point *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::PwAff +inline PwAff manage(__isl_take isl_pw_aff *ptr); + +inline PwAff give(__isl_take isl_pw_aff *ptr); + +class PwAff { + friend inline PwAff manage(__isl_take isl_pw_aff *ptr); + +inline PwAff give(__isl_take isl_pw_aff *ptr); + + isl_pw_aff *ptr = nullptr; + + inline explicit PwAff(__isl_take isl_pw_aff *ptr); + +public: + inline PwAff(); + inline PwAff(const PwAff &obj); + inline PwAff(std::nullptr_t); + inline PwAff &operator=(PwAff obj); + inline ~PwAff(); + inline __isl_give isl_pw_aff *copy() const &; + inline __isl_give isl_pw_aff *copy() && = delete; + inline __isl_keep isl_pw_aff *get() const; + inline __isl_give isl_pw_aff *release(); + inline __isl_keep isl_pw_aff *keep() const; + inline __isl_give isl_pw_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::PwMultiAff +inline PwMultiAff manage(__isl_take isl_pw_multi_aff *ptr); + +inline PwMultiAff give(__isl_take isl_pw_multi_aff *ptr); + +class PwMultiAff { + friend inline PwMultiAff manage(__isl_take isl_pw_multi_aff *ptr); + +inline PwMultiAff give(__isl_take isl_pw_multi_aff *ptr); + + isl_pw_multi_aff *ptr = nullptr; + + inline explicit PwMultiAff(__isl_take isl_pw_multi_aff *ptr); + +public: + inline PwMultiAff(); + inline PwMultiAff(const PwMultiAff &obj); + inline PwMultiAff(std::nullptr_t); + inline PwMultiAff &operator=(PwMultiAff obj); + inline ~PwMultiAff(); + inline __isl_give isl_pw_multi_aff *copy() const &; + inline __isl_give isl_pw_multi_aff *copy() && = delete; + inline __isl_keep isl_pw_multi_aff *get() const; + inline __isl_give isl_pw_multi_aff *release(); + inline __isl_keep isl_pw_multi_aff *keep() const; + inline __isl_give isl_pw_multi_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Schedule +inline Schedule manage(__isl_take isl_schedule *ptr); + +inline Schedule give(__isl_take isl_schedule *ptr); + +class Schedule { + friend inline Schedule manage(__isl_take isl_schedule *ptr); + +inline Schedule give(__isl_take isl_schedule *ptr); + + isl_schedule *ptr = nullptr; + + inline explicit Schedule(__isl_take isl_schedule *ptr); + +public: + inline Schedule(); + inline Schedule(const Schedule &obj); + inline Schedule(std::nullptr_t); + inline Schedule &operator=(Schedule obj); + inline ~Schedule(); + inline __isl_give isl_schedule *copy() const &; + inline __isl_give isl_schedule *copy() && = delete; + inline __isl_keep isl_schedule *get() const; + inline __isl_give isl_schedule *release(); + inline __isl_keep isl_schedule *keep() const; + inline __isl_give isl_schedule *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::ScheduleConstraints +inline ScheduleConstraints manage(__isl_take isl_schedule_constraints *ptr); + +inline ScheduleConstraints give(__isl_take isl_schedule_constraints *ptr); + +class ScheduleConstraints { + friend inline ScheduleConstraints manage(__isl_take isl_schedule_constraints *ptr); + +inline ScheduleConstraints give(__isl_take isl_schedule_constraints *ptr); + + isl_schedule_constraints *ptr = nullptr; + + inline explicit ScheduleConstraints(__isl_take isl_schedule_constraints *ptr); + +public: + inline ScheduleConstraints(); + inline ScheduleConstraints(const ScheduleConstraints &obj); + inline ScheduleConstraints(std::nullptr_t); + inline ScheduleConstraints &operator=(ScheduleConstraints obj); + inline ~ScheduleConstraints(); + inline __isl_give isl_schedule_constraints *copy() const &; + inline __isl_give isl_schedule_constraints *copy() && = delete; + inline __isl_keep isl_schedule_constraints *get() const; + inline __isl_give isl_schedule_constraints *release(); + inline __isl_keep isl_schedule_constraints *keep() const; + inline __isl_give isl_schedule_constraints *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::ScheduleNode +inline ScheduleNode manage(__isl_take isl_schedule_node *ptr); + +inline ScheduleNode give(__isl_take isl_schedule_node *ptr); + +class ScheduleNode { + friend inline ScheduleNode manage(__isl_take isl_schedule_node *ptr); + +inline ScheduleNode give(__isl_take isl_schedule_node *ptr); + + isl_schedule_node *ptr = nullptr; + + inline explicit ScheduleNode(__isl_take isl_schedule_node *ptr); + +public: + inline ScheduleNode(); + inline ScheduleNode(const ScheduleNode &obj); + inline ScheduleNode(std::nullptr_t); + inline ScheduleNode &operator=(ScheduleNode obj); + inline ~ScheduleNode(); + inline __isl_give isl_schedule_node *copy() const &; + inline __isl_give isl_schedule_node *copy() && = delete; + inline __isl_keep isl_schedule_node *get() const; + inline __isl_give isl_schedule_node *release(); + inline __isl_keep isl_schedule_node *keep() const; + inline __isl_give isl_schedule_node *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Set +inline Set manage(__isl_take isl_set *ptr); + +inline Set give(__isl_take isl_set *ptr); + +class Set { + friend inline Set manage(__isl_take isl_set *ptr); + +inline Set give(__isl_take isl_set *ptr); + + isl_set *ptr = nullptr; + + inline explicit Set(__isl_take isl_set *ptr); + +public: + inline Set(); + inline Set(const Set &obj); + inline Set(std::nullptr_t); + inline Set &operator=(Set obj); + inline ~Set(); + inline __isl_give isl_set *copy() const &; + inline __isl_give isl_set *copy() && = delete; + inline __isl_keep isl_set *get() const; + inline __isl_give isl_set *release(); + inline __isl_keep isl_set *keep() const; + inline __isl_give isl_set *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Space +inline Space manage(__isl_take isl_space *ptr); + +inline Space give(__isl_take isl_space *ptr); + +class Space { + friend inline Space manage(__isl_take isl_space *ptr); + +inline Space give(__isl_take isl_space *ptr); + + isl_space *ptr = nullptr; + + inline explicit Space(__isl_take isl_space *ptr); + +public: + inline Space(); + inline Space(const Space &obj); + inline Space(std::nullptr_t); + inline Space &operator=(Space obj); + inline ~Space(); + inline __isl_give isl_space *copy() const &; + inline __isl_give isl_space *copy() && = delete; + inline __isl_keep isl_space *get() const; + inline __isl_give isl_space *release(); + inline __isl_keep isl_space *keep() const; + inline __isl_give isl_space *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionAccessInfo +inline UnionAccessInfo manage(__isl_take isl_union_access_info *ptr); + +inline UnionAccessInfo give(__isl_take isl_union_access_info *ptr); + +class UnionAccessInfo { + friend inline UnionAccessInfo manage(__isl_take isl_union_access_info *ptr); + +inline UnionAccessInfo give(__isl_take isl_union_access_info *ptr); + + isl_union_access_info *ptr = nullptr; + + inline explicit UnionAccessInfo(__isl_take isl_union_access_info *ptr); + +public: + inline UnionAccessInfo(); + inline UnionAccessInfo(const UnionAccessInfo &obj); + inline UnionAccessInfo(std::nullptr_t); + inline UnionAccessInfo &operator=(UnionAccessInfo obj); + inline ~UnionAccessInfo(); + inline __isl_give isl_union_access_info *copy() const &; + inline __isl_give isl_union_access_info *copy() && = delete; + inline __isl_keep isl_union_access_info *get() const; + inline __isl_give isl_union_access_info *release(); + inline __isl_keep isl_union_access_info *keep() const; + inline __isl_give isl_union_access_info *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionFlow +inline UnionFlow manage(__isl_take isl_union_flow *ptr); + +inline UnionFlow give(__isl_take isl_union_flow *ptr); + +class UnionFlow { + friend inline UnionFlow manage(__isl_take isl_union_flow *ptr); + +inline UnionFlow give(__isl_take isl_union_flow *ptr); + + isl_union_flow *ptr = nullptr; + + inline explicit UnionFlow(__isl_take isl_union_flow *ptr); + +public: + inline UnionFlow(); + inline UnionFlow(const UnionFlow &obj); + inline UnionFlow(std::nullptr_t); + inline UnionFlow &operator=(UnionFlow obj); + inline ~UnionFlow(); + inline __isl_give isl_union_flow *copy() const &; + inline __isl_give isl_union_flow *copy() && = delete; + inline __isl_keep isl_union_flow *get() const; + inline __isl_give isl_union_flow *release(); + inline __isl_keep isl_union_flow *keep() const; + inline __isl_give isl_union_flow *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionMap +inline UnionMap manage(__isl_take isl_union_map *ptr); + +inline UnionMap give(__isl_take isl_union_map *ptr); + +class UnionMap { + friend inline UnionMap manage(__isl_take isl_union_map *ptr); + +inline UnionMap give(__isl_take isl_union_map *ptr); + + isl_union_map *ptr = nullptr; + + inline explicit UnionMap(__isl_take isl_union_map *ptr); + +public: + inline UnionMap(); + inline UnionMap(const UnionMap &obj); + inline UnionMap(std::nullptr_t); + inline UnionMap &operator=(UnionMap obj); + inline ~UnionMap(); + inline __isl_give isl_union_map *copy() const &; + inline __isl_give isl_union_map *copy() && = delete; + inline __isl_keep isl_union_map *get() const; + inline __isl_give isl_union_map *release(); + inline __isl_keep isl_union_map *keep() const; + inline __isl_give isl_union_map *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionPwAff +inline UnionPwAff manage(__isl_take isl_union_pw_aff *ptr); + +inline UnionPwAff give(__isl_take isl_union_pw_aff *ptr); + +class UnionPwAff { + friend inline UnionPwAff manage(__isl_take isl_union_pw_aff *ptr); + +inline UnionPwAff give(__isl_take isl_union_pw_aff *ptr); + + isl_union_pw_aff *ptr = nullptr; + + inline explicit UnionPwAff(__isl_take isl_union_pw_aff *ptr); + +public: + inline UnionPwAff(); + inline UnionPwAff(const UnionPwAff &obj); + inline UnionPwAff(std::nullptr_t); + inline UnionPwAff &operator=(UnionPwAff obj); + inline ~UnionPwAff(); + inline __isl_give isl_union_pw_aff *copy() const &; + inline __isl_give isl_union_pw_aff *copy() && = delete; + inline __isl_keep isl_union_pw_aff *get() const; + inline __isl_give isl_union_pw_aff *release(); + inline __isl_keep isl_union_pw_aff *keep() const; + inline __isl_give isl_union_pw_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionPwMultiAff +inline UnionPwMultiAff manage(__isl_take isl_union_pw_multi_aff *ptr); + +inline UnionPwMultiAff give(__isl_take isl_union_pw_multi_aff *ptr); + +class UnionPwMultiAff { + friend inline UnionPwMultiAff manage(__isl_take isl_union_pw_multi_aff *ptr); + +inline UnionPwMultiAff give(__isl_take isl_union_pw_multi_aff *ptr); + + isl_union_pw_multi_aff *ptr = nullptr; + + inline explicit UnionPwMultiAff(__isl_take isl_union_pw_multi_aff *ptr); + +public: + inline UnionPwMultiAff(); + inline UnionPwMultiAff(const UnionPwMultiAff &obj); + inline UnionPwMultiAff(std::nullptr_t); + inline UnionPwMultiAff &operator=(UnionPwMultiAff obj); + inline ~UnionPwMultiAff(); + inline __isl_give isl_union_pw_multi_aff *copy() const &; + inline __isl_give isl_union_pw_multi_aff *copy() && = delete; + inline __isl_keep isl_union_pw_multi_aff *get() const; + inline __isl_give isl_union_pw_multi_aff *release(); + inline __isl_keep isl_union_pw_multi_aff *keep() const; + inline __isl_give isl_union_pw_multi_aff *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::UnionSet +inline UnionSet manage(__isl_take isl_union_set *ptr); + +inline UnionSet give(__isl_take isl_union_set *ptr); + +class UnionSet { + friend inline UnionSet manage(__isl_take isl_union_set *ptr); + +inline UnionSet give(__isl_take isl_union_set *ptr); + + isl_union_set *ptr = nullptr; + + inline explicit UnionSet(__isl_take isl_union_set *ptr); + +public: + inline UnionSet(); + inline UnionSet(const UnionSet &obj); + inline UnionSet(std::nullptr_t); + inline UnionSet &operator=(UnionSet obj); + inline ~UnionSet(); + inline __isl_give isl_union_set *copy() const &; + inline __isl_give isl_union_set *copy() && = delete; + inline __isl_keep isl_union_set *get() const; + inline __isl_give isl_union_set *release(); + inline __isl_keep isl_union_set *keep() const; + inline __isl_give isl_union_set *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// declarations for isl::Val +inline Val manage(__isl_take isl_val *ptr); + +inline Val give(__isl_take isl_val *ptr); + +class Val { + friend inline Val manage(__isl_take isl_val *ptr); + +inline Val give(__isl_take isl_val *ptr); + + isl_val *ptr = nullptr; + + inline explicit Val(__isl_take isl_val *ptr); + +public: + inline Val(); + inline Val(const Val &obj); + inline Val(std::nullptr_t); + inline Val &operator=(Val obj); + inline ~Val(); + inline __isl_give isl_val *copy() const &; + inline __isl_give isl_val *copy() && = delete; + inline __isl_keep isl_val *get() const; + inline __isl_give isl_val *release(); + inline __isl_keep isl_val *keep() const; + inline __isl_give isl_val *take(); + inline explicit operator bool() const; + inline isl_ctx *getCtx() const; + inline bool isNull() const; + inline std::string getStr() const; +}; + +// implementations for isl::Aff +Aff manage(__isl_take isl_aff *ptr) { + return Aff(ptr); +} + +Aff give(__isl_take isl_aff *ptr) { + return manage(ptr); +} + +Aff::Aff() + : ptr(nullptr) {} + +Aff::Aff(const Aff &obj) + : ptr(obj.copy()) {} + +Aff::Aff(std::nullptr_t) + : ptr(nullptr) {} + +Aff::Aff(__isl_take isl_aff *ptr) + : ptr(ptr) {} + +Aff &Aff::operator=(Aff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Aff::~Aff() { + if (ptr) + isl_aff_free(ptr); +} + +__isl_give isl_aff *Aff::copy() const & { + return isl_aff_copy(ptr); +} + +__isl_keep isl_aff *Aff::get() const { + return ptr; +} + +__isl_give isl_aff *Aff::release() { + isl_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_aff *Aff::keep() const { + return get(); +} + +__isl_give isl_aff *Aff::take() { + return release(); +} + +Aff::operator bool() const { + return !isNull(); +} + +isl_ctx *Aff::getCtx() const { + return isl_aff_get_ctx(ptr); +} + +bool Aff::isNull() const { + return ptr == nullptr; +} + +std::string Aff::getStr() const { + char *Tmp = isl_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Aff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::AstBuild +AstBuild manage(__isl_take isl_ast_build *ptr) { + return AstBuild(ptr); +} + +AstBuild give(__isl_take isl_ast_build *ptr) { + return manage(ptr); +} + +AstBuild::AstBuild() + : ptr(nullptr) {} + +AstBuild::AstBuild(const AstBuild &obj) + : ptr(obj.copy()) {} + +AstBuild::AstBuild(std::nullptr_t) + : ptr(nullptr) {} + +AstBuild::AstBuild(__isl_take isl_ast_build *ptr) + : ptr(ptr) {} + +AstBuild &AstBuild::operator=(AstBuild obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +AstBuild::~AstBuild() { + if (ptr) + isl_ast_build_free(ptr); +} + +__isl_give isl_ast_build *AstBuild::copy() const & { + return isl_ast_build_copy(ptr); +} + +__isl_keep isl_ast_build *AstBuild::get() const { + return ptr; +} + +__isl_give isl_ast_build *AstBuild::release() { + isl_ast_build *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_build *AstBuild::keep() const { + return get(); +} + +__isl_give isl_ast_build *AstBuild::take() { + return release(); +} + +AstBuild::operator bool() const { + return !isNull(); +} + +isl_ctx *AstBuild::getCtx() const { + return isl_ast_build_get_ctx(ptr); +} + +bool AstBuild::isNull() const { + return ptr == nullptr; +} + +// implementations for isl::AstExpr +AstExpr manage(__isl_take isl_ast_expr *ptr) { + return AstExpr(ptr); +} + +AstExpr give(__isl_take isl_ast_expr *ptr) { + return manage(ptr); +} + +AstExpr::AstExpr() + : ptr(nullptr) {} + +AstExpr::AstExpr(const AstExpr &obj) + : ptr(obj.copy()) {} + +AstExpr::AstExpr(std::nullptr_t) + : ptr(nullptr) {} + +AstExpr::AstExpr(__isl_take isl_ast_expr *ptr) + : ptr(ptr) {} + +AstExpr &AstExpr::operator=(AstExpr obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +AstExpr::~AstExpr() { + if (ptr) + isl_ast_expr_free(ptr); +} + +__isl_give isl_ast_expr *AstExpr::copy() const & { + return isl_ast_expr_copy(ptr); +} + +__isl_keep isl_ast_expr *AstExpr::get() const { + return ptr; +} + +__isl_give isl_ast_expr *AstExpr::release() { + isl_ast_expr *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_expr *AstExpr::keep() const { + return get(); +} + +__isl_give isl_ast_expr *AstExpr::take() { + return release(); +} + +AstExpr::operator bool() const { + return !isNull(); +} + +isl_ctx *AstExpr::getCtx() const { + return isl_ast_expr_get_ctx(ptr); +} + +bool AstExpr::isNull() const { + return ptr == nullptr; +} + +std::string AstExpr::getStr() const { + char *Tmp = isl_ast_expr_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const AstExpr &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::AstNode +AstNode manage(__isl_take isl_ast_node *ptr) { + return AstNode(ptr); +} + +AstNode give(__isl_take isl_ast_node *ptr) { + return manage(ptr); +} + +AstNode::AstNode() + : ptr(nullptr) {} + +AstNode::AstNode(const AstNode &obj) + : ptr(obj.copy()) {} + +AstNode::AstNode(std::nullptr_t) + : ptr(nullptr) {} + +AstNode::AstNode(__isl_take isl_ast_node *ptr) + : ptr(ptr) {} + +AstNode &AstNode::operator=(AstNode obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +AstNode::~AstNode() { + if (ptr) + isl_ast_node_free(ptr); +} + +__isl_give isl_ast_node *AstNode::copy() const & { + return isl_ast_node_copy(ptr); +} + +__isl_keep isl_ast_node *AstNode::get() const { + return ptr; +} + +__isl_give isl_ast_node *AstNode::release() { + isl_ast_node *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_ast_node *AstNode::keep() const { + return get(); +} + +__isl_give isl_ast_node *AstNode::take() { + return release(); +} + +AstNode::operator bool() const { + return !isNull(); +} + +isl_ctx *AstNode::getCtx() const { + return isl_ast_node_get_ctx(ptr); +} + +bool AstNode::isNull() const { + return ptr == nullptr; +} + +std::string AstNode::getStr() const { + char *Tmp = isl_ast_node_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const AstNode &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::BasicMap +BasicMap manage(__isl_take isl_basic_map *ptr) { + return BasicMap(ptr); +} + +BasicMap give(__isl_take isl_basic_map *ptr) { + return manage(ptr); +} + +BasicMap::BasicMap() + : ptr(nullptr) {} + +BasicMap::BasicMap(const BasicMap &obj) + : ptr(obj.copy()) {} + +BasicMap::BasicMap(std::nullptr_t) + : ptr(nullptr) {} + +BasicMap::BasicMap(__isl_take isl_basic_map *ptr) + : ptr(ptr) {} + +BasicMap &BasicMap::operator=(BasicMap obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +BasicMap::~BasicMap() { + if (ptr) + isl_basic_map_free(ptr); +} + +__isl_give isl_basic_map *BasicMap::copy() const & { + return isl_basic_map_copy(ptr); +} + +__isl_keep isl_basic_map *BasicMap::get() const { + return ptr; +} + +__isl_give isl_basic_map *BasicMap::release() { + isl_basic_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_basic_map *BasicMap::keep() const { + return get(); +} + +__isl_give isl_basic_map *BasicMap::take() { + return release(); +} + +BasicMap::operator bool() const { + return !isNull(); +} + +isl_ctx *BasicMap::getCtx() const { + return isl_basic_map_get_ctx(ptr); +} + +bool BasicMap::isNull() const { + return ptr == nullptr; +} + +std::string BasicMap::getStr() const { + char *Tmp = isl_basic_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const BasicMap &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::BasicSet +BasicSet manage(__isl_take isl_basic_set *ptr) { + return BasicSet(ptr); +} + +BasicSet give(__isl_take isl_basic_set *ptr) { + return manage(ptr); +} + +BasicSet::BasicSet() + : ptr(nullptr) {} + +BasicSet::BasicSet(const BasicSet &obj) + : ptr(obj.copy()) {} + +BasicSet::BasicSet(std::nullptr_t) + : ptr(nullptr) {} + +BasicSet::BasicSet(__isl_take isl_basic_set *ptr) + : ptr(ptr) {} + +BasicSet &BasicSet::operator=(BasicSet obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +BasicSet::~BasicSet() { + if (ptr) + isl_basic_set_free(ptr); +} + +__isl_give isl_basic_set *BasicSet::copy() const & { + return isl_basic_set_copy(ptr); +} + +__isl_keep isl_basic_set *BasicSet::get() const { + return ptr; +} + +__isl_give isl_basic_set *BasicSet::release() { + isl_basic_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_basic_set *BasicSet::keep() const { + return get(); +} + +__isl_give isl_basic_set *BasicSet::take() { + return release(); +} + +BasicSet::operator bool() const { + return !isNull(); +} + +isl_ctx *BasicSet::getCtx() const { + return isl_basic_set_get_ctx(ptr); +} + +bool BasicSet::isNull() const { + return ptr == nullptr; +} + +std::string BasicSet::getStr() const { + char *Tmp = isl_basic_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const BasicSet &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Id +Id manage(__isl_take isl_id *ptr) { + return Id(ptr); +} + +Id give(__isl_take isl_id *ptr) { + return manage(ptr); +} + +Id::Id() + : ptr(nullptr) {} + +Id::Id(const Id &obj) + : ptr(obj.copy()) {} + +Id::Id(std::nullptr_t) + : ptr(nullptr) {} + +Id::Id(__isl_take isl_id *ptr) + : ptr(ptr) {} + +Id &Id::operator=(Id obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Id::~Id() { + if (ptr) + isl_id_free(ptr); +} + +__isl_give isl_id *Id::copy() const & { + return isl_id_copy(ptr); +} + +__isl_keep isl_id *Id::get() const { + return ptr; +} + +__isl_give isl_id *Id::release() { + isl_id *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_id *Id::keep() const { + return get(); +} + +__isl_give isl_id *Id::take() { + return release(); +} + +Id::operator bool() const { + return !isNull(); +} + +isl_ctx *Id::getCtx() const { + return isl_id_get_ctx(ptr); +} + +bool Id::isNull() const { + return ptr == nullptr; +} + +std::string Id::getStr() const { + char *Tmp = isl_id_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Id &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Map +Map manage(__isl_take isl_map *ptr) { + return Map(ptr); +} + +Map give(__isl_take isl_map *ptr) { + return manage(ptr); +} + +Map::Map() + : ptr(nullptr) {} + +Map::Map(const Map &obj) + : ptr(obj.copy()) {} + +Map::Map(std::nullptr_t) + : ptr(nullptr) {} + +Map::Map(__isl_take isl_map *ptr) + : ptr(ptr) {} + +Map &Map::operator=(Map obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Map::~Map() { + if (ptr) + isl_map_free(ptr); +} + +__isl_give isl_map *Map::copy() const & { + return isl_map_copy(ptr); +} + +__isl_keep isl_map *Map::get() const { + return ptr; +} + +__isl_give isl_map *Map::release() { + isl_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_map *Map::keep() const { + return get(); +} + +__isl_give isl_map *Map::take() { + return release(); +} + +Map::operator bool() const { + return !isNull(); +} + +isl_ctx *Map::getCtx() const { + return isl_map_get_ctx(ptr); +} + +bool Map::isNull() const { + return ptr == nullptr; +} + +std::string Map::getStr() const { + char *Tmp = isl_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Map &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::MultiAff +MultiAff manage(__isl_take isl_multi_aff *ptr) { + return MultiAff(ptr); +} + +MultiAff give(__isl_take isl_multi_aff *ptr) { + return manage(ptr); +} + +MultiAff::MultiAff() + : ptr(nullptr) {} + +MultiAff::MultiAff(const MultiAff &obj) + : ptr(obj.copy()) {} + +MultiAff::MultiAff(std::nullptr_t) + : ptr(nullptr) {} + +MultiAff::MultiAff(__isl_take isl_multi_aff *ptr) + : ptr(ptr) {} + +MultiAff &MultiAff::operator=(MultiAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +MultiAff::~MultiAff() { + if (ptr) + isl_multi_aff_free(ptr); +} + +__isl_give isl_multi_aff *MultiAff::copy() const & { + return isl_multi_aff_copy(ptr); +} + +__isl_keep isl_multi_aff *MultiAff::get() const { + return ptr; +} + +__isl_give isl_multi_aff *MultiAff::release() { + isl_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_aff *MultiAff::keep() const { + return get(); +} + +__isl_give isl_multi_aff *MultiAff::take() { + return release(); +} + +MultiAff::operator bool() const { + return !isNull(); +} + +isl_ctx *MultiAff::getCtx() const { + return isl_multi_aff_get_ctx(ptr); +} + +bool MultiAff::isNull() const { + return ptr == nullptr; +} + +std::string MultiAff::getStr() const { + char *Tmp = isl_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const MultiAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::MultiPwAff +MultiPwAff manage(__isl_take isl_multi_pw_aff *ptr) { + return MultiPwAff(ptr); +} + +MultiPwAff give(__isl_take isl_multi_pw_aff *ptr) { + return manage(ptr); +} + +MultiPwAff::MultiPwAff() + : ptr(nullptr) {} + +MultiPwAff::MultiPwAff(const MultiPwAff &obj) + : ptr(obj.copy()) {} + +MultiPwAff::MultiPwAff(std::nullptr_t) + : ptr(nullptr) {} + +MultiPwAff::MultiPwAff(__isl_take isl_multi_pw_aff *ptr) + : ptr(ptr) {} + +MultiPwAff &MultiPwAff::operator=(MultiPwAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +MultiPwAff::~MultiPwAff() { + if (ptr) + isl_multi_pw_aff_free(ptr); +} + +__isl_give isl_multi_pw_aff *MultiPwAff::copy() const & { + return isl_multi_pw_aff_copy(ptr); +} + +__isl_keep isl_multi_pw_aff *MultiPwAff::get() const { + return ptr; +} + +__isl_give isl_multi_pw_aff *MultiPwAff::release() { + isl_multi_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_pw_aff *MultiPwAff::keep() const { + return get(); +} + +__isl_give isl_multi_pw_aff *MultiPwAff::take() { + return release(); +} + +MultiPwAff::operator bool() const { + return !isNull(); +} + +isl_ctx *MultiPwAff::getCtx() const { + return isl_multi_pw_aff_get_ctx(ptr); +} + +bool MultiPwAff::isNull() const { + return ptr == nullptr; +} + +std::string MultiPwAff::getStr() const { + char *Tmp = isl_multi_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const MultiPwAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::MultiUnionPwAff +MultiUnionPwAff manage(__isl_take isl_multi_union_pw_aff *ptr) { + return MultiUnionPwAff(ptr); +} + +MultiUnionPwAff give(__isl_take isl_multi_union_pw_aff *ptr) { + return manage(ptr); +} + +MultiUnionPwAff::MultiUnionPwAff() + : ptr(nullptr) {} + +MultiUnionPwAff::MultiUnionPwAff(const MultiUnionPwAff &obj) + : ptr(obj.copy()) {} + +MultiUnionPwAff::MultiUnionPwAff(std::nullptr_t) + : ptr(nullptr) {} + +MultiUnionPwAff::MultiUnionPwAff(__isl_take isl_multi_union_pw_aff *ptr) + : ptr(ptr) {} + +MultiUnionPwAff &MultiUnionPwAff::operator=(MultiUnionPwAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +MultiUnionPwAff::~MultiUnionPwAff() { + if (ptr) + isl_multi_union_pw_aff_free(ptr); +} + +__isl_give isl_multi_union_pw_aff *MultiUnionPwAff::copy() const & { + return isl_multi_union_pw_aff_copy(ptr); +} + +__isl_keep isl_multi_union_pw_aff *MultiUnionPwAff::get() const { + return ptr; +} + +__isl_give isl_multi_union_pw_aff *MultiUnionPwAff::release() { + isl_multi_union_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_union_pw_aff *MultiUnionPwAff::keep() const { + return get(); +} + +__isl_give isl_multi_union_pw_aff *MultiUnionPwAff::take() { + return release(); +} + +MultiUnionPwAff::operator bool() const { + return !isNull(); +} + +isl_ctx *MultiUnionPwAff::getCtx() const { + return isl_multi_union_pw_aff_get_ctx(ptr); +} + +bool MultiUnionPwAff::isNull() const { + return ptr == nullptr; +} + +std::string MultiUnionPwAff::getStr() const { + char *Tmp = isl_multi_union_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const MultiUnionPwAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::MultiVal +MultiVal manage(__isl_take isl_multi_val *ptr) { + return MultiVal(ptr); +} + +MultiVal give(__isl_take isl_multi_val *ptr) { + return manage(ptr); +} + +MultiVal::MultiVal() + : ptr(nullptr) {} + +MultiVal::MultiVal(const MultiVal &obj) + : ptr(obj.copy()) {} + +MultiVal::MultiVal(std::nullptr_t) + : ptr(nullptr) {} + +MultiVal::MultiVal(__isl_take isl_multi_val *ptr) + : ptr(ptr) {} + +MultiVal &MultiVal::operator=(MultiVal obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +MultiVal::~MultiVal() { + if (ptr) + isl_multi_val_free(ptr); +} + +__isl_give isl_multi_val *MultiVal::copy() const & { + return isl_multi_val_copy(ptr); +} + +__isl_keep isl_multi_val *MultiVal::get() const { + return ptr; +} + +__isl_give isl_multi_val *MultiVal::release() { + isl_multi_val *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_multi_val *MultiVal::keep() const { + return get(); +} + +__isl_give isl_multi_val *MultiVal::take() { + return release(); +} + +MultiVal::operator bool() const { + return !isNull(); +} + +isl_ctx *MultiVal::getCtx() const { + return isl_multi_val_get_ctx(ptr); +} + +bool MultiVal::isNull() const { + return ptr == nullptr; +} + +std::string MultiVal::getStr() const { + char *Tmp = isl_multi_val_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const MultiVal &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Point +Point manage(__isl_take isl_point *ptr) { + return Point(ptr); +} + +Point give(__isl_take isl_point *ptr) { + return manage(ptr); +} + +Point::Point() + : ptr(nullptr) {} + +Point::Point(const Point &obj) + : ptr(obj.copy()) {} + +Point::Point(std::nullptr_t) + : ptr(nullptr) {} + +Point::Point(__isl_take isl_point *ptr) + : ptr(ptr) {} + +Point &Point::operator=(Point obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Point::~Point() { + if (ptr) + isl_point_free(ptr); +} + +__isl_give isl_point *Point::copy() const & { + return isl_point_copy(ptr); +} + +__isl_keep isl_point *Point::get() const { + return ptr; +} + +__isl_give isl_point *Point::release() { + isl_point *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_point *Point::keep() const { + return get(); +} + +__isl_give isl_point *Point::take() { + return release(); +} + +Point::operator bool() const { + return !isNull(); +} + +isl_ctx *Point::getCtx() const { + return isl_point_get_ctx(ptr); +} + +bool Point::isNull() const { + return ptr == nullptr; +} + +std::string Point::getStr() const { + char *Tmp = isl_point_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Point &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::PwAff +PwAff manage(__isl_take isl_pw_aff *ptr) { + return PwAff(ptr); +} + +PwAff give(__isl_take isl_pw_aff *ptr) { + return manage(ptr); +} + +PwAff::PwAff() + : ptr(nullptr) {} + +PwAff::PwAff(const PwAff &obj) + : ptr(obj.copy()) {} + +PwAff::PwAff(std::nullptr_t) + : ptr(nullptr) {} + +PwAff::PwAff(__isl_take isl_pw_aff *ptr) + : ptr(ptr) {} + +PwAff &PwAff::operator=(PwAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +PwAff::~PwAff() { + if (ptr) + isl_pw_aff_free(ptr); +} + +__isl_give isl_pw_aff *PwAff::copy() const & { + return isl_pw_aff_copy(ptr); +} + +__isl_keep isl_pw_aff *PwAff::get() const { + return ptr; +} + +__isl_give isl_pw_aff *PwAff::release() { + isl_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_pw_aff *PwAff::keep() const { + return get(); +} + +__isl_give isl_pw_aff *PwAff::take() { + return release(); +} + +PwAff::operator bool() const { + return !isNull(); +} + +isl_ctx *PwAff::getCtx() const { + return isl_pw_aff_get_ctx(ptr); +} + +bool PwAff::isNull() const { + return ptr == nullptr; +} + +std::string PwAff::getStr() const { + char *Tmp = isl_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const PwAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::PwMultiAff +PwMultiAff manage(__isl_take isl_pw_multi_aff *ptr) { + return PwMultiAff(ptr); +} + +PwMultiAff give(__isl_take isl_pw_multi_aff *ptr) { + return manage(ptr); +} + +PwMultiAff::PwMultiAff() + : ptr(nullptr) {} + +PwMultiAff::PwMultiAff(const PwMultiAff &obj) + : ptr(obj.copy()) {} + +PwMultiAff::PwMultiAff(std::nullptr_t) + : ptr(nullptr) {} + +PwMultiAff::PwMultiAff(__isl_take isl_pw_multi_aff *ptr) + : ptr(ptr) {} + +PwMultiAff &PwMultiAff::operator=(PwMultiAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +PwMultiAff::~PwMultiAff() { + if (ptr) + isl_pw_multi_aff_free(ptr); +} + +__isl_give isl_pw_multi_aff *PwMultiAff::copy() const & { + return isl_pw_multi_aff_copy(ptr); +} + +__isl_keep isl_pw_multi_aff *PwMultiAff::get() const { + return ptr; +} + +__isl_give isl_pw_multi_aff *PwMultiAff::release() { + isl_pw_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_pw_multi_aff *PwMultiAff::keep() const { + return get(); +} + +__isl_give isl_pw_multi_aff *PwMultiAff::take() { + return release(); +} + +PwMultiAff::operator bool() const { + return !isNull(); +} + +isl_ctx *PwMultiAff::getCtx() const { + return isl_pw_multi_aff_get_ctx(ptr); +} + +bool PwMultiAff::isNull() const { + return ptr == nullptr; +} + +std::string PwMultiAff::getStr() const { + char *Tmp = isl_pw_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const PwMultiAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Schedule +Schedule manage(__isl_take isl_schedule *ptr) { + return Schedule(ptr); +} + +Schedule give(__isl_take isl_schedule *ptr) { + return manage(ptr); +} + +Schedule::Schedule() + : ptr(nullptr) {} + +Schedule::Schedule(const Schedule &obj) + : ptr(obj.copy()) {} + +Schedule::Schedule(std::nullptr_t) + : ptr(nullptr) {} + +Schedule::Schedule(__isl_take isl_schedule *ptr) + : ptr(ptr) {} + +Schedule &Schedule::operator=(Schedule obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Schedule::~Schedule() { + if (ptr) + isl_schedule_free(ptr); +} + +__isl_give isl_schedule *Schedule::copy() const & { + return isl_schedule_copy(ptr); +} + +__isl_keep isl_schedule *Schedule::get() const { + return ptr; +} + +__isl_give isl_schedule *Schedule::release() { + isl_schedule *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule *Schedule::keep() const { + return get(); +} + +__isl_give isl_schedule *Schedule::take() { + return release(); +} + +Schedule::operator bool() const { + return !isNull(); +} + +isl_ctx *Schedule::getCtx() const { + return isl_schedule_get_ctx(ptr); +} + +bool Schedule::isNull() const { + return ptr == nullptr; +} + +std::string Schedule::getStr() const { + char *Tmp = isl_schedule_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Schedule &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::ScheduleConstraints +ScheduleConstraints manage(__isl_take isl_schedule_constraints *ptr) { + return ScheduleConstraints(ptr); +} + +ScheduleConstraints give(__isl_take isl_schedule_constraints *ptr) { + return manage(ptr); +} + +ScheduleConstraints::ScheduleConstraints() + : ptr(nullptr) {} + +ScheduleConstraints::ScheduleConstraints(const ScheduleConstraints &obj) + : ptr(obj.copy()) {} + +ScheduleConstraints::ScheduleConstraints(std::nullptr_t) + : ptr(nullptr) {} + +ScheduleConstraints::ScheduleConstraints(__isl_take isl_schedule_constraints *ptr) + : ptr(ptr) {} + +ScheduleConstraints &ScheduleConstraints::operator=(ScheduleConstraints obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +ScheduleConstraints::~ScheduleConstraints() { + if (ptr) + isl_schedule_constraints_free(ptr); +} + +__isl_give isl_schedule_constraints *ScheduleConstraints::copy() const & { + return isl_schedule_constraints_copy(ptr); +} + +__isl_keep isl_schedule_constraints *ScheduleConstraints::get() const { + return ptr; +} + +__isl_give isl_schedule_constraints *ScheduleConstraints::release() { + isl_schedule_constraints *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule_constraints *ScheduleConstraints::keep() const { + return get(); +} + +__isl_give isl_schedule_constraints *ScheduleConstraints::take() { + return release(); +} + +ScheduleConstraints::operator bool() const { + return !isNull(); +} + +isl_ctx *ScheduleConstraints::getCtx() const { + return isl_schedule_constraints_get_ctx(ptr); +} + +bool ScheduleConstraints::isNull() const { + return ptr == nullptr; +} + +std::string ScheduleConstraints::getStr() const { + char *Tmp = isl_schedule_constraints_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const ScheduleConstraints &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::ScheduleNode +ScheduleNode manage(__isl_take isl_schedule_node *ptr) { + return ScheduleNode(ptr); +} + +ScheduleNode give(__isl_take isl_schedule_node *ptr) { + return manage(ptr); +} + +ScheduleNode::ScheduleNode() + : ptr(nullptr) {} + +ScheduleNode::ScheduleNode(const ScheduleNode &obj) + : ptr(obj.copy()) {} + +ScheduleNode::ScheduleNode(std::nullptr_t) + : ptr(nullptr) {} + +ScheduleNode::ScheduleNode(__isl_take isl_schedule_node *ptr) + : ptr(ptr) {} + +ScheduleNode &ScheduleNode::operator=(ScheduleNode obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +ScheduleNode::~ScheduleNode() { + if (ptr) + isl_schedule_node_free(ptr); +} + +__isl_give isl_schedule_node *ScheduleNode::copy() const & { + return isl_schedule_node_copy(ptr); +} + +__isl_keep isl_schedule_node *ScheduleNode::get() const { + return ptr; +} + +__isl_give isl_schedule_node *ScheduleNode::release() { + isl_schedule_node *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_schedule_node *ScheduleNode::keep() const { + return get(); +} + +__isl_give isl_schedule_node *ScheduleNode::take() { + return release(); +} + +ScheduleNode::operator bool() const { + return !isNull(); +} + +isl_ctx *ScheduleNode::getCtx() const { + return isl_schedule_node_get_ctx(ptr); +} + +bool ScheduleNode::isNull() const { + return ptr == nullptr; +} + +std::string ScheduleNode::getStr() const { + char *Tmp = isl_schedule_node_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const ScheduleNode &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Set +Set manage(__isl_take isl_set *ptr) { + return Set(ptr); +} + +Set give(__isl_take isl_set *ptr) { + return manage(ptr); +} + +Set::Set() + : ptr(nullptr) {} + +Set::Set(const Set &obj) + : ptr(obj.copy()) {} + +Set::Set(std::nullptr_t) + : ptr(nullptr) {} + +Set::Set(__isl_take isl_set *ptr) + : ptr(ptr) {} + +Set &Set::operator=(Set obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Set::~Set() { + if (ptr) + isl_set_free(ptr); +} + +__isl_give isl_set *Set::copy() const & { + return isl_set_copy(ptr); +} + +__isl_keep isl_set *Set::get() const { + return ptr; +} + +__isl_give isl_set *Set::release() { + isl_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_set *Set::keep() const { + return get(); +} + +__isl_give isl_set *Set::take() { + return release(); +} + +Set::operator bool() const { + return !isNull(); +} + +isl_ctx *Set::getCtx() const { + return isl_set_get_ctx(ptr); +} + +bool Set::isNull() const { + return ptr == nullptr; +} + +std::string Set::getStr() const { + char *Tmp = isl_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Set &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Space +Space manage(__isl_take isl_space *ptr) { + return Space(ptr); +} + +Space give(__isl_take isl_space *ptr) { + return manage(ptr); +} + +Space::Space() + : ptr(nullptr) {} + +Space::Space(const Space &obj) + : ptr(obj.copy()) {} + +Space::Space(std::nullptr_t) + : ptr(nullptr) {} + +Space::Space(__isl_take isl_space *ptr) + : ptr(ptr) {} + +Space &Space::operator=(Space obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Space::~Space() { + if (ptr) + isl_space_free(ptr); +} + +__isl_give isl_space *Space::copy() const & { + return isl_space_copy(ptr); +} + +__isl_keep isl_space *Space::get() const { + return ptr; +} + +__isl_give isl_space *Space::release() { + isl_space *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_space *Space::keep() const { + return get(); +} + +__isl_give isl_space *Space::take() { + return release(); +} + +Space::operator bool() const { + return !isNull(); +} + +isl_ctx *Space::getCtx() const { + return isl_space_get_ctx(ptr); +} + +bool Space::isNull() const { + return ptr == nullptr; +} + +std::string Space::getStr() const { + char *Tmp = isl_space_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Space &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionAccessInfo +UnionAccessInfo manage(__isl_take isl_union_access_info *ptr) { + return UnionAccessInfo(ptr); +} + +UnionAccessInfo give(__isl_take isl_union_access_info *ptr) { + return manage(ptr); +} + +UnionAccessInfo::UnionAccessInfo() + : ptr(nullptr) {} + +UnionAccessInfo::UnionAccessInfo(const UnionAccessInfo &obj) + : ptr(obj.copy()) {} + +UnionAccessInfo::UnionAccessInfo(std::nullptr_t) + : ptr(nullptr) {} + +UnionAccessInfo::UnionAccessInfo(__isl_take isl_union_access_info *ptr) + : ptr(ptr) {} + +UnionAccessInfo &UnionAccessInfo::operator=(UnionAccessInfo obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionAccessInfo::~UnionAccessInfo() { + if (ptr) + isl_union_access_info_free(ptr); +} + +__isl_give isl_union_access_info *UnionAccessInfo::copy() const & { + return isl_union_access_info_copy(ptr); +} + +__isl_keep isl_union_access_info *UnionAccessInfo::get() const { + return ptr; +} + +__isl_give isl_union_access_info *UnionAccessInfo::release() { + isl_union_access_info *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_access_info *UnionAccessInfo::keep() const { + return get(); +} + +__isl_give isl_union_access_info *UnionAccessInfo::take() { + return release(); +} + +UnionAccessInfo::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionAccessInfo::getCtx() const { + return isl_union_access_info_get_ctx(ptr); +} + +bool UnionAccessInfo::isNull() const { + return ptr == nullptr; +} + +std::string UnionAccessInfo::getStr() const { + char *Tmp = isl_union_access_info_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionAccessInfo &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionFlow +UnionFlow manage(__isl_take isl_union_flow *ptr) { + return UnionFlow(ptr); +} + +UnionFlow give(__isl_take isl_union_flow *ptr) { + return manage(ptr); +} + +UnionFlow::UnionFlow() + : ptr(nullptr) {} + +UnionFlow::UnionFlow(const UnionFlow &obj) + : ptr(obj.copy()) {} + +UnionFlow::UnionFlow(std::nullptr_t) + : ptr(nullptr) {} + +UnionFlow::UnionFlow(__isl_take isl_union_flow *ptr) + : ptr(ptr) {} + +UnionFlow &UnionFlow::operator=(UnionFlow obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionFlow::~UnionFlow() { + if (ptr) + isl_union_flow_free(ptr); +} + +__isl_give isl_union_flow *UnionFlow::copy() const & { + return isl_union_flow_copy(ptr); +} + +__isl_keep isl_union_flow *UnionFlow::get() const { + return ptr; +} + +__isl_give isl_union_flow *UnionFlow::release() { + isl_union_flow *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_flow *UnionFlow::keep() const { + return get(); +} + +__isl_give isl_union_flow *UnionFlow::take() { + return release(); +} + +UnionFlow::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionFlow::getCtx() const { + return isl_union_flow_get_ctx(ptr); +} + +bool UnionFlow::isNull() const { + return ptr == nullptr; +} + +std::string UnionFlow::getStr() const { + char *Tmp = isl_union_flow_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionFlow &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionMap +UnionMap manage(__isl_take isl_union_map *ptr) { + return UnionMap(ptr); +} + +UnionMap give(__isl_take isl_union_map *ptr) { + return manage(ptr); +} + +UnionMap::UnionMap() + : ptr(nullptr) {} + +UnionMap::UnionMap(const UnionMap &obj) + : ptr(obj.copy()) {} + +UnionMap::UnionMap(std::nullptr_t) + : ptr(nullptr) {} + +UnionMap::UnionMap(__isl_take isl_union_map *ptr) + : ptr(ptr) {} + +UnionMap &UnionMap::operator=(UnionMap obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionMap::~UnionMap() { + if (ptr) + isl_union_map_free(ptr); +} + +__isl_give isl_union_map *UnionMap::copy() const & { + return isl_union_map_copy(ptr); +} + +__isl_keep isl_union_map *UnionMap::get() const { + return ptr; +} + +__isl_give isl_union_map *UnionMap::release() { + isl_union_map *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_map *UnionMap::keep() const { + return get(); +} + +__isl_give isl_union_map *UnionMap::take() { + return release(); +} + +UnionMap::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionMap::getCtx() const { + return isl_union_map_get_ctx(ptr); +} + +bool UnionMap::isNull() const { + return ptr == nullptr; +} + +std::string UnionMap::getStr() const { + char *Tmp = isl_union_map_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionMap &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionPwAff +UnionPwAff manage(__isl_take isl_union_pw_aff *ptr) { + return UnionPwAff(ptr); +} + +UnionPwAff give(__isl_take isl_union_pw_aff *ptr) { + return manage(ptr); +} + +UnionPwAff::UnionPwAff() + : ptr(nullptr) {} + +UnionPwAff::UnionPwAff(const UnionPwAff &obj) + : ptr(obj.copy()) {} + +UnionPwAff::UnionPwAff(std::nullptr_t) + : ptr(nullptr) {} + +UnionPwAff::UnionPwAff(__isl_take isl_union_pw_aff *ptr) + : ptr(ptr) {} + +UnionPwAff &UnionPwAff::operator=(UnionPwAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionPwAff::~UnionPwAff() { + if (ptr) + isl_union_pw_aff_free(ptr); +} + +__isl_give isl_union_pw_aff *UnionPwAff::copy() const & { + return isl_union_pw_aff_copy(ptr); +} + +__isl_keep isl_union_pw_aff *UnionPwAff::get() const { + return ptr; +} + +__isl_give isl_union_pw_aff *UnionPwAff::release() { + isl_union_pw_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_pw_aff *UnionPwAff::keep() const { + return get(); +} + +__isl_give isl_union_pw_aff *UnionPwAff::take() { + return release(); +} + +UnionPwAff::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionPwAff::getCtx() const { + return isl_union_pw_aff_get_ctx(ptr); +} + +bool UnionPwAff::isNull() const { + return ptr == nullptr; +} + +std::string UnionPwAff::getStr() const { + char *Tmp = isl_union_pw_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionPwAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionPwMultiAff +UnionPwMultiAff manage(__isl_take isl_union_pw_multi_aff *ptr) { + return UnionPwMultiAff(ptr); +} + +UnionPwMultiAff give(__isl_take isl_union_pw_multi_aff *ptr) { + return manage(ptr); +} + +UnionPwMultiAff::UnionPwMultiAff() + : ptr(nullptr) {} + +UnionPwMultiAff::UnionPwMultiAff(const UnionPwMultiAff &obj) + : ptr(obj.copy()) {} + +UnionPwMultiAff::UnionPwMultiAff(std::nullptr_t) + : ptr(nullptr) {} + +UnionPwMultiAff::UnionPwMultiAff(__isl_take isl_union_pw_multi_aff *ptr) + : ptr(ptr) {} + +UnionPwMultiAff &UnionPwMultiAff::operator=(UnionPwMultiAff obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionPwMultiAff::~UnionPwMultiAff() { + if (ptr) + isl_union_pw_multi_aff_free(ptr); +} + +__isl_give isl_union_pw_multi_aff *UnionPwMultiAff::copy() const & { + return isl_union_pw_multi_aff_copy(ptr); +} + +__isl_keep isl_union_pw_multi_aff *UnionPwMultiAff::get() const { + return ptr; +} + +__isl_give isl_union_pw_multi_aff *UnionPwMultiAff::release() { + isl_union_pw_multi_aff *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_pw_multi_aff *UnionPwMultiAff::keep() const { + return get(); +} + +__isl_give isl_union_pw_multi_aff *UnionPwMultiAff::take() { + return release(); +} + +UnionPwMultiAff::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionPwMultiAff::getCtx() const { + return isl_union_pw_multi_aff_get_ctx(ptr); +} + +bool UnionPwMultiAff::isNull() const { + return ptr == nullptr; +} + +std::string UnionPwMultiAff::getStr() const { + char *Tmp = isl_union_pw_multi_aff_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionPwMultiAff &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::UnionSet +UnionSet manage(__isl_take isl_union_set *ptr) { + return UnionSet(ptr); +} + +UnionSet give(__isl_take isl_union_set *ptr) { + return manage(ptr); +} + +UnionSet::UnionSet() + : ptr(nullptr) {} + +UnionSet::UnionSet(const UnionSet &obj) + : ptr(obj.copy()) {} + +UnionSet::UnionSet(std::nullptr_t) + : ptr(nullptr) {} + +UnionSet::UnionSet(__isl_take isl_union_set *ptr) + : ptr(ptr) {} + +UnionSet &UnionSet::operator=(UnionSet obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +UnionSet::~UnionSet() { + if (ptr) + isl_union_set_free(ptr); +} + +__isl_give isl_union_set *UnionSet::copy() const & { + return isl_union_set_copy(ptr); +} + +__isl_keep isl_union_set *UnionSet::get() const { + return ptr; +} + +__isl_give isl_union_set *UnionSet::release() { + isl_union_set *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_union_set *UnionSet::keep() const { + return get(); +} + +__isl_give isl_union_set *UnionSet::take() { + return release(); +} + +UnionSet::operator bool() const { + return !isNull(); +} + +isl_ctx *UnionSet::getCtx() const { + return isl_union_set_get_ctx(ptr); +} + +bool UnionSet::isNull() const { + return ptr == nullptr; +} + +std::string UnionSet::getStr() const { + char *Tmp = isl_union_set_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const UnionSet &Obj) { + OS << Obj.getStr(); + return OS; +} + +// implementations for isl::Val +Val manage(__isl_take isl_val *ptr) { + return Val(ptr); +} + +Val give(__isl_take isl_val *ptr) { + return manage(ptr); +} + +Val::Val() + : ptr(nullptr) {} + +Val::Val(const Val &obj) + : ptr(obj.copy()) {} + +Val::Val(std::nullptr_t) + : ptr(nullptr) {} + +Val::Val(__isl_take isl_val *ptr) + : ptr(ptr) {} + +Val &Val::operator=(Val obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +Val::~Val() { + if (ptr) + isl_val_free(ptr); +} + +__isl_give isl_val *Val::copy() const & { + return isl_val_copy(ptr); +} + +__isl_keep isl_val *Val::get() const { + return ptr; +} + +__isl_give isl_val *Val::release() { + isl_val *tmp = ptr; + ptr = nullptr; + return tmp; +} + +__isl_keep isl_val *Val::keep() const { + return get(); +} + +__isl_give isl_val *Val::take() { + return release(); +} + +Val::operator bool() const { + return !isNull(); +} + +isl_ctx *Val::getCtx() const { + return isl_val_get_ctx(ptr); +} + +bool Val::isNull() const { + return ptr == nullptr; +} + +std::string Val::getStr() const { + char *Tmp = isl_val_to_str(get()); + if (!Tmp) + return ""; + std::string S(Tmp); + free(Tmp); + return S; +} + +inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, + const Val &Obj) { + OS << Obj.getStr(); + return OS; +} + +}; /* namespace noexpections */ + +}; /* namespace isl */ + +#endif /* ISL_CPP_ALL */ Index: lib/Support/GICHelper.cpp =================================================================== --- lib/Support/GICHelper.cpp +++ lib/Support/GICHelper.cpp @@ -204,133 +204,104 @@ return getIslCompatibleName(Prefix, ValStr, Suffix); } -#define DEFINE_ISLPTR(TYPE) \ - template <> void IslPtr::dump() const { isl_##TYPE##_dump(Obj); } - -namespace polly { -DEFINE_ISLPTR(id) -DEFINE_ISLPTR(val) -DEFINE_ISLPTR(space) -DEFINE_ISLPTR(basic_map) -DEFINE_ISLPTR(map) -DEFINE_ISLPTR(union_map) -DEFINE_ISLPTR(basic_set) -DEFINE_ISLPTR(set) -DEFINE_ISLPTR(union_set) -DEFINE_ISLPTR(aff) -DEFINE_ISLPTR(multi_aff) -DEFINE_ISLPTR(pw_aff) -DEFINE_ISLPTR(pw_multi_aff) -DEFINE_ISLPTR(multi_pw_aff) -DEFINE_ISLPTR(union_pw_aff) -DEFINE_ISLPTR(multi_union_pw_aff) -DEFINE_ISLPTR(union_pw_multi_aff) -} - -void polly::foreachElt(const IslPtr &Map, - const std::function)> &F) { +void polly::foreachElt(const isl::Map &Map, + const std::function &F) { isl_map_foreach_basic_map( Map.keep(), [](__isl_take isl_basic_map *BMap, void *User) -> isl_stat { auto &F = - *static_cast)> *>( - User); + *static_cast *>(User); F(give(BMap)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &Set, - const std::function)> &F) { +void polly::foreachElt(const isl::Set &Set, + const std::function &F) { isl_set_foreach_basic_set( Set.keep(), [](__isl_take isl_basic_set *BSet, void *User) -> isl_stat { auto &F = - *static_cast)> *>( - User); + *static_cast *>(User); F(give(BSet)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &UMap, - const std::function Map)> &F) { +void polly::foreachElt(const isl::UnionMap &UMap, + const std::function &F) { isl_union_map_foreach_map( UMap.keep(), [](__isl_take isl_map *Map, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(Map)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &USet, - const std::function Set)> &F) { +void polly::foreachElt(const isl::UnionSet &USet, + const std::function &F) { isl_union_set_foreach_set( USet.keep(), [](__isl_take isl_set *Set, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(Set)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -void polly::foreachElt(const IslPtr &UPwAff, - const std::function)> &F) { +void polly::foreachElt(const isl::UnionPwAff &UPwAff, + const std::function &F) { isl_union_pw_aff_foreach_pw_aff( UPwAff.keep(), [](__isl_take isl_pw_aff *PwAff, void *User) -> isl_stat { - auto &F = - *static_cast)> *>(User); + auto &F = *static_cast *>(User); F(give(PwAff)); return isl_stat_ok; }, const_cast(static_cast(&F))); } -isl_stat polly::foreachEltWithBreak( - const IslPtr &Map, - const std::function)> &F) { +isl_stat +polly::foreachEltWithBreak(const isl::Map &Map, + const std::function &F) { return isl_map_foreach_basic_map( Map.keep(), [](__isl_take isl_basic_map *BMap, void *User) -> isl_stat { - auto &F = *static_cast< - const std::function)> *>(User); + auto &F = + *static_cast *>(User); return F(give(BMap)); }, const_cast(static_cast(&F))); } -isl_stat polly::foreachEltWithBreak( - const IslPtr &UMap, - const std::function Map)> &F) { +isl_stat +polly::foreachEltWithBreak(const isl::UnionMap &UMap, + const std::function &F) { return isl_union_map_foreach_map( UMap.keep(), [](__isl_take isl_map *Map, void *User) -> isl_stat { auto &F = - *static_cast Map)> *>( - User); + *static_cast *>(User); return F(give(Map)); }, const_cast(static_cast(&F))); } isl_stat polly::foreachPieceWithBreak( - const IslPtr &PwAff, - const std::function, IslPtr)> &F) { + const isl::PwAff &PwAff, + const std::function &F) { return isl_pw_aff_foreach_piece( PwAff.keep(), [](__isl_take isl_set *Domain, __isl_take isl_aff *Aff, void *User) -> isl_stat { - auto &F = *static_cast< - const std::function, IslPtr)> *>( - User); + auto &F = + *static_cast *>( + User); return F(give(Domain), give(Aff)); }, const_cast(static_cast(&F))); Index: lib/Support/ISLTools.cpp =================================================================== --- lib/Support/ISLTools.cpp +++ lib/Support/ISLTools.cpp @@ -29,8 +29,7 @@ /// @param Amount Value added to the shifted dimension. /// /// @return An isl_multi_aff for the map with this shifted dimension. -IslPtr makeShiftDimAff(IslPtr Space, int Pos, - int Amount) { +isl::MultiAff makeShiftDimAff(isl::Space Space, int Pos, int Amount) { auto Identity = give(isl_multi_aff_identity(Space.take())); if (Amount == 0) return Identity; @@ -45,8 +44,8 @@ /// @param FromSpace2 { Space2[] } /// /// @return { [Space1[] -> Space2[]] -> [Space2[] -> Space1[]] } -IslPtr makeTupleSwapBasicMap(IslPtr FromSpace1, - IslPtr FromSpace2) { +isl::BasicMap makeTupleSwapBasicMap(isl::Space FromSpace1, + isl::Space FromSpace2) { assert(isl_space_is_set(FromSpace1.keep()) != isl_bool_false); assert(isl_space_is_set(FromSpace2.keep()) != isl_bool_false); @@ -72,69 +71,64 @@ return Result; } -/// Like makeTupleSwapBasicMap(IslPtr,IslPtr), but returns +/// Like makeTupleSwapBasicMap(isl::Space,isl::Space), but returns /// an isl_map. -IslPtr makeTupleSwapMap(IslPtr FromSpace1, - IslPtr FromSpace2) { +isl::Map makeTupleSwapMap(isl::Space FromSpace1, isl::Space FromSpace2) { auto BMapResult = makeTupleSwapBasicMap(std::move(FromSpace1), std::move(FromSpace2)); return give(isl_map_from_basic_map(BMapResult.take())); } } // anonymous namespace -IslPtr polly::beforeScatter(IslPtr Map, bool Strict) { +isl::Map polly::beforeScatter(isl::Map Map, bool Strict) { auto RangeSpace = give(isl_space_range(isl_map_get_space(Map.keep()))); auto ScatterRel = give(Strict ? isl_map_lex_gt(RangeSpace.take()) : isl_map_lex_ge(RangeSpace.take())); return give(isl_map_apply_range(Map.take(), ScatterRel.take())); } -IslPtr polly::beforeScatter(IslPtr UMap, - bool Strict) { +isl::UnionMap polly::beforeScatter(isl::UnionMap UMap, bool Strict) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::Map Map) { auto After = beforeScatter(Map, Strict); Result = give(isl_union_map_add_map(Result.take(), After.take())); }); return Result; } -IslPtr polly::afterScatter(IslPtr Map, bool Strict) { +isl::Map polly::afterScatter(isl::Map Map, bool Strict) { auto RangeSpace = give(isl_space_range(isl_map_get_space(Map.keep()))); auto ScatterRel = give(Strict ? isl_map_lex_lt(RangeSpace.take()) : isl_map_lex_le(RangeSpace.take())); return give(isl_map_apply_range(Map.take(), ScatterRel.take())); } -IslPtr polly::afterScatter(const IslPtr &UMap, - bool Strict) { +isl::UnionMap polly::afterScatter(const isl::UnionMap &UMap, bool Strict) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::Map Map) { auto After = afterScatter(Map, Strict); Result = give(isl_union_map_add_map(Result.take(), After.take())); }); return Result; } -IslPtr polly::betweenScatter(IslPtr From, IslPtr To, - bool InclFrom, bool InclTo) { +isl::Map polly::betweenScatter(isl::Map From, isl::Map To, bool InclFrom, + bool InclTo) { auto AfterFrom = afterScatter(From, !InclFrom); auto BeforeTo = beforeScatter(To, !InclTo); return give(isl_map_intersect(AfterFrom.take(), BeforeTo.take())); } -IslPtr polly::betweenScatter(IslPtr From, - IslPtr To, - bool InclFrom, bool InclTo) { +isl::UnionMap polly::betweenScatter(isl::UnionMap From, isl::UnionMap To, + bool InclFrom, bool InclTo) { auto AfterFrom = afterScatter(From, !InclFrom); auto BeforeTo = beforeScatter(To, !InclTo); return give(isl_union_map_intersect(AfterFrom.take(), BeforeTo.take())); } -IslPtr polly::singleton(IslPtr UMap, - IslPtr ExpectedSpace) { +isl::Map polly::singleton(isl::UnionMap UMap, isl::Space ExpectedSpace) { if (!UMap) return nullptr; @@ -148,8 +142,7 @@ return Result; } -IslPtr polly::singleton(IslPtr USet, - IslPtr ExpectedSpace) { +isl::Set polly::singleton(isl::UnionSet USet, isl::Space ExpectedSpace) { if (!USet) return nullptr; @@ -163,16 +156,15 @@ return Result; } -unsigned polly::getNumScatterDims(const IslPtr &Schedule) { +unsigned polly::getNumScatterDims(const isl::UnionMap &Schedule) { unsigned Dims = 0; - foreachElt(Schedule, [&Dims](IslPtr Map) { + foreachElt(Schedule, [&Dims](isl::Map Map) { Dims = std::max(Dims, isl_map_dim(Map.keep(), isl_dim_out)); }); return Dims; } -IslPtr -polly::getScatterSpace(const IslPtr &Schedule) { +isl::Space polly::getScatterSpace(const isl::UnionMap &Schedule) { if (!Schedule) return nullptr; auto Dims = getNumScatterDims(Schedule); @@ -181,10 +173,10 @@ return give(isl_space_add_dims(ScatterSpace.take(), isl_dim_set, Dims)); } -IslPtr polly::makeIdentityMap(const IslPtr &USet, - bool RestrictDomain) { +isl::UnionMap polly::makeIdentityMap(const isl::UnionSet &USet, + bool RestrictDomain) { auto Result = give(isl_union_map_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::Set Set) { auto IdentityMap = give(isl_map_identity( isl_space_map_from_set(isl_set_get_space(Set.keep())))); if (RestrictDomain) @@ -195,7 +187,7 @@ return Result; } -IslPtr polly::reverseDomain(IslPtr Map) { +isl::Map polly::reverseDomain(isl::Map Map) { auto DomSpace = give(isl_space_unwrap(isl_space_domain(isl_map_get_space(Map.keep())))); auto Space1 = give(isl_space_domain(DomSpace.copy())); @@ -204,16 +196,16 @@ return give(isl_map_apply_domain(Map.take(), Swap.take())); } -IslPtr polly::reverseDomain(const IslPtr &UMap) { +isl::UnionMap polly::reverseDomain(const isl::UnionMap &UMap) { auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::Map Map) { auto Reversed = reverseDomain(std::move(Map)); Result = give(isl_union_map_add_map(Result.take(), Reversed.take())); }); return Result; } -IslPtr polly::shiftDim(IslPtr Set, int Pos, int Amount) { +isl::Set polly::shiftDim(isl::Set Set, int Pos, int Amount) { int NumDims = isl_set_dim(Set.keep(), isl_dim_set); if (Pos < 0) Pos = NumDims + Pos; @@ -225,50 +217,48 @@ return give(isl_set_apply(Set.take(), TranslatorMap.take())); } -IslPtr polly::shiftDim(IslPtr USet, int Pos, - int Amount) { +isl::UnionSet polly::shiftDim(isl::UnionSet USet, int Pos, int Amount) { auto Result = give(isl_union_set_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::Set Set) { auto Shifted = shiftDim(Set, Pos, Amount); Result = give(isl_union_set_add_set(Result.take(), Shifted.take())); }); return Result; } -void polly::simplify(IslPtr &Set) { +void polly::simplify(isl::Set &Set) { Set = give(isl_set_compute_divs(Set.take())); Set = give(isl_set_detect_equalities(Set.take())); Set = give(isl_set_coalesce(Set.take())); } -void polly::simplify(IslPtr &USet) { +void polly::simplify(isl::UnionSet &USet) { USet = give(isl_union_set_compute_divs(USet.take())); USet = give(isl_union_set_detect_equalities(USet.take())); USet = give(isl_union_set_coalesce(USet.take())); } -void polly::simplify(IslPtr &Map) { +void polly::simplify(isl::Map &Map) { Map = give(isl_map_compute_divs(Map.take())); Map = give(isl_map_detect_equalities(Map.take())); Map = give(isl_map_coalesce(Map.take())); } -void polly::simplify(IslPtr &UMap) { +void polly::simplify(isl::UnionMap &UMap) { UMap = give(isl_union_map_compute_divs(UMap.take())); UMap = give(isl_union_map_detect_equalities(UMap.take())); UMap = give(isl_union_map_coalesce(UMap.take())); } -IslPtr -polly::computeReachingWrite(IslPtr Schedule, - IslPtr Writes, bool Reverse, - bool InclPrevDef, bool InclNextDef) { +isl::UnionMap polly::computeReachingWrite(isl::UnionMap Schedule, + isl::UnionMap Writes, bool Reverse, + bool InclPrevDef, bool InclNextDef) { // { Scatter[] } auto ScatterSpace = getScatterSpace(Schedule); // { ScatterRead[] -> ScatterWrite[] } - IslPtr Relation; + isl::Map Relation; if (Reverse) Relation = give(InclPrevDef ? isl_map_lex_lt(ScatterSpace.take()) : isl_map_lex_le(ScatterSpace.take())); @@ -319,12 +309,10 @@ return ReachableWriteDomain; } -IslPtr polly::computeArrayUnused(IslPtr Schedule, - IslPtr Writes, - IslPtr Reads, - bool ReadEltInSameInst, - bool IncludeLastRead, - bool IncludeWrite) { +isl::UnionMap +polly::computeArrayUnused(isl::UnionMap Schedule, isl::UnionMap Writes, + isl::UnionMap Reads, bool ReadEltInSameInst, + bool IncludeLastRead, bool IncludeWrite) { // { Element[] -> Scatter[] } auto ReadActions = give(isl_union_map_apply_domain(Schedule.copy(), Reads.take())); @@ -366,9 +354,8 @@ isl_union_map_domain_factor_domain(BetweenLastReadOverwrite.take()))); } -IslPtr polly::convertZoneToTimepoints(IslPtr Zone, - bool InclStart, - bool InclEnd) { +isl::UnionSet polly::convertZoneToTimepoints(isl::UnionSet Zone, bool InclStart, + bool InclEnd) { if (!InclStart && InclEnd) return Zone; Index: lib/Transform/DeLICM.cpp =================================================================== --- lib/Transform/DeLICM.cpp +++ lib/Transform/DeLICM.cpp @@ -248,16 +248,15 @@ } }; -IslPtr computeReachingDefinition(IslPtr Schedule, - IslPtr Writes, - bool InclDef, bool InclRedef) { +isl::UnionMap computeReachingDefinition(isl::UnionMap Schedule, + isl::UnionMap Writes, bool InclDef, + bool InclRedef) { return computeReachingWrite(Schedule, Writes, false, InclDef, InclRedef); } -IslPtr computeReachingOverwrite(IslPtr Schedule, - IslPtr Writes, - bool InclPrevWrite, - bool InclOverwrite) { +isl::UnionMap computeReachingOverwrite(isl::UnionMap Schedule, + isl::UnionMap Writes, bool InclPrevWrite, + bool InclOverwrite) { return computeReachingWrite(Schedule, Writes, true, InclPrevWrite, InclOverwrite); } @@ -275,10 +274,10 @@ /// of the overwrite itself. /// /// @return { Scatter[] -> DomainDef[] } -IslPtr -computeScalarReachingOverwrite(IslPtr Schedule, - IslPtr Writes, bool InclPrevWrite, - bool InclOverwrite) { +isl::UnionMap computeScalarReachingOverwrite(isl::UnionMap Schedule, + isl::UnionSet Writes, + bool InclPrevWrite, + bool InclOverwrite) { // { DomainWrite[] } auto WritesMap = give(isl_union_map_from_domain(Writes.take())); @@ -299,10 +298,9 @@ /// @param InclOverwrite Include the overwrite to the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr computeScalarReachingOverwrite(IslPtr Schedule, - IslPtr Writes, - bool InclPrevWrite, - bool InclOverwrite) { +isl::Map computeScalarReachingOverwrite(isl::UnionMap Schedule, isl::Set Writes, + bool InclPrevWrite, + bool InclOverwrite) { auto ScatterSpace = getScatterSpace(Schedule); auto DomSpace = give(isl_set_get_space(Writes.keep())); @@ -327,10 +325,9 @@ /// @param InclRedef Include the timepoint of the overwrite into the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr -computeScalarReachingDefinition(IslPtr Schedule, - IslPtr Writes, bool InclDef, - bool InclRedef) { +isl::UnionMap computeScalarReachingDefinition(isl::UnionMap Schedule, + isl::UnionSet Writes, + bool InclDef, bool InclRedef) { // { DomainWrite[] -> Element[] } auto Defs = give(isl_union_map_from_domain(Writes.take())); @@ -355,9 +352,8 @@ /// @param InclRedef Include the timepoint of the overwrite into the result. /// /// @return { Scatter[] -> DomainWrite[] } -IslPtr computeScalarReachingDefinition( // { Domain[] -> Zone[] } - IslPtr Schedule, IslPtr Writes, bool InclDef, - bool InclRedef) { +isl::Map computeScalarReachingDefinition( // { Domain[] -> Zone[] } + isl::UnionMap Schedule, isl::Set Writes, bool InclDef, bool InclRedef) { auto DomainSpace = give(isl_set_get_space(Writes.keep())); auto ScatterSpace = getScatterSpace(Schedule); @@ -439,18 +435,18 @@ /// interval and can be converted to sets of timepoints when needed (e.g., in /// isConflicting when comparing to the write sets). /// @see convertZoneToTimepoints and this file's comment for more details. - IslPtr Occupied; + isl::UnionSet Occupied; /// { [Element[] -> Zone[]] } /// Set of array elements when they are not alive, i.e. their memory can be /// used for other purposed. Can contain a nullptr; in this case the set is /// implicitly defined as the complement of #Occupied. - IslPtr Unused; + isl::UnionSet Unused; /// { [Element[] -> Scatter[]] } /// The write actions currently in the scop or that would be added when /// mapping a scalar. - IslPtr Written; + isl::UnionSet Written; /// Check whether this Knowledge object is well-formed. void checkConsistency() const { @@ -480,16 +476,14 @@ Knowledge() {} /// Create a new object with the given members. - Knowledge(IslPtr Occupied, IslPtr Unused, - IslPtr Written) + Knowledge(isl::UnionSet Occupied, isl::UnionSet Unused, isl::UnionSet Written) : Occupied(std::move(Occupied)), Unused(std::move(Unused)), Written(std::move(Written)) { checkConsistency(); } /// Alternative constructor taking isl_sets instead isl_union_sets. - Knowledge(IslPtr Occupied, IslPtr Unused, - IslPtr Written) + Knowledge(isl::Set Occupied, isl::Set Unused, isl::Set Written) : Knowledge(give(isl_union_set_from_set(Occupied.take())), give(isl_union_set_from_set(Unused.take())), give(isl_union_set_from_set(Written.take()))) {} @@ -666,35 +660,35 @@ /// Cached reaching definitions for each ScopStmt. /// /// Use getScalarReachingDefinition() to get its contents. - DenseMap> ScalarReachDefZone; + DenseMap ScalarReachDefZone; /// The analyzed Scop. Scop *S; /// Parameter space that does not need realignment. - IslPtr ParamSpace; + isl::Space ParamSpace; /// Space the schedule maps to. - IslPtr ScatterSpace; + isl::Space ScatterSpace; /// Cached version of the schedule and domains. - IslPtr Schedule; + isl::UnionMap Schedule; /// Set of all referenced elements. /// { Element[] -> Element[] } - IslPtr AllElements; + isl::UnionSet AllElements; /// Combined access relations of all MemoryKind::Array READ accesses. /// { DomainRead[] -> Element[] } - IslPtr AllReads; + isl::UnionMap AllReads; /// Combined access relations of all MemoryKind::Array, MAY_WRITE accesses. /// { DomainMayWrite[] -> Element[] } - IslPtr AllMayWrites; + isl::UnionMap AllMayWrites; /// Combined access relations of all MemoryKind::Array, MUST_WRITE accesses. /// { DomainMustWrite[] -> Element[] } - IslPtr AllMustWrites; + isl::UnionMap AllMustWrites; /// Prepare the object before computing the zones of @p S. ZoneAlgorithm(Scop *S) @@ -814,11 +808,11 @@ } protected: - IslPtr makeEmptyUnionSet() { + isl::UnionSet makeEmptyUnionSet() { return give(isl_union_set_empty(ParamSpace.copy())); } - IslPtr makeEmptyUnionMap() { + isl::UnionMap makeEmptyUnionMap() { return give(isl_union_map_empty(ParamSpace.copy())); } @@ -834,24 +828,24 @@ /// Get the schedule for @p Stmt. /// /// The domain of the result is as narrow as possible. - IslPtr getScatterFor(ScopStmt *Stmt) const { + isl::Map getScatterFor(ScopStmt *Stmt) const { auto ResultSpace = give(isl_space_map_from_domain_and_range( Stmt->getDomainSpace(), ScatterSpace.copy())); return give(isl_union_map_extract_map(Schedule.keep(), ResultSpace.take())); } /// Get the schedule of @p MA's parent statement. - IslPtr getScatterFor(MemoryAccess *MA) const { + isl::Map getScatterFor(MemoryAccess *MA) const { return getScatterFor(MA->getStatement()); } /// Get the schedule for the statement instances of @p Domain. - IslPtr getScatterFor(IslPtr Domain) const { + isl::UnionMap getScatterFor(isl::UnionSet Domain) const { return give(isl_union_map_intersect_domain(Schedule.copy(), Domain.take())); } /// Get the schedule for the statement instances of @p Domain. - IslPtr getScatterFor(IslPtr Domain) const { + isl::Map getScatterFor(isl::Set Domain) const { auto ResultSpace = give(isl_space_map_from_domain_and_range( isl_set_get_space(Domain.keep()), ScatterSpace.copy())); auto UDomain = give(isl_union_set_from_set(Domain.copy())); @@ -863,19 +857,19 @@ } /// Get the domain of @p Stmt. - IslPtr getDomainFor(ScopStmt *Stmt) const { + isl::Set getDomainFor(ScopStmt *Stmt) const { return give(Stmt->getDomain()); } /// Get the domain @p MA's parent statement. - IslPtr getDomainFor(MemoryAccess *MA) const { + isl::Set getDomainFor(MemoryAccess *MA) const { return getDomainFor(MA->getStatement()); } /// Get the access relation of @p MA. /// /// The domain of the result is as narrow as possible. - IslPtr getAccessRelationFor(MemoryAccess *MA) const { + isl::Map getAccessRelationFor(MemoryAccess *MA) const { auto Domain = getDomainFor(MA); auto AccRel = give(MA->getLatestAccessRelation()); return give(isl_map_intersect_domain(AccRel.take(), Domain.take())); @@ -889,7 +883,7 @@ /// @param Stmt The statement in which a scalar is defined. /// /// @return { Scatter[] -> DomainDef[] } - IslPtr getScalarReachingDefinition(ScopStmt *Stmt) { + isl::Map getScalarReachingDefinition(ScopStmt *Stmt) { auto &Result = ScalarReachDefZone[Stmt]; if (Result) return Result; @@ -927,7 +921,7 @@ // { Element[] } AllElements = makeEmptyUnionSet(); - foreachElt(AllWrites, [this](IslPtr Write) { + foreachElt(AllWrites, [this](isl::Map Write) { auto Space = give(isl_map_get_space(Write.keep())); auto EltSpace = give(isl_space_range(Space.take())); auto EltUniv = give(isl_set_universe(EltSpace.take())); @@ -1036,7 +1030,7 @@ /// @return { DomainDef[] -> DomainUse[] }, { DomainDef[] -> Zone[] } /// First element is the set of uses for each definition. /// The second is the lifetime of each definition. - std::tuple, IslPtr> + std::tuple computeValueUses(const ScopArrayInfo *SAI) { assert(SAI->isValueKind()); @@ -1093,7 +1087,7 @@ /// @param SAI The ScopArrayInfo representing the PHI's storage. /// /// @return { DomainPHIRead[] -> DomainPHIWrite[] } - IslPtr computePerPHI(const ScopArrayInfo *SAI) { + isl::UnionMap computePerPHI(const ScopArrayInfo *SAI) { assert(SAI->isPHIKind()); // { DomainPHIWrite[] -> Scatter[] } @@ -1137,7 +1131,7 @@ /// Suggestion where to map a scalar to when at a timepoint. /// /// @return true if the scalar was successfully mapped. - bool tryMapValue(const ScopArrayInfo *SAI, IslPtr TargetElt) { + bool tryMapValue(const ScopArrayInfo *SAI, isl::Map TargetElt) { assert(SAI->isValueKind()); auto *DefMA = DefUse.getValueDef(SAI); @@ -1167,10 +1161,10 @@ } // { DomainDef[] -> Zone[] } - IslPtr Lifetime; + isl::Map Lifetime; // { DomainDef[] -> DomainUse[] } - IslPtr DefUses; + isl::UnionMap DefUses; std::tie(DefUses, Lifetime) = computeValueUses(SAI); DEBUG(dbgs() << " Lifetime: " << Lifetime << '\n'); @@ -1218,8 +1212,8 @@ /// The lifetime of each llvm::Value definition for /// reporting. /// @param Proposed Mapping constraints for reporting. - void mapValue(const ScopArrayInfo *SAI, IslPtr DefTarget, - IslPtr UseTarget, IslPtr Lifetime, + void mapValue(const ScopArrayInfo *SAI, isl::Map DefTarget, + isl::UnionMap UseTarget, isl::Map Lifetime, Knowledge Proposed) { // Redirect the read accesses. for (auto *MA : DefUse.getValueUses(SAI)) { @@ -1250,7 +1244,7 @@ /// timepoint. /// /// @return true if the PHI scalar has been mapped. - bool tryMapPHI(const ScopArrayInfo *SAI, IslPtr TargetElt) { + bool tryMapPHI(const ScopArrayInfo *SAI, isl::Map TargetElt) { auto *PHIRead = DefUse.getPHIRead(SAI); assert(PHIRead->isPHIKind()); assert(PHIRead->isRead()); @@ -1356,8 +1350,8 @@ /// @param Lifetime { DomainRead[] -> Zone[] } /// The lifetime of each PHI for reporting. /// @param Proposed Mapping constraints for reporting. - void mapPHI(const ScopArrayInfo *SAI, IslPtr ReadTarget, - IslPtr WriteTarget, IslPtr Lifetime, + void mapPHI(const ScopArrayInfo *SAI, isl::Map ReadTarget, + isl::UnionMap WriteTarget, isl::Map Lifetime, Knowledge Proposed) { // Redirect the PHI incoming writes. for (auto *MA : DefUse.getPHIIncomings(SAI)) { @@ -1500,7 +1494,7 @@ /// Compute when an array element is unused. /// /// @return { [Element[] -> Zone[]] } - IslPtr computeLifetime() const { + isl::UnionSet computeLifetime() const { // { Element[] -> Zone[] } auto ArrayUnused = computeArrayUnused(Schedule, AllMustWrites, AllReads, false, false, true); @@ -1514,7 +1508,7 @@ /// Determine when an array element is written to. /// /// @return { [Element[] -> Scatter[]] } - IslPtr computeWritten() const { + isl::UnionSet computeWritten() const { // { WriteDomain[] -> Element[] } auto AllWrites = give(isl_union_map_union(AllMustWrites.copy(), AllMayWrites.copy())); @@ -1559,7 +1553,7 @@ } DefUse.compute(S); - IslPtr EltUnused, EltWritten; + isl::UnionSet EltUnused, EltWritten; { IslMaxOperationsGuard MaxOpGuard(IslCtx.get(), DelicmMaxOps); @@ -1725,13 +1719,13 @@ INITIALIZE_PASS_END(DeLICM, "polly-delicm", "Polly - DeLICM/DePRE", false, false) -bool polly::isConflicting(IslPtr ExistingOccupied, - IslPtr ExistingUnused, - IslPtr ExistingWrites, - IslPtr ProposedOccupied, - IslPtr ProposedUnused, - IslPtr ProposedWrites, - llvm::raw_ostream *OS, unsigned Indent) { +bool polly::isConflicting(isl::UnionSet ExistingOccupied, + isl::UnionSet ExistingUnused, + isl::UnionSet ExistingWrites, + isl::UnionSet ProposedOccupied, + isl::UnionSet ProposedUnused, + isl::UnionSet ProposedWrites, llvm::raw_ostream *OS, + unsigned Indent) { Knowledge Existing(std::move(ExistingOccupied), std::move(ExistingUnused), std::move(ExistingWrites)); Knowledge Proposed(std::move(ProposedOccupied), std::move(ProposedUnused), Index: lib/Transform/FlattenAlgo.cpp =================================================================== --- lib/Transform/FlattenAlgo.cpp +++ lib/Transform/FlattenAlgo.cpp @@ -24,7 +24,7 @@ /// Whether a dimension of a set is bounded (lower and upper) by a constant, /// i.e. there are two constants Min and Max, such that every value x of the /// chosen dimensions is Min <= x <= Max. -bool isDimBoundedByConstant(IslPtr Set, unsigned dim) { +bool isDimBoundedByConstant(isl::Set Set, unsigned dim) { auto ParamDims = isl_set_dim(Set.keep(), isl_dim_param); Set = give(isl_set_project_out(Set.take(), isl_dim_param, 0, ParamDims)); Set = give(isl_set_project_out(Set.take(), isl_dim_set, 0, dim)); @@ -37,7 +37,7 @@ /// parameters, i.e. there are two expressions Min_p and Max_p of the parameters /// p, such that every value x of the chosen dimensions is /// Min_p <= x <= Max_p. -bool isDimBoundedByParameter(IslPtr Set, unsigned dim) { +bool isDimBoundedByParameter(isl::Set Set, unsigned dim) { Set = give(isl_set_project_out(Set.take(), isl_dim_set, 0, dim)); auto SetDims = isl_set_dim(Set.keep(), isl_dim_set); Set = give(isl_set_project_out(Set.take(), isl_dim_set, 1, SetDims - 1)); @@ -45,15 +45,15 @@ } /// Whether BMap's first out-dimension is not a constant. -bool isVariableDim(const IslPtr &BMap) { +bool isVariableDim(const isl::BasicMap &BMap) { auto FixedVal = give(isl_basic_map_plain_get_val_if_fixed(BMap.keep(), isl_dim_out, 0)); return !FixedVal || isl_val_is_nan(FixedVal.keep()); } /// Whether Map's first out dimension is no constant nor piecewise constant. -bool isVariableDim(const IslPtr &Map) { - return foreachEltWithBreak(Map, [](IslPtr BMap) -> isl_stat { +bool isVariableDim(const isl::Map &Map) { + return foreachEltWithBreak(Map, [](isl::BasicMap BMap) -> isl_stat { if (isVariableDim(BMap)) return isl_stat_error; return isl_stat_ok; @@ -61,8 +61,8 @@ } /// Whether UMap's first out dimension is no (piecewise) constant. -bool isVariableDim(const IslPtr &UMap) { - return foreachEltWithBreak(UMap, [](IslPtr Map) -> isl_stat { +bool isVariableDim(const isl::UnionMap &UMap) { + return foreachEltWithBreak(UMap, [](isl::Map Map) -> isl_stat { if (isVariableDim(Map)) return isl_stat_error; return isl_stat_ok; @@ -72,56 +72,54 @@ /// If @p PwAff maps to a constant, return said constant. If @p Max/@p Min, it /// can also be a piecewise constant and it would return the minimum/maximum /// value. Otherwise, return NaN. -IslPtr getConstant(IslPtr PwAff, bool Max, bool Min) { +isl::Val getConstant(isl::PwAff PwAff, bool Max, bool Min) { assert(!Max || !Min); - IslPtr Result; - foreachPieceWithBreak( - PwAff, [=, &Result](IslPtr Set, IslPtr Aff) { - if (Result && isl_val_is_nan(Result.keep())) - return isl_stat_ok; - - // TODO: If Min/Max, we can also determine a minimum/maximum value if - // Set is constant-bounded. - if (!isl_aff_is_cst(Aff.keep())) { - Result = give(isl_val_nan(Aff.getCtx())); - return isl_stat_error; - } - - auto ThisVal = give(isl_aff_get_constant_val(Aff.keep())); - if (!Result) { - Result = ThisVal; - return isl_stat_ok; - } - - if (isl_val_eq(Result.keep(), ThisVal.keep())) - return isl_stat_ok; - - if (Max && isl_val_gt(ThisVal.keep(), Result.keep())) { - Result = ThisVal; - return isl_stat_ok; - } - - if (Min && isl_val_lt(ThisVal.keep(), Result.keep())) { - Result = ThisVal; - return isl_stat_ok; - } - - // Not compatible - Result = give(isl_val_nan(Aff.getCtx())); - return isl_stat_error; - }); + isl::Val Result; + foreachPieceWithBreak(PwAff, [=, &Result](isl::Set Set, isl::Aff Aff) { + if (Result && isl_val_is_nan(Result.keep())) + return isl_stat_ok; + + // TODO: If Min/Max, we can also determine a minimum/maximum value if + // Set is constant-bounded. + if (!isl_aff_is_cst(Aff.keep())) { + Result = give(isl_val_nan(Aff.getCtx())); + return isl_stat_error; + } + + auto ThisVal = give(isl_aff_get_constant_val(Aff.keep())); + if (!Result) { + Result = ThisVal; + return isl_stat_ok; + } + + if (isl_val_eq(Result.keep(), ThisVal.keep())) + return isl_stat_ok; + + if (Max && isl_val_gt(ThisVal.keep(), Result.keep())) { + Result = ThisVal; + return isl_stat_ok; + } + + if (Min && isl_val_lt(ThisVal.keep(), Result.keep())) { + Result = ThisVal; + return isl_stat_ok; + } + + // Not compatible + Result = give(isl_val_nan(Aff.getCtx())); + return isl_stat_error; + }); return Result; } /// Compute @p UPwAff - @p Val. -IslPtr subtract(IslPtr UPwAff, - IslPtr Val) { +isl::UnionPwAff subtract(isl::UnionPwAff UPwAff, isl::Val Val) { if (isl_val_is_zero(Val.keep())) return UPwAff; auto Result = give(isl_union_pw_aff_empty(isl_union_pw_aff_get_space(UPwAff.keep()))); - foreachElt(UPwAff, [=, &Result](IslPtr PwAff) { + foreachElt(UPwAff, [=, &Result](isl::PwAff PwAff) { auto ValAff = give(isl_pw_aff_val_on_domain( isl_set_universe(isl_space_domain(isl_pw_aff_get_space(PwAff.keep()))), Val.copy())); @@ -133,14 +131,13 @@ } /// Compute @UPwAff * @p Val. -IslPtr multiply(IslPtr UPwAff, - IslPtr Val) { +isl::UnionPwAff multiply(isl::UnionPwAff UPwAff, isl::Val Val) { if (isl_val_is_one(Val.keep())) return UPwAff; auto Result = give(isl_union_pw_aff_empty(isl_union_pw_aff_get_space(UPwAff.keep()))); - foreachElt(UPwAff, [=, &Result](IslPtr PwAff) { + foreachElt(UPwAff, [=, &Result](isl::PwAff PwAff) { auto ValAff = give(isl_pw_aff_val_on_domain( isl_set_universe(isl_space_domain(isl_pw_aff_get_space(PwAff.keep()))), Val.copy())); @@ -155,14 +152,14 @@ /// /// It is assumed that all maps in the maps have at least the necessary number /// of out dimensions. -IslPtr scheduleProjectOut(const IslPtr &UMap, - unsigned first, unsigned n) { +isl::UnionMap scheduleProjectOut(const isl::UnionMap &UMap, unsigned first, + unsigned n) { if (n == 0) return UMap; /* isl_map_project_out would also reset the tuple, which should have no effect on schedule ranges */ auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &Result](IslPtr Map) { + foreachElt(UMap, [=, &Result](isl::Map Map) { auto Outprojected = give(isl_map_project_out(Map.take(), isl_dim_out, first, n)); Result = give(isl_union_map_add_map(Result.take(), Outprojected.take())); @@ -175,20 +172,19 @@ /// Because this function takes an isl_union_map, the out dimensions could be /// different. We return the maximum number in this case. However, a different /// number of dimensions is not supported by the other code in this file. -size_t scheduleScatterDims(const IslPtr &Schedule) { +size_t scheduleScatterDims(const isl::UnionMap &Schedule) { unsigned Dims = 0; - foreachElt(Schedule, [&Dims](IslPtr Map) { + foreachElt(Schedule, [&Dims](isl::Map Map) { Dims = std::max(Dims, isl_map_dim(Map.keep(), isl_dim_out)); }); return Dims; } /// Return the @p pos' range dimension, converted to an isl_union_pw_aff. -IslPtr scheduleExtractDimAff(IslPtr UMap, - unsigned pos) { +isl::UnionPwAff scheduleExtractDimAff(isl::UnionMap UMap, unsigned pos) { auto SingleUMap = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep()))); - foreachElt(UMap, [=, &SingleUMap](IslPtr Map) { + foreachElt(UMap, [=, &SingleUMap](isl::Map Map) { auto MapDims = isl_map_dim(Map.keep(), isl_dim_out); auto SingleMap = give(isl_map_project_out(Map.take(), isl_dim_out, 0, pos)); SingleMap = give(isl_map_project_out(SingleMap.take(), isl_dim_out, 1, @@ -222,7 +218,7 @@ /// left. /// The example schedule would be transformed to: /// { Stmt_X[] -> [X - l_X, ...]; Stmt_B -> [l_X - u_X + 1 + Y - l_Y, ...] } -IslPtr tryFlattenSequence(IslPtr Schedule) { +isl::UnionMap tryFlattenSequence(isl::UnionMap Schedule) { auto IslCtx = Schedule.getCtx(); auto ScatterSet = give(isl_set_from_union_set(isl_union_map_range(Schedule.copy()))); @@ -324,7 +320,7 @@ /// actual value of i. Let l_X() the smallest possible value of X and u_X() its /// largest value. Then, construct a new schedule /// { Stmt[i] -> [i * (u_X() - l_X() + 1), ...] } -IslPtr tryFlattenLoop(IslPtr Schedule) { +isl::UnionMap tryFlattenLoop(isl::UnionMap Schedule) { assert(scheduleScatterDims(Schedule) >= 2); auto Remaining = scheduleProjectOut(Schedule, 0, 1); @@ -379,7 +375,7 @@ } } // anonymous namespace -IslPtr polly::flattenSchedule(IslPtr Schedule) { +isl::UnionMap polly::flattenSchedule(isl::UnionMap Schedule) { auto Dims = scheduleScatterDims(Schedule); DEBUG(dbgs() << "Recursive schedule to process:\n " << Schedule << "\n"); Index: lib/Transform/FlattenSchedule.cpp =================================================================== --- lib/Transform/FlattenSchedule.cpp +++ lib/Transform/FlattenSchedule.cpp @@ -27,11 +27,9 @@ /// Print a schedule to @p OS. /// /// Prints the schedule for each statements on a new line. -void printSchedule(raw_ostream &OS, const IslPtr &Schedule, - int indent) { - foreachElt(Schedule, [&OS, indent](IslPtr Map) { - OS.indent(indent) << Map << "\n"; - }); +void printSchedule(raw_ostream &OS, const isl::UnionMap Schedule, int indent) { + foreachElt(Schedule, + [&OS, indent](isl::Map Map) { OS.indent(indent) << Map << "\n"; }); } /// Flatten the schedule stored in an polly::Scop. @@ -41,7 +39,7 @@ const FlattenSchedule &operator=(const FlattenSchedule &) = delete; std::shared_ptr IslCtx; - IslPtr OldSchedule; + isl::UnionMap OldSchedule; public: static char ID; Index: unittests/DeLICM/DeLICMTest.cpp =================================================================== --- unittests/DeLICM/DeLICMTest.cpp +++ unittests/DeLICM/DeLICMTest.cpp @@ -22,9 +22,9 @@ namespace { /// Get the universes of all spaces in @p USet. -IslPtr unionSpace(const IslPtr &USet) { +isl::UnionSet unionSpace(const isl::UnionSet &USet) { auto Result = give(isl_union_set_empty(isl_union_set_get_space(USet.keep()))); - foreachElt(USet, [=, &Result](IslPtr Set) { + foreachElt(USet, [=, &Result](isl::Set Set) { auto Space = give(isl_set_get_space(Set.keep())); auto Universe = give(isl_set_universe(Space.take())); Result = give(isl_union_set_add_set(Result.take(), Universe.take())); @@ -32,9 +32,8 @@ return Result; } -void completeLifetime(IslPtr Universe, - IslPtr &Unknown, - IslPtr &Undef) { +void completeLifetime(isl::UnionSet Universe, isl::UnionSet &Unknown, + isl::UnionSet &Undef) { if (!Unknown) { assert(Undef); Unknown = give(isl_union_set_subtract(Universe.copy(), Undef.copy())); @@ -104,7 +103,7 @@ // Add a space the universe that does not occur anywhere else to ensure // robustness. Use &NewId to ensure that this Id is unique. - IslPtr NewId = give(isl_id_alloc(Ctx.get(), "Unrelated", &NewId)); + isl::Id NewId = give(isl_id_alloc(Ctx.get(), "Unrelated", &NewId)); // The space must contains at least one dimension to allow order // modifications. auto NewSpace = give(isl_space_set_alloc(Ctx.get(), 0, 1)); Index: unittests/Isl/IslTest.cpp =================================================================== --- unittests/Isl/IslTest.cpp +++ unittests/Isl/IslTest.cpp @@ -16,11 +16,11 @@ using namespace llvm; using namespace polly; -static IslPtr parseSpace(isl_ctx *Ctx, const char *Str) { +static isl::Space parseSpace(isl_ctx *Ctx, const char *Str) { isl_stream *Stream = isl_stream_new_str(Ctx, Str); auto Obj = isl_stream_read_obj(Stream); - IslPtr Result; + isl::Space Result; if (Obj.type == isl_obj_set) Result = give(isl_set_get_space(static_cast(Obj.v))); else if (Obj.type == isl_obj_map) @@ -40,39 +40,6 @@ #define USET(Str) give(isl_union_set_read_from_str(Ctx.get(), Str)) #define UMAP(Str) give(isl_union_map_read_from_str(Ctx.get(), Str)) -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { - auto IsEqual = isl_space_is_equal(LHS.keep(), RHS.keep()); - EXPECT_NE(isl_bool_error, IsEqual); - return IsEqual; -} - -static bool operator==(const IslPtr &LHS, const IslPtr &RHS) { - auto IsEqual = isl_set_is_equal(LHS.keep(), RHS.keep()); - EXPECT_NE(isl_bool_error, IsEqual); - return IsEqual; -} - -static bool operator==(const IslPtr &LHS, const IslPtr &RHS) { - auto IsEqual = isl_map_is_equal(LHS.keep(), RHS.keep()); - EXPECT_NE(isl_bool_error, IsEqual); - return IsEqual; -} - -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { - auto IsEqual = isl_union_set_is_equal(LHS.keep(), RHS.keep()); - EXPECT_NE(isl_bool_error, IsEqual); - return IsEqual; -} - -static bool operator==(const IslPtr &LHS, - const IslPtr &RHS) { - auto IsEqual = isl_union_map_is_equal(LHS.keep(), RHS.keep()); - EXPECT_NE(isl_bool_error, IsEqual); - return IsEqual; -} - namespace { TEST(Isl, APIntToIslVal) { @@ -310,7 +277,7 @@ { auto NumBMaps = 0; - foreachElt(TestMap, [&](IslPtr BMap) { + foreachElt(TestMap, [&](isl::BasicMap BMap) { EXPECT_EQ(isl_bool_true, isl_basic_map_is_equal(BMap.keep(), TestBMap.keep())); NumBMaps++; @@ -320,7 +287,7 @@ { auto NumBSets = 0; - foreachElt(TestSet, [&](IslPtr BSet) { + foreachElt(TestSet, [&](isl::BasicSet BSet) { EXPECT_EQ(isl_bool_true, isl_basic_set_is_equal(BSet.keep(), TestBSet.keep())); NumBSets++; @@ -330,7 +297,7 @@ { auto NumMaps = 0; - foreachElt(TestUMap, [&](IslPtr Map) { + foreachElt(TestUMap, [&](isl::Map Map) { EXPECT_EQ(isl_bool_true, isl_map_is_equal(Map.keep(), TestMap.keep())); NumMaps++; }); @@ -339,7 +306,7 @@ { auto NumSets = 0; - foreachElt(TestUSet, [&](IslPtr Set) { + foreachElt(TestUSet, [&](isl::Set Set) { EXPECT_EQ(isl_bool_true, isl_set_is_equal(Set.keep(), TestSet.keep())); NumSets++; }); @@ -350,7 +317,7 @@ auto UPwAff = give(isl_union_pw_aff_val_on_domain(TestUSet.copy(), isl_val_zero(Ctx.get()))); auto NumPwAffs = 0; - foreachElt(UPwAff, [&](IslPtr PwAff) { + foreachElt(UPwAff, [&](isl::PwAff PwAff) { EXPECT_EQ(isl_bool_true, isl_pw_aff_is_cst(PwAff.keep())); NumPwAffs++; }); @@ -360,26 +327,24 @@ { auto NumBMaps = 0; EXPECT_EQ(isl_stat_error, - foreachEltWithBreak( - TestMap, [&](IslPtr BMap) -> isl_stat { - EXPECT_EQ(isl_bool_true, isl_basic_map_is_equal( - BMap.keep(), TestBMap.keep())); - NumBMaps++; - return isl_stat_error; - })); + foreachEltWithBreak(TestMap, [&](isl::BasicMap BMap) -> isl_stat { + EXPECT_EQ(isl_bool_true, + isl_basic_map_is_equal(BMap.keep(), TestBMap.keep())); + NumBMaps++; + return isl_stat_error; + })); EXPECT_EQ(1, NumBMaps); } { auto NumMaps = 0; - EXPECT_EQ( - isl_stat_error, - foreachEltWithBreak(TestUMap, [&](IslPtr Map) -> isl_stat { - EXPECT_EQ(isl_bool_true, - isl_map_is_equal(Map.keep(), TestMap.keep())); - NumMaps++; - return isl_stat_error; - })); + EXPECT_EQ(isl_stat_error, + foreachEltWithBreak(TestUMap, [&](isl::Map Map) -> isl_stat { + EXPECT_EQ(isl_bool_true, + isl_map_is_equal(Map.keep(), TestMap.keep())); + NumMaps++; + return isl_stat_error; + })); EXPECT_EQ(1, NumMaps); } @@ -388,8 +353,7 @@ give(isl_pw_aff_val_on_domain(TestSet.copy(), isl_val_zero(Ctx.get()))); auto NumPieces = 0; foreachPieceWithBreak( - TestPwAff, - [&](IslPtr Domain, IslPtr Aff) -> isl_stat { + TestPwAff, [&](isl::Set Domain, isl::Aff Aff) -> isl_stat { EXPECT_EQ(isl_bool_true, isl_set_is_equal(Domain.keep(), TestSet.keep())); EXPECT_EQ(isl_bool_true, isl_aff_is_cst(Aff.keep()));