From dddb225acf1f194c85e29e47ac07205cc38186d1 Mon Sep 17 00:00:00 2001 From: patacca Date: Fri, 9 Jul 2021 12:24:35 +0200 Subject: [PATCH] [Polly][Isl] Update isl to isl-0.24-52-gd7be01f7 This is needed because the functions `isl_union_{set,map}_get_{set,map}_list` have been exposed to the C++ interface --- polly/lib/External/isl/GIT_HEAD_ID | 2 +- polly/lib/External/isl/doc/SubmittingPatches | 1 + polly/lib/External/isl/doc/user.pod | 6 +- .../isl/include/isl/cpp-checked-conversion.h | 8 + polly/lib/External/isl/include/isl/cpp-checked.h | 230 ++++++++- polly/lib/External/isl/include/isl/cpp.h | 332 ++++++++++++- polly/lib/External/isl/include/isl/map_type.h | 5 +- polly/lib/External/isl/include/isl/typed_cpp.h | 552 +++++++++++++++++++++ polly/lib/External/isl/include/isl/union_set.h | 1 + polly/lib/External/isl/interface/isl.py | 203 ++++++++ polly/lib/External/isl/isl_list_read_templ.c | 2 + polly/lib/External/isl/isl_set_list.c | 1 + 12 files changed, 1325 insertions(+), 18 deletions(-) diff --git a/polly/lib/External/isl/GIT_HEAD_ID b/polly/lib/External/isl/GIT_HEAD_ID index d82f0b9..56d7f75 100644 --- a/polly/lib/External/isl/GIT_HEAD_ID +++ b/polly/lib/External/isl/GIT_HEAD_ID @@ -1 +1 @@ -isl-0.24-47-g8853f375 +isl-0.24-52-gd7be01f7 diff --git a/polly/lib/External/isl/doc/SubmittingPatches b/polly/lib/External/isl/doc/SubmittingPatches index 2c2b938..5a59a12 100644 --- a/polly/lib/External/isl/doc/SubmittingPatches +++ b/polly/lib/External/isl/doc/SubmittingPatches @@ -11,6 +11,7 @@ - the body should provide a meaningful commit message, which includes motivation for the change, and contrasts its implementation with previous behaviour + - the lines of this body should have at most 76 columns - if you want your work included in isl.git, add a "Signed-off-by: Your Name " line to the commit message (or just use the option "-s" when diff --git a/polly/lib/External/isl/doc/user.pod b/polly/lib/External/isl/doc/user.pod index 743e881..1e8d6a9 100644 --- a/polly/lib/External/isl/doc/user.pod +++ b/polly/lib/External/isl/doc/user.pod @@ -9411,7 +9411,7 @@ in isl format. An C, C, C, C, C, C, -C or C object +C, C or C object can also be read from input using the following functions. #include @@ -9436,6 +9436,10 @@ can also be read from input using the following functions. isl_union_pw_aff_list_read_from_str(isl_ctx *ctx, const char *str); + #include + __isl_give isl_set_list *isl_set_list_read_from_str( + isl_ctx *ctx, const char *str); + #include __isl_give isl_map_list *isl_map_list_read_from_str( isl_ctx *ctx, const char *str); diff --git a/polly/lib/External/isl/include/isl/cpp-checked-conversion.h b/polly/lib/External/isl/include/isl/cpp-checked-conversion.h index 2575ce5..5268364 100644 --- a/polly/lib/External/isl/include/isl/cpp-checked-conversion.h +++ b/polly/lib/External/isl/include/isl/cpp-checked-conversion.h @@ -590,6 +590,14 @@ set uncheck(checked::set obj) { return manage(obj.copy()); } +checked::set_list check(set_list obj) { + return checked::manage(obj.copy()); +} + +set_list uncheck(checked::set_list obj) { + return manage(obj.copy()); +} + checked::space check(space obj) { return checked::manage(obj.copy()); } diff --git a/polly/lib/External/isl/include/isl/cpp-checked.h b/polly/lib/External/isl/include/isl/cpp-checked.h index c97cdb2..54417e0 100644 --- a/polly/lib/External/isl/include/isl/cpp-checked.h +++ b/polly/lib/External/isl/include/isl/cpp-checked.h @@ -280,6 +280,7 @@ class schedule_node_mark; class schedule_node_sequence; class schedule_node_set; class set; +class set_list; class space; class union_access_info; class union_flow; @@ -1637,12 +1638,13 @@ public: inline isl::checked::pw_multi_aff pw_multi_aff_on_domain(const isl::checked::multi_val &mv) const; inline isl::checked::basic_set sample() const; inline isl::checked::point sample_point() const; + inline isl::checked::set_list set_list() const; inline isl::checked::fixed_box simple_fixed_box_hull() const; inline isl::checked::space space() const; inline isl::checked::val stride(int pos) const; inline isl::checked::set subtract(const isl::checked::set &set2) const; inline isl::checked::union_set subtract(const isl::checked::union_set &uset2) const; - inline isl::checked::union_set_list to_list() const; + inline isl::checked::set_list to_list() const; inline isl::checked::set to_set() const; inline isl::checked::union_set to_union_set() const; inline isl::checked::map translation() const; @@ -2555,12 +2557,13 @@ public: inline isl::checked::pw_multi_aff pw_multi_aff_on_domain(const isl::checked::multi_val &mv) const; inline isl::checked::basic_set sample() const; inline isl::checked::point sample_point() const; + inline isl::checked::set_list set_list() const; inline isl::checked::fixed_box simple_fixed_box_hull() const; inline isl::checked::space space() const; inline isl::checked::val stride(int pos) const; inline isl::checked::set subtract(const isl::checked::set &set2) const; inline isl::checked::union_set subtract(const isl::checked::union_set &uset2) const; - inline isl::checked::union_set_list to_list() const; + inline isl::checked::set_list to_list() const; inline isl::checked::set to_set() const; inline isl::checked::union_set to_union_set() const; inline isl::checked::map translation() const; @@ -3501,6 +3504,7 @@ public: inline isl::checked::pw_multi_aff pw_multi_aff_on_domain(isl::checked::multi_val mv) const; inline isl::checked::basic_set sample() const; inline isl::checked::point sample_point() const; + inline isl::checked::set_list set_list() const; inline isl::checked::fixed_box simple_fixed_box_hull() const; inline isl::checked::fixed_box get_simple_fixed_box_hull() const; inline isl::checked::space space() const; @@ -3511,7 +3515,7 @@ public: inline isl::checked::union_set subtract(const isl::checked::union_set &uset2) const; inline isl::checked::set subtract(const isl::checked::basic_set &set2) const; inline isl::checked::set subtract(const isl::checked::point &set2) const; - inline isl::checked::union_set_list to_list() const; + inline isl::checked::set_list to_list() const; inline isl::checked::union_set to_union_set() const; inline isl::checked::map translation() const; inline class size tuple_dim() const; @@ -3528,6 +3532,45 @@ public: inline isl::checked::set upper_bound(isl::checked::multi_val upper) const; }; +// declarations for isl::set_list +inline set_list manage(__isl_take isl_set_list *ptr); +inline set_list manage_copy(__isl_keep isl_set_list *ptr); + +class set_list { + friend inline set_list manage(__isl_take isl_set_list *ptr); + friend inline set_list manage_copy(__isl_keep isl_set_list *ptr); + +protected: + isl_set_list *ptr = nullptr; + + inline explicit set_list(__isl_take isl_set_list *ptr); + +public: + inline /* implicit */ set_list(); + inline /* implicit */ set_list(const set_list &obj); + inline explicit set_list(isl::checked::ctx ctx, int n); + inline explicit set_list(isl::checked::set el); + inline explicit set_list(isl::checked::ctx ctx, const std::string &str); + inline set_list &operator=(set_list obj); + inline ~set_list(); + inline __isl_give isl_set_list *copy() const &; + inline __isl_give isl_set_list *copy() && = delete; + inline __isl_keep isl_set_list *get() const; + inline __isl_give isl_set_list *release(); + inline bool is_null() const; + inline isl::checked::ctx ctx() const; + + inline isl::checked::set_list add(isl::checked::set el) const; + inline isl::checked::set at(int index) const; + inline isl::checked::set get_at(int index) const; + inline isl::checked::set_list clear() const; + inline isl::checked::set_list concat(isl::checked::set_list list2) const; + inline isl::checked::set_list drop(unsigned int first, unsigned int n) const; + inline stat foreach(const std::function &fn) const; + inline isl::checked::set_list insert(unsigned int pos, isl::checked::set el) const; + inline class size size() const; +}; + // declarations for isl::space inline space manage(__isl_take isl_space *ptr); inline space manage_copy(__isl_keep isl_space *ptr); @@ -4053,6 +4096,8 @@ public: inline isl::checked::union_set preimage(isl::checked::pw_multi_aff pma) const; inline isl::checked::union_set preimage(isl::checked::union_pw_multi_aff upma) const; inline isl::checked::point sample_point() const; + inline isl::checked::set_list set_list() const; + inline isl::checked::set_list get_set_list() const; inline isl::checked::space space() const; inline isl::checked::space get_space() const; inline isl::checked::union_set subtract(isl::checked::union_set uset2) const; @@ -8324,6 +8369,11 @@ isl::checked::point basic_set::sample_point() const return manage(res); } +isl::checked::set_list basic_set::set_list() const +{ + return isl::checked::set(*this).set_list(); +} + isl::checked::fixed_box basic_set::simple_fixed_box_hull() const { return isl::checked::set(*this).simple_fixed_box_hull(); @@ -8349,7 +8399,7 @@ isl::checked::union_set basic_set::subtract(const isl::checked::union_set &uset2 return isl::checked::set(*this).subtract(uset2); } -isl::checked::union_set_list basic_set::to_list() const +isl::checked::set_list basic_set::to_list() const { return isl::checked::set(*this).to_list(); } @@ -12464,6 +12514,11 @@ isl::checked::point point::sample_point() const return isl::checked::basic_set(*this).sample_point(); } +isl::checked::set_list point::set_list() const +{ + return isl::checked::basic_set(*this).set_list(); +} + isl::checked::fixed_box point::simple_fixed_box_hull() const { return isl::checked::basic_set(*this).simple_fixed_box_hull(); @@ -12489,7 +12544,7 @@ isl::checked::union_set point::subtract(const isl::checked::union_set &uset2) co return isl::checked::basic_set(*this).subtract(uset2); } -isl::checked::union_set_list point::to_list() const +isl::checked::set_list point::to_list() const { return isl::checked::basic_set(*this).to_list(); } @@ -16255,6 +16310,11 @@ isl::checked::point set::sample_point() const return manage(res); } +isl::checked::set_list set::set_list() const +{ + return isl::checked::union_set(*this).set_list(); +} + isl::checked::fixed_box set::simple_fixed_box_hull() const { auto res = isl_set_get_simple_fixed_box_hull(get()); @@ -16309,9 +16369,10 @@ isl::checked::set set::subtract(const isl::checked::point &set2) const return this->subtract(isl::checked::set(set2)); } -isl::checked::union_set_list set::to_list() const +isl::checked::set_list set::to_list() const { - return isl::checked::union_set(*this).to_list(); + auto res = isl_set_to_list(copy()); + return manage(res); } isl::checked::union_set set::to_union_set() const @@ -16407,6 +16468,150 @@ inline std::ostream &operator<<(std::ostream &os, const set &obj) return os; } +// implementations for isl::set_list +set_list manage(__isl_take isl_set_list *ptr) { + return set_list(ptr); +} +set_list manage_copy(__isl_keep isl_set_list *ptr) { + ptr = isl_set_list_copy(ptr); + return set_list(ptr); +} + +set_list::set_list() + : ptr(nullptr) {} + +set_list::set_list(const set_list &obj) + : ptr(nullptr) +{ + ptr = obj.copy(); +} + +set_list::set_list(__isl_take isl_set_list *ptr) + : ptr(ptr) {} + +set_list::set_list(isl::checked::ctx ctx, int n) +{ + auto res = isl_set_list_alloc(ctx.release(), n); + ptr = res; +} + +set_list::set_list(isl::checked::set el) +{ + auto res = isl_set_list_from_set(el.release()); + ptr = res; +} + +set_list::set_list(isl::checked::ctx ctx, const std::string &str) +{ + auto res = isl_set_list_read_from_str(ctx.release(), str.c_str()); + ptr = res; +} + +set_list &set_list::operator=(set_list obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +set_list::~set_list() { + if (ptr) + isl_set_list_free(ptr); +} + +__isl_give isl_set_list *set_list::copy() const & { + return isl_set_list_copy(ptr); +} + +__isl_keep isl_set_list *set_list::get() const { + return ptr; +} + +__isl_give isl_set_list *set_list::release() { + isl_set_list *tmp = ptr; + ptr = nullptr; + return tmp; +} + +bool set_list::is_null() const { + return ptr == nullptr; +} + +isl::checked::ctx set_list::ctx() const { + return isl::checked::ctx(isl_set_list_get_ctx(ptr)); +} + +isl::checked::set_list set_list::add(isl::checked::set el) const +{ + auto res = isl_set_list_add(copy(), el.release()); + return manage(res); +} + +isl::checked::set set_list::at(int index) const +{ + auto res = isl_set_list_get_at(get(), index); + return manage(res); +} + +isl::checked::set set_list::get_at(int index) const +{ + return at(index); +} + +isl::checked::set_list set_list::clear() const +{ + auto res = isl_set_list_clear(copy()); + return manage(res); +} + +isl::checked::set_list set_list::concat(isl::checked::set_list list2) const +{ + auto res = isl_set_list_concat(copy(), list2.release()); + return manage(res); +} + +isl::checked::set_list set_list::drop(unsigned int first, unsigned int n) const +{ + auto res = isl_set_list_drop(copy(), first, n); + return manage(res); +} + +stat set_list::foreach(const std::function &fn) const +{ + struct fn_data { + std::function func; + } fn_data = { fn }; + auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat { + auto *data = static_cast(arg_1); + auto ret = (data->func)(manage(arg_0)); + return ret.release(); + }; + auto res = isl_set_list_foreach(get(), fn_lambda, &fn_data); + return manage(res); +} + +isl::checked::set_list set_list::insert(unsigned int pos, isl::checked::set el) const +{ + auto res = isl_set_list_insert(copy(), pos, el.release()); + return manage(res); +} + +class size set_list::size() const +{ + auto res = isl_set_list_size(get()); + return manage(res); +} + +inline std::ostream &operator<<(std::ostream &os, const set_list &obj) +{ + char *str = isl_set_list_to_str(obj.get()); + if (!str) { + os.setstate(std::ios_base::badbit); + return os; + } + os << str; + free(str); + return os; +} + // implementations for isl::space space manage(__isl_take isl_space *ptr) { return space(ptr); @@ -18761,6 +18966,17 @@ isl::checked::point union_set::sample_point() const return manage(res); } +isl::checked::set_list union_set::set_list() const +{ + auto res = isl_union_set_get_set_list(get()); + return manage(res); +} + +isl::checked::set_list union_set::get_set_list() const +{ + return set_list(); +} + isl::checked::space union_set::space() const { auto res = isl_union_set_get_space(get()); diff --git a/polly/lib/External/isl/include/isl/cpp.h b/polly/lib/External/isl/include/isl/cpp.h index f47b12a..0e7c6b9 100644 --- a/polly/lib/External/isl/include/isl/cpp.h +++ b/polly/lib/External/isl/include/isl/cpp.h @@ -344,6 +344,7 @@ class schedule_node_mark; class schedule_node_sequence; class schedule_node_set; class set; +class set_list; class space; class union_access_info; class union_flow; @@ -1702,12 +1703,13 @@ public: inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const; inline isl::basic_set sample() const; inline isl::point sample_point() const; + inline isl::set_list set_list() const; inline isl::fixed_box simple_fixed_box_hull() const; inline isl::space space() const; inline isl::val stride(int pos) const; inline isl::set subtract(const isl::set &set2) const; inline isl::union_set subtract(const isl::union_set &uset2) const; - inline isl::union_set_list to_list() const; + inline isl::set_list to_list() const; inline isl::set to_set() const; inline isl::union_set to_union_set() const; inline isl::map translation() const; @@ -2620,12 +2622,13 @@ public: inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const; inline isl::basic_set sample() const; inline isl::point sample_point() const; + inline isl::set_list set_list() const; inline isl::fixed_box simple_fixed_box_hull() const; inline isl::space space() const; inline isl::val stride(int pos) const; inline isl::set subtract(const isl::set &set2) const; inline isl::union_set subtract(const isl::union_set &uset2) const; - inline isl::union_set_list to_list() const; + inline isl::set_list to_list() const; inline isl::set to_set() const; inline isl::union_set to_union_set() const; inline isl::map translation() const; @@ -3566,6 +3569,7 @@ public: inline isl::pw_multi_aff pw_multi_aff_on_domain(isl::multi_val mv) const; inline isl::basic_set sample() const; inline isl::point sample_point() const; + inline isl::set_list set_list() const; inline isl::fixed_box simple_fixed_box_hull() const; inline isl::fixed_box get_simple_fixed_box_hull() const; inline isl::space space() const; @@ -3576,7 +3580,7 @@ public: inline isl::union_set subtract(const isl::union_set &uset2) const; inline isl::set subtract(const isl::basic_set &set2) const; inline isl::set subtract(const isl::point &set2) const; - inline isl::union_set_list to_list() const; + inline isl::set_list to_list() const; inline isl::union_set to_union_set() const; inline isl::map translation() const; inline unsigned tuple_dim() const; @@ -3593,6 +3597,45 @@ public: inline isl::set upper_bound(isl::multi_val upper) const; }; +// declarations for isl::set_list +inline set_list manage(__isl_take isl_set_list *ptr); +inline set_list manage_copy(__isl_keep isl_set_list *ptr); + +class set_list { + friend inline set_list manage(__isl_take isl_set_list *ptr); + friend inline set_list manage_copy(__isl_keep isl_set_list *ptr); + +protected: + isl_set_list *ptr = nullptr; + + inline explicit set_list(__isl_take isl_set_list *ptr); + +public: + inline /* implicit */ set_list(); + inline /* implicit */ set_list(const set_list &obj); + inline explicit set_list(isl::ctx ctx, int n); + inline explicit set_list(isl::set el); + inline explicit set_list(isl::ctx ctx, const std::string &str); + inline set_list &operator=(set_list obj); + inline ~set_list(); + inline __isl_give isl_set_list *copy() const &; + inline __isl_give isl_set_list *copy() && = delete; + inline __isl_keep isl_set_list *get() const; + inline __isl_give isl_set_list *release(); + inline bool is_null() const; + inline isl::ctx ctx() const; + + inline isl::set_list add(isl::set el) const; + inline isl::set at(int index) const; + inline isl::set get_at(int index) const; + inline isl::set_list clear() const; + inline isl::set_list concat(isl::set_list list2) const; + inline isl::set_list drop(unsigned int first, unsigned int n) const; + inline void foreach(const std::function &fn) const; + inline isl::set_list insert(unsigned int pos, isl::set el) const; + inline unsigned size() const; +}; + // declarations for isl::space inline space manage(__isl_take isl_space *ptr); inline space manage_copy(__isl_keep isl_space *ptr); @@ -4118,6 +4161,8 @@ public: inline isl::union_set preimage(isl::pw_multi_aff pma) const; inline isl::union_set preimage(isl::union_pw_multi_aff upma) const; inline isl::point sample_point() const; + inline isl::set_list set_list() const; + inline isl::set_list get_set_list() const; inline isl::space space() const; inline isl::space get_space() const; inline isl::union_set subtract(isl::union_set uset2) const; @@ -9971,6 +10016,13 @@ isl::point basic_set::sample_point() const return manage(res); } +isl::set_list basic_set::set_list() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + return isl::set(*this).set_list(); +} + isl::fixed_box basic_set::simple_fixed_box_hull() const { if (!ptr) @@ -10006,7 +10058,7 @@ isl::union_set basic_set::subtract(const isl::union_set &uset2) const return isl::set(*this).subtract(uset2); } -isl::union_set_list basic_set::to_list() const +isl::set_list basic_set::to_list() const { if (!ptr) exception::throw_invalid("NULL input", __FILE__, __LINE__); @@ -16645,6 +16697,13 @@ isl::point point::sample_point() const return isl::basic_set(*this).sample_point(); } +isl::set_list point::set_list() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + return isl::basic_set(*this).set_list(); +} + isl::fixed_box point::simple_fixed_box_hull() const { if (!ptr) @@ -16680,7 +16739,7 @@ isl::union_set point::subtract(const isl::union_set &uset2) const return isl::basic_set(*this).subtract(uset2); } -isl::union_set_list point::to_list() const +isl::set_list point::to_list() const { if (!ptr) exception::throw_invalid("NULL input", __FILE__, __LINE__); @@ -22618,6 +22677,13 @@ isl::point set::sample_point() const return manage(res); } +isl::set_list set::set_list() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + return isl::union_set(*this).set_list(); +} + isl::fixed_box set::simple_fixed_box_hull() const { if (!ptr) @@ -22702,11 +22768,16 @@ isl::set set::subtract(const isl::point &set2) const return this->subtract(isl::set(set2)); } -isl::union_set_list set::to_list() const +isl::set_list set::to_list() const { if (!ptr) exception::throw_invalid("NULL input", __FILE__, __LINE__); - return isl::union_set(*this).to_list(); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_to_list(copy()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); } isl::union_set set::to_union_set() const @@ -22876,6 +22947,236 @@ inline std::ostream &operator<<(std::ostream &os, const set &obj) return os; } +// implementations for isl::set_list +set_list manage(__isl_take isl_set_list *ptr) { + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + return set_list(ptr); +} +set_list manage_copy(__isl_keep isl_set_list *ptr) { + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = isl_set_list_get_ctx(ptr); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + ptr = isl_set_list_copy(ptr); + if (!ptr) + exception::throw_last_error(saved_ctx); + return set_list(ptr); +} + +set_list::set_list() + : ptr(nullptr) {} + +set_list::set_list(const set_list &obj) + : ptr(nullptr) +{ + if (!obj.ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = isl_set_list_get_ctx(obj.ptr); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + ptr = obj.copy(); + if (!ptr) + exception::throw_last_error(saved_ctx); +} + +set_list::set_list(__isl_take isl_set_list *ptr) + : ptr(ptr) {} + +set_list::set_list(isl::ctx ctx, int n) +{ + auto saved_ctx = ctx; + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_alloc(ctx.release(), n); + if (!res) + exception::throw_last_error(saved_ctx); + ptr = res; +} + +set_list::set_list(isl::set el) +{ + if (el.is_null()) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = el.ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_from_set(el.release()); + if (!res) + exception::throw_last_error(saved_ctx); + ptr = res; +} + +set_list::set_list(isl::ctx ctx, const std::string &str) +{ + auto saved_ctx = ctx; + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_read_from_str(ctx.release(), str.c_str()); + if (!res) + exception::throw_last_error(saved_ctx); + ptr = res; +} + +set_list &set_list::operator=(set_list obj) { + std::swap(this->ptr, obj.ptr); + return *this; +} + +set_list::~set_list() { + if (ptr) + isl_set_list_free(ptr); +} + +__isl_give isl_set_list *set_list::copy() const & { + return isl_set_list_copy(ptr); +} + +__isl_keep isl_set_list *set_list::get() const { + return ptr; +} + +__isl_give isl_set_list *set_list::release() { + isl_set_list *tmp = ptr; + ptr = nullptr; + return tmp; +} + +bool set_list::is_null() const { + return ptr == nullptr; +} + +isl::ctx set_list::ctx() const { + return isl::ctx(isl_set_list_get_ctx(ptr)); +} + +isl::set_list set_list::add(isl::set el) const +{ + if (!ptr || el.is_null()) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_add(copy(), el.release()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +isl::set set_list::at(int index) const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_get_at(get(), index); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +isl::set set_list::get_at(int index) const +{ + return at(index); +} + +isl::set_list set_list::clear() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_clear(copy()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +isl::set_list set_list::concat(isl::set_list list2) const +{ + if (!ptr || list2.is_null()) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_concat(copy(), list2.release()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +isl::set_list set_list::drop(unsigned int first, unsigned int n) const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_drop(copy(), first, n); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +void set_list::foreach(const std::function &fn) const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + struct fn_data { + std::function func; + std::exception_ptr eptr; + } fn_data = { fn }; + auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat { + auto *data = static_cast(arg_1); + ISL_CPP_TRY { + (data->func)(manage(arg_0)); + return isl_stat_ok; + } ISL_CPP_CATCH_ALL { + data->eptr = std::current_exception(); + return isl_stat_error; + } + }; + auto res = isl_set_list_foreach(get(), fn_lambda, &fn_data); + if (fn_data.eptr) + std::rethrow_exception(fn_data.eptr); + if (res < 0) + exception::throw_last_error(saved_ctx); + return; +} + +isl::set_list set_list::insert(unsigned int pos, isl::set el) const +{ + if (!ptr || el.is_null()) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_insert(copy(), pos, el.release()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +unsigned set_list::size() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_set_list_size(get()); + if (res < 0) + exception::throw_last_error(saved_ctx); + return res; +} + +inline std::ostream &operator<<(std::ostream &os, const set_list &obj) +{ + if (!obj.get()) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = isl_set_list_get_ctx(obj.get()); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + char *str = isl_set_list_to_str(obj.get()); + if (!str) + exception::throw_last_error(saved_ctx); + os << str; + free(str); + return os; +} + // implementations for isl::space space manage(__isl_take isl_space *ptr) { if (!ptr) @@ -26950,6 +27251,23 @@ isl::point union_set::sample_point() const return manage(res); } +isl::set_list union_set::set_list() const +{ + if (!ptr) + exception::throw_invalid("NULL input", __FILE__, __LINE__); + auto saved_ctx = ctx(); + options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error); + auto res = isl_union_set_get_set_list(get()); + if (!res) + exception::throw_last_error(saved_ctx); + return manage(res); +} + +isl::set_list union_set::get_set_list() const +{ + return set_list(); +} + isl::space union_set::space() const { if (!ptr) diff --git a/polly/lib/External/isl/include/isl/map_type.h b/polly/lib/External/isl/include/isl/map_type.h index 8802584..731dfed 100644 --- a/polly/lib/External/isl/include/isl/map_type.h +++ b/polly/lib/External/isl/include/isl/map_type.h @@ -24,11 +24,12 @@ ISL_DECLARE_LIST_TYPE(basic_set) #ifndef isl_set struct __isl_subclass(isl_union_set) isl_set; typedef struct isl_set isl_set; -ISL_DECLARE_LIST_TYPE(set) +ISL_DECLARE_EXPORTED_LIST_TYPE(set) #endif ISL_DECLARE_LIST_FN(basic_set) -ISL_DECLARE_LIST_FN(set) +ISL_DECLARE_EXPORTED_LIST_FN(set) +ISL_DECLARE_EXPORTED_LIST_FN_READ(set) #if defined(__cplusplus) } diff --git a/polly/lib/External/isl/include/isl/typed_cpp.h b/polly/lib/External/isl/include/isl/typed_cpp.h index df39c8e..165a61b 100644 --- a/polly/lib/External/isl/include/isl/typed_cpp.h +++ b/polly/lib/External/isl/include/isl/typed_cpp.h @@ -94,6 +94,9 @@ template struct set; template +struct set_list; + +template struct space; template @@ -169,6 +172,8 @@ struct aff : public isl::aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -360,6 +365,8 @@ struct aff : public isl::aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -574,6 +581,8 @@ struct aff, Anonymous> : public isl::aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -791,6 +800,8 @@ struct aff_list : public isl::aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -867,6 +878,8 @@ struct aff_list : public isl::aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -953,6 +966,8 @@ struct basic_map : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -1154,6 +1169,8 @@ struct basic_map, Range2> : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -1354,6 +1371,8 @@ struct basic_map : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -1560,6 +1579,8 @@ struct basic_map> : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -1760,6 +1781,8 @@ struct basic_map, pair> : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -1963,6 +1986,8 @@ struct basic_map, pair> : public isl::basic_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2162,6 +2187,8 @@ struct basic_set<> : public isl::basic_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2241,6 +2268,7 @@ struct basic_set<> : public isl::basic_set { inline typed::set<> project_out_param(const std::string &id) const; inline typed::set<> project_out_param(const typed::id_list &list) const; inline typed::pw_multi_aff<> pw_multi_aff_on_domain(const typed::multi_val<> &mv) const = delete; + inline typed::set_list<> set_list() const; inline typed::fixed_box<> simple_fixed_box_hull() const = delete; inline typed::space<> space() const; inline typed::set<> subtract(const typed::set<> &set2) const; @@ -2303,6 +2331,8 @@ struct basic_set : public isl::basic_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2397,6 +2427,7 @@ struct basic_set : public isl::basic_set { inline typed::set project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list set_list() const; inline typed::fixed_box simple_fixed_box_hull() const; inline typed::space space() const; inline typed::set subtract(const typed::set &set2) const; @@ -2459,6 +2490,8 @@ struct basic_set> : public isl::basic_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2554,6 +2587,7 @@ struct basic_set> : public isl::basic_set { inline typed::set> project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff, Arg2> pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list> set_list() const; inline typed::fixed_box> simple_fixed_box_hull() const; inline typed::space> space() const; inline typed::set> subtract(const typed::set> &set2) const; @@ -2616,6 +2650,8 @@ struct fixed_box : public isl::fixed_box { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2700,6 +2736,8 @@ struct fixed_box : public isl::fixed_box { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2785,6 +2823,8 @@ struct id : public isl::id { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2855,6 +2895,8 @@ struct id_list : public isl::id_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -2932,6 +2974,8 @@ struct map : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -3179,6 +3223,8 @@ struct map, Range2> : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -3425,6 +3471,8 @@ struct map : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -3697,6 +3745,8 @@ struct map> : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -3943,6 +3993,8 @@ struct map, pair> : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -4212,6 +4264,8 @@ struct map, pair> : public isl::map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -4457,6 +4511,8 @@ struct map_list : public isl::map_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -4545,6 +4601,8 @@ struct multi_aff : public isl::multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -4731,6 +4789,8 @@ struct multi_aff : public isl::multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -4932,6 +4992,8 @@ struct multi_aff, Range> : public isl::multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -5136,6 +5198,8 @@ struct multi_aff> : public isl::multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -5336,6 +5400,8 @@ struct multi_aff, pair> : public isl::multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -5539,6 +5605,8 @@ struct multi_id : public isl::multi_id { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -5628,6 +5696,8 @@ struct multi_pw_aff : public isl::multi_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -5809,6 +5879,8 @@ struct multi_pw_aff : public isl::multi_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6003,6 +6075,8 @@ struct multi_pw_aff, Range> : public isl::multi_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6198,6 +6272,8 @@ struct multi_union_pw_aff : public isl::multi_union_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6329,6 +6405,8 @@ struct multi_union_pw_aff : public isl::multi_union_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6472,6 +6550,8 @@ struct multi_val : public isl::multi_val { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6581,6 +6661,8 @@ struct point<> : public isl::point { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6657,6 +6739,7 @@ struct point<> : public isl::point { inline typed::set<> project_out_param(const std::string &id) const; inline typed::set<> project_out_param(const typed::id_list &list) const; inline typed::pw_multi_aff<> pw_multi_aff_on_domain(const typed::multi_val<> &mv) const = delete; + inline typed::set_list<> set_list() const; inline typed::fixed_box<> simple_fixed_box_hull() const = delete; inline typed::space<> space() const; inline typed::set<> subtract(const typed::set<> &set2) const; @@ -6718,6 +6801,8 @@ struct point : public isl::point { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6809,6 +6894,7 @@ struct point : public isl::point { inline typed::set project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list set_list() const; inline typed::fixed_box simple_fixed_box_hull() const; inline typed::space space() const; inline typed::set subtract(const typed::set &set2) const; @@ -6870,6 +6956,8 @@ struct point> : public isl::point { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -6962,6 +7050,7 @@ struct point> : public isl::point { inline typed::set> project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff, Arg2> pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list> set_list() const; inline typed::fixed_box> simple_fixed_box_hull() const; inline typed::space> space() const; inline typed::set> subtract(const typed::set> &set2) const; @@ -7023,6 +7112,8 @@ struct pw_aff : public isl::pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7213,6 +7304,8 @@ struct pw_aff : public isl::pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7423,6 +7516,8 @@ struct pw_aff, Anonymous> : public isl::pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7636,6 +7731,8 @@ struct pw_aff_list : public isl::pw_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7713,6 +7810,8 @@ struct pw_aff_list : public isl::pw_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7800,6 +7899,8 @@ struct pw_multi_aff : public isl::pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -7988,6 +8089,8 @@ struct pw_multi_aff : public isl::pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8189,6 +8292,8 @@ struct pw_multi_aff, Range> : public isl::pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8395,6 +8500,8 @@ struct pw_multi_aff> : public isl::pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8595,6 +8702,8 @@ struct pw_multi_aff, pair> : public isl::pw_multi_af template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8800,6 +8909,8 @@ struct pw_multi_aff_list : public isl::pw_multi_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8888,6 +8999,8 @@ struct pw_multi_aff_list : public isl::pw_multi_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -8977,6 +9090,8 @@ struct set<> : public isl::set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9060,6 +9175,7 @@ struct set<> : public isl::set { inline typed::set<> project_out_param(const std::string &id) const; inline typed::set<> project_out_param(const typed::id_list &list) const; inline typed::pw_multi_aff<> pw_multi_aff_on_domain(const typed::multi_val<> &mv) const = delete; + inline typed::set_list<> set_list() const; inline typed::fixed_box<> simple_fixed_box_hull() const = delete; inline typed::fixed_box<> get_simple_fixed_box_hull() const = delete; inline typed::space<> space() const; @@ -9127,6 +9243,8 @@ struct set : public isl::set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9227,6 +9345,7 @@ struct set : public isl::set { inline typed::set project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list set_list() const; inline typed::fixed_box simple_fixed_box_hull() const; inline typed::fixed_box get_simple_fixed_box_hull() const = delete; inline typed::space space() const; @@ -9294,6 +9413,8 @@ struct set> : public isl::set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9395,6 +9516,7 @@ struct set> : public isl::set { inline typed::set> project_out_param(const typed::id_list &list) const; template inline typed::pw_multi_aff, Arg2> pw_multi_aff_on_domain(const typed::multi_val &mv) const; + inline typed::set_list> set_list() const; inline typed::fixed_box> simple_fixed_box_hull() const; inline typed::fixed_box> get_simple_fixed_box_hull() const = delete; inline typed::space> space() const; @@ -9420,6 +9542,181 @@ struct set> : public isl::set { }; template <> +struct set_list<> : public isl::set_list { + template + friend struct aff; + template + friend struct aff_list; + template + friend struct basic_map; + template + friend struct basic_set; + template + friend struct fixed_box; + template + friend struct id; + template + friend struct id_list; + template + friend struct map; + template + friend struct map_list; + template + friend struct multi_aff; + template + friend struct multi_id; + template + friend struct multi_pw_aff; + template + friend struct multi_union_pw_aff; + template + friend struct multi_val; + template + friend struct point; + template + friend struct pw_aff; + template + friend struct pw_aff_list; + template + friend struct pw_multi_aff; + template + friend struct pw_multi_aff_list; + template + friend struct set; + template + friend struct set_list; + template + friend struct space; + template + friend struct union_map; + template + friend struct union_pw_aff; + template + friend struct union_pw_aff_list; + template + friend struct union_pw_multi_aff; + template + friend struct union_set; + template + friend struct union_set_list; + template + friend struct val; + template + friend struct val_list; + + set_list() = default; + private: + template {}, bool>::type = true> + set_list(const base &obj) : isl::set_list(obj) {} + public: + static set_list from(const isl::set_list &obj) { + return set_list(obj); + } + inline explicit set_list(const isl::ctx &ctx, int n); + inline explicit set_list(const typed::set<> &el); + inline explicit set_list(const isl::ctx &ctx, const std::string &str); + inline typed::set_list<> add(const typed::set<> &el) const; + inline typed::set_list<> add(const typed::basic_set<> &el) const; + inline typed::set_list<> add(const typed::point<> &el) const; + inline typed::set<> at(int index) const = delete; + inline typed::set<> get_at(int index) const = delete; + inline typed::set_list<> drop(unsigned int first, unsigned int n) const; + inline void foreach(const std::function)> &fn) const; +}; + +template +struct set_list : public isl::set_list { + template + friend struct aff; + template + friend struct aff_list; + template + friend struct basic_map; + template + friend struct basic_set; + template + friend struct fixed_box; + template + friend struct id; + template + friend struct id_list; + template + friend struct map; + template + friend struct map_list; + template + friend struct multi_aff; + template + friend struct multi_id; + template + friend struct multi_pw_aff; + template + friend struct multi_union_pw_aff; + template + friend struct multi_val; + template + friend struct point; + template + friend struct pw_aff; + template + friend struct pw_aff_list; + template + friend struct pw_multi_aff; + template + friend struct pw_multi_aff_list; + template + friend struct set; + template + friend struct set_list; + template + friend struct space; + template + friend struct union_map; + template + friend struct union_pw_aff; + template + friend struct union_pw_aff_list; + template + friend struct union_pw_multi_aff; + template + friend struct union_set; + template + friend struct union_set_list; + template + friend struct val; + template + friend struct val_list; + + set_list() = default; + template {}, + bool>::type = true> + set_list(const set_list &obj) : isl::set_list(obj) {} + private: + template {}, bool>::type = true> + set_list(const base &obj) : isl::set_list(obj) {} + public: + static set_list from(const isl::set_list &obj) { + return set_list(obj); + } + inline explicit set_list(const isl::ctx &ctx, int n); + inline explicit set_list(const typed::set &el); + inline explicit set_list(const isl::ctx &ctx, const std::string &str); + inline typed::set_list add(const typed::set &el) const; + inline typed::set_list add(const typed::basic_set &el) const; + inline typed::set_list add(const typed::point &el) const; + inline typed::set at(int index) const; + inline typed::set get_at(int index) const = delete; + inline typed::set_list drop(unsigned int first, unsigned int n) const; + inline void foreach(const std::function)> &fn) const; +}; + +template <> struct space<> : public isl::space { template friend struct aff; @@ -9462,6 +9759,8 @@ struct space<> : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9585,6 +9884,8 @@ struct space : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9717,6 +10018,8 @@ struct space : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9848,6 +10151,8 @@ struct space> : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -9979,6 +10284,8 @@ struct space, Range2> : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10109,6 +10416,8 @@ struct space> : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10239,6 +10548,8 @@ struct space, pair> : public isl::space { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10368,6 +10679,8 @@ struct union_map : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10561,6 +10874,8 @@ struct union_map, Range2> : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10755,6 +11070,8 @@ struct union_map : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -10950,6 +11267,8 @@ struct union_map> : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11144,6 +11463,8 @@ struct union_map, pair> : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11340,6 +11661,8 @@ struct union_map, pair> : public isl::union_map { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11535,6 +11858,8 @@ struct union_pw_aff : public isl::union_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11669,6 +11994,8 @@ struct union_pw_aff : public isl::union_pw_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11823,6 +12150,8 @@ struct union_pw_aff, Anonymous> : public isl::union_pw_aff template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -11979,6 +12308,8 @@ struct union_pw_aff_list : public isl::union_pw_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12057,6 +12388,8 @@ struct union_pw_aff_list : public isl::union_pw_aff_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12145,6 +12478,8 @@ struct union_pw_multi_aff : public isl::union_pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12283,6 +12618,8 @@ struct union_pw_multi_aff : public isl::union_pw_multi_aff { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12434,6 +12771,8 @@ struct union_pw_multi_aff, Range> : public isl::union_pw_m template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12590,6 +12929,8 @@ struct union_pw_multi_aff> : public isl::union_pw_mu template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12742,6 +13083,8 @@ struct union_pw_multi_aff, pair> : public isl::union template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12899,6 +13242,8 @@ struct union_set<> : public isl::union_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -12959,6 +13304,8 @@ struct union_set<> : public isl::union_set { inline typed::union_set<> preimage(const typed::multi_aff<> &ma) const = delete; inline typed::union_set<> preimage(const typed::pw_multi_aff<> &pma) const = delete; inline typed::union_set<> preimage(const typed::union_pw_multi_aff<> &upma) const = delete; + inline typed::set_list<> set_list() const; + inline typed::set_list<> get_set_list() const = delete; inline typed::space<> space() const; inline typed::space<> get_space() const = delete; inline typed::union_set<> subtract(const typed::union_set<> &uset2) const; @@ -13016,6 +13363,8 @@ struct union_set : public isl::union_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -13087,6 +13436,8 @@ struct union_set : public isl::union_set { inline typed::union_set preimage(const typed::pw_multi_aff &pma) const; template inline typed::union_set preimage(const typed::union_pw_multi_aff &upma) const; + inline typed::set_list set_list() const; + inline typed::set_list get_set_list() const = delete; inline typed::space<> space() const; inline typed::space get_space() const = delete; inline typed::union_set subtract(const typed::union_set &uset2) const; @@ -13144,6 +13495,8 @@ struct union_set> : public isl::union_set { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -13216,6 +13569,8 @@ struct union_set> : public isl::union_set { inline typed::union_set preimage(const typed::pw_multi_aff> &pma) const; template inline typed::union_set preimage(const typed::union_pw_multi_aff> &upma) const; + inline typed::set_list> set_list() const; + inline typed::set_list> get_set_list() const = delete; inline typed::space<> space() const; inline typed::space> get_space() const = delete; inline typed::union_set> subtract(const typed::union_set> &uset2) const; @@ -13273,6 +13628,8 @@ struct union_set_list<> : public isl::union_set_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -13357,6 +13714,8 @@ struct union_set_list : public isl::union_set_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -13446,6 +13805,8 @@ struct val : public isl::val { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -13531,6 +13892,8 @@ struct val_list : public isl::val_list { template friend struct set; template + friend struct set_list; + template friend struct space; template friend struct union_map; @@ -19755,6 +20118,12 @@ typed::set<> typed::basic_set<>::project_out_param(const typed::id_list(res); } +typed::set_list<> typed::basic_set<>::set_list() const +{ + auto res = isl::basic_set::set_list(); + return typed::set_list<>(res); +} + typed::space<> typed::basic_set<>::space() const { auto res = isl::basic_set::space(); @@ -20176,6 +20545,13 @@ typed::pw_multi_aff typed::basic_set::pw_multi_aff_on_dom } template +typed::set_list typed::basic_set::set_list() const +{ + auto res = isl::basic_set::set_list(); + return typed::set_list(res); +} + +template typed::fixed_box typed::basic_set::simple_fixed_box_hull() const { auto res = isl::basic_set::simple_fixed_box_hull(); @@ -20634,6 +21010,13 @@ typed::pw_multi_aff, Arg2> typed::basic_set +typed::set_list> typed::basic_set>::set_list() const +{ + auto res = isl::basic_set::set_list(); + return typed::set_list>(res); +} + +template typed::fixed_box> typed::basic_set>::simple_fixed_box_hull() const { auto res = isl::basic_set::simple_fixed_box_hull(); @@ -31712,6 +32095,12 @@ typed::set<> typed::point<>::project_out_param(const typed::id_list & return typed::set<>(res); } +typed::set_list<> typed::point<>::set_list() const +{ + auto res = isl::point::set_list(); + return typed::set_list<>(res); +} + typed::space<> typed::point<>::space() const { auto res = isl::point::space(); @@ -32101,6 +32490,13 @@ typed::pw_multi_aff typed::point::pw_multi_aff_on_domain( } template +typed::set_list typed::point::set_list() const +{ + auto res = isl::point::set_list(); + return typed::set_list(res); +} + +template typed::fixed_box typed::point::simple_fixed_box_hull() const { auto res = isl::point::simple_fixed_box_hull(); @@ -32526,6 +32922,13 @@ typed::pw_multi_aff, Arg2> typed::point> } template +typed::set_list> typed::point>::set_list() const +{ + auto res = isl::point::set_list(); + return typed::set_list>(res); +} + +template typed::fixed_box> typed::point>::simple_fixed_box_hull() const { auto res = isl::point::simple_fixed_box_hull(); @@ -38271,6 +38674,12 @@ typed::set<> typed::set<>::project_out_param(const typed::id_list &li return typed::set<>(res); } +typed::set_list<> typed::set<>::set_list() const +{ + auto res = isl::set::set_list(); + return typed::set_list<>(res); +} + typed::space<> typed::set<>::space() const { auto res = isl::set::space(); @@ -38726,6 +39135,13 @@ typed::pw_multi_aff typed::set::pw_multi_aff_on_domain(co } template +typed::set_list typed::set::set_list() const +{ + auto res = isl::set::set_list(); + return typed::set_list(res); +} + +template typed::fixed_box typed::set::simple_fixed_box_hull() const { auto res = isl::set::simple_fixed_box_hull(); @@ -39220,6 +39636,13 @@ typed::pw_multi_aff, Arg2> typed::set>:: } template +typed::set_list> typed::set>::set_list() const +{ + auto res = isl::set::set_list(); + return typed::set_list>(res); +} + +template typed::fixed_box> typed::set>::simple_fixed_box_hull() const { auto res = isl::set::simple_fixed_box_hull(); @@ -39339,6 +39762,115 @@ typed::set> typed::set>::upper_bound(con return typed::set>(res); } +typed::set_list<>::set_list(const isl::ctx &ctx, int n) + : isl::set_list(ctx, n) +{ +} + +typed::set_list<>::set_list(const typed::set<> &el) + : isl::set_list(el) +{ +} + +typed::set_list<>::set_list(const isl::ctx &ctx, const std::string &str) + : isl::set_list(ctx, str) +{ +} + +typed::set_list<> typed::set_list<>::add(const typed::set<> &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list<>(res); +} + +typed::set_list<> typed::set_list<>::add(const typed::basic_set<> &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list<>(res); +} + +typed::set_list<> typed::set_list<>::add(const typed::point<> &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list<>(res); +} + +typed::set_list<> typed::set_list<>::drop(unsigned int first, unsigned int n) const +{ + auto res = isl::set_list::drop(first, n); + return typed::set_list<>(res); +} + +void typed::set_list<>::foreach(const std::function)> &fn) const +{ + auto lambda = [&] (isl::set arg0) { + return fn(typed::set<>(arg0)); + }; + return isl::set_list::foreach(lambda); +} + +template +typed::set_list::set_list(const isl::ctx &ctx, int n) + : isl::set_list(ctx, n) +{ +} + +template +typed::set_list::set_list(const typed::set &el) + : isl::set_list(el) +{ +} + +template +typed::set_list::set_list(const isl::ctx &ctx, const std::string &str) + : isl::set_list(ctx, str) +{ +} + +template +typed::set_list typed::set_list::add(const typed::set &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list(res); +} + +template +typed::set_list typed::set_list::add(const typed::basic_set &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list(res); +} + +template +typed::set_list typed::set_list::add(const typed::point &el) const +{ + auto res = isl::set_list::add(el); + return typed::set_list(res); +} + +template +typed::set typed::set_list::at(int index) const +{ + auto res = isl::set_list::at(index); + return typed::set(res); +} + +template +typed::set_list typed::set_list::drop(unsigned int first, unsigned int n) const +{ + auto res = isl::set_list::drop(first, n); + return typed::set_list(res); +} + +template +void typed::set_list::foreach(const std::function)> &fn) const +{ + auto lambda = [&] (isl::set arg0) { + return fn(typed::set(arg0)); + }; + return isl::set_list::foreach(lambda); +} + template typed::space typed::space<>::add_named_tuple(const typed::id &tuple_id, unsigned int dim) const { @@ -47374,6 +47906,12 @@ typed::union_set<> typed::union_set<>::intersect(const typed::set<> &uset2) cons return typed::union_set<>(res); } +typed::set_list<> typed::union_set<>::set_list() const +{ + auto res = isl::union_set::set_list(); + return typed::set_list<>(res); +} + typed::space<> typed::union_set<>::space() const { auto res = isl::union_set::space(); @@ -47667,6 +48205,13 @@ typed::union_set typed::union_set::preimage(const typed::union_ } template +typed::set_list typed::union_set::set_list() const +{ + auto res = isl::union_set::set_list(); + return typed::set_list(res); +} + +template typed::space<> typed::union_set::space() const { auto res = isl::union_set::space(); @@ -47969,6 +48514,13 @@ typed::union_set typed::union_set>::preimage(const } template +typed::set_list> typed::union_set>::set_list() const +{ + auto res = isl::union_set::set_list(); + return typed::set_list>(res); +} + +template typed::space<> typed::union_set>::space() const { auto res = isl::union_set::space(); diff --git a/polly/lib/External/isl/include/isl/union_set.h b/polly/lib/External/isl/include/isl/union_set.h index 35ae11c..73cdb7f 100644 --- a/polly/lib/External/isl/include/isl/union_set.h +++ b/polly/lib/External/isl/include/isl/union_set.h @@ -135,6 +135,7 @@ isl_bool isl_union_set_every_set(__isl_keep isl_union_set *uset, isl_bool (*test)(__isl_keep isl_set *set, void *user), void *user); __isl_give isl_basic_set_list *isl_union_set_get_basic_set_list( __isl_keep isl_union_set *uset); +__isl_export __isl_give isl_set_list *isl_union_set_get_set_list( __isl_keep isl_union_set *uset); isl_bool isl_union_set_contains(__isl_keep isl_union_set *uset, diff --git a/polly/lib/External/isl/interface/isl.py b/polly/lib/External/isl/interface/isl.py index 9e747ed..13a9514 100644 --- a/polly/lib/External/isl/interface/isl.py +++ b/polly/lib/External/isl/interface/isl.py @@ -9880,6 +9880,18 @@ class union_set(object): res = isl.isl_union_set_sample_point(isl.isl_union_set_copy(arg0.ptr)) obj = point(ctx=ctx, ptr=res) return obj + def set_list(arg0): + try: + if not arg0.__class__ is union_set: + arg0 = union_set(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_union_set_get_set_list(arg0.ptr) + obj = set_list(ctx=ctx, ptr=res) + return obj + def get_set_list(arg0): + return arg0.set_list() def space(arg0): try: if not arg0.__class__ is union_set: @@ -10010,6 +10022,8 @@ isl.isl_union_set_preimage_union_pw_multi_aff.restype = c_void_p isl.isl_union_set_preimage_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] isl.isl_union_set_sample_point.restype = c_void_p isl.isl_union_set_sample_point.argtypes = [c_void_p] +isl.isl_union_set_get_set_list.restype = c_void_p +isl.isl_union_set_get_set_list.argtypes = [c_void_p] isl.isl_union_set_get_space.restype = c_void_p isl.isl_union_set_get_space.argtypes = [c_void_p] isl.isl_union_set_subtract.restype = c_void_p @@ -10694,6 +10708,16 @@ class set(union_set): res = isl.isl_set_subtract(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) obj = set(ctx=ctx, ptr=res) return obj + def to_list(arg0): + try: + if not arg0.__class__ is set: + arg0 = set(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_to_list(isl.isl_set_copy(arg0.ptr)) + obj = set_list(ctx=ctx, ptr=res) + return obj def to_union_set(arg0): try: if not arg0.__class__ is set: @@ -10918,6 +10942,8 @@ isl.isl_set_get_stride.restype = c_void_p isl.isl_set_get_stride.argtypes = [c_void_p, c_int] isl.isl_set_subtract.restype = c_void_p isl.isl_set_subtract.argtypes = [c_void_p, c_void_p] +isl.isl_set_to_list.restype = c_void_p +isl.isl_set_to_list.argtypes = [c_void_p] isl.isl_set_to_union_set.restype = c_void_p isl.isl_set_to_union_set.argtypes = [c_void_p] isl.isl_set_translation.restype = c_void_p @@ -14568,6 +14594,183 @@ isl.isl_schedule_node_free.argtypes = [c_void_p] isl.isl_schedule_node_to_str.restype = POINTER(c_char) isl.isl_schedule_node_to_str.argtypes = [c_void_p] +class set_list(object): + def __init__(self, *args, **keywords): + if "ptr" in keywords: + self.ctx = keywords["ctx"] + self.ptr = keywords["ptr"] + return + if len(args) == 1 and type(args[0]) == int: + self.ctx = Context.getDefaultInstance() + self.ptr = isl.isl_set_list_alloc(self.ctx, args[0]) + return + if len(args) == 1 and args[0].__class__ is set: + self.ctx = Context.getDefaultInstance() + self.ptr = isl.isl_set_list_from_set(isl.isl_set_copy(args[0].ptr)) + return + if len(args) == 1 and type(args[0]) == str: + self.ctx = Context.getDefaultInstance() + self.ptr = isl.isl_set_list_read_from_str(self.ctx, args[0].encode('ascii')) + return + raise Error + def __del__(self): + if hasattr(self, 'ptr'): + isl.isl_set_list_free(self.ptr) + def __str__(arg0): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + ptr = isl.isl_set_list_to_str(arg0.ptr) + res = cast(ptr, c_char_p).value.decode('ascii') + libc.free(ptr) + return res + def __repr__(self): + s = str(self) + if '"' in s: + return 'isl.set_list("""%s""")' % s + else: + return 'isl.set_list("%s")' % s + def add(arg0, arg1): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + try: + if not arg1.__class__ is set: + arg1 = set(arg1) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_add(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) + obj = set_list(ctx=ctx, ptr=res) + return obj + def at(arg0, arg1): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_get_at(arg0.ptr, arg1) + obj = set(ctx=ctx, ptr=res) + return obj + def get_at(arg0, arg1): + return arg0.at(arg1) + def clear(arg0): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_clear(isl.isl_set_list_copy(arg0.ptr)) + obj = set_list(ctx=ctx, ptr=res) + return obj + def concat(arg0, arg1): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + try: + if not arg1.__class__ is set_list: + arg1 = set_list(arg1) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_concat(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_list_copy(arg1.ptr)) + obj = set_list(ctx=ctx, ptr=res) + return obj + def drop(arg0, arg1, arg2): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_drop(isl.isl_set_list_copy(arg0.ptr), arg1, arg2) + obj = set_list(ctx=ctx, ptr=res) + return obj + def foreach(arg0, arg1): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + exc_info = [None] + fn = CFUNCTYPE(c_int, c_void_p, c_void_p) + def cb_func(cb_arg0, cb_arg1): + cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) + try: + arg1(cb_arg0) + except BaseException as e: + exc_info[0] = e + return -1 + return 0 + cb = fn(cb_func) + ctx = arg0.ctx + res = isl.isl_set_list_foreach(arg0.ptr, cb, None) + if exc_info[0] is not None: + raise exc_info[0] + if res < 0: + raise + def insert(arg0, arg1, arg2): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + try: + if not arg2.__class__ is set: + arg2 = set(arg2) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_insert(isl.isl_set_list_copy(arg0.ptr), arg1, isl.isl_set_copy(arg2.ptr)) + obj = set_list(ctx=ctx, ptr=res) + return obj + def size(arg0): + try: + if not arg0.__class__ is set_list: + arg0 = set_list(arg0) + except: + raise + ctx = arg0.ctx + res = isl.isl_set_list_size(arg0.ptr) + if res < 0: + raise + return int(res) + +isl.isl_set_list_alloc.restype = c_void_p +isl.isl_set_list_alloc.argtypes = [Context, c_int] +isl.isl_set_list_from_set.restype = c_void_p +isl.isl_set_list_from_set.argtypes = [c_void_p] +isl.isl_set_list_read_from_str.restype = c_void_p +isl.isl_set_list_read_from_str.argtypes = [Context, c_char_p] +isl.isl_set_list_add.restype = c_void_p +isl.isl_set_list_add.argtypes = [c_void_p, c_void_p] +isl.isl_set_list_get_at.restype = c_void_p +isl.isl_set_list_get_at.argtypes = [c_void_p, c_int] +isl.isl_set_list_clear.restype = c_void_p +isl.isl_set_list_clear.argtypes = [c_void_p] +isl.isl_set_list_concat.restype = c_void_p +isl.isl_set_list_concat.argtypes = [c_void_p, c_void_p] +isl.isl_set_list_drop.restype = c_void_p +isl.isl_set_list_drop.argtypes = [c_void_p, c_int, c_int] +isl.isl_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] +isl.isl_set_list_insert.restype = c_void_p +isl.isl_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] +isl.isl_set_list_size.argtypes = [c_void_p] +isl.isl_set_list_copy.restype = c_void_p +isl.isl_set_list_copy.argtypes = [c_void_p] +isl.isl_set_list_free.restype = c_void_p +isl.isl_set_list_free.argtypes = [c_void_p] +isl.isl_set_list_to_str.restype = POINTER(c_char) +isl.isl_set_list_to_str.argtypes = [c_void_p] + class space(object): def __init__(self, *args, **keywords): if "ptr" in keywords: diff --git a/polly/lib/External/isl/isl_list_read_templ.c b/polly/lib/External/isl/isl_list_read_templ.c index 25b3478..d9a2c40 100644 --- a/polly/lib/External/isl/isl_list_read_templ.c +++ b/polly/lib/External/isl/isl_list_read_templ.c @@ -29,6 +29,8 @@ static __isl_give LIST(EL) *FN(isl_stream_read,LIST(EL_BASE))(isl_stream *s) return NULL; if (isl_stream_eat(s, '(') < 0) return FN(LIST(EL),free)(list); + if (isl_stream_eat_if_available(s, ')')) + return list; do { EL *el; diff --git a/polly/lib/External/isl/isl_set_list.c b/polly/lib/External/isl/isl_set_list.c index e505552..e1bbcaf 100644 --- a/polly/lib/External/isl/isl_set_list.c +++ b/polly/lib/External/isl/isl_set_list.c @@ -25,6 +25,7 @@ #define EL_BASE set #include +#include #undef EL_BASE #define EL_BASE union_set -- 2.7.4