From b2f399264d2ec868dbad3bebfd36f5cfb9e269ed Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Thu, 28 May 2015 13:32:11 +0000 Subject: [PATCH] Update isl to 93b8e43d This update brings mostly interface cleanups, but also fixes two bugs in imath (a memory leak, some undefined behavior). llvm-svn: 238422 --- polly/lib/Analysis/DependenceInfo.cpp | 4 +- polly/lib/Analysis/ScopInfo.cpp | 6 +- polly/lib/CodeGen/IslNodeBuilder.cpp | 4 +- polly/lib/External/isl/bound.c | 4 +- polly/lib/External/isl/codegen.c | 2 +- polly/lib/External/isl/doc/user.pod | 617 +++++++++-------- polly/lib/External/isl/imath/ChangeLog | 5 + .../lib/External/isl/imath/examples/imcalc.c | 240 ------- .../External/isl/imath/examples/randprime.c | 16 - .../lib/External/isl/imath/examples/rsakey.c | 24 - polly/lib/External/isl/imath/gmp_compat.c | 3 +- polly/lib/External/isl/imath/imath.c | 426 +----------- polly/lib/External/isl/imath/imdrover.c | 248 ------- polly/lib/External/isl/imath/imrat.c | 183 ------ polly/lib/External/isl/imath/imtest.c | 44 -- polly/lib/External/isl/imath/imtimer.c | 28 - polly/lib/External/isl/imath/iprime.c | 8 - polly/lib/External/isl/imath/pi.c | 4 - polly/lib/External/isl/imath/rsamath.c | 40 -- polly/lib/External/isl/include/isl/aff.h | 55 +- polly/lib/External/isl/include/isl/ast.h | 14 +- .../lib/External/isl/include/isl/ast_build.h | 18 +- polly/lib/External/isl/include/isl/band.h | 4 +- .../lib/External/isl/include/isl/constraint.h | 24 +- polly/lib/External/isl/include/isl/ctx.h | 26 +- polly/lib/External/isl/include/isl/flow.h | 5 +- polly/lib/External/isl/include/isl/hash.h | 16 +- polly/lib/External/isl/include/isl/hmap.h | 8 +- polly/lib/External/isl/include/isl/id.h | 1 + polly/lib/External/isl/include/isl/list.h | 10 +- .../External/isl/include/isl/local_space.h | 10 +- polly/lib/External/isl/include/isl/map.h | 107 ++- polly/lib/External/isl/include/isl/multi.h | 10 +- polly/lib/External/isl/include/isl/options.h | 10 +- polly/lib/External/isl/include/isl/point.h | 2 +- .../lib/External/isl/include/isl/polynomial.h | 65 +- polly/lib/External/isl/include/isl/schedule.h | 24 +- .../External/isl/include/isl/schedule_node.h | 36 +- polly/lib/External/isl/include/isl/set.h | 95 ++- polly/lib/External/isl/include/isl/space.h | 35 +- polly/lib/External/isl/include/isl/stdint.h | 1 + .../lib/External/isl/include/isl/union_map.h | 24 +- .../lib/External/isl/include/isl/union_set.h | 20 +- polly/lib/External/isl/include/isl/val.h | 41 +- polly/lib/External/isl/include/isl/vec.h | 2 +- polly/lib/External/isl/include/isl/vertices.h | 12 +- polly/lib/External/isl/isl_aff.c | 189 +++--- polly/lib/External/isl/isl_ast.c | 46 +- polly/lib/External/isl/isl_ast_build.c | 20 +- polly/lib/External/isl/isl_ast_build_expr.c | 21 +- .../lib/External/isl/isl_ast_build_private.h | 2 +- polly/lib/External/isl/isl_ast_codegen.c | 133 ++-- polly/lib/External/isl/isl_ast_graft.c | 6 +- polly/lib/External/isl/isl_band.c | 21 +- polly/lib/External/isl/isl_bound.c | 18 +- polly/lib/External/isl/isl_constraint.c | 103 +-- polly/lib/External/isl/isl_deprecated.c | 15 + polly/lib/External/isl/isl_equalities.c | 8 +- polly/lib/External/isl/isl_flow.c | 69 +- polly/lib/External/isl/isl_fold.c | 38 +- polly/lib/External/isl/isl_hash.c | 11 +- polly/lib/External/isl/isl_hmap_templ.c | 29 +- polly/lib/External/isl/isl_list_templ.c | 34 +- polly/lib/External/isl/isl_local_space.c | 26 +- polly/lib/External/isl/isl_map.c | 543 +++++++-------- polly/lib/External/isl/isl_map_private.h | 62 +- polly/lib/External/isl/isl_map_simplify.c | 87 +-- polly/lib/External/isl/isl_map_subtract.c | 80 +-- polly/lib/External/isl/isl_multi_templ.c | 30 +- polly/lib/External/isl/isl_output.c | 25 +- polly/lib/External/isl/isl_point.c | 35 +- polly/lib/External/isl/isl_polynomial.c | 84 +-- .../lib/External/isl/isl_polynomial_private.h | 2 +- polly/lib/External/isl/isl_pw_templ.c | 72 +- polly/lib/External/isl/isl_range.c | 29 +- polly/lib/External/isl/isl_scan.c | 6 +- polly/lib/External/isl/isl_scan.h | 3 +- polly/lib/External/isl/isl_schedule.c | 45 +- polly/lib/External/isl/isl_schedule_band.c | 52 +- polly/lib/External/isl/isl_schedule_band.h | 6 +- polly/lib/External/isl/isl_schedule_node.c | 86 +-- polly/lib/External/isl/isl_schedule_tree.c | 40 +- polly/lib/External/isl/isl_schedule_tree.h | 10 +- polly/lib/External/isl/isl_scheduler.c | 70 +- polly/lib/External/isl/isl_space.c | 122 ++-- polly/lib/External/isl/isl_space_private.h | 4 +- polly/lib/External/isl/isl_stream.c | 4 +- polly/lib/External/isl/isl_tarjan.c | 14 +- polly/lib/External/isl/isl_tarjan.h | 2 +- polly/lib/External/isl/isl_test.c | 104 ++- .../lib/External/isl/isl_transitive_closure.c | 28 +- polly/lib/External/isl/isl_union_map.c | 622 +++++++++--------- polly/lib/External/isl/isl_union_templ.c | 130 ++-- polly/lib/External/isl/isl_val.c | 116 ++-- polly/lib/External/isl/isl_vec.c | 6 +- polly/lib/External/isl/isl_vertices.c | 52 +- polly/lib/External/isl/pip.c | 4 +- polly/lib/External/isl/polytope_scan.c | 6 +- polly/lib/Transform/ScheduleOptimizer.cpp | 2 +- 99 files changed, 2419 insertions(+), 3534 deletions(-) create mode 100644 polly/lib/External/isl/include/isl/stdint.h diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index 418e19cfa11c..c19531e5fbf0 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -125,12 +125,12 @@ static void collectInfo(Scop &S, isl_union_map **Read, isl_union_map **Write, } /// @brief Fix all dimension of @p Zero to 0 and add it to @p user -static int fixSetToZero(__isl_take isl_set *Zero, void *user) { +static isl_stat fixSetToZero(__isl_take isl_set *Zero, void *user) { isl_union_set **User = (isl_union_set **)user; for (unsigned i = 0; i < isl_set_dim(Zero, isl_dim_set); i++) Zero = isl_set_fix_si(Zero, isl_dim_set, i, 0); *User = isl_union_set_add_set(*User, Zero); - return 0; + return isl_stat_ok; } /// @brief Compute the privatization dependences for a given dependency @p Map diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 7c3486198887..2ae6a1e5e541 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1388,7 +1388,7 @@ void Scop::simplifyAssumedContext() { } /// @brief Add the minimal/maximal access in @p Set to @p User. -static int buildMinMaxAccess(__isl_take isl_set *Set, void *User) { +static isl_stat buildMinMaxAccess(__isl_take isl_set *Set, void *User) { Scop::MinMaxVectorTy *MinMaxAccesses = (Scop::MinMaxVectorTy *)User; isl_pw_multi_aff *MinPMA, *MaxPMA; isl_pw_aff *LastDimAff; @@ -1417,7 +1417,7 @@ static int buildMinMaxAccess(__isl_take isl_set *Set, void *User) { if (InvolvedParams > RunTimeChecksMaxParameters) { isl_set_free(Set); - return -1; + return isl_stat_error; } } @@ -1446,7 +1446,7 @@ static int buildMinMaxAccess(__isl_take isl_set *Set, void *User) { MinMaxAccesses->push_back(std::make_pair(MinPMA, MaxPMA)); isl_set_free(Set); - return 0; + return isl_stat_ok; } static __isl_give isl_set *getAccessDomain(MemoryAccess *MA) { diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 215b0a80b34e..86ffe0fe3368 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -183,7 +183,7 @@ static int findValuesInBlock(struct FindValuesUser &User, const ScopStmt *Stmt, /// This function extracts a ScopStmt from a given isl_set and computes the /// Values this statement depends on as well as a set of SCEV expressions that /// need to be synthesized when generating code for this statment. -static int findValuesInStmt(isl_set *Set, void *UserPtr) { +static isl_stat findValuesInStmt(isl_set *Set, void *UserPtr) { isl_id *Id = isl_set_get_tuple_id(Set); struct FindValuesUser &User = *static_cast(UserPtr); const ScopStmt *Stmt = static_cast(isl_id_get_user(Id)); @@ -199,7 +199,7 @@ static int findValuesInStmt(isl_set *Set, void *UserPtr) { isl_id_free(Id); isl_set_free(Set); - return 0; + return isl_stat_ok; } void IslNodeBuilder::getReferencesInSubtree(__isl_keep isl_ast_node *For, diff --git a/polly/lib/External/isl/bound.c b/polly/lib/External/isl/bound.c index 73075a1f393d..e0eeaa89caf4 100644 --- a/polly/lib/External/isl/bound.c +++ b/polly/lib/External/isl/bound.c @@ -58,7 +58,7 @@ struct verify_point_bound { isl_pw_qpolynomial_fold *bound; }; -static int verify_point(__isl_take isl_point *pnt, void *user) +static isl_stat verify_point(__isl_take isl_point *pnt, void *user) { int i; unsigned nvar; @@ -175,7 +175,7 @@ error: if (vpb->options->continue_on_error) ok = 1; - return (vpb->n >= 1 && ok) ? 0 : -1; + return (vpb->n >= 1 && ok) ? isl_stat_ok : isl_stat_error; } static int check_solution(__isl_take isl_pw_qpolynomial_fold *pwf, diff --git a/polly/lib/External/isl/codegen.c b/polly/lib/External/isl/codegen.c index 30317d2d6433..b2227aaf417f 100644 --- a/polly/lib/External/isl/codegen.c +++ b/polly/lib/External/isl/codegen.c @@ -165,7 +165,7 @@ static __isl_give isl_schedule *schedule_set_options( return schedule; type = options->separate ? isl_ast_loop_separate : isl_ast_loop_atomic; - schedule = isl_schedule_map_schedule_node(schedule, + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, &node_set_options, &type); return schedule; diff --git a/polly/lib/External/isl/doc/user.pod b/polly/lib/External/isl/doc/user.pod index 5024ea640f85..4d79130c96dd 100644 --- a/polly/lib/External/isl/doc/user.pod +++ b/polly/lib/External/isl/doc/user.pod @@ -244,6 +244,11 @@ for backward compatibility, but it will be removed in the future. =item * The C AST generation option has been deprecated. +=item * The functions C and C +have been renamed to C and +C. The original names have been +kept for backward compatibility, but they will be removed in the future. + =back =head1 License @@ -567,6 +572,23 @@ in which the object was created. isl_ctx *isl_ast_node_get_ctx( __isl_keep isl_ast_node *node); +=head2 Return Types + +C uses two special return types for functions that either return +a boolean or that in principle do not return anything. +In particular, the C type has three possible values: +C (a positive integer value), indicating I or I; +C (the integer value zero), indicating I or I; and +C (a negative integer value), indicating that something +went wrong. +The C type has two possible values: +C (the integer value zero), indicating a successful +operation; and +C (a negative integer value), indicating that something +went wrong. +See L for more information on +C and C. + =head2 Values An C represents an integer value, a rational value @@ -632,37 +654,37 @@ The following unary properties are defined on Cs. #include int isl_val_sgn(__isl_keep isl_val *v); - int isl_val_is_zero(__isl_keep isl_val *v); - int isl_val_is_one(__isl_keep isl_val *v); - int isl_val_is_negone(__isl_keep isl_val *v); - int isl_val_is_nonneg(__isl_keep isl_val *v); - int isl_val_is_nonpos(__isl_keep isl_val *v); - int isl_val_is_pos(__isl_keep isl_val *v); - int isl_val_is_neg(__isl_keep isl_val *v); - int isl_val_is_int(__isl_keep isl_val *v); - int isl_val_is_rat(__isl_keep isl_val *v); - int isl_val_is_nan(__isl_keep isl_val *v); - int isl_val_is_infty(__isl_keep isl_val *v); - int isl_val_is_neginfty(__isl_keep isl_val *v); + isl_bool isl_val_is_zero(__isl_keep isl_val *v); + isl_bool isl_val_is_one(__isl_keep isl_val *v); + isl_bool isl_val_is_negone(__isl_keep isl_val *v); + isl_bool isl_val_is_nonneg(__isl_keep isl_val *v); + isl_bool isl_val_is_nonpos(__isl_keep isl_val *v); + isl_bool isl_val_is_pos(__isl_keep isl_val *v); + isl_bool isl_val_is_neg(__isl_keep isl_val *v); + isl_bool isl_val_is_int(__isl_keep isl_val *v); + isl_bool isl_val_is_rat(__isl_keep isl_val *v); + isl_bool isl_val_is_nan(__isl_keep isl_val *v); + isl_bool isl_val_is_infty(__isl_keep isl_val *v); + isl_bool isl_val_is_neginfty(__isl_keep isl_val *v); Note that the sign of NaN is undefined. The following binary properties are defined on pairs of Cs. #include - int isl_val_lt(__isl_keep isl_val *v1, + isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_le(__isl_keep isl_val *v1, + isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_gt(__isl_keep isl_val *v1, + isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_ge(__isl_keep isl_val *v1, + isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_eq(__isl_keep isl_val *v1, + isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_ne(__isl_keep isl_val *v1, + isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); - int isl_val_abs_eq(__isl_keep isl_val *v1, + isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); The function C checks whether its two arguments @@ -671,7 +693,7 @@ are equal in absolute value. For integer Cs we additionally have the following binary property. #include - int isl_val_is_divisible_by(__isl_keep isl_val *v1, + isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2); An C can also be compared to an integer using the following @@ -777,7 +799,11 @@ to react on error: to warn, to continue or to abort. The default behavior is to warn. In this mode, C prints a warning, stores the last error in the corresponding C and the function in which the -error was triggered returns C. An error does not corrupt internal state, +error was triggered returns a value indicating that some error has +occurred. In case of functions returning a pointer, this value is +C. In case of functions returning an C or an +C, this valus is C or C. +An error does not corrupt internal state, such that isl can continue to be used. C also provides functions to read the last error and to reset the memory that stores the last error. The last error is only stored for information purposes. Its presence does not @@ -808,7 +834,7 @@ choices for the command line option are C, C and C. It is also possible to query the current error mode. #include - int isl_options_set_on_error(isl_ctx *ctx, int val); + isl_stat isl_options_set_on_error(isl_ctx *ctx, int val); int isl_options_get_on_error(isl_ctx *ctx); =head2 Identifiers @@ -888,20 +914,20 @@ To check whether a given space is that of a set or a map or whether it is a parameter space, use these functions: #include - int isl_space_is_params(__isl_keep isl_space *space); - int isl_space_is_set(__isl_keep isl_space *space); - int isl_space_is_map(__isl_keep isl_space *space); + isl_bool isl_space_is_params(__isl_keep isl_space *space); + isl_bool isl_space_is_set(__isl_keep isl_space *space); + isl_bool isl_space_is_map(__isl_keep isl_space *space); Spaces can be compared using the following functions: #include - int isl_space_is_equal(__isl_keep isl_space *space1, + isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); - int isl_space_is_domain(__isl_keep isl_space *space1, + isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2); - int isl_space_is_range(__isl_keep isl_space *space1, + isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2); - int isl_space_tuple_is_equal( + isl_bool isl_space_tuple_is_equal( __isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, @@ -1095,7 +1121,7 @@ operations and may not be preserved across those operations. __isl_take isl_space *space, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); - int isl_space_has_dim_id(__isl_keep isl_space *space, + isl_bool isl_space_has_dim_id(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_space_get_dim_id( __isl_keep isl_space *space, @@ -1104,7 +1130,7 @@ operations and may not be preserved across those operations. __isl_take isl_space *space, enum isl_dim_type type, unsigned pos, __isl_keep const char *name); - int isl_space_has_dim_name(__isl_keep isl_space *space, + isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_keep const char *isl_space_get_dim_name( __isl_keep isl_space *space, @@ -1115,7 +1141,7 @@ operations and may not be preserved across those operations. __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); - int isl_local_space_has_dim_id( + isl_bool isl_local_space_has_dim_id( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_local_space_get_dim_id( @@ -1124,7 +1150,7 @@ operations and may not be preserved across those operations. __isl_give isl_local_space *isl_local_space_set_dim_name( __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, const char *s); - int isl_local_space_has_dim_name( + isl_bool isl_local_space_has_dim_name( __isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) const char *isl_local_space_get_dim_name( @@ -1143,7 +1169,7 @@ operations and may not be preserved across those operations. __isl_give isl_set *isl_set_set_dim_id( __isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); - int isl_set_has_dim_id(__isl_keep isl_set *set, + isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_set_get_dim_id( __isl_keep isl_set *set, enum isl_dim_type type, @@ -1151,7 +1177,7 @@ operations and may not be preserved across those operations. const char *isl_basic_set_get_dim_name( __isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos); - int isl_set_has_dim_name(__isl_keep isl_set *set, + isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); const char *isl_set_get_dim_name( __isl_keep isl_set *set, @@ -1161,10 +1187,10 @@ operations and may not be preserved across those operations. __isl_give isl_map *isl_map_set_dim_id( __isl_take isl_map *map, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); - int isl_basic_map_has_dim_id( + isl_bool isl_basic_map_has_dim_id( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); - int isl_map_has_dim_id(__isl_keep isl_map *map, + isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_map_get_dim_id( __isl_keep isl_map *map, enum isl_dim_type type, @@ -1175,7 +1201,7 @@ operations and may not be preserved across those operations. const char *isl_basic_map_get_dim_name( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); - int isl_map_has_dim_name(__isl_keep isl_map *map, + isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); const char *isl_map_get_dim_name( __isl_keep isl_map *map, @@ -1218,7 +1244,7 @@ operations and may not be preserved across those operations. __isl_give isl_id *isl_multi_aff_get_dim_id( __isl_keep isl_multi_aff *ma, enum isl_dim_type type, unsigned pos); - int isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, + isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_pw_aff_get_dim_id( __isl_keep isl_pw_aff *pa, @@ -1399,14 +1425,16 @@ using the following functions. enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_space *isl_space_reset_tuple_id( __isl_take isl_space *space, enum isl_dim_type type); - int isl_space_has_tuple_id(__isl_keep isl_space *space, + isl_bool isl_space_has_tuple_id( + __isl_keep isl_space *space, enum isl_dim_type type); __isl_give isl_id *isl_space_get_tuple_id( __isl_keep isl_space *space, enum isl_dim_type type); __isl_give isl_space *isl_space_set_tuple_name( __isl_take isl_space *space, enum isl_dim_type type, const char *s); - int isl_space_has_tuple_name(__isl_keep isl_space *space, + isl_bool isl_space_has_tuple_name( + __isl_keep isl_space *space, enum isl_dim_type type); const char *isl_space_get_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type); @@ -1424,7 +1452,7 @@ using the following functions. __isl_take isl_set *set, __isl_take isl_id *id); __isl_give isl_set *isl_set_reset_tuple_id( __isl_take isl_set *set); - int isl_set_has_tuple_id(__isl_keep isl_set *set); + isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set); __isl_give isl_id *isl_set_get_tuple_id( __isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_set_set_tuple_name( @@ -1433,7 +1461,7 @@ using the following functions. __isl_take isl_set *set, const char *s); const char *isl_basic_set_get_tuple_name( __isl_keep isl_basic_set *bset); - int isl_set_has_tuple_name(__isl_keep isl_set *set); + isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set); const char *isl_set_get_tuple_name( __isl_keep isl_set *set); @@ -1446,7 +1474,7 @@ using the following functions. __isl_take isl_id *id); __isl_give isl_map *isl_map_reset_tuple_id( __isl_take isl_map *map, enum isl_dim_type type); - int isl_map_has_tuple_id(__isl_keep isl_map *map, + isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_id *isl_map_get_tuple_id( __isl_keep isl_map *map, enum isl_dim_type type); @@ -1459,7 +1487,7 @@ using the following functions. __isl_give isl_basic_map *isl_basic_map_set_tuple_name( __isl_take isl_basic_map *bmap, enum isl_dim_type type, const char *s); - int isl_map_has_tuple_name(__isl_keep isl_map *map, + isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type); const char *isl_map_get_tuple_name( __isl_keep isl_map *map, @@ -1472,7 +1500,8 @@ using the following functions. __isl_give isl_multi_val *isl_multi_val_reset_tuple_id( __isl_take isl_multi_val *mv, enum isl_dim_type type); - int isl_multi_val_has_tuple_id(__isl_keep isl_multi_val *mv, + isl_bool isl_multi_val_has_tuple_id( + __isl_keep isl_multi_val *mv, enum isl_dim_type type); __isl_give isl_id *isl_multi_val_get_tuple_id( __isl_keep isl_multi_val *mv, @@ -1519,29 +1548,30 @@ using the following functions. isl_multi_union_pw_aff_reset_tuple_id( __isl_take isl_multi_union_pw_aff *mupa, enum isl_dim_type type); - int isl_multi_aff_has_tuple_id(__isl_keep isl_multi_aff *ma, + isl_bool isl_multi_aff_has_tuple_id( + __isl_keep isl_multi_aff *ma, enum isl_dim_type type); __isl_give isl_id *isl_multi_aff_get_tuple_id( __isl_keep isl_multi_aff *ma, enum isl_dim_type type); - int isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, + isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type); __isl_give isl_id *isl_pw_aff_get_tuple_id( __isl_keep isl_pw_aff *pa, enum isl_dim_type type); - int isl_pw_multi_aff_has_tuple_id( + isl_bool isl_pw_multi_aff_has_tuple_id( __isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); __isl_give isl_id *isl_pw_multi_aff_get_tuple_id( __isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); - int isl_multi_pw_aff_has_tuple_id( + isl_bool isl_multi_pw_aff_has_tuple_id( __isl_keep isl_multi_pw_aff *mpa, enum isl_dim_type type); __isl_give isl_id *isl_multi_pw_aff_get_tuple_id( __isl_keep isl_multi_pw_aff *mpa, enum isl_dim_type type); - int isl_multi_union_pw_aff_has_tuple_id( + isl_bool isl_multi_union_pw_aff_has_tuple_id( __isl_keep isl_multi_union_pw_aff *mupa, enum isl_dim_type type); __isl_give isl_id *isl_multi_union_pw_aff_get_tuple_id( @@ -1561,7 +1591,7 @@ using the following functions. const char *isl_multi_aff_get_tuple_name( __isl_keep isl_multi_aff *multi, enum isl_dim_type type); - int isl_pw_multi_aff_has_tuple_name( + isl_bool isl_pw_multi_aff_has_tuple_name( __isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); const char *isl_pw_multi_aff_get_tuple_name( @@ -1684,9 +1714,10 @@ A new local space can be created from a space using They can be inspected, modified, copied and freed using the following functions. #include - int isl_local_space_is_params( + isl_bool isl_local_space_is_params( + __isl_keep isl_local_space *ls); + isl_bool isl_local_space_is_set( __isl_keep isl_local_space *ls); - int isl_local_space_is_set(__isl_keep isl_local_space *ls); __isl_give isl_space *isl_local_space_get_space( __isl_keep isl_local_space *ls); __isl_give isl_aff *isl_local_space_get_div( @@ -1701,7 +1732,8 @@ of sets. Two local spaces can be compared using - int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, + isl_bool isl_local_space_is_equal( + __isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2); Local spaces can be created from other local spaces @@ -1866,9 +1898,9 @@ added to (or removed from) (basic) sets and relations using the following functions. #include - __isl_give isl_constraint *isl_equality_alloc( + __isl_give isl_constraint *isl_constraint_alloc_equality( __isl_take isl_local_space *ls); - __isl_give isl_constraint *isl_inequality_alloc( + __isl_give isl_constraint *isl_constraint_alloc_inequality( __isl_take isl_local_space *ls); __isl_give isl_constraint *isl_constraint_set_constant_si( __isl_take isl_constraint *constraint, int v); @@ -1908,17 +1940,17 @@ between 10 and 42, you would use the following code. bset = isl_basic_set_universe(isl_space_copy(space)); ls = isl_local_space_from_space(space); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 1, 2); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); c = isl_constraint_set_constant_si(c, -10); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, 1); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(ls); + c = isl_constraint_alloc_inequality(ls); c = isl_constraint_set_constant_si(c, 42); c = isl_constraint_set_coefficient_si(c, isl_dim_set, 0, -1); bset = isl_basic_set_add_constraint(bset, c); @@ -2075,11 +2107,13 @@ no explicit representation is known. To iterate over all the sets or maps in a union set or map, use - int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), + isl_stat isl_union_set_foreach_set( + __isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user); - int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), + isl_stat isl_union_map_foreach_map( + __isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user); The number of sets or maps in a union set or map can be obtained @@ -2099,11 +2133,13 @@ To extract the set or map in a given space from a union, use To iterate over all the basic sets or maps in a set or map, use - int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), + isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, + void *user), void *user); - int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), + isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, + void *user), void *user); The callback function C should return 0 if successful and @@ -2136,15 +2172,17 @@ To iterate over the constraints of a basic set or map, use int isl_basic_set_n_constraint( __isl_keep isl_basic_set *bset); - int isl_basic_set_foreach_constraint( + isl_stat isl_basic_set_foreach_constraint( __isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), + isl_stat (*fn)(__isl_take isl_constraint *c, + void *user), void *user); int isl_basic_map_n_constraint( __isl_keep isl_basic_map *bmap); - int isl_basic_map_foreach_constraint( + isl_stat isl_basic_map_foreach_constraint( __isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), + isl_stat (*fn)(__isl_take isl_constraint *c, + void *user), void *user); __isl_null isl_constraint *isl_constraint_free( __isl_take isl_constraint *c); @@ -2156,7 +2194,7 @@ The constraint C represents either an equality or an inequality. Use the following function to find out whether a constraint represents an equality. If not, it represents an inequality. - int isl_constraint_is_equality( + isl_bool isl_constraint_is_equality( __isl_keep isl_constraint *constraint); It is also possible to obtain a list of constraints from a basic @@ -2177,10 +2215,10 @@ The returned list can be manipulated using the functions in L<"Lists">. The coefficients of the constraints can be inspected using the following functions. - int isl_constraint_is_lower_bound( + isl_bool isl_constraint_is_lower_bound( __isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); - int isl_constraint_is_upper_bound( + isl_bool isl_constraint_is_upper_bound( __isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); __isl_give isl_val *isl_constraint_get_constant_val( @@ -2284,11 +2322,14 @@ and a box can be created from two opposite extremal points using All elements of a B (union) set can be enumerated using the following functions. - int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), + isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, + void *user), void *user); - int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), + isl_stat isl_union_set_foreach_point( + __isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, + void *user), void *user); The function C is called for each integer point in @@ -2311,7 +2352,7 @@ If C does not contain any (integer) points, then the resulting point will be ``void'', a property that can be tested using - int isl_point_is_void(__isl_keep isl_point *pnt); + isl_bool isl_point_is_void(__isl_keep isl_point *pnt); =head2 Functions @@ -2516,9 +2557,9 @@ The constant term of a quasipolynomial can be extracted using To iterate over all terms in a quasipolynomial, use - int isl_qpolynomial_foreach_term( + isl_stat isl_qpolynomial_foreach_term( __isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, + isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user); The terms themselves can be inspected and freed using @@ -2565,9 +2606,9 @@ the following functions. To iterate over all quasipolynomials in a reduction, use - int isl_qpolynomial_fold_foreach_qpolynomial( + isl_stat isl_qpolynomial_fold_foreach_qpolynomial( __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user); =head3 Multiple Expressions @@ -2970,37 +3011,38 @@ To iterate over the different cells of a piecewise expression, use the following functions. #include - int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); + isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff); - int isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, - int (*fn)(__isl_take isl_set *set, + isl_stat isl_pw_aff_foreach_piece( + __isl_keep isl_pw_aff *pwaff, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user), void *user); - int isl_pw_multi_aff_foreach_piece( + isl_stat isl_pw_multi_aff_foreach_piece( __isl_keep isl_pw_multi_aff *pma, - int (*fn)(__isl_take isl_set *set, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff, void *user), void *user); #include - int isl_pw_qpolynomial_foreach_piece( + isl_stat isl_pw_qpolynomial_foreach_piece( __isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); - int isl_pw_qpolynomial_foreach_lifted_piece( + isl_stat isl_pw_qpolynomial_foreach_lifted_piece( __isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); - int isl_pw_qpolynomial_fold_foreach_piece( + isl_stat isl_pw_qpolynomial_fold_foreach_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, void *user), void *user); - int isl_pw_qpolynomial_fold_foreach_lifted_piece( + isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, void *user), void *user); @@ -3180,29 +3222,29 @@ use the following functions. #include int isl_union_pw_aff_n_pw_aff( __isl_keep isl_union_pw_aff *upa); - int isl_union_pw_aff_foreach_pw_aff( + isl_stat isl_union_pw_aff_foreach_pw_aff( __isl_keep isl_union_pw_aff *upa, - int (*fn)(__isl_take isl_pw_aff *ma, void *user), - void *user); + isl_stat (*fn)(__isl_take isl_pw_aff *ma, + void *user), void *user); int isl_union_pw_multi_aff_n_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma); - int isl_union_pw_multi_aff_foreach_pw_multi_aff( + isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma, - int (*fn)(__isl_take isl_pw_multi_aff *pma, + isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user), void *user); #include int isl_union_pw_qpolynomial_n_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp); - int isl_union_pw_qpolynomial_foreach_pw_qpolynomial( + isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp, - int (*fn)(__isl_take isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), void *user); int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf); - int isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( + isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf, - int (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, void *user), void *user); To extract the base expression in a given space from a union, use @@ -3590,52 +3632,69 @@ contains any integer points. The ``plain'' variants do not perform any computations, but simply check if the given set or relation is already known to be empty. - int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); - int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); - int isl_set_plain_is_empty(__isl_keep isl_set *set); - int isl_set_is_empty(__isl_keep isl_set *set); - int isl_union_set_is_empty(__isl_keep isl_union_set *uset); - int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); - int isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); - int isl_map_plain_is_empty(__isl_keep isl_map *map); - int isl_map_is_empty(__isl_keep isl_map *map); - int isl_union_map_is_empty(__isl_keep isl_union_map *umap); + isl_bool isl_basic_set_plain_is_empty( + __isl_keep isl_basic_set *bset); + isl_bool isl_basic_set_is_empty( + __isl_keep isl_basic_set *bset); + isl_bool isl_set_plain_is_empty( + __isl_keep isl_set *set); + isl_bool isl_set_is_empty(__isl_keep isl_set *set); + isl_bool isl_union_set_is_empty( + __isl_keep isl_union_set *uset); + isl_bool isl_basic_map_plain_is_empty( + __isl_keep isl_basic_map *bmap); + isl_bool isl_basic_map_is_empty( + __isl_keep isl_basic_map *bmap); + isl_bool isl_map_plain_is_empty( + __isl_keep isl_map *map); + isl_bool isl_map_is_empty(__isl_keep isl_map *map); + isl_bool isl_union_map_is_empty( + __isl_keep isl_union_map *umap); =item * Universality - int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); - int isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); - int isl_set_plain_is_universe(__isl_keep isl_set *set); - int isl_map_plain_is_universe(__isl_keep isl_map *map); + isl_bool isl_basic_set_is_universe( + __isl_keep isl_basic_set *bset); + isl_bool isl_basic_map_is_universe( + __isl_keep isl_basic_map *bmap); + isl_bool isl_set_plain_is_universe( + __isl_keep isl_set *set); + isl_bool isl_map_plain_is_universe( + __isl_keep isl_map *map); =item * Single-valuedness #include - int isl_set_is_singleton(__isl_keep isl_set *set); + isl_bool isl_set_is_singleton(__isl_keep isl_set *set); #include - int isl_basic_map_is_single_valued( + isl_bool isl_basic_map_is_single_valued( __isl_keep isl_basic_map *bmap); - int isl_map_plain_is_single_valued( + isl_bool isl_map_plain_is_single_valued( __isl_keep isl_map *map); - int isl_map_is_single_valued(__isl_keep isl_map *map); + isl_bool isl_map_is_single_valued(__isl_keep isl_map *map); #include - int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); + isl_bool isl_union_map_is_single_valued( + __isl_keep isl_union_map *umap); =item * Injectivity - int isl_map_plain_is_injective(__isl_keep isl_map *map); - int isl_map_is_injective(__isl_keep isl_map *map); - int isl_union_map_plain_is_injective( + isl_bool isl_map_plain_is_injective( + __isl_keep isl_map *map); + isl_bool isl_map_is_injective( + __isl_keep isl_map *map); + isl_bool isl_union_map_plain_is_injective( __isl_keep isl_union_map *umap); - int isl_union_map_is_injective( + isl_bool isl_union_map_is_injective( __isl_keep isl_union_map *umap); =item * Bijectivity - int isl_map_is_bijective(__isl_keep isl_map *map); - int isl_union_map_is_bijective(__isl_keep isl_union_map *umap); + isl_bool isl_map_is_bijective( + __isl_keep isl_map *map); + isl_bool isl_union_map_is_bijective( + __isl_keep isl_union_map *umap); =item * Position @@ -3656,7 +3715,7 @@ Otherwise return NaN. =item * Stride - int isl_set_dim_residue_class_val( + isl_stat isl_set_dim_residue_class_val( __isl_keep isl_set *set, int pos, __isl_give isl_val **modulo, __isl_give isl_val **residue); @@ -3676,38 +3735,39 @@ on one or more given dimensions, the following functions can be used. #include - int isl_constraint_involves_dims( + isl_bool isl_constraint_involves_dims( __isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n); #include - int isl_basic_set_involves_dims( + isl_bool isl_basic_set_involves_dims( __isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n); - int isl_set_involves_dims(__isl_keep isl_set *set, + isl_bool isl_set_involves_dims(__isl_keep isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); #include - int isl_basic_map_involves_dims( + isl_bool isl_basic_map_involves_dims( __isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n); - int isl_map_involves_dims(__isl_keep isl_map *map, + isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); #include - int isl_union_map_involves_dims( + isl_bool isl_union_map_involves_dims( __isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n); #include - int isl_aff_involves_dims(__isl_keep isl_aff *aff, + isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n); - int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, + isl_bool isl_pw_aff_involves_dims( + __isl_keep isl_pw_aff *pwaff, enum isl_dim_type type, unsigned first, unsigned n); - int isl_multi_aff_involves_dims( + isl_bool isl_multi_aff_involves_dims( __isl_keep isl_multi_aff *ma, enum isl_dim_type type, unsigned first, unsigned n); - int isl_multi_pw_aff_involves_dims( + isl_bool isl_multi_pw_aff_involves_dims( __isl_keep isl_multi_pw_aff *mpa, enum isl_dim_type type, unsigned first, unsigned n); @@ -3715,9 +3775,11 @@ Similarly, the following functions can be used to check whether a given dimension is involved in any lower or upper bound. #include - int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, + isl_bool isl_set_dim_has_any_lower_bound( + __isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); - int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, + isl_bool isl_set_dim_has_any_upper_bound( + __isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); Note that these functions return true even if there is a bound on @@ -3726,17 +3788,19 @@ To check if they have a bound for all of the basic sets in C, use the following functions instead. #include - int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, + isl_bool isl_set_dim_has_lower_bound( + __isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); - int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, + isl_bool isl_set_dim_has_upper_bound( + __isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); =item * Space To check whether a set is a parameter domain, use this function: - int isl_set_is_params(__isl_keep isl_set *set); - int isl_union_set_is_params( + isl_bool isl_set_is_params(__isl_keep isl_set *set); + isl_bool isl_union_set_is_params( __isl_keep isl_union_set *uset); =item * Wrapping @@ -3745,34 +3809,34 @@ The following functions check whether the space of the given (basic) set or relation range is a wrapped relation. #include - int isl_space_is_wrapping( + isl_bool isl_space_is_wrapping( __isl_keep isl_space *space); - int isl_space_domain_is_wrapping( + isl_bool isl_space_domain_is_wrapping( __isl_keep isl_space *space); - int isl_space_range_is_wrapping( + isl_bool isl_space_range_is_wrapping( __isl_keep isl_space *space); #include - int isl_basic_set_is_wrapping( + isl_bool isl_basic_set_is_wrapping( __isl_keep isl_basic_set *bset); - int isl_set_is_wrapping(__isl_keep isl_set *set); + isl_bool isl_set_is_wrapping(__isl_keep isl_set *set); #include - int isl_map_domain_is_wrapping( + isl_bool isl_map_domain_is_wrapping( __isl_keep isl_map *map); - int isl_map_range_is_wrapping( + isl_bool isl_map_range_is_wrapping( __isl_keep isl_map *map); #include - int isl_multi_val_range_is_wrapping( + isl_bool isl_multi_val_range_is_wrapping( __isl_keep isl_multi_val *mv); #include - int isl_multi_aff_range_is_wrapping( + isl_bool isl_multi_aff_range_is_wrapping( __isl_keep isl_multi_aff *ma); - int isl_multi_pw_aff_range_is_wrapping( + isl_bool isl_multi_pw_aff_range_is_wrapping( __isl_keep isl_multi_pw_aff *mpa); - int isl_multi_union_pw_aff_range_is_wrapping( + isl_bool isl_multi_union_pw_aff_range_is_wrapping( __isl_keep isl_multi_union_pw_aff *mupa); The input to C should @@ -3782,9 +3846,9 @@ C should be the space of a relation. =item * Internal Product - int isl_basic_map_can_zip( + isl_bool isl_basic_map_can_zip( __isl_keep isl_basic_map *bmap); - int isl_map_can_zip(__isl_keep isl_map *map); + isl_bool isl_map_can_zip(__isl_keep isl_map *map); Check whether the product of domain and range of the given relation can be computed, @@ -3792,38 +3856,40 @@ i.e., whether both domain and range are nested relations. =item * Currying - int isl_basic_map_can_curry( + isl_bool isl_basic_map_can_curry( __isl_keep isl_basic_map *bmap); - int isl_map_can_curry(__isl_keep isl_map *map); + isl_bool isl_map_can_curry(__isl_keep isl_map *map); Check whether the domain of the (basic) relation is a wrapped relation. - int isl_basic_map_can_uncurry( + isl_bool isl_basic_map_can_uncurry( __isl_keep isl_basic_map *bmap); - int isl_map_can_uncurry(__isl_keep isl_map *map); + isl_bool isl_map_can_uncurry(__isl_keep isl_map *map); Check whether the range of the (basic) relation is a wrapped relation. =item * Special Values #include - int isl_aff_is_cst(__isl_keep isl_aff *aff); - int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); + isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff); + isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); Check whether the given expression is a constant. #include - int isl_aff_is_nan(__isl_keep isl_aff *aff); - int isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa); + isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff); + isl_bool isl_pw_aff_involves_nan( + __isl_keep isl_pw_aff *pa); #include - int isl_qpolynomial_fold_is_nan( + isl_bool isl_qpolynomial_fold_is_nan( __isl_keep isl_qpolynomial_fold *fold); Check whether the given expression is equal to or involves NaN. #include - int isl_aff_plain_is_zero(__isl_keep isl_aff *aff); + isl_bool isl_aff_plain_is_zero( + __isl_keep isl_aff *aff); Check whether the affine expression is obviously zero. @@ -3843,132 +3909,136 @@ even if the objects are the same, but they will never return true if the objects are not the same. #include - int isl_basic_set_plain_is_equal( + isl_bool isl_basic_set_plain_is_equal( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); - int isl_basic_set_is_equal( + isl_bool isl_basic_set_is_equal( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); - int isl_set_plain_is_equal(__isl_keep isl_set *set1, + isl_bool isl_set_plain_is_equal( + __isl_keep isl_set *set1, __isl_keep isl_set *set2); - int isl_set_is_equal(__isl_keep isl_set *set1, + isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); #include - int isl_basic_map_is_equal( + isl_bool isl_basic_map_is_equal( __isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); - int isl_map_is_equal(__isl_keep isl_map *map1, + isl_bool isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); - int isl_map_plain_is_equal(__isl_keep isl_map *map1, + isl_bool isl_map_plain_is_equal( + __isl_keep isl_map *map1, __isl_keep isl_map *map2); #include - int isl_union_set_is_equal( + isl_bool isl_union_set_is_equal( __isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); #include - int isl_union_map_is_equal( + isl_bool isl_union_map_is_equal( __isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); #include - int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + isl_bool isl_aff_plain_is_equal( + __isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2); - int isl_multi_aff_plain_is_equal( + isl_bool isl_multi_aff_plain_is_equal( __isl_keep isl_multi_aff *maff1, __isl_keep isl_multi_aff *maff2); - int isl_pw_aff_plain_is_equal( + isl_bool isl_pw_aff_plain_is_equal( __isl_keep isl_pw_aff *pwaff1, __isl_keep isl_pw_aff *pwaff2); - int isl_pw_multi_aff_plain_is_equal( + isl_bool isl_pw_multi_aff_plain_is_equal( __isl_keep isl_pw_multi_aff *pma1, __isl_keep isl_pw_multi_aff *pma2); - int isl_multi_pw_aff_plain_is_equal( + isl_bool isl_multi_pw_aff_plain_is_equal( __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2); - int isl_multi_pw_aff_is_equal( + isl_bool isl_multi_pw_aff_is_equal( __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2); - int isl_union_pw_aff_plain_is_equal( + isl_bool isl_union_pw_aff_plain_is_equal( __isl_keep isl_union_pw_aff *upa1, __isl_keep isl_union_pw_aff *upa2); - int isl_union_pw_multi_aff_plain_is_equal( + isl_bool isl_union_pw_multi_aff_plain_is_equal( __isl_keep isl_union_pw_multi_aff *upma1, __isl_keep isl_union_pw_multi_aff *upma2); - int isl_multi_union_pw_aff_plain_is_equal( + isl_bool isl_multi_union_pw_aff_plain_is_equal( __isl_keep isl_multi_union_pw_aff *mupa1, __isl_keep isl_multi_union_pw_aff *mupa2); #include - int isl_union_pw_qpolynomial_plain_is_equal( + isl_bool isl_union_pw_qpolynomial_plain_is_equal( __isl_keep isl_union_pw_qpolynomial *upwqp1, __isl_keep isl_union_pw_qpolynomial *upwqp2); - int isl_union_pw_qpolynomial_fold_plain_is_equal( + isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal( __isl_keep isl_union_pw_qpolynomial_fold *upwf1, __isl_keep isl_union_pw_qpolynomial_fold *upwf2); =item * Disjointness #include - int isl_basic_set_is_disjoint( + isl_bool isl_basic_set_is_disjoint( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); - int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, + isl_bool isl_set_plain_is_disjoint( + __isl_keep isl_set *set1, __isl_keep isl_set *set2); - int isl_set_is_disjoint(__isl_keep isl_set *set1, + isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2); #include - int isl_basic_map_is_disjoint( + isl_bool isl_basic_map_is_disjoint( __isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); - int isl_map_is_disjoint(__isl_keep isl_map *map1, + isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2); #include - int isl_union_set_is_disjoint( + isl_bool isl_union_set_is_disjoint( __isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); #include - int isl_union_map_is_disjoint( + isl_bool isl_union_map_is_disjoint( __isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); =item * Subset - int isl_basic_set_is_subset( + isl_bool isl_basic_set_is_subset( __isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); - int isl_set_is_subset(__isl_keep isl_set *set1, + isl_bool isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); - int isl_set_is_strict_subset( + isl_bool isl_set_is_strict_subset( __isl_keep isl_set *set1, __isl_keep isl_set *set2); - int isl_union_set_is_subset( + isl_bool isl_union_set_is_subset( __isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); - int isl_union_set_is_strict_subset( + isl_bool isl_union_set_is_strict_subset( __isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); - int isl_basic_map_is_subset( + isl_bool isl_basic_map_is_subset( __isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); - int isl_basic_map_is_strict_subset( + isl_bool isl_basic_map_is_strict_subset( __isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); - int isl_map_is_subset( + isl_bool isl_map_is_subset( __isl_keep isl_map *map1, __isl_keep isl_map *map2); - int isl_map_is_strict_subset( + isl_bool isl_map_is_strict_subset( __isl_keep isl_map *map1, __isl_keep isl_map *map2); - int isl_union_map_is_subset( + isl_bool isl_union_map_is_subset( __isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); - int isl_union_map_is_strict_subset( + isl_bool isl_union_map_is_strict_subset( __isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); @@ -4551,7 +4621,7 @@ in the constraints of the input. By default, the coefficients are not allowed to grow larger, but this can be changed by unsetting the following option. - int isl_options_set_coalesce_bounded_wrapping( + isl_stat isl_options_set_coalesce_bounded_wrapping( isl_ctx *ctx, int val); int isl_options_get_coalesce_bounded_wrapping( isl_ctx *ctx); @@ -6992,14 +7062,15 @@ Lists can be inspected using the following functions. int isl_set_list_n_set(__isl_keep isl_set_list *list); __isl_give isl_set *isl_set_list_get_set( __isl_keep isl_set_list *list, int index); - int isl_set_list_foreach(__isl_keep isl_set_list *list, - int (*fn)(__isl_take isl_set *el, void *user), + isl_stat isl_set_list_foreach(__isl_keep isl_set_list *list, + isl_stat (*fn)(__isl_take isl_set *el, void *user), void *user); - int isl_set_list_foreach_scc(__isl_keep isl_set_list *list, - int (*follows)(__isl_keep isl_set *a, + isl_stat isl_set_list_foreach_scc( + __isl_keep isl_set_list *list, + isl_bool (*follows)(__isl_keep isl_set *a, __isl_keep isl_set *b, void *user), void *follows_user - int (*fn)(__isl_take isl_set *el, void *user), + isl_stat (*fn)(__isl_take isl_set *el, void *user), void *fn_user); The function C calls C on each of the @@ -7043,15 +7114,15 @@ The associative array will be grown automatically as needed. Associative arrays can be inspected using the following functions. #include - int isl_id_to_ast_expr_has( + isl_bool isl_id_to_ast_expr_has( __isl_keep isl_id_to_ast_expr *id2expr, __isl_keep isl_id *key); __isl_give isl_ast_expr *isl_id_to_ast_expr_get( __isl_keep isl_id_to_ast_expr *id2expr, __isl_take isl_id *key); - int isl_id_to_ast_expr_foreach( + isl_stat isl_id_to_ast_expr_foreach( __isl_keep isl_id_to_ast_expr *id2expr, - int (*fn)(__isl_take isl_id *key, + isl_stat (*fn)(__isl_take isl_id *key, __isl_take isl_ast_expr *val, void *user), void *user); @@ -7191,18 +7262,18 @@ This information can be queried by either iterating over all the vertices or iterating over all the chambers or cells and then iterating over all vertices that are active on the chamber. - int isl_vertices_foreach_vertex( + isl_stat isl_vertices_foreach_vertex( __isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), - void *user); + isl_stat (*fn)(__isl_take isl_vertex *vertex, + void *user), void *user); - int isl_vertices_foreach_cell( + isl_stat isl_vertices_foreach_cell( __isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), - void *user); - int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), - void *user); + isl_stat (*fn)(__isl_take isl_cell *cell, + void *user), void *user); + isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, + void *user), void *user); Other operations that can be performed on an C object are the following. @@ -7388,7 +7459,7 @@ The following functions checks whether two C objects are obviously the same. #include - int isl_schedule_plain_is_equal( + isl_bool isl_schedule_plain_is_equal( __isl_keep isl_schedule *schedule1, __isl_keep isl_schedule *schedule2); @@ -7544,7 +7615,7 @@ The following functions can be used to check if two schedule nodes point to the same position in the same schedule. #include - int isl_schedule_node_is_equal( + isl_bool isl_schedule_node_is_equal( __isl_keep isl_schedule_node *node1, __isl_keep isl_schedule_node *node2); @@ -7570,7 +7641,7 @@ to a different position in the tree or to check if such a position exists. #include - int isl_schedule_node_has_parent( + isl_bool isl_schedule_node_has_parent( __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node *isl_schedule_node_parent( __isl_take isl_schedule_node *node); @@ -7583,16 +7654,16 @@ exists. __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node *isl_schedule_node_child( __isl_take isl_schedule_node *node, int pos); - int isl_schedule_node_has_children( + isl_bool isl_schedule_node_has_children( __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node *isl_schedule_node_first_child( __isl_take isl_schedule_node *node); - int isl_schedule_node_has_previous_sibling( + isl_bool isl_schedule_node_has_previous_sibling( __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node * isl_schedule_node_previous_sibling( __isl_take isl_schedule_node *node); - int isl_schedule_node_has_next_sibling( + isl_bool isl_schedule_node_has_next_sibling( __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node * isl_schedule_node_next_sibling( @@ -7631,15 +7702,15 @@ all descendants of a specific node (including the node) can be visited in depth-first pre-order using the following functions. #include - int isl_schedule_foreach_schedule_node( + isl_stat isl_schedule_foreach_schedule_node_top_down( __isl_keep isl_schedule *sched, - int (*fn)(__isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); #include - int isl_schedule_node_foreach_descendant( + isl_stat isl_schedule_node_foreach_descendant_top_down( __isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); The callback function is slightly different from the usual @@ -7654,9 +7725,9 @@ the root down to and including the parent of the node using the following function. #include - int isl_schedule_node_foreach_ancestor_top_down( + isl_stat isl_schedule_node_foreach_ancestor_top_down( __isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, + isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); The following functions allows for a depth-first post-order @@ -7666,7 +7737,8 @@ itself), where the user callback is allowed to modify the visited node. #include - __isl_give isl_schedule *isl_schedule_map_schedule_node( + __isl_give isl_schedule * + isl_schedule_map_schedule_node_bottom_up( __isl_take isl_schedule *schedule, __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, @@ -7674,7 +7746,7 @@ visited node. #include __isl_give isl_schedule_node * - isl_schedule_node_map_descendant( + isl_schedule_node_map_descendant_bottom_up( __isl_take isl_schedule_node *node, __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, @@ -7715,7 +7787,7 @@ outer band nodes. The following function can be used to test whether the subtree rooted at a given node contains any such nodes. #include - int isl_schedule_node_is_subtree_anchored( + isl_bool isl_schedule_node_is_subtree_anchored( __isl_keep isl_schedule_node *node); The following function resets the user pointers on all parameter @@ -7748,13 +7820,13 @@ Several node types have their own functions for querying __isl_keep isl_schedule_node *node); unsigned isl_schedule_node_band_n_member( __isl_keep isl_schedule_node *node); - int isl_schedule_node_band_member_get_coincident( + isl_bool isl_schedule_node_band_member_get_coincident( __isl_keep isl_schedule_node *node, int pos); __isl_give isl_schedule_node * isl_schedule_node_band_member_set_coincident( __isl_take isl_schedule_node *node, int pos, int coincident); - int isl_schedule_node_band_get_permutable( + isl_bool isl_schedule_node_band_get_permutable( __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node * isl_schedule_node_band_set_permutable( @@ -8032,10 +8104,10 @@ A band node can be tiled using the following function. __isl_take isl_schedule_node *node, __isl_take isl_multi_val *sizes); - int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, + isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); - int isl_options_set_tile_shift_point_loops(isl_ctx *ctx, + isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); @@ -8267,8 +8339,8 @@ A lower-level interface is provided by the following functions. __isl_give isl_flow *isl_access_info_compute_flow( __isl_take isl_access_info *acc); - int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, + isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), void *user); __isl_give isl_map *isl_flow_get_no_source( @@ -8567,33 +8639,33 @@ L. =head3 Options #include - int isl_options_set_schedule_max_coefficient( + isl_stat isl_options_set_schedule_max_coefficient( isl_ctx *ctx, int val); int isl_options_get_schedule_max_coefficient( isl_ctx *ctx); - int isl_options_set_schedule_max_constant_term( + isl_stat isl_options_set_schedule_max_constant_term( isl_ctx *ctx, int val); int isl_options_get_schedule_max_constant_term( isl_ctx *ctx); - int isl_options_set_schedule_fuse(isl_ctx *ctx, int val); + isl_stat isl_options_set_schedule_fuse(isl_ctx *ctx, int val); int isl_options_get_schedule_fuse(isl_ctx *ctx); - int isl_options_set_schedule_maximize_band_depth( + isl_stat isl_options_set_schedule_maximize_band_depth( isl_ctx *ctx, int val); int isl_options_get_schedule_maximize_band_depth( isl_ctx *ctx); - int isl_options_set_schedule_outer_coincidence( + isl_stat isl_options_set_schedule_outer_coincidence( isl_ctx *ctx, int val); int isl_options_get_schedule_outer_coincidence( isl_ctx *ctx); - int isl_options_set_schedule_split_scaled( + isl_stat isl_options_set_schedule_split_scaled( isl_ctx *ctx, int val); int isl_options_get_schedule_split_scaled( isl_ctx *ctx); - int isl_options_set_schedule_algorithm( + isl_stat isl_options_set_schedule_algorithm( isl_ctx *ctx, int val); int isl_options_get_schedule_algorithm( isl_ctx *ctx); - int isl_options_set_schedule_separate_components( + isl_stat isl_options_set_schedule_separate_components( isl_ctx *ctx, int val); int isl_options_get_schedule_separate_components( isl_ctx *ctx); @@ -8751,7 +8823,7 @@ Each type of node has its own additional properties. __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_for_get_body( __isl_keep isl_ast_node *node); - int isl_ast_node_for_is_degenerate( + isl_bool isl_ast_node_for_is_degenerate( __isl_keep isl_ast_node *node); An C is considered degenerate if it is known to execute @@ -8762,7 +8834,7 @@ exactly once. __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_then( __isl_keep isl_ast_node *node); - int isl_ast_node_if_has_else( + isl_bool isl_ast_node_if_has_else( __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_else( __isl_keep isl_ast_node *node); @@ -8806,10 +8878,10 @@ Each type of expression has its own additional properties. int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr); __isl_give isl_ast_expr *isl_ast_expr_get_op_arg( __isl_keep isl_ast_expr *expr, int pos); - int isl_ast_node_foreach_ast_op_type( + isl_stat isl_ast_node_foreach_ast_op_type( __isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), - void *user); + isl_stat (*fn)(enum isl_ast_op_type type, + void *user), void *user); C returns the type of the operation performed. C returns the number of @@ -8963,7 +9035,8 @@ Return the integer represented by the AST expression. =head3 Properties of ASTs #include - int isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, + isl_bool isl_ast_expr_is_equal( + __isl_keep isl_ast_expr *expr1, __isl_keep isl_ast_expr *expr2); Check if two Cs are equal to each other. @@ -9213,7 +9286,7 @@ C. The following option determines the type to be used for iterators while printing the AST. - int isl_options_set_ast_iterator_type( + isl_stat isl_options_set_ast_iterator_type( isl_ctx *ctx, const char *val); const char *isl_options_get_ast_iterator_type( isl_ctx *ctx); @@ -9224,36 +9297,36 @@ For example, a C node with one body node will not be surrounded with braces in C. A block will always be printed by setting the following option. - int isl_options_set_ast_always_print_block(isl_ctx *ctx, + isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx, int val); int isl_options_get_ast_always_print_block(isl_ctx *ctx); =head3 Options #include - int isl_options_set_ast_build_atomic_upper_bound( + isl_stat isl_options_set_ast_build_atomic_upper_bound( isl_ctx *ctx, int val); int isl_options_get_ast_build_atomic_upper_bound( isl_ctx *ctx); - int isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx); - int isl_options_set_ast_build_exploit_nested_bounds( + isl_stat isl_options_set_ast_build_exploit_nested_bounds( isl_ctx *ctx, int val); int isl_options_get_ast_build_exploit_nested_bounds( isl_ctx *ctx); - int isl_options_set_ast_build_group_coscheduled( + isl_stat isl_options_set_ast_build_group_coscheduled( isl_ctx *ctx, int val); int isl_options_get_ast_build_group_coscheduled( isl_ctx *ctx); - int isl_options_set_ast_build_scale_strides( + isl_stat isl_options_set_ast_build_scale_strides( isl_ctx *ctx, int val); int isl_options_get_ast_build_scale_strides( isl_ctx *ctx); - int isl_options_set_ast_build_allow_else(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_else(isl_ctx *ctx); - int isl_options_set_ast_build_allow_or(isl_ctx *ctx, + isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_or(isl_ctx *ctx); @@ -9841,7 +9914,7 @@ user defined node created using the following function. __isl_give isl_ast_build * isl_ast_build_set_before_each_mark( __isl_take isl_ast_build *build, - int (*fn)(__isl_keep isl_id *mark, + isl_stat (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, void *user), void *user); __isl_give isl_ast_build * diff --git a/polly/lib/External/isl/imath/ChangeLog b/polly/lib/External/isl/imath/ChangeLog index 5222475d084a..f26d415c381d 100644 --- a/polly/lib/External/isl/imath/ChangeLog +++ b/polly/lib/External/isl/imath/ChangeLog @@ -375,3 +375,8 @@ 1.19 Fix signedness error in compile. Reported by Paweł Sikora. + +1.20 + Fix broken comments, apparently from a previous bad merge. + Remove emacs folding-mode comments throughout. + Some minor Makefile cleanup to make clang happier. diff --git a/polly/lib/External/isl/imath/examples/imcalc.c b/polly/lib/External/isl/imath/examples/imcalc.c index 97f0dc5affb8..bb4bdbce8152 100644 --- a/polly/lib/External/isl/imath/examples/imcalc.c +++ b/polly/lib/External/isl/imath/examples/imcalc.c @@ -62,8 +62,6 @@ typedef struct { int buflen; /* size of scratch buffer */ } cstate_t; -/* {{{ State function prototypes */ - static mp_result state_init(cstate_t *sp, mp_size n_elts); static void state_clear(cstate_t *sp); static void stack_flush(cstate_t *sp); @@ -73,10 +71,6 @@ static mp_result mem_insert(cstate_t *sp, const char *name, mp_int value); static mp_result mem_recall(cstate_t *sp, const char *name, mp_int value); static mp_result mem_clear(cstate_t *sp); -/* }}} */ - -/* {{{ Calculation function prototypes */ - typedef mp_result (*op_func)(cstate_t *); static mp_result cf_abs(cstate_t *sp); @@ -123,10 +117,6 @@ static mp_result cf_cmem(cstate_t *sp); static mp_result cf_pmem(cstate_t *sp); static mp_result cf_qrecall(cstate_t *sp); -/* }}} */ - -/* {{{ Built-in operator records, g_ops[] */ - typedef struct { char *name; /* The name of the operator. */ int stack_size; /* Number of stack arguments required. */ @@ -196,23 +186,17 @@ static calcop_t g_ops[] = { { NULL, 0, cf_qrecall, "-- x ; recall from named variable" }, }; -/* }}} */ - #define BUFFER_SIZE 16384 /* max. length of input values, in chars */ /* Token types from the primitive lexical analyzer */ typedef enum { t_eof, t_symbol, t_number, t_error } token_t; -/* {{{ Helper functions */ - static token_t next_token(FILE *ifp, char *buf, int size); static mp_result read_number(char *buf, mp_int *out); static int find_command(cstate_t *ops); static void print_value(mp_int v); static mp_result run_file(FILE *ifp, cstate_t *op_state); -/* }}} */ - /* Error code used internally to signal input problems. */ static mp_result MP_INPUT; @@ -295,8 +279,6 @@ int main(int argc, char *argv[]) } } -/* {{{ next_token(*ifp, *buf, size) */ - static token_t next_token(FILE *ifp, char *buf, int size) { int ch, pos = 0; @@ -344,10 +326,6 @@ static token_t next_token(FILE *ifp, char *buf, int size) return res; } -/* }}} */ - -/* {{{ read_number(*buf, *out) */ - static mp_result read_number(char *buf, mp_int *out) { int radix = 10, pos = 0; @@ -392,10 +370,6 @@ static mp_result read_number(char *buf, mp_int *out) return res; } -/* }}} */ - -/* {{{ find_command(*buf) */ - static int find_command(cstate_t *op) { int ix, jx; @@ -417,10 +391,6 @@ static int find_command(cstate_t *op) return -1; } -/* }}} */ - -/* {{{ print_value(v) */ - static void print_value(mp_int v) { if(g_output_radix == 0) { @@ -454,10 +424,6 @@ static void print_value(mp_int v) } } -/* }}} */ - -/* {{{ run_file(*ifp, *op_state) */ - static mp_result run_file(FILE *ifp, cstate_t *op_state) { mp_result res = MP_OK; @@ -500,10 +466,6 @@ static mp_result run_file(FILE *ifp, cstate_t *op_state) return res; } -/* }}} */ - -/* {{{ state_init(*sp, n_elts) */ - static mp_result state_init(cstate_t *sp, mp_size n_elts) { int ix; @@ -543,10 +505,6 @@ static mp_result state_init(cstate_t *sp, mp_size n_elts) return MP_OK; } -/* }}} */ - -/* {{{ state_clear(*sp) */ - static void state_clear(cstate_t *sp) { assert(sp != NULL); @@ -592,10 +550,6 @@ static void state_clear(cstate_t *sp) } } -/* }}} */ - -/* {{{ stack_flush(*sp) */ - static void stack_flush(cstate_t *sp) { int ix; @@ -610,10 +564,6 @@ static void stack_flush(cstate_t *sp) sp->used = 0; } -/* }}} */ - -/* {{{ stack_push(*sp, elt) */ - static mp_result stack_push(cstate_t *sp, mp_int elt) { if(sp->used >= sp->alloc) { @@ -636,10 +586,6 @@ static mp_result stack_push(cstate_t *sp, mp_int elt) return MP_OK; } -/* }}} */ - -/* {{{ stack_pop(*sp) */ - static mp_result stack_pop(cstate_t *sp) { assert(sp != NULL && sp->elts != NULL); @@ -654,10 +600,6 @@ static mp_result stack_pop(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ mem_insert(*sp, *name, value) */ - static mp_result mem_insert(cstate_t *sp, const char *name, mp_int value) { int ix; @@ -710,10 +652,6 @@ static mp_result mem_insert(cstate_t *sp, const char *name, mp_int value) return mp_int_copy(value, sp->mem[ix]); } -/* }}} */ - -/* {{{ mem_recall(*sp, *name, value) */ - static mp_result mem_recall(cstate_t *sp, const char *name, mp_int value) { int ix; @@ -727,10 +665,6 @@ static mp_result mem_recall(cstate_t *sp, const char *name, mp_int value) return MP_UNDEF; /* not found */ } -/* }}} */ - -/* {{{ mem_clear(*sp) */ - static mp_result mem_clear(cstate_t *sp) { int ix; @@ -744,10 +678,6 @@ static mp_result mem_clear(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_abs(sp) */ - static mp_result cf_abs(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -755,10 +685,6 @@ static mp_result cf_abs(cstate_t *sp) return mp_int_abs(a, a); } -/* }}} */ - -/* {{{ cf_neg(sp) */ - static mp_result cf_neg(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -766,10 +692,6 @@ static mp_result cf_neg(cstate_t *sp) return mp_int_neg(a, a); } -/* }}} */ - -/* {{{ cf_add(sp) */ - static mp_result cf_add(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -782,10 +704,6 @@ static mp_result cf_add(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_sub(sp) */ - static mp_result cf_sub(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -798,10 +716,6 @@ static mp_result cf_sub(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_mul(sp) */ - static mp_result cf_mul(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -814,10 +728,6 @@ static mp_result cf_mul(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_divmod(sp) */ - static mp_result cf_divmod(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -826,10 +736,6 @@ static mp_result cf_divmod(cstate_t *sp) return mp_int_div(a, b, a, b); } -/* }}} */ - -/* {{{ cf_div(sp) */ - static mp_result cf_div(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -842,10 +748,6 @@ static mp_result cf_div(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_mod(sp) */ - static mp_result cf_mod(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -858,10 +760,6 @@ static mp_result cf_mod(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_expt(sp) */ - static mp_result cf_expt(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -876,10 +774,6 @@ static mp_result cf_expt(cstate_t *sp) return mp_int_expt(a, bval, a); } -/* }}} */ - -/* {{{ cf_exptmod(sp) */ - static mp_result cf_exptmod(cstate_t *sp) { mp_int m = sp->elts[sp->used - 1]; @@ -895,10 +789,6 @@ static mp_result cf_exptmod(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_square(sp) */ - static mp_result cf_square(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -906,10 +796,6 @@ static mp_result cf_square(cstate_t *sp) return mp_int_sqr(a, a); } -/* }}} */ - -/* {{{ cf_invmod(sp) */ - static mp_result cf_invmod(cstate_t *sp) { mp_int m = sp->elts[sp->used - 1]; @@ -921,10 +807,6 @@ static mp_result cf_invmod(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_gcd(sp) */ - static mp_result cf_gcd(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -937,10 +819,6 @@ static mp_result cf_gcd(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_xgcd(sp) */ - static mp_result cf_xgcd(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -961,10 +839,6 @@ static mp_result cf_xgcd(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_sqrt(sp) */ - static mp_result cf_sqrt(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -972,10 +846,6 @@ static mp_result cf_sqrt(cstate_t *sp) return mp_int_sqrt(a, a); } -/* }}} */ - -/* {{{ cf_root(sp) */ - static mp_result cf_root(cstate_t *sp) { mp_int a = sp->elts[sp->used - 2]; @@ -990,10 +860,6 @@ static mp_result cf_root(cstate_t *sp) return mp_int_root(a, b, a); } -/* }}} */ - -/* {{{ cf_cmplt(sp) */ - static mp_result cf_cmplt(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1005,10 +871,6 @@ static mp_result cf_cmplt(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_cmpgt(sp) */ - static mp_result cf_cmpgt(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1020,10 +882,6 @@ static mp_result cf_cmpgt(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_cmple(sp) */ - static mp_result cf_cmple(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1035,10 +893,6 @@ static mp_result cf_cmple(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_cmpge(sp) */ - static mp_result cf_cmpge(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1050,10 +904,6 @@ static mp_result cf_cmpge(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_cmpeq(sp) */ - static mp_result cf_cmpeq(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1065,10 +915,6 @@ static mp_result cf_cmpeq(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_cmpne(sp) */ - static mp_result cf_cmpne(cstate_t *sp) { mp_int b = sp->elts[sp->used - 1]; @@ -1080,10 +926,6 @@ static mp_result cf_cmpne(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_inc(sp) */ - static mp_result cf_inc(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -1091,10 +933,6 @@ static mp_result cf_inc(cstate_t *sp) return mp_int_add_value(a, 1, a); } -/* }}} */ - -/* {{{ cf_dec(sp) */ - static mp_result cf_dec(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -1102,10 +940,6 @@ static mp_result cf_dec(cstate_t *sp) return mp_int_sub_value(a, 1, a); } -/* }}} */ - -/* {{{ cf_fact(sp) */ - static mp_result cf_fact(cstate_t *sp) { mpz_t tmp; @@ -1131,10 +965,6 @@ static mp_result cf_fact(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_pprint(sp) */ - static mp_result cf_pprint(cstate_t *sp) { print_value(sp->elts[sp->used - 1]); @@ -1142,20 +972,12 @@ static mp_result cf_pprint(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_print(sp) */ - static mp_result cf_print(cstate_t *sp) { print_value(sp->elts[sp->used - 1]); return MP_OK; } -/* }}} */ - -/* {{{ cf_pstack(sp) */ - static mp_result cf_pstack(cstate_t *sp) { int ix; @@ -1173,10 +995,6 @@ static mp_result cf_pstack(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_clstk(sp) */ - static mp_result cf_clstk(cstate_t *sp) { stack_flush(sp); @@ -1184,19 +1002,11 @@ static mp_result cf_clstk(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_pop(sp) */ - static mp_result cf_pop(cstate_t *sp) { return stack_pop(sp); } -/* }}} */ - -/* {{{ cf_dup(sp) */ - static mp_result cf_dup(cstate_t *sp) { mp_int cp = mp_int_alloc(); @@ -1216,10 +1026,6 @@ static mp_result cf_dup(cstate_t *sp) return res; } -/* }}} */ - -/* {{{ cf_copy(sp) */ - static mp_result cf_copy(cstate_t *sp) { mp_int n = sp->elts[sp->used - 1]; @@ -1253,10 +1059,6 @@ static mp_result cf_copy(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_swap(sp) */ - static mp_result cf_swap(cstate_t *sp) { mp_int t = sp->elts[sp->used - 1]; @@ -1267,10 +1069,6 @@ static mp_result cf_swap(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_rot(sp) */ - static mp_result cf_rot(cstate_t *sp) { mp_int t = sp->elts[sp->used - 3]; @@ -1282,10 +1080,6 @@ static mp_result cf_rot(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_pick(sp) */ - static mp_result cf_pick(cstate_t *sp) { mp_int n = sp->elts[sp->used - 1]; @@ -1301,10 +1095,6 @@ static mp_result cf_pick(cstate_t *sp) return mp_int_copy(sp->elts[sp->used - 2 - pos], n); } -/* }}} */ - -/* {{{ cf_setr(sp) */ - static mp_result cf_setr(cstate_t *sp) { mp_int a = sp->elts[sp->used - 1]; @@ -1322,20 +1112,12 @@ static mp_result cf_setr(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_setbin(sp) */ - static mp_result cf_setbin(cstate_t *sp) { g_output_radix = 0; return MP_OK; } -/* }}} */ - -/* {{{ cf_help(sp) */ - static mp_result cf_help(cstate_t *sp) { int ix, maxlen = 10; /* minimum width */ @@ -1362,10 +1144,6 @@ static mp_result cf_help(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_store(*sp) */ - static mp_result cf_store(cstate_t *sp) { mp_result res; @@ -1379,10 +1157,6 @@ static mp_result cf_store(cstate_t *sp) return stack_pop(sp); } -/* }}} */ - -/* {{{ cf_recall(*sp) */ - static mp_result cf_recall(cstate_t *sp) { mp_result res; @@ -1401,19 +1175,11 @@ static mp_result cf_recall(cstate_t *sp) return stack_push(sp, val); } -/* }}} */ - -/* {{{ cf_cmem(*sp) */ - static mp_result cf_cmem(cstate_t *sp) { return mem_clear(sp); } -/* }}} */ - -/* {{{ cf_pmem(*sp) */ - static mp_result cf_pmem(cstate_t *sp) { int ix, max_len = 0; @@ -1446,10 +1212,6 @@ static mp_result cf_pmem(cstate_t *sp) return MP_OK; } -/* }}} */ - -/* {{{ cf_qrecall(*sp) */ - static mp_result cf_qrecall(cstate_t *sp) { mp_result res; @@ -1466,6 +1228,4 @@ static mp_result cf_qrecall(cstate_t *sp) return stack_push(sp, val); } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/examples/randprime.c b/polly/lib/External/isl/imath/examples/randprime.c index 84ccdc98c987..bca621894a33 100644 --- a/polly/lib/External/isl/imath/examples/randprime.c +++ b/polly/lib/External/isl/imath/examples/randprime.c @@ -132,8 +132,6 @@ int main(int argc, char *argv[]) return 0; } -/* {{{ randomize(buf, len) */ - int randomize(unsigned char *buf, size_t len) { FILE *rnd = fopen("/dev/random", "rb"); @@ -148,10 +146,6 @@ int randomize(unsigned char *buf, size_t len) return (int) nr; } -/* }}} */ - -/* {{{ mp_int_randomize(a, n_bits) */ - mp_result mp_int_randomize(mp_int a, mp_size n_bits) { mp_size n_bytes = (n_bits + CHAR_BIT - 1) / CHAR_BIT; @@ -187,10 +181,6 @@ mp_result mp_int_randomize(mp_int a, mp_size n_bits) return res; } -/* }}} */ - -/* {{{ find_prime(seed, fb) */ - mp_result find_prime(mp_int seed, FILE *fb) { mp_result res; @@ -216,10 +206,6 @@ mp_result find_prime(mp_int seed, FILE *fb) return res; } -/* }}} */ - -/* {{{ find_strong_prime(seed, fb) */ - mp_result find_strong_prime(mp_int seed, FILE *fb) { mp_result res; @@ -256,6 +242,4 @@ mp_result find_strong_prime(mp_int seed, FILE *fb) return res; } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/examples/rsakey.c b/polly/lib/External/isl/imath/examples/rsakey.c index 34190fa414f7..441e724df4c5 100644 --- a/polly/lib/External/isl/imath/examples/rsakey.c +++ b/polly/lib/External/isl/imath/examples/rsakey.c @@ -183,8 +183,6 @@ int main(int argc, char *argv[]) return 0; } -/* {{{ randomize(buf, len) */ - int randomize(unsigned char *buf, size_t len) { FILE *rnd = fopen("/dev/random", "rb"); @@ -199,10 +197,6 @@ int randomize(unsigned char *buf, size_t len) return (int) nr; } -/* }}} */ - -/* {{{ mp_int_randomize(a, n_bits) */ - mp_result mp_int_randomize(mp_int a, mp_size n_bits) { mp_size n_bytes = (n_bits + CHAR_BIT - 1) / CHAR_BIT; @@ -238,10 +232,6 @@ mp_result mp_int_randomize(mp_int a, mp_size n_bits) return res; } -/* }}} */ - -/* {{{ find_prime(seed, fb) */ - mp_result find_prime(mp_int seed, FILE *fb) { mp_result res; @@ -267,10 +257,6 @@ mp_result find_prime(mp_int seed, FILE *fb) return res; } -/* }}} */ - -/* {{{ rsa_key_init(kp) */ - mp_result rsa_key_init(rsa_key *kp) { mp_int_init(&(kp->p)); @@ -282,10 +268,6 @@ mp_result rsa_key_init(rsa_key *kp) return MP_OK; } -/* }}} */ - -/* {{{ rsa_key_clear(kp) */ - void rsa_key_clear(rsa_key *kp) { mp_int_clear(&(kp->p)); @@ -295,10 +277,6 @@ void rsa_key_clear(rsa_key *kp) mp_int_clear(&(kp->d)); } -/* }}} */ - -/* {{{ rsa_key_write(kp, ofp) */ - void rsa_key_write(rsa_key *kp, FILE *ofp) { int len; @@ -320,6 +298,4 @@ void rsa_key_write(rsa_key *kp, FILE *ofp) free(obuf); } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/gmp_compat.c b/polly/lib/External/isl/imath/gmp_compat.c index 5d89b3097dab..30b63e61ce79 100644 --- a/polly/lib/External/isl/imath/gmp_compat.c +++ b/polly/lib/External/isl/imath/gmp_compat.c @@ -326,7 +326,7 @@ char* GMPZAPI(get_str)(char *str, int radix, mp_int op) { CHECK(mp_int_to_string(op, r, str, len)); /* Change case to match gmp */ - for (i = 0; i < len; i++) + for (i = 0; i < len - 1; i++) if (radix < 0) str[i] = toupper(str[i]); else @@ -832,6 +832,7 @@ void GMPZAPI(import)(mp_int rop, size_t count, int order, size_t size, int endia /* Copy to destination */ mp_int_copy(tmp, rop); + mp_int_clear(tmp); } /* gmp: mpz_sizeinbase */ diff --git a/polly/lib/External/isl/imath/imath.c b/polly/lib/External/isl/imath/imath.c index 306678ec963b..7a767dcdf009 100644 --- a/polly/lib/External/isl/imath/imath.c +++ b/polly/lib/External/isl/imath/imath.c @@ -42,8 +42,6 @@ #define STATIC static #endif -/* {{{ Constants */ - const mp_result MP_OK = 0; /* no error, all is well */ const mp_result MP_FALSE = 0; /* boolean false */ const mp_result MP_TRUE = -1; /* boolean true */ @@ -69,15 +67,11 @@ STATIC const char *s_error_msg[] = { NULL }; -/* }}} */ - /* Argument checking macros Use CHECK() where a return value is required; NRCHECK() elsewhere */ #define CHECK(TEST) assert(TEST) #define NRCHECK(TEST) assert(TEST) -/* {{{ Logarithm table for computing output sizes */ - /* The ith entry of this table gives the value of log_i(2). An integer value n requires ceil(log_i(n)) digits to be represented @@ -102,8 +96,7 @@ STATIC const double s_log2[] = { 0.193426404, /* 36 */ }; -/* }}} */ -/* {{{ Various macros */ + /* Return the number of digits needed to represent a static value */ #define MP_VALUE_DIGITS(V) \ @@ -212,8 +205,7 @@ do{ \ #define HIGH_BIT_SET(W) ((W) >> (MP_WORD_BIT - 1)) #define ADD_WILL_OVERFLOW(W, V) ((MP_WORD_MAX - (V)) < (W)) -/* }}} */ -/* {{{ Default configuration settings */ + /* Default number of digits allocated to a new mp_int */ #if IMATH_TEST @@ -229,8 +221,6 @@ mp_size multiply_threshold = MP_MULT_THRESH; STATIC const mp_size multiply_threshold = MP_MULT_THRESH; #endif -/* }}} */ - /* Allocate a buffer of (at least) num digits, or return NULL if that couldn't be done. */ STATIC mp_digit *s_alloc(mp_size num); @@ -366,8 +356,6 @@ void s_print(char *tag, mp_int z); void s_print_buf(char *tag, mp_digit *buf, mp_size num); #endif -/* {{{ mp_int_init(z) */ - mp_result mp_int_init(mp_int z) { if (z == NULL) @@ -382,10 +370,6 @@ mp_result mp_int_init(mp_int z) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_alloc() */ - mp_int mp_int_alloc(void) { mp_int out = malloc(sizeof(mpz_t)); @@ -396,10 +380,6 @@ mp_int mp_int_alloc(void) return out; } -/* }}} */ - -/* {{{ mp_int_init_size(z, prec) */ - mp_result mp_int_init_size(mp_int z, mp_size prec) { CHECK(z != NULL); @@ -422,10 +402,6 @@ mp_result mp_int_init_size(mp_int z, mp_size prec) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_init_copy(z, old) */ - mp_result mp_int_init_copy(mp_int z, mp_int old) { mp_result res; @@ -451,10 +427,6 @@ mp_result mp_int_init_copy(mp_int z, mp_int old) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_init_value(z, value) */ - mp_result mp_int_init_value(mp_int z, mp_small value) { mpz_t vtmp; @@ -464,10 +436,6 @@ mp_result mp_int_init_value(mp_int z, mp_small value) return mp_int_init_copy(z, &vtmp); } -/* }}} */ - -/* {{{ mp_int_init_uvalue(z, uvalue) */ - mp_result mp_int_init_uvalue(mp_int z, mp_usmall uvalue) { mpz_t vtmp; @@ -477,10 +445,6 @@ mp_result mp_int_init_uvalue(mp_int z, mp_usmall uvalue) return mp_int_init_copy(z, &vtmp); } -/* }}} */ - -/* {{{ mp_int_set_value(z, value) */ - mp_result mp_int_set_value(mp_int z, mp_small value) { mpz_t vtmp; @@ -490,10 +454,6 @@ mp_result mp_int_set_value(mp_int z, mp_small value) return mp_int_copy(&vtmp, z); } -/* }}} */ - -/* {{{ mp_int_set_uvalue(z, value) */ - mp_result mp_int_set_uvalue(mp_int z, mp_usmall uvalue) { mpz_t vtmp; @@ -503,10 +463,6 @@ mp_result mp_int_set_uvalue(mp_int z, mp_usmall uvalue) return mp_int_copy(&vtmp, z); } -/* }}} */ - -/* {{{ mp_int_clear(z) */ - void mp_int_clear(mp_int z) { if (z == NULL) @@ -520,10 +476,6 @@ void mp_int_clear(mp_int z) } } -/* }}} */ - -/* {{{ mp_int_free(z) */ - void mp_int_free(mp_int z) { NRCHECK(z != NULL); @@ -532,10 +484,6 @@ void mp_int_free(mp_int z) free(z); /* note: NOT s_free() */ } -/* }}} */ - -/* {{{ mp_int_copy(a, c) */ - mp_result mp_int_copy(mp_int a, mp_int c) { CHECK(a != NULL && c != NULL); @@ -557,10 +505,6 @@ mp_result mp_int_copy(mp_int a, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_swap(a, c) */ - void mp_int_swap(mp_int a, mp_int c) { if (a != c) { @@ -576,10 +520,6 @@ void mp_int_swap(mp_int a, mp_int c) } } -/* }}} */ - -/* {{{ mp_int_zero(z) */ - void mp_int_zero(mp_int z) { NRCHECK(z != NULL); @@ -589,10 +529,6 @@ void mp_int_zero(mp_int z) MP_SIGN(z) = MP_ZPOS; } -/* }}} */ - -/* {{{ mp_int_abs(a, c) */ - mp_result mp_int_abs(mp_int a, mp_int c) { mp_result res; @@ -606,10 +542,6 @@ mp_result mp_int_abs(mp_int a, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_neg(a, c) */ - mp_result mp_int_neg(mp_int a, mp_int c) { mp_result res; @@ -625,10 +557,6 @@ mp_result mp_int_neg(mp_int a, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_add(a, b, c) */ - mp_result mp_int_add(mp_int a, mp_int b, mp_int c) { mp_size ua, ub, uc, max; @@ -694,10 +622,6 @@ mp_result mp_int_add(mp_int a, mp_int b, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_add_value(a, value, c) */ - mp_result mp_int_add_value(mp_int a, mp_small value, mp_int c) { mpz_t vtmp; @@ -708,10 +632,6 @@ mp_result mp_int_add_value(mp_int a, mp_small value, mp_int c) return mp_int_add(a, &vtmp, c); } -/* }}} */ - -/* {{{ mp_int_sub(a, b, c) */ - mp_result mp_int_sub(mp_int a, mp_int b, mp_int c) { mp_size ua, ub, uc, max; @@ -772,10 +692,6 @@ mp_result mp_int_sub(mp_int a, mp_int b, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_sub_value(a, value, c) */ - mp_result mp_int_sub_value(mp_int a, mp_small value, mp_int c) { mpz_t vtmp; @@ -786,10 +702,6 @@ mp_result mp_int_sub_value(mp_int a, mp_small value, mp_int c) return mp_int_sub(a, &vtmp, c); } -/* }}} */ - -/* {{{ mp_int_mul(a, b, c) */ - mp_result mp_int_mul(mp_int a, mp_int b, mp_int c) { mp_digit *out; @@ -848,10 +760,6 @@ mp_result mp_int_mul(mp_int a, mp_int b, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_mul_value(a, value, c) */ - mp_result mp_int_mul_value(mp_int a, mp_small value, mp_int c) { mpz_t vtmp; @@ -862,10 +770,6 @@ mp_result mp_int_mul_value(mp_int a, mp_small value, mp_int c) return mp_int_mul(a, &vtmp, c); } -/* }}} */ - -/* {{{ mp_int_mul_pow2(a, p2, c) */ - mp_result mp_int_mul_pow2(mp_int a, mp_small p2, mp_int c) { mp_result res; @@ -880,10 +784,6 @@ mp_result mp_int_mul_pow2(mp_int a, mp_small p2, mp_int c) return MP_MEMORY; } -/* }}} */ - -/* {{{ mp_int_sqr(a, c) */ - mp_result mp_int_sqr(mp_int a, mp_int c) { mp_digit *out; @@ -927,10 +827,6 @@ mp_result mp_int_sqr(mp_int a, mp_int c) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_div(a, b, q, r) */ - mp_result mp_int_div(mp_int a, mp_int b, mp_int q, mp_int r) { int cmp, lg; @@ -1029,10 +925,6 @@ mp_result mp_int_div(mp_int a, mp_int b, mp_int q, mp_int r) return res; } -/* }}} */ - -/* {{{ mp_int_mod(a, m, c) */ - mp_result mp_int_mod(mp_int a, mp_int m, mp_int c) { mp_result res; @@ -1062,10 +954,6 @@ mp_result mp_int_mod(mp_int a, mp_int m, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_div_value(a, value, q, r) */ - mp_result mp_int_div_value(mp_int a, mp_small value, mp_int q, mp_small *r) { mpz_t vtmp, rtmp; @@ -1086,10 +974,6 @@ mp_result mp_int_div_value(mp_int a, mp_small value, mp_int q, mp_small *r) return res; } -/* }}} */ - -/* {{{ mp_int_div_pow2(a, p2, q, r) */ - mp_result mp_int_div_pow2(mp_int a, mp_small p2, mp_int q, mp_int r) { mp_result res = MP_OK; @@ -1105,10 +989,6 @@ mp_result mp_int_div_pow2(mp_int a, mp_small p2, mp_int q, mp_int r) return res; } -/* }}} */ - -/* {{{ mp_int_expt(a, b, c) */ - mp_result mp_int_expt(mp_int a, mp_small b, mp_int c) { mpz_t t; @@ -1141,10 +1021,6 @@ mp_result mp_int_expt(mp_int a, mp_small b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_expt_value(a, b, c) */ - mp_result mp_int_expt_value(mp_small a, mp_small b, mp_int c) { mpz_t t; @@ -1177,10 +1053,6 @@ mp_result mp_int_expt_value(mp_small a, mp_small b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_expt_full(a, b, c) */ - mp_result mp_int_expt_full(mp_int a, mp_int b, mp_int c) { mpz_t t; @@ -1217,10 +1089,6 @@ mp_result mp_int_expt_full(mp_int a, mp_int b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_compare(a, b) */ - int mp_int_compare(mp_int a, mp_int b) { mp_sign sa; @@ -1247,10 +1115,6 @@ int mp_int_compare(mp_int a, mp_int b) } } -/* }}} */ - -/* {{{ mp_int_compare_unsigned(a, b) */ - int mp_int_compare_unsigned(mp_int a, mp_int b) { NRCHECK(a != NULL && b != NULL); @@ -1258,10 +1122,6 @@ int mp_int_compare_unsigned(mp_int a, mp_int b) return s_ucmp(a, b); } -/* }}} */ - -/* {{{ mp_int_compare_zero(z) */ - int mp_int_compare_zero(mp_int z) { NRCHECK(z != NULL); @@ -1274,10 +1134,6 @@ int mp_int_compare_zero(mp_int z) return -1; } -/* }}} */ - -/* {{{ mp_int_compare_value(z, value) */ - int mp_int_compare_value(mp_int z, mp_small value) { mp_sign vsign = (value < 0) ? MP_NEG : MP_ZPOS; @@ -1295,10 +1151,6 @@ int mp_int_compare_value(mp_int z, mp_small value) } } -/* }}} */ - -/* {{{ mp_int_compare_uvalue(z, uv) */ - int mp_int_compare_uvalue(mp_int z, mp_usmall uv) { CHECK(z != NULL); @@ -1309,10 +1161,6 @@ int mp_int_compare_uvalue(mp_int z, mp_usmall uv) return s_uvcmp(z, uv); } -/* }}} */ - -/* {{{ mp_int_exptmod(a, b, m, c) */ - mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, mp_int c) { mp_result res; @@ -1353,10 +1201,6 @@ mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_exptmod_evalue(a, value, m, c) */ - mp_result mp_int_exptmod_evalue(mp_int a, mp_small value, mp_int m, mp_int c) { mpz_t vtmp; @@ -1367,10 +1211,6 @@ mp_result mp_int_exptmod_evalue(mp_int a, mp_small value, mp_int m, mp_int c) return mp_int_exptmod(a, &vtmp, m, c); } -/* }}} */ - -/* {{{ mp_int_exptmod_bvalue(v, b, m, c) */ - mp_result mp_int_exptmod_bvalue(mp_small value, mp_int b, mp_int m, mp_int c) { @@ -1382,10 +1222,6 @@ mp_result mp_int_exptmod_bvalue(mp_small value, mp_int b, return mp_int_exptmod(&vtmp, b, m, c); } -/* }}} */ - -/* {{{ mp_int_exptmod_known(a, b, m, mu, c) */ - mp_result mp_int_exptmod_known(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c) { mp_result res; @@ -1423,10 +1259,6 @@ mp_result mp_int_exptmod_known(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c return res; } -/* }}} */ - -/* {{{ mp_int_redux_const(m, c) */ - mp_result mp_int_redux_const(mp_int m, mp_int c) { CHECK(m != NULL && c != NULL && m != c); @@ -1434,10 +1266,6 @@ mp_result mp_int_redux_const(mp_int m, mp_int c) return s_brmu(c, m); } -/* }}} */ - -/* {{{ mp_int_invmod(a, m, c) */ - mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c) { mp_result res; @@ -1480,10 +1308,6 @@ mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_gcd(a, b, c) */ - /* Binary GCD algorithm due to Josef Stein, 1961 */ mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c) { @@ -1559,10 +1383,6 @@ mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_egcd(a, b, c, x, y) */ - /* This is the binary GCD algorithm again, but this time we keep track of the elementary matrix operations as we go, so we can get values x and y satisfying c = ax + by. @@ -1675,10 +1495,6 @@ mp_result mp_int_egcd(mp_int a, mp_int b, mp_int c, return res; } -/* }}} */ - -/* {{{ mp_int_lcm(a, b, c) */ - mp_result mp_int_lcm(mp_int a, mp_int b, mp_int c) { mpz_t lcm; @@ -1709,10 +1525,6 @@ mp_result mp_int_lcm(mp_int a, mp_int b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_divisible_value(a, v) */ - int mp_int_divisible_value(mp_int a, mp_small v) { mp_small rem = 0; @@ -1723,10 +1535,6 @@ int mp_int_divisible_value(mp_int a, mp_small v) return rem == 0; } -/* }}} */ - -/* {{{ mp_int_is_pow2(z) */ - int mp_int_is_pow2(mp_int z) { CHECK(z != NULL); @@ -1734,10 +1542,6 @@ int mp_int_is_pow2(mp_int z) return s_isp2(z); } -/* }}} */ - -/* {{{ mp_int_root(a, b, c) */ - /* Implementation of Newton's root finding method, based loosely on a patch contributed by Hal Finkel modified by M. J. Fromberger. @@ -1806,10 +1610,6 @@ mp_result mp_int_root(mp_int a, mp_small b, mp_int c) return res; } -/* }}} */ - -/* {{{ mp_int_to_int(z, *out) */ - mp_result mp_int_to_int(mp_int z, mp_small *out) { mp_usmall uv = 0; @@ -1840,10 +1640,6 @@ mp_result mp_int_to_int(mp_int z, mp_small *out) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_to_uint(z, *out) */ - mp_result mp_int_to_uint(mp_int z, mp_usmall *out) { mp_usmall uv = 0; @@ -1873,10 +1669,6 @@ mp_result mp_int_to_uint(mp_int z, mp_usmall *out) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_to_string(z, radix, str, limit) */ - mp_result mp_int_to_string(mp_int z, mp_size radix, char *str, int limit) { @@ -1933,10 +1725,6 @@ mp_result mp_int_to_string(mp_int z, mp_size radix, return MP_TRUNC; } -/* }}} */ - -/* {{{ mp_int_string_len(z, radix) */ - mp_result mp_int_string_len(mp_int z, mp_size radix) { int len; @@ -1955,20 +1743,12 @@ mp_result mp_int_string_len(mp_int z, mp_size radix) return len; } -/* }}} */ - -/* {{{ mp_int_read_string(z, radix, *str) */ - /* Read zero-terminated string into z */ mp_result mp_int_read_string(mp_int z, mp_size radix, const char *str) { return mp_int_read_cstring(z, radix, str, NULL); } -/* }}} */ - -/* {{{ mp_int_read_cstring(z, radix, *str, **end) */ - mp_result mp_int_read_cstring(mp_int z, mp_size radix, const char *str, char **end) { int ch; @@ -2028,10 +1808,6 @@ mp_result mp_int_read_cstring(mp_int z, mp_size radix, const char *str, char **e return MP_OK; } -/* }}} */ - -/* {{{ mp_int_count_bits(z) */ - mp_result mp_int_count_bits(mp_int z) { mp_size nbits = 0, uz; @@ -2055,10 +1831,6 @@ mp_result mp_int_count_bits(mp_int z) return nbits; } -/* }}} */ - -/* {{{ mp_int_to_binary(z, buf, limit) */ - mp_result mp_int_to_binary(mp_int z, unsigned char *buf, int limit) { static const int PAD_FOR_2C = 1; @@ -2076,10 +1848,6 @@ mp_result mp_int_to_binary(mp_int z, unsigned char *buf, int limit) return res; } -/* }}} */ - -/* {{{ mp_int_read_binary(z, buf, len) */ - mp_result mp_int_read_binary(mp_int z, unsigned char *buf, int len) { mp_size need, i; @@ -2115,10 +1883,6 @@ mp_result mp_int_read_binary(mp_int z, unsigned char *buf, int len) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_binary_len(z) */ - mp_result mp_int_binary_len(mp_int z) { mp_result res = mp_int_count_bits(z); @@ -2138,10 +1902,6 @@ mp_result mp_int_binary_len(mp_int z) return bytes; } -/* }}} */ - -/* {{{ mp_int_to_unsigned(z, buf, limit) */ - mp_result mp_int_to_unsigned(mp_int z, unsigned char *buf, int limit) { static const int NO_PADDING = 0; @@ -2151,10 +1911,6 @@ mp_result mp_int_to_unsigned(mp_int z, unsigned char *buf, int limit) return s_tobin(z, buf, &limit, NO_PADDING); } -/* }}} */ - -/* {{{ mp_int_read_unsigned(z, buf, len) */ - mp_result mp_int_read_unsigned(mp_int z, unsigned char *buf, int len) { mp_size need, i; @@ -2177,10 +1933,6 @@ mp_result mp_int_read_unsigned(mp_int z, unsigned char *buf, int len) return MP_OK; } -/* }}} */ - -/* {{{ mp_int_unsigned_len(z) */ - mp_result mp_int_unsigned_len(mp_int z) { mp_result res = mp_int_count_bits(z); @@ -2194,10 +1946,6 @@ mp_result mp_int_unsigned_len(mp_int z) return bytes; } -/* }}} */ - -/* {{{ mp_error_string(res) */ - const char *mp_error_string(mp_result res) { int ix; @@ -2214,13 +1962,9 @@ const char *mp_error_string(mp_result res) return s_unknown_err; } -/* }}} */ - /*------------------------------------------------------------------------*/ /* Private functions for internal use. These make assumptions. */ -/* {{{ s_alloc(num) */ - STATIC mp_digit *s_alloc(mp_size num) { mp_digit *out = malloc(num * sizeof(mp_digit)); @@ -2239,10 +1983,6 @@ STATIC mp_digit *s_alloc(mp_size num) return out; } -/* }}} */ - -/* {{{ s_realloc(old, osize, nsize) */ - STATIC mp_digit *s_realloc(mp_digit *old, mp_size osize, mp_size nsize) { #if DEBUG > 1 @@ -2261,19 +2001,11 @@ STATIC mp_digit *s_realloc(mp_digit *old, mp_size osize, mp_size nsize) return new; } -/* }}} */ - -/* {{{ s_free(ptr) */ - STATIC void s_free(void *ptr) { free(ptr); } -/* }}} */ - -/* {{{ s_pad(z, min) */ - STATIC int s_pad(mp_int z, mp_size min) { if (MP_ALLOC(z) < min) { @@ -2296,10 +2028,6 @@ STATIC int s_pad(mp_int z, mp_size min) return 1; } -/* }}} */ - -/* {{{ s_fake(z, value, vbuf[]) */ - /* Note: This will not work correctly when value == MP_SMALL_MIN */ STATIC void s_fake(mp_int z, mp_small value, mp_digit vbuf[]) { @@ -2309,10 +2037,6 @@ STATIC void s_fake(mp_int z, mp_small value, mp_digit vbuf[]) z->sign = MP_NEG; } -/* }}} */ - -/* {{{ s_ufake(z, value, vbuf[]) */ - STATIC void s_ufake(mp_int z, mp_usmall value, mp_digit vbuf[]) { mp_size ndig = (mp_size) s_uvpack(value, vbuf); @@ -2323,10 +2047,6 @@ STATIC void s_ufake(mp_int z, mp_usmall value, mp_digit vbuf[]) z->digits = vbuf; } -/* }}} */ - -/* {{{ s_cdig(da, db, len) */ - STATIC int s_cdig(mp_digit *da, mp_digit *db, mp_size len) { mp_digit *dat = da + len - 1, *dbt = db + len - 1; @@ -2341,10 +2061,6 @@ STATIC int s_cdig(mp_digit *da, mp_digit *db, mp_size len) return 0; } -/* }}} */ - -/* {{{ s_uvpack(uv, t[]) */ - STATIC int s_uvpack(mp_usmall uv, mp_digit t[]) { int ndig = 0; @@ -2362,10 +2078,6 @@ STATIC int s_uvpack(mp_usmall uv, mp_digit t[]) return ndig; } -/* }}} */ - -/* {{{ s_ucmp(a, b) */ - STATIC int s_ucmp(mp_int a, mp_int b) { mp_size ua = MP_USED(a), ub = MP_USED(b); @@ -2378,20 +2090,12 @@ STATIC int s_ucmp(mp_int a, mp_int b) return s_cdig(MP_DIGITS(a), MP_DIGITS(b), ua); } -/* }}} */ - -/* {{{ s_vcmp(a, v) */ - STATIC int s_vcmp(mp_int a, mp_small v) { mp_usmall uv = (mp_usmall) (v < 0) ? -v : v; return s_uvcmp(a, uv); } -/* }}} */ - -/* {{{ s_uvcmp(a, v) */ - STATIC int s_uvcmp(mp_int a, mp_usmall uv) { mpz_t vtmp; @@ -2401,10 +2105,6 @@ STATIC int s_uvcmp(mp_int a, mp_usmall uv) return s_ucmp(a, &vtmp); } -/* }}} */ - -/* {{{ s_uadd(da, db, dc, size_a, size_b) */ - STATIC mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, mp_size size_b) { @@ -2436,10 +2136,6 @@ STATIC mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, return (mp_digit)w; } -/* }}} */ - -/* {{{ s_usub(da, db, dc, size_a, size_b) */ - STATIC void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, mp_size size_b) { @@ -2471,10 +2167,6 @@ STATIC void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, assert(w == 0); } -/* }}} */ - -/* {{{ s_kmul(da, db, dc, size_a, size_b) */ - STATIC int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, mp_size size_b) { @@ -2560,10 +2252,6 @@ STATIC int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, return 1; } -/* }}} */ - -/* {{{ s_umul(da, db, dc, size_a, size_b) */ - STATIC void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, mp_size size_b) { @@ -2589,10 +2277,6 @@ STATIC void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, } } -/* }}} */ - -/* {{{ s_ksqr(da, dc, size_a) */ - STATIC int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a) { if (multiply_threshold && size_a > multiply_threshold) { @@ -2646,10 +2330,6 @@ STATIC int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a) return 1; } -/* }}} */ - -/* {{{ s_usqr(da, dc, size_a) */ - STATIC void s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a) { mp_size i, j; @@ -2702,10 +2382,6 @@ STATIC void s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a) } } -/* }}} */ - -/* {{{ s_dadd(a, b) */ - STATIC void s_dadd(mp_int a, mp_digit b) { mp_word w = 0; @@ -2729,10 +2405,6 @@ STATIC void s_dadd(mp_int a, mp_digit b) } } -/* }}} */ - -/* {{{ s_dmul(a, b) */ - STATIC void s_dmul(mp_int a, mp_digit b) { mp_word w = 0; @@ -2752,10 +2424,6 @@ STATIC void s_dmul(mp_int a, mp_digit b) } } -/* }}} */ - -/* {{{ s_dbmul(da, b, dc, size_a) */ - STATIC void s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc, mp_size size_a) { mp_word w = 0; @@ -2772,10 +2440,6 @@ STATIC void s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc, mp_size size_a) *dc = LOWER_HALF(w); } -/* }}} */ - -/* {{{ s_ddiv(da, d, dc, size_a) */ - STATIC mp_digit s_ddiv(mp_int a, mp_digit b) { mp_word w = 0, qdigit; @@ -2800,10 +2464,6 @@ STATIC mp_digit s_ddiv(mp_int a, mp_digit b) return (mp_digit)w; } -/* }}} */ - -/* {{{ s_qdiv(z, p2) */ - STATIC void s_qdiv(mp_int z, mp_size p2) { mp_size ndig = p2 / MP_DIGIT_BIT, nbits = p2 % MP_DIGIT_BIT; @@ -2847,10 +2507,6 @@ STATIC void s_qdiv(mp_int z, mp_size p2) MP_SIGN(z) = MP_ZPOS; } -/* }}} */ - -/* {{{ s_qmod(z, p2) */ - STATIC void s_qmod(mp_int z, mp_size p2) { mp_size start = p2 / MP_DIGIT_BIT + 1, rest = p2 % MP_DIGIT_BIT; @@ -2864,10 +2520,6 @@ STATIC void s_qmod(mp_int z, mp_size p2) } } -/* }}} */ - -/* {{{ s_qmul(z, p2) */ - STATIC int s_qmul(mp_int z, mp_size p2) { mp_size uz, need, rest, extra, i; @@ -2929,10 +2581,6 @@ STATIC int s_qmul(mp_int z, mp_size p2) return 1; } -/* }}} */ - -/* {{{ s_qsub(z, p2) */ - /* Compute z = 2^p2 - |z|; requires that 2^p2 >= |z| The sign of the result is always zero/positive. */ @@ -2963,10 +2611,6 @@ STATIC int s_qsub(mp_int z, mp_size p2) return 1; } -/* }}} */ - -/* {{{ s_dp2k(z) */ - STATIC int s_dp2k(mp_int z) { int k = 0; @@ -2989,10 +2633,6 @@ STATIC int s_dp2k(mp_int z) return k; } -/* }}} */ - -/* {{{ s_isp2(z) */ - STATIC int s_isp2(mp_int z) { mp_size uz = MP_USED(z), k = 0; @@ -3015,10 +2655,6 @@ STATIC int s_isp2(mp_int z) return (int) k; } -/* }}} */ - -/* {{{ s_2expt(z, k) */ - STATIC int s_2expt(mp_int z, mp_small k) { mp_size ndig, rest; @@ -3038,10 +2674,6 @@ STATIC int s_2expt(mp_int z, mp_small k) return 1; } -/* }}} */ - -/* {{{ s_norm(a, b) */ - STATIC int s_norm(mp_int a, mp_int b) { mp_digit d = b->digits[MP_USED(b) - 1]; @@ -3061,10 +2693,6 @@ STATIC int s_norm(mp_int a, mp_int b) return k; } -/* }}} */ - -/* {{{ s_brmu(z, m) */ - STATIC mp_result s_brmu(mp_int z, mp_int m) { mp_size um = MP_USED(m) * 2; @@ -3076,10 +2704,6 @@ STATIC mp_result s_brmu(mp_int z, mp_int m) return mp_int_div(z, m, z, NULL); } -/* }}} */ - -/* {{{ s_reduce(x, m, mu, q1, q2) */ - STATIC int s_reduce(mp_int x, mp_int m, mp_int mu, mp_int q1, mp_int q2) { mp_size um = MP_USED(m), umb_p1, umb_m1; @@ -3123,10 +2747,6 @@ STATIC int s_reduce(mp_int x, mp_int m, mp_int mu, mp_int q1, mp_int q2) return 1; } -/* }}} */ - -/* {{{ s_embar(a, b, m, mu, c) */ - /* Perform modular exponentiation using Barrett's method, where mu is the reduction constant for m. Assumes a < m, b > 0. */ STATIC mp_result s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c) @@ -3196,16 +2816,13 @@ STATIC mp_result s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c) return res; } -/* }}} */ - #if 0 -/* {{{ s_udiv(a, b) */ -/* The s_udiv function produces incorrect results. For example, with test +/* + The s_udiv function produces incorrect results. For example, with test div:11141460315522012760862883825:48318382095:0,230584300062375935 commenting out the function for now and using s_udiv_knuth instead. STATIC mp_result s_udiv(mp_int a, mp_int b); */ - /* Precondition: a >= b and b > 0 Postcondition: a' = a / b, b' = a % b */ @@ -3297,8 +2914,6 @@ STATIC mp_result s_udiv(mp_int a, mp_int b) mp_int_clear(&q); return res; } - -/* }}} */ #endif /* Division of nonnegative integers @@ -3466,8 +3081,9 @@ STATIC mp_result s_udiv_knuth(mp_int u, mp_int v) { /************************************************************/ /* D5: Test remainder */ /* note: Not needed because we always check that qhat is the correct value - * before performing the subtract. */ - q.digits[j] = qhat; + * before performing the subtract. + * Value cast to mp_digit to prevent warning, qhat has been clamped to MP_DIGIT_MAX */ + q.digits[j] = (mp_digit)qhat; /************************************************************/ /* D6: Add back */ @@ -3498,8 +3114,6 @@ STATIC mp_result s_udiv_knuth(mp_int u, mp_int v) { return res; } -/* {{{ s_outlen(z, r) */ - STATIC int s_outlen(mp_int z, mp_size r) { mp_result bits; @@ -3513,10 +3127,6 @@ STATIC int s_outlen(mp_int z, mp_size r) return (int)(raw + 0.999999); } -/* }}} */ - -/* {{{ s_inlen(len, r) */ - STATIC mp_size s_inlen(int len, mp_size r) { double raw = (double)len / s_log2[r]; @@ -3525,10 +3135,6 @@ STATIC mp_size s_inlen(int len, mp_size r) return (mp_size)((bits + (MP_DIGIT_BIT - 1)) / MP_DIGIT_BIT) + 1; } -/* }}} */ - -/* {{{ s_ch2val(c, r) */ - STATIC int s_ch2val(char c, int r) { int out; @@ -3543,10 +3149,6 @@ STATIC int s_ch2val(char c, int r) return (out >= r) ? -1 : out; } -/* }}} */ - -/* {{{ s_val2ch(v, caps) */ - STATIC char s_val2ch(int v, int caps) { assert(v >= 0); @@ -3563,10 +3165,6 @@ STATIC char s_val2ch(int v, int caps) } } -/* }}} */ - -/* {{{ s_2comp(buf, len) */ - STATIC void s_2comp(unsigned char *buf, int len) { int i; @@ -3585,10 +3183,6 @@ STATIC void s_2comp(unsigned char *buf, int len) /* last carry out is ignored */ } -/* }}} */ - -/* {{{ s_tobin(z, buf, *limpos) */ - STATIC mp_result s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad) { mp_size uz; @@ -3631,10 +3225,6 @@ STATIC mp_result s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad) return (uz == 0) ? MP_OK : MP_TRUNC; } -/* }}} */ - -/* {{{ s_print(tag, z) */ - #if DEBUG void s_print(char *tag, mp_int z) { @@ -3663,6 +3253,4 @@ void s_print_buf(char *tag, mp_digit *buf, mp_size num) } #endif -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/imdrover.c b/polly/lib/External/isl/imath/imdrover.c index be0de16cc8fe..148561311a1f 100644 --- a/polly/lib/External/isl/imath/imdrover.c +++ b/polly/lib/External/isl/imath/imdrover.c @@ -99,8 +99,6 @@ static void done_testing(void); /*------------------------------------------------------------------------*/ /* Utility subroutines for writing tests (explained above) */ -/* {{{ read_int_value(z, str) */ - static mp_result read_int_value(mp_int z, char *str) { int radix = 10; @@ -129,10 +127,6 @@ static mp_result read_int_value(mp_int z, char *str) return mp_int_read_string(z, radix, str); } -/* }}} */ - -/* {{{ read_rat_value(q, str) */ - static mp_result read_rat_value(mp_rat q, char *str) { int radix = 10; @@ -164,10 +158,6 @@ static mp_result read_rat_value(mp_rat q, char *str) return mp_rat_read_string(q, radix, str); } -/* }}} */ - -/* {{{ read_long(z, str) */ - static int read_long(long *z, char *str) { char *end; @@ -198,10 +188,6 @@ static int read_long(long *z, char *str) return (end != str && *end == '\0'); } -/* }}} */ - -/* {{{ parse_int_values(t, in, out) */ - static int parse_int_values(testspec_t* t, mp_int* in, mp_int* out, mp_result* rval) { @@ -283,10 +269,6 @@ static int parse_int_values(testspec_t* t, mp_int* in, mp_int* out, return 1; } -/* }}} */ - -/* {{{ parse_rat_values(t, in, out) */ - static int parse_rat_values(testspec_t* t, mp_rat *in, mp_rat *out, mp_result *rval) { @@ -368,10 +350,6 @@ static int parse_rat_values(testspec_t* t, mp_rat *in, mp_rat *out, return 1; } -/* }}} */ - -/* {{{ parse_result_code(str, *code) */ - static int parse_result_code(char *str, mp_result *code) { if (str[0] == '$') { @@ -411,10 +389,6 @@ static int parse_result_code(char *str, mp_result *code) return 1; } -/* }}} */ - -/* {{{ parse_binary(str, buf, limit) */ - static int parse_binary(char *str, unsigned char *buf, int limit) { int pos = 0; @@ -436,10 +410,6 @@ static int parse_binary(char *str, unsigned char *buf, int limit) return pos; } -/* }}} */ - -/* {{{ done_testing() */ - static void done_testing(void) { int i; @@ -450,13 +420,9 @@ static void done_testing(void) } } -/* }}} */ - /*------------------------------------------------------------------------*/ /* Global functions visible to callers outside this file */ -/* {{{ init_testing() */ - void init_testing(void) { static int is_done = 0; @@ -476,10 +442,6 @@ void init_testing(void) is_done = 1; } -/* }}} */ - -/* {{{ reset_registers() */ - void reset_registers(void) { int i; @@ -490,8 +452,6 @@ void reset_registers(void) } } -/* }}} */ - int test_init(testspec_t* t, FILE* ofp) { mp_int in[2], out[1]; @@ -545,8 +505,6 @@ int test_set(testspec_t* t, FILE* ofp) return 1; } -/* {{{ test_neg(t, ofp) */ - int test_neg(testspec_t* t, FILE* ofp) { mp_int in[2], out[1]; @@ -563,10 +521,6 @@ int test_neg(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_abs(t, ofp) */ - int test_abs(testspec_t* t, FILE* ofp) { mp_int in[2], out[1]; @@ -583,10 +537,6 @@ int test_abs(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_add(t, ofp) */ - int test_add(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -611,10 +561,6 @@ int test_add(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_sub(t, ofp) */ - int test_sub(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -638,10 +584,6 @@ int test_sub(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_mul(t, ofp) */ - int test_mul(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -657,10 +599,6 @@ int test_mul(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_mulp2(t, ofp) */ - int test_mulp2(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -678,10 +616,6 @@ int test_mulp2(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_mulv(t, ofp) */ - int test_mulv(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -699,10 +633,6 @@ int test_mulv(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_sqr(t, ofp) */ - int test_sqr(testspec_t* t, FILE* ofp) { mp_int in[2], out[1]; @@ -718,10 +648,6 @@ int test_sqr(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_div(t, ofp) */ - int test_div(testspec_t* t, FILE* ofp) { mp_int in[4], out[2]; @@ -745,10 +671,6 @@ int test_div(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_divp2(t, ofp) */ - int test_divp2(testspec_t* t, FILE* ofp) { mp_int in[4], out[2]; @@ -774,10 +696,6 @@ int test_divp2(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_divv(t, ofp) */ - int test_divv(testspec_t* t, FILE* ofp) { mp_int in[3], out[2]; @@ -802,10 +720,6 @@ int test_divv(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_expt(t, ofp) */ - int test_expt(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -823,10 +737,6 @@ int test_expt(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_exptv(t, ofp) */ - int test_exptv(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -845,10 +755,6 @@ int test_exptv(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_exptf(t, ofp) */ - int test_exptf(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -864,10 +770,6 @@ int test_exptf(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_mod(t, ofp) */ - int test_mod(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -883,10 +785,6 @@ int test_mod(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_gcd(t, ofp) */ - int test_gcd(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -902,10 +800,6 @@ int test_gcd(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_egcd(t, ofp) */ - int test_egcd(testspec_t* t, FILE* ofp) { mp_int in[5], out[3], t1 = g_zreg + 8, t2 = g_zreg + 9; @@ -945,10 +839,6 @@ int test_egcd(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_lcm(t, ofp) */ - int test_lcm(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -964,10 +854,6 @@ int test_lcm(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_sqrt(t, ofp) */ - int test_sqrt(testspec_t* t, FILE* ofp) { mp_int in[2], out[1]; @@ -983,10 +869,6 @@ int test_sqrt(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_root(t, ofp) */ - int test_root(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -1004,10 +886,6 @@ int test_root(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_invmod(t, ofp) */ - int test_invmod(testspec_t* t, FILE* ofp) { mp_int in[3], out[1]; @@ -1023,10 +901,6 @@ int test_invmod(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_exptmod(t, ofp) */ - int test_exptmod(testspec_t* t, FILE* ofp) { mp_int in[4], out[1]; @@ -1042,10 +916,6 @@ int test_exptmod(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_exptmod_ev(t, ofp) */ - int test_exptmod_ev(testspec_t* t, FILE* ofp) { mp_int in[4], out[1]; @@ -1063,10 +933,6 @@ int test_exptmod_ev(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_exptmod_bv(t, ofp) */ - int test_exptmod_bv(testspec_t* t, FILE* ofp) { mp_int in[4], out[1]; @@ -1084,10 +950,6 @@ int test_exptmod_bv(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_comp(t, ofp) */ - int test_comp(testspec_t* t, FILE* ofp) { mp_int in[2]; @@ -1103,10 +965,6 @@ int test_comp(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_ucomp(t, ofp) */ - int test_ucomp(testspec_t* t, FILE* ofp) { mp_int in[2]; @@ -1122,10 +980,6 @@ int test_ucomp(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_zcomp(t, ofp) */ - int test_zcomp(testspec_t* t, FILE* ofp) { mp_int in[1]; @@ -1141,10 +995,6 @@ int test_zcomp(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_vcomp(t, ofp) */ - int test_vcomp(testspec_t* t, FILE* ofp) { mp_int in[2]; @@ -1162,10 +1012,6 @@ int test_vcomp(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_uvcomp(t, ofp) */ - int test_uvcomp(testspec_t* t, FILE* ofp) { mp_int in[2]; @@ -1183,10 +1029,6 @@ int test_uvcomp(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_tostr(t, ofp) */ - int test_tostr(testspec_t* t, FILE* ofp) { mp_int in[2]; @@ -1210,10 +1052,6 @@ int test_tostr(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_tobin(t, ofp) */ - int test_tobin(testspec_t* t, FILE* ofp) { mp_int in[1]; @@ -1245,10 +1083,6 @@ int test_tobin(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_to_int(t, ofp) */ - int test_to_int(testspec_t* t, FILE* ofp) { mp_int in[1], out[1]; @@ -1265,10 +1099,6 @@ int test_to_int(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_to_uint(t, ofp) */ - int test_to_uint(testspec_t* t, FILE* ofp) { mp_int in[1], out[1]; @@ -1285,10 +1115,6 @@ int test_to_uint(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_read_binary(t, ofp) */ - int test_read_binary(testspec_t* t, FILE* ofp) { mp_int out[1], in = g_zreg + 1; @@ -1310,10 +1136,6 @@ int test_read_binary(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_to_uns(t, ofp) */ - int test_to_uns(testspec_t* t, FILE* ofp) { mp_int in[1]; @@ -1345,10 +1167,6 @@ int test_to_uns(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_read_uns(t, ofp) */ - int test_read_uns(testspec_t* t, FILE* ofp) { mp_int out[1], in = g_zreg + 1; @@ -1370,10 +1188,6 @@ int test_read_uns(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_meta(t, ofp) */ - int test_meta(testspec_t* t, FILE* ofp) { mp_int *in = NULL, *out = NULL; @@ -1413,10 +1227,6 @@ int test_meta(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qneg(t, ofp) */ - int test_qneg(testspec_t* t, FILE* ofp) { mp_rat in[2], out[1]; @@ -1432,10 +1242,6 @@ int test_qneg(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qrecip(t, ofp) */ - int test_qrecip(testspec_t* t, FILE* ofp) { mp_rat in[2], out[1]; @@ -1451,10 +1257,6 @@ int test_qrecip(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qabs(t, ofp) */ - int test_qabs(testspec_t* t, FILE* ofp) { mp_rat in[2], out[1]; @@ -1470,10 +1272,6 @@ int test_qabs(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qadd(t, ofp) */ - int test_qadd(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1489,10 +1287,6 @@ int test_qadd(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qsub(t, ofp) */ - int test_qsub(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1508,10 +1302,6 @@ int test_qsub(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qmul(t, ofp) */ - int test_qmul(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1527,10 +1317,6 @@ int test_qmul(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qdiv(t, ofp) */ - int test_qdiv(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1546,10 +1332,6 @@ int test_qdiv(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qaddz(t, ofp) */ - int test_qaddz(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1572,10 +1354,6 @@ int test_qaddz(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qsubz(t, ofp) */ - int test_qsubz(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1598,10 +1376,6 @@ int test_qsubz(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qmulz(t, ofp) */ - int test_qmulz(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1624,10 +1398,6 @@ int test_qmulz(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qdivz(t, ofp) */ - int test_qdivz(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1650,10 +1420,6 @@ int test_qdivz(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qexpt(t, ofp) */ - int test_qexpt(testspec_t* t, FILE* ofp) { mp_rat in[3], out[1]; @@ -1678,10 +1444,6 @@ int test_qexpt(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qtostr(t, ofp) */ - int test_qtostr(testspec_t* t, FILE* ofp) { mp_rat in[2]; @@ -1709,10 +1471,6 @@ int test_qtostr(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qtodec(t, ofp) */ - int test_qtodec(testspec_t* t, FILE* ofp) { mp_rat in[4]; @@ -1752,10 +1510,6 @@ int test_qtodec(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - -/* {{{ test_qrdec(t, ofp) */ - int test_qrdec(testspec_t* t, FILE* ofp) { mp_rat out[1], reg = g_qreg + 1; @@ -1775,6 +1529,4 @@ int test_qrdec(testspec_t* t, FILE* ofp) return 1; } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/imrat.c b/polly/lib/External/isl/imath/imrat.c index c6e9cde003ee..49448fe919e9 100644 --- a/polly/lib/External/isl/imath/imrat.c +++ b/polly/lib/External/isl/imath/imrat.c @@ -30,8 +30,6 @@ #include #include -/* {{{ Useful macros */ - #define TEMP(K) (temp + (K)) #define SETUP(E, C) \ do{if((res = (E)) != MP_OK) goto CLEANUP; ++(C);}while(0) @@ -41,8 +39,6 @@ do{if((res = (E)) != MP_OK) goto CLEANUP; ++(C);}while(0) #define CHECK(TEST) assert(TEST) #define NRCHECK(TEST) assert(TEST) -/* }}} */ - /* Reduce the given rational, in place, to lowest terms and canonical form. Zero is represented as 0/1, one as 1/1. Signs are adjusted so that the sign of the numerator is definitive. */ @@ -52,8 +48,6 @@ static mp_result s_rat_reduce(mp_rat r); static mp_result s_rat_combine(mp_rat a, mp_rat b, mp_rat c, mp_result (*comb_f)(mp_int, mp_int, mp_int)); -/* {{{ mp_rat_init(r) */ - mp_result mp_rat_init(mp_rat r) { mp_result res; @@ -68,10 +62,6 @@ mp_result mp_rat_init(mp_rat r) return mp_int_set_value(MP_DENOM_P(r), 1); } -/* }}} */ - -/* {{{ mp_rat_alloc() */ - mp_rat mp_rat_alloc(void) { mp_rat out = malloc(sizeof(*out)); @@ -86,18 +76,10 @@ mp_rat mp_rat_alloc(void) return out; } -/* }}} */ - -/* {{{ mp_rat_reduce(r) */ - mp_result mp_rat_reduce(mp_rat r) { return s_rat_reduce(r); } -/* }}} */ - -/* {{{ mp_rat_init_size(r, n_prec, d_prec) */ - mp_result mp_rat_init_size(mp_rat r, mp_size n_prec, mp_size d_prec) { mp_result res; @@ -112,10 +94,6 @@ mp_result mp_rat_init_size(mp_rat r, mp_size n_prec, mp_size d_prec) return mp_int_set_value(MP_DENOM_P(r), 1); } -/* }}} */ - -/* {{{ mp_rat_init_copy(r, old) */ - mp_result mp_rat_init_copy(mp_rat r, mp_rat old) { mp_result res; @@ -128,10 +106,6 @@ mp_result mp_rat_init_copy(mp_rat r, mp_rat old) return res; } -/* }}} */ - -/* {{{ mp_rat_set_value(r, numer, denom) */ - mp_result mp_rat_set_value(mp_rat r, mp_small numer, mp_small denom) { mp_result res; @@ -147,10 +121,6 @@ mp_result mp_rat_set_value(mp_rat r, mp_small numer, mp_small denom) return s_rat_reduce(r); } -/* }}} */ - -/* {{{ mp_rat_set_uvalue(r, numer, denom) */ - mp_result mp_rat_set_uvalue(mp_rat r, mp_usmall numer, mp_usmall denom) { mp_result res; @@ -166,10 +136,6 @@ mp_result mp_rat_set_uvalue(mp_rat r, mp_usmall numer, mp_usmall denom) return s_rat_reduce(r); } -/* }}} */ - -/* {{{ mp_rat_clear(r) */ - void mp_rat_clear(mp_rat r) { mp_int_clear(MP_NUMER_P(r)); @@ -177,10 +143,6 @@ void mp_rat_clear(mp_rat r) } -/* }}} */ - -/* {{{ mp_rat_free(r) */ - void mp_rat_free(mp_rat r) { NRCHECK(r != NULL); @@ -191,56 +153,32 @@ void mp_rat_free(mp_rat r) free(r); } -/* }}} */ - -/* {{{ mp_rat_numer(r, z) */ - mp_result mp_rat_numer(mp_rat r, mp_int z) { return mp_int_copy(MP_NUMER_P(r), z); } -/* }}} */ - -/* {{{ mp_rat_numer_ref(r) */ - mp_int mp_rat_numer_ref(mp_rat r) { return MP_NUMER_P(r); } -/* }}} */ - - -/* {{{ mp_rat_denom(r, z) */ mp_result mp_rat_denom(mp_rat r, mp_int z) { return mp_int_copy(MP_DENOM_P(r), z); } -/* }}} */ - -/* {{{ mp_rat_denom_ref(r) */ - mp_int mp_rat_denom_ref(mp_rat r) { return MP_DENOM_P(r); } -/* }}} */ - -/* {{{ mp_rat_sign(r) */ - mp_sign mp_rat_sign(mp_rat r) { return MP_SIGN(MP_NUMER_P(r)); } -/* }}} */ - -/* {{{ mp_rat_copy(a, c) */ - mp_result mp_rat_copy(mp_rat a, mp_rat c) { mp_result res; @@ -252,10 +190,6 @@ mp_result mp_rat_copy(mp_rat a, mp_rat c) return res; } -/* }}} */ - -/* {{{ mp_rat_zero(r) */ - void mp_rat_zero(mp_rat r) { mp_int_zero(MP_NUMER_P(r)); @@ -263,10 +197,6 @@ void mp_rat_zero(mp_rat r) } -/* }}} */ - -/* {{{ mp_rat_abs(a, c) */ - mp_result mp_rat_abs(mp_rat a, mp_rat c) { mp_result res; @@ -278,10 +208,6 @@ mp_result mp_rat_abs(mp_rat a, mp_rat c) return res; } -/* }}} */ - -/* {{{ mp_rat_neg(a, c) */ - mp_result mp_rat_neg(mp_rat a, mp_rat c) { mp_result res; @@ -293,10 +219,6 @@ mp_result mp_rat_neg(mp_rat a, mp_rat c) return res; } -/* }}} */ - -/* {{{ mp_rat_recip(a, c) */ - mp_result mp_rat_recip(mp_rat a, mp_rat c) { mp_result res; @@ -320,30 +242,18 @@ mp_result mp_rat_recip(mp_rat a, mp_rat c) return MP_OK; } -/* }}} */ - -/* {{{ mp_rat_add(a, b, c) */ - mp_result mp_rat_add(mp_rat a, mp_rat b, mp_rat c) { return s_rat_combine(a, b, c, mp_int_add); } -/* }}} */ - -/* {{{ mp_rat_sub(a, b, c) */ - mp_result mp_rat_sub(mp_rat a, mp_rat b, mp_rat c) { return s_rat_combine(a, b, c, mp_int_sub); } -/* }}} */ - -/* {{{ mp_rat_mul(a, b, c) */ - mp_result mp_rat_mul(mp_rat a, mp_rat b, mp_rat c) { mp_result res; @@ -359,10 +269,6 @@ mp_result mp_rat_mul(mp_rat a, mp_rat b, mp_rat c) return s_rat_reduce(c); } -/* }}} */ - -/* {{{ mp_int_div(a, b, c) */ - mp_result mp_rat_div(mp_rat a, mp_rat b, mp_rat c) { mp_result res = MP_OK; @@ -396,10 +302,6 @@ mp_result mp_rat_div(mp_rat a, mp_rat b, mp_rat c) return s_rat_reduce(c); } -/* }}} */ - -/* {{{ mp_rat_add_int(a, b, c) */ - mp_result mp_rat_add_int(mp_rat a, mp_int b, mp_rat c) { mpz_t tmp; @@ -424,10 +326,6 @@ mp_result mp_rat_add_int(mp_rat a, mp_int b, mp_rat c) return res; } -/* }}} */ - -/* {{{ mp_rat_sub_int(a, b, c) */ - mp_result mp_rat_sub_int(mp_rat a, mp_int b, mp_rat c) { mpz_t tmp; @@ -452,10 +350,6 @@ mp_result mp_rat_sub_int(mp_rat a, mp_int b, mp_rat c) return res; } -/* }}} */ - -/* {{{ mp_rat_mul_int(a, b, c) */ - mp_result mp_rat_mul_int(mp_rat a, mp_int b, mp_rat c) { mp_result res; @@ -469,10 +363,6 @@ mp_result mp_rat_mul_int(mp_rat a, mp_int b, mp_rat c) return s_rat_reduce(c); } -/* }}} */ - -/* {{{ mp_rat_div_int(a, b, c) */ - mp_result mp_rat_div_int(mp_rat a, mp_int b, mp_rat c) { mp_result res; @@ -489,10 +379,6 @@ mp_result mp_rat_div_int(mp_rat a, mp_int b, mp_rat c) return s_rat_reduce(c); } -/* }}} */ - -/* {{{ mp_rat_expt(a, b, c) */ - mp_result mp_rat_expt(mp_rat a, mp_small b, mp_rat c) { mp_result res; @@ -511,10 +397,6 @@ mp_result mp_rat_expt(mp_rat a, mp_small b, mp_rat c) return mp_int_expt(MP_DENOM_P(a), b, MP_DENOM_P(c)); } -/* }}} */ - -/* {{{ mp_rat_compare(a, b) */ - int mp_rat_compare(mp_rat a, mp_rat b) { /* Quick check for opposite signs. Works because the sign of the numerator @@ -537,10 +419,6 @@ int mp_rat_compare(mp_rat a, mp_rat b) } } -/* }}} */ - -/* {{{ mp_rat_compare_unsigned(a, b) */ - int mp_rat_compare_unsigned(mp_rat a, mp_rat b) { /* If the denominators are equal, we can quickly compare numerators without @@ -571,19 +449,11 @@ int mp_rat_compare_unsigned(mp_rat a, mp_rat b) } } -/* }}} */ - -/* {{{ mp_rat_compare_zero(r) */ - int mp_rat_compare_zero(mp_rat r) { return mp_int_compare_zero(MP_NUMER_P(r)); } -/* }}} */ - -/* {{{ mp_rat_compare_value(r, n, d) */ - int mp_rat_compare_value(mp_rat r, mp_small n, mp_small d) { mpq_t tmp; @@ -602,19 +472,11 @@ int mp_rat_compare_value(mp_rat r, mp_small n, mp_small d) return out; } -/* }}} */ - -/* {{{ mp_rat_is_integer(r) */ - int mp_rat_is_integer(mp_rat r) { return (mp_int_compare_value(MP_DENOM_P(r), 1) == 0); } -/* }}} */ - -/* {{{ mp_rat_to_ints(r, *num, *den) */ - mp_result mp_rat_to_ints(mp_rat r, mp_small *num, mp_small *den) { mp_result res; @@ -626,10 +488,6 @@ mp_result mp_rat_to_ints(mp_rat r, mp_small *num, mp_small *den) return res; } -/* }}} */ - -/* {{{ mp_rat_to_string(r, radix, *str, limit) */ - mp_result mp_rat_to_string(mp_rat r, mp_size radix, char *str, int limit) { char *start; @@ -660,9 +518,6 @@ mp_result mp_rat_to_string(mp_rat r, mp_size radix, char *str, int limit) return res; } -/* }}} */ - -/* {{{ mp_rat_to_decimal(r, radix, prec, *str, limit) */ mp_result mp_rat_to_decimal(mp_rat r, mp_size radix, mp_size prec, mp_round_mode round, char *str, int limit) { @@ -786,10 +641,6 @@ mp_result mp_rat_to_decimal(mp_rat r, mp_size radix, mp_size prec, return res; } -/* }}} */ - -/* {{{ mp_rat_string_len(r, radix) */ - mp_result mp_rat_string_len(mp_rat r, mp_size radix) { mp_result n_len, d_len = 0; @@ -808,10 +659,6 @@ mp_result mp_rat_string_len(mp_rat r, mp_size radix) } -/* }}} */ - -/* {{{ mp_rat_decimal_len(r, radix, prec) */ - mp_result mp_rat_decimal_len(mp_rat r, mp_size radix, mp_size prec) { int z_len, f_len; @@ -826,19 +673,11 @@ mp_result mp_rat_decimal_len(mp_rat r, mp_size radix, mp_size prec) return z_len + f_len; } -/* }}} */ - -/* {{{ mp_rat_read_string(r, radix, *str) */ - mp_result mp_rat_read_string(mp_rat r, mp_size radix, const char *str) { return mp_rat_read_cstring(r, radix, str, NULL); } -/* }}} */ - -/* {{{ mp_rat_read_cstring(r, radix, *str, **end) */ - mp_result mp_rat_read_cstring(mp_rat r, mp_size radix, const char *str, char **end) { @@ -873,10 +712,6 @@ mp_result mp_rat_read_cstring(mp_rat r, mp_size radix, const char *str, return s_rat_reduce(r); } -/* }}} */ - -/* {{{ mp_rat_read_ustring(r, radix, *str, **end) */ - /* Read a string and figure out what format it's in. The radix may be supplied as zero to use "default" behaviour. @@ -906,19 +741,11 @@ mp_result mp_rat_read_ustring(mp_rat r, mp_size radix, const char *str, return res; } -/* }}} */ - -/* {{{ mp_rat_read_decimal(r, radix, *str) */ - mp_result mp_rat_read_decimal(mp_rat r, mp_size radix, const char *str) { return mp_rat_read_cdecimal(r, radix, str, NULL); } -/* }}} */ - -/* {{{ mp_rat_read_cdecimal(r, radix, *str, **end) */ - mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, char **end) { @@ -1045,13 +872,9 @@ mp_result mp_rat_read_cdecimal(mp_rat r, mp_size radix, const char *str, } } -/* }}} */ - /* Private functions for internal use. Make unchecked assumptions about format and validity of inputs. */ -/* {{{ s_rat_reduce(r) */ - static mp_result s_rat_reduce(mp_rat r) { mpz_t gcd; @@ -1091,10 +914,6 @@ static mp_result s_rat_reduce(mp_rat r) return res; } -/* }}} */ - -/* {{{ s_rat_combine(a, b, c, comb_f) */ - static mp_result s_rat_combine(mp_rat a, mp_rat b, mp_rat c, mp_result (*comb_f)(mp_int, mp_int, mp_int)) { @@ -1136,6 +955,4 @@ static mp_result s_rat_combine(mp_rat a, mp_rat b, mp_rat c, } } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/imtest.c b/polly/lib/External/isl/imath/imtest.c index 804034f51e63..e36f4a2ff4db 100644 --- a/polly/lib/External/isl/imath/imtest.c +++ b/polly/lib/External/isl/imath/imtest.c @@ -208,8 +208,6 @@ int main(int argc, char *argv[]) return exit_status; } -/* {{{ process_file(ifp, ofp) */ - int process_file(FILE *ifp, FILE *ofp) { int res, line_num, test_num = 0, num_failed = 0, num_bogus = 0; @@ -240,10 +238,6 @@ int process_file(FILE *ifp, FILE *ofp) return num_failed; } -/* }}} */ - -/* {{{ read_line(ifp, line, limit) */ - int read_line(FILE *ifp, char *line, int limit) { static FILE *current_fp = NULL; @@ -265,10 +259,6 @@ int read_line(FILE *ifp, char *line, int limit) return current_line; } -/* }}} */ - -/* {{{ trim_line(line) */ - void trim_line(char *line) { int len; @@ -287,10 +277,6 @@ void trim_line(char *line) *fnw-- = '\0'; } -/* }}} */ - -/* {{{ is_blank(line) */ - int is_blank(char *line) { while (*line && *line != '#' && isspace((unsigned char) *line)) @@ -299,10 +285,6 @@ int is_blank(char *line) return *line == '\0' || *line == '#'; } -/* }}} */ - -/* {{{ parse_line(line, t) */ - int parse_line(char *line, testspec_t *t) { char *code_brk, *in_brk; @@ -334,10 +316,6 @@ int parse_line(char *line, testspec_t *t) return 1; } -/* }}} */ - -/* {{{ count_fields(line, delim) */ - int count_fields(char *line, int delim) { int count = 1; @@ -353,10 +331,6 @@ int count_fields(char *line, int delim) return count; } -/* }}} */ - -/* {{{ parse_fields(line, delim, start) */ - void parse_fields(char *line, int delim, char **start) { int pos = 0; @@ -368,10 +342,6 @@ void parse_fields(char *line, int delim, char **start) } } -/* }}} */ - -/* {{{ run_test(test_num, t, ofp) */ - int run_test(int test_num, testspec_t *t, FILE *ofp) { test_t info; @@ -422,10 +392,6 @@ int run_test(int test_num, testspec_t *t, FILE *ofp) return 0; } -/* }}} */ - -/* {{{ find_test(code, info) */ - int find_test(char *code, test_t *info) { int i = 0; @@ -440,10 +406,6 @@ int find_test(char *code, test_t *info) return -1; } -/* }}} */ - -/* {{{ free_test(*t) */ - void free_test(testspec_t *t) { assert(t != NULL); @@ -458,10 +420,6 @@ void free_test(testspec_t *t) } } -/* }}} */ - -/* {{{ error_string(res) */ - char *error_string(mp_result res) { int v = abs(res); @@ -469,6 +427,4 @@ char *error_string(mp_result res) return (char *)g_imath_strerr[v]; } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/imtimer.c b/polly/lib/External/isl/imath/imtimer.c index f5a0ecf56418..2b926af8f393 100644 --- a/polly/lib/External/isl/imath/imtimer.c +++ b/polly/lib/External/isl/imath/imtimer.c @@ -129,17 +129,11 @@ int main(int argc, char *argv[]) return 0; } -/* {{{ clocks_to_seconds(start, end) */ - double clocks_to_seconds(clock_t start, clock_t end) { return (double)(end - start) / CLOCKS_PER_SEC; } -/* }}} */ - -/* {{{ alloc_values(nt, prec) */ - mp_int alloc_values(int nt, int prec) { mp_int out = malloc(nt * sizeof(mpz_t)); @@ -159,10 +153,6 @@ mp_int alloc_values(int nt, int prec) return out; } -/* }}} */ - -/* {{{ randomize_values(values, nt, prec) */ - void randomize_values(mp_int values, int nt, int prec) { int i; @@ -171,10 +161,6 @@ void randomize_values(mp_int values, int nt, int prec) mp_int_random(values + i, prec); } -/* }}} */ - -/* {{{ release_values(values, nt) */ - void release_values(mp_int values, int nt) { int i; @@ -185,10 +171,6 @@ void release_values(mp_int values, int nt) free(values); } -/* }}} */ - -/* {{{ get_multiply_time(nt, prec) */ - double get_multiply_time(int nt, int prec) { clock_t start, end; @@ -209,10 +191,6 @@ double get_multiply_time(int nt, int prec) return clocks_to_seconds(start, end); } -/* }}} */ - -/* {{{ get_exptmod_time(nt, prec) */ - double get_exptmod_time(int nt, int prec) { clock_t start, end; @@ -233,10 +211,6 @@ double get_exptmod_time(int nt, int prec) return clocks_to_seconds(start, end); } -/* }}} */ - -/* {{{ mp_int_random(z, prec) */ - void mp_int_random(mp_int z, int prec) { int i; @@ -255,5 +229,3 @@ void mp_int_random(mp_int z, int prec) } MP_USED(z) = prec; } - -/* }}} */ diff --git a/polly/lib/External/isl/imath/iprime.c b/polly/lib/External/isl/imath/iprime.c index 864eadbac948..45989ba9b131 100644 --- a/polly/lib/External/isl/imath/iprime.c +++ b/polly/lib/External/isl/imath/iprime.c @@ -43,8 +43,6 @@ static int s_ptab[] = { 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 }; -/* {{{ mp_int_is_prime(z) */ - /* Test whether z is likely to be prime: MP_TRUE means it is probably prime MP_FALSE means it is definitely composite @@ -90,10 +88,6 @@ mp_result mp_int_is_prime(mp_int z) return MP_TRUE; } -/* }}} */ - -/* {{{ mp_int_find_prime(z) */ - /* Find the first apparent prime in ascending order from z */ mp_result mp_int_find_prime(mp_int z) { @@ -111,6 +105,4 @@ mp_result mp_int_find_prime(mp_int z) return res; } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/pi.c b/polly/lib/External/isl/imath/pi.c index e1d46487b309..d0d083df5c7c 100644 --- a/polly/lib/External/isl/imath/pi.c +++ b/polly/lib/External/isl/imath/pi.c @@ -108,8 +108,6 @@ int main(int argc, char *argv[]) return out; } -/* {{{ arctan(radix, mul, x, prec, sum) */ - /* Compute mul * atan(1/x) to prec digits of precision, and store the result in sum. @@ -172,6 +170,4 @@ mp_result arctan(mp_small radix, mp_small mul, mp_small x, return res; } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/imath/rsamath.c b/polly/lib/External/isl/imath/rsamath.c index ff9aa1898bb3..cecf05d077be 100644 --- a/polly/lib/External/isl/imath/rsamath.c +++ b/polly/lib/External/isl/imath/rsamath.c @@ -32,8 +32,6 @@ static mp_result s_rsa_transform(mp_int msg, mp_int exp, mp_int mod, mp_int out); -/* {{{ rsa_i2osp(z, out, len) */ - /* Convert integer to octet string, per PKCS#1 v.2.1 */ mp_result rsa_i2osp(mp_int z, unsigned char *out, int len) { @@ -50,60 +48,36 @@ mp_result rsa_i2osp(mp_int z, unsigned char *out, int len) return MP_OK; } -/* }}} */ - -/* {{{ rsa_os2ip(z, in, len) */ - /* Convert octet string to integer, per PKCS#1 v.2.1 */ mp_result rsa_os2ip(mp_int z, unsigned char *in, int len) { return mp_int_read_binary(z, in, len); } -/* }}} */ - -/* {{{ rsa_rsaep(msg, exp, mod, cipher) */ - /* Primitive RSA encryption operation */ mp_result rsa_rsaep(mp_int msg, mp_int exp, mp_int mod, mp_int cipher) { return s_rsa_transform(msg, exp, mod, cipher); } -/* }}} */ - -/* {{{ rsa_rsadp(cipher, exp, mod, msg) */ - /* Primitive RSA decryption operation */ mp_result rsa_rsadp(mp_int cipher, mp_int exp, mp_int mod, mp_int msg) { return s_rsa_transform(cipher, exp, mod, msg); } -/* }}} */ - -/* {{{ rsa_rsasp(msg, exp, mod, signature) */ - /* Primitive RSA signing operation */ mp_result rsa_rsasp(mp_int msg, mp_int exp, mp_int mod, mp_int signature) { return s_rsa_transform(msg, exp, mod, signature); } -/* }}} */ - -/* {{{ rsa_rsavp(signature, exp, mod, msg) */ - /* Primitive RSA verification operation */ mp_result rsa_rsavp(mp_int signature, mp_int exp, mp_int mod, mp_int msg) { return s_rsa_transform(signature, exp, mod, msg); } -/* }}} */ - -/* {{{ rsa_max_message_len(mod) */ - /* Compute the maximum length in bytes a message can have using PKCS#1 v.1.5 encoding with the given modulus */ int rsa_max_message_len(mp_int mod) @@ -117,10 +91,6 @@ int rsa_max_message_len(mp_int mod) return num_bytes - 11; } -/* }}} */ - -/* {{{ rsa_pkcs1v15_encode(buf, msg_len, buf_len, tag, filler) */ - mp_result rsa_pkcs1v15_encode(unsigned char *buf, int msg_len, int buf_len, int tag, random_f filler) { @@ -152,10 +122,6 @@ mp_result rsa_pkcs1v15_encode(unsigned char *buf, int msg_len, return MP_OK; } -/* }}} */ - -/* {{{ rsa_pkcs1v15_decode(buf, buf_len, *msg_len) */ - mp_result rsa_pkcs1v15_decode(unsigned char *buf, int buf_len, int tag, int *msg_len) { @@ -184,10 +150,6 @@ mp_result rsa_pkcs1v15_decode(unsigned char *buf, int buf_len, return MP_OK; } -/* }}} */ - -/* {{{ s_rsa_transform(msg, exp, mod, out) */ - static mp_result s_rsa_transform(mp_int msg, mp_int exp, mp_int mod, mp_int out) { @@ -198,6 +160,4 @@ static mp_result s_rsa_transform(mp_int msg, mp_int exp, return mp_int_exptmod(msg, exp, mod, out); } -/* }}} */ - /* Here there be dragons */ diff --git a/polly/lib/External/isl/include/isl/aff.h b/polly/lib/External/isl/include/isl/aff.h index 5b8a2aad4bf2..5d0233939c12 100644 --- a/polly/lib/External/isl/include/isl/aff.h +++ b/polly/lib/External/isl/include/isl/aff.h @@ -27,7 +27,7 @@ __isl_null isl_aff *isl_aff_free(__isl_take isl_aff *aff); isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff); int isl_aff_dim(__isl_keep isl_aff *aff, enum isl_dim_type type); -int isl_aff_involves_dims(__isl_keep isl_aff *aff, +isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_space *isl_aff_get_domain_space(__isl_keep isl_aff *aff); @@ -60,7 +60,7 @@ __isl_give isl_aff *isl_aff_add_coefficient_si(__isl_take isl_aff *aff, __isl_give isl_aff *isl_aff_add_coefficient_val(__isl_take isl_aff *aff, enum isl_dim_type type, int pos, __isl_take isl_val *v); -int isl_aff_is_cst(__isl_keep isl_aff *aff); +isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff); __isl_give isl_aff *isl_aff_set_tuple_id(__isl_take isl_aff *aff, enum isl_dim_type type, __isl_take isl_id *id); @@ -72,9 +72,10 @@ __isl_give isl_aff *isl_aff_set_dim_id(__isl_take isl_aff *aff, int isl_aff_find_dim_by_name(__isl_keep isl_aff *aff, enum isl_dim_type type, const char *name); -int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2); -int isl_aff_plain_is_zero(__isl_keep isl_aff *aff); -int isl_aff_is_nan(__isl_keep isl_aff *aff); +isl_bool isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + __isl_keep isl_aff *aff2); +isl_bool isl_aff_plain_is_zero(__isl_keep isl_aff *aff); +isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff); __isl_give isl_aff *isl_aff_get_div(__isl_keep isl_aff *aff, int pos); @@ -156,7 +157,7 @@ __isl_give isl_pw_aff *isl_set_indicator_function(__isl_take isl_set *set); const char *isl_pw_aff_get_dim_name(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); -int isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, +isl_bool isl_pw_aff_has_dim_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_pw_aff_get_dim_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, unsigned pos); @@ -166,11 +167,11 @@ __isl_give isl_pw_aff *isl_pw_aff_set_dim_id(__isl_take isl_pw_aff *pma, int isl_pw_aff_find_dim_by_name(__isl_keep isl_pw_aff *pa, enum isl_dim_type type, const char *name); -int isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); -int isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa); +isl_bool isl_pw_aff_is_empty(__isl_keep isl_pw_aff *pwaff); +isl_bool isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa); int isl_pw_aff_plain_cmp(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2); -int isl_pw_aff_plain_is_equal(__isl_keep isl_pw_aff *pwaff1, +isl_bool isl_pw_aff_plain_is_equal(__isl_keep isl_pw_aff *pwaff1, __isl_keep isl_pw_aff *pwaff2); int isl_pw_aff_is_equal(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2); @@ -185,15 +186,16 @@ __isl_give isl_pw_aff *isl_pw_aff_copy(__isl_keep isl_pw_aff *pwaff); __isl_null isl_pw_aff *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff); unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type); -int isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, +isl_bool isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type, unsigned first, unsigned n); -int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); +isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff); __isl_give isl_pw_aff *isl_pw_aff_align_params(__isl_take isl_pw_aff *pwaff, __isl_take isl_space *model); -int isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type); +isl_bool isl_pw_aff_has_tuple_id(__isl_keep isl_pw_aff *pa, + enum isl_dim_type type); __isl_give isl_id *isl_pw_aff_get_tuple_id(__isl_keep isl_pw_aff *pa, enum isl_dim_type type); __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(__isl_take isl_pw_aff *pwaff, @@ -267,8 +269,8 @@ __isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff( __isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa); int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff); -int isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, - int (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff, +isl_stat isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user), void *user); __isl_give isl_set *isl_set_from_pw_aff(__isl_take isl_pw_aff *pwaff); @@ -409,13 +411,13 @@ __isl_give isl_space *isl_pw_multi_aff_get_domain_space( __isl_keep isl_pw_multi_aff *pma); __isl_give isl_space *isl_pw_multi_aff_get_space( __isl_keep isl_pw_multi_aff *pma); -int isl_pw_multi_aff_has_tuple_name(__isl_keep isl_pw_multi_aff *pma, +isl_bool isl_pw_multi_aff_has_tuple_name(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); const char *isl_pw_multi_aff_get_tuple_name(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); __isl_give isl_id *isl_pw_multi_aff_get_tuple_id( __isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); -int isl_pw_multi_aff_has_tuple_id(__isl_keep isl_pw_multi_aff *pma, +isl_bool isl_pw_multi_aff_has_tuple_id(__isl_keep isl_pw_multi_aff *pma, enum isl_dim_type type); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_tuple_id( __isl_take isl_pw_multi_aff *pma, @@ -450,7 +452,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_dim_id( __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_pw_multi_aff_plain_is_equal(__isl_keep isl_pw_multi_aff *pma1, +isl_bool isl_pw_multi_aff_plain_is_equal(__isl_keep isl_pw_multi_aff *pma1, __isl_keep isl_pw_multi_aff *pma2); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_fix_si( @@ -517,8 +519,8 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_pullback_multi_aff( __isl_give isl_pw_multi_aff *isl_pw_multi_aff_pullback_pw_multi_aff( __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2); -int isl_pw_multi_aff_foreach_piece(__isl_keep isl_pw_multi_aff *pma, - int (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff, +isl_stat isl_pw_multi_aff_foreach_piece(__isl_keep isl_pw_multi_aff *pma, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff, void *user), void *user); __isl_give isl_map *isl_map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma); @@ -600,13 +602,14 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_align_params( int isl_union_pw_multi_aff_n_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma); -int isl_union_pw_multi_aff_foreach_pw_multi_aff( +isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma, - int (*fn)(__isl_take isl_pw_multi_aff *pma, void *user), void *user); + isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user), + void *user); __isl_give isl_pw_multi_aff *isl_union_pw_multi_aff_extract_pw_multi_aff( __isl_keep isl_union_pw_multi_aff *upma, __isl_take isl_space *space); -int isl_union_pw_multi_aff_plain_is_equal( +isl_bool isl_union_pw_multi_aff_plain_is_equal( __isl_keep isl_union_pw_multi_aff *upma1, __isl_keep isl_union_pw_multi_aff *upma2); @@ -682,7 +685,7 @@ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist( __isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params( __isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set); -int isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, +isl_bool isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2); __isl_give isl_multi_pw_aff *isl_multi_pw_aff_pullback_multi_aff( @@ -757,12 +760,12 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff( int isl_union_pw_aff_n_pw_aff(__isl_keep isl_union_pw_aff *upa); -int isl_union_pw_aff_foreach_pw_aff(__isl_keep isl_union_pw_aff *upa, - int (*fn)(__isl_take isl_pw_aff *ma, void *user), void *user); +isl_stat isl_union_pw_aff_foreach_pw_aff(__isl_keep isl_union_pw_aff *upa, + isl_stat (*fn)(__isl_take isl_pw_aff *ma, void *user), void *user); __isl_give isl_pw_aff *isl_union_pw_aff_extract_pw_aff( __isl_keep isl_union_pw_aff *upa, __isl_take isl_space *space); -int isl_union_pw_aff_plain_is_equal(__isl_keep isl_union_pw_aff *upa1, +isl_bool isl_union_pw_aff_plain_is_equal(__isl_keep isl_union_pw_aff *upa1, __isl_keep isl_union_pw_aff *upa2); __isl_give isl_union_set *isl_union_pw_aff_domain( diff --git a/polly/lib/External/isl/include/isl/ast.h b/polly/lib/External/isl/include/isl/ast.h index ba05274fc13b..e0917970935f 100644 --- a/polly/lib/External/isl/include/isl/ast.h +++ b/polly/lib/External/isl/include/isl/ast.h @@ -13,10 +13,10 @@ extern "C" { #endif -int isl_options_set_ast_iterator_type(isl_ctx *ctx, const char *val); +isl_stat isl_options_set_ast_iterator_type(isl_ctx *ctx, const char *val); const char *isl_options_get_ast_iterator_type(isl_ctx *ctx); -int isl_options_set_ast_always_print_block(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_always_print_block(isl_ctx *ctx, int val); int isl_options_get_ast_always_print_block(isl_ctx *ctx); __isl_give isl_ast_expr *isl_ast_expr_from_val(__isl_take isl_val *v); @@ -73,7 +73,7 @@ __isl_give isl_ast_expr *isl_ast_expr_get_op_arg(__isl_keep isl_ast_expr *expr, __isl_give isl_ast_expr *isl_ast_expr_set_op_arg(__isl_take isl_ast_expr *expr, int pos, __isl_take isl_ast_expr *arg); -int isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, +isl_bool isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, __isl_keep isl_ast_expr *expr2); __isl_give isl_ast_expr *isl_ast_expr_substitute_ids( @@ -105,13 +105,13 @@ __isl_give isl_ast_expr *isl_ast_node_for_get_inc( __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_for_get_body( __isl_keep isl_ast_node *node); -int isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node); +isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node); __isl_give isl_ast_expr *isl_ast_node_if_get_cond( __isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_then( __isl_keep isl_ast_node *node); -int isl_ast_node_if_has_else(__isl_keep isl_ast_node *node); +isl_bool isl_ast_node_if_has_else(__isl_keep isl_ast_node *node); __isl_give isl_ast_node *isl_ast_node_if_get_else( __isl_keep isl_ast_node *node); @@ -150,8 +150,8 @@ __isl_give isl_ast_print_options *isl_ast_print_options_set_print_for( __isl_keep isl_ast_node *node, void *user), void *user); -int isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), void *user); +isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, + isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user); __isl_give isl_printer *isl_ast_op_type_print_macro( enum isl_ast_op_type type, __isl_take isl_printer *p); __isl_give isl_printer *isl_ast_node_print_macros( diff --git a/polly/lib/External/isl/include/isl/ast_build.h b/polly/lib/External/isl/include/isl/ast_build.h index e914bece39a7..0971a0491512 100644 --- a/polly/lib/External/isl/include/isl/ast_build.h +++ b/polly/lib/External/isl/include/isl/ast_build.h @@ -14,30 +14,30 @@ struct isl_ast_build; typedef struct isl_ast_build isl_ast_build; -int isl_options_set_ast_build_atomic_upper_bound(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_atomic_upper_bound(isl_ctx *ctx, int val); int isl_options_get_ast_build_atomic_upper_bound(isl_ctx *ctx); -int isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_prefer_pdiv(isl_ctx *ctx, int val); int isl_options_get_ast_build_prefer_pdiv(isl_ctx *ctx); -int isl_options_set_ast_build_exploit_nested_bounds(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_exploit_nested_bounds(isl_ctx *ctx, int val); int isl_options_get_ast_build_exploit_nested_bounds(isl_ctx *ctx); -int isl_options_set_ast_build_group_coscheduled(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_group_coscheduled(isl_ctx *ctx, int val); int isl_options_get_ast_build_group_coscheduled(isl_ctx *ctx); #define ISL_AST_BUILD_SEPARATION_BOUNDS_EXPLICIT 0 #define ISL_AST_BUILD_SEPARATION_BOUNDS_IMPLICIT 1 -int isl_options_set_ast_build_separation_bounds(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_separation_bounds(isl_ctx *ctx, int val); int isl_options_get_ast_build_separation_bounds(isl_ctx *ctx); -int isl_options_set_ast_build_scale_strides(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_scale_strides(isl_ctx *ctx, int val); int isl_options_get_ast_build_scale_strides(isl_ctx *ctx); -int isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_else(isl_ctx *ctx); -int isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); +isl_stat isl_options_set_ast_build_allow_or(isl_ctx *ctx, int val); int isl_options_get_ast_build_allow_or(isl_ctx *ctx); isl_ctx *isl_ast_build_get_ctx(__isl_keep isl_ast_build *build); @@ -78,7 +78,7 @@ __isl_give isl_ast_build *isl_ast_build_set_after_each_for( __isl_keep isl_ast_build *build, void *user), void *user); __isl_give isl_ast_build *isl_ast_build_set_before_each_mark( __isl_take isl_ast_build *build, - int (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, + isl_stat (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, void *user), void *user); __isl_give isl_ast_build *isl_ast_build_set_after_each_mark( __isl_take isl_ast_build *build, diff --git a/polly/lib/External/isl/include/isl/band.h b/polly/lib/External/isl/include/isl/band.h index cb2bfeebfc19..6dd19ba8f02e 100644 --- a/polly/lib/External/isl/include/isl/band.h +++ b/polly/lib/External/isl/include/isl/band.h @@ -31,9 +31,9 @@ __isl_give isl_union_map *isl_band_get_partial_schedule( __isl_give isl_union_map *isl_band_get_suffix_schedule( __isl_keep isl_band *band); -int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); -int isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); int isl_band_tile(__isl_keep isl_band *band, __isl_take isl_vec *sizes); diff --git a/polly/lib/External/isl/include/isl/constraint.h b/polly/lib/External/isl/include/isl/constraint.h index 8e5049874581..d3b563ab09c3 100644 --- a/polly/lib/External/isl/include/isl/constraint.h +++ b/polly/lib/External/isl/include/isl/constraint.h @@ -29,6 +29,10 @@ ISL_DECLARE_LIST(constraint) isl_ctx *isl_constraint_get_ctx(__isl_keep isl_constraint *c); +__isl_give isl_constraint *isl_constraint_alloc_equality( + __isl_take isl_local_space *ls); +__isl_give isl_constraint *isl_constraint_alloc_inequality( + __isl_take isl_local_space *ls); __isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls); __isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls); @@ -38,10 +42,10 @@ __isl_null isl_constraint *isl_constraint_free(__isl_take isl_constraint *c); int isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap); int isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset); -int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user); -int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user); +isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user); +isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user); __isl_give isl_constraint_list *isl_basic_map_get_constraint_list( __isl_keep isl_basic_map *bmap); __isl_give isl_constraint_list *isl_basic_set_get_constraint_list( @@ -49,9 +53,9 @@ __isl_give isl_constraint_list *isl_basic_set_get_constraint_list( int isl_constraint_is_equal(struct isl_constraint *constraint1, struct isl_constraint *constraint2); -int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, +isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user); @@ -82,7 +86,7 @@ __isl_give isl_local_space *isl_constraint_get_local_space( int isl_constraint_dim(struct isl_constraint *constraint, enum isl_dim_type type); -int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n); const char *isl_constraint_get_dim_name(__isl_keep isl_constraint *constraint, @@ -107,12 +111,12 @@ __isl_give isl_aff *isl_constraint_get_div(__isl_keep isl_constraint *constraint struct isl_constraint *isl_constraint_negate(struct isl_constraint *constraint); -int isl_constraint_is_equality(__isl_keep isl_constraint *constraint); +isl_bool isl_constraint_is_equality(__isl_keep isl_constraint *constraint); int isl_constraint_is_div_constraint(__isl_keep isl_constraint *constraint); -int isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); -int isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos); __isl_give isl_basic_map *isl_basic_map_from_constraint( diff --git a/polly/lib/External/isl/include/isl/ctx.h b/polly/lib/External/isl/include/isl/ctx.h index 44680b10a083..6cd26a1bcbde 100644 --- a/polly/lib/External/isl/include/isl/ctx.h +++ b/polly/lib/External/isl/include/isl/ctx.h @@ -14,7 +14,6 @@ #include #include -#include #ifndef __isl_give #define __isl_give @@ -79,6 +78,15 @@ enum isl_error { isl_error_quota, isl_error_unsupported }; +typedef enum { + isl_stat_error = -1, + isl_stat_ok = 0, +} isl_stat; +typedef enum { + isl_bool_error = -1, + isl_bool_false = 0, + isl_bool_true = 1 +} isl_bool; struct isl_ctx; typedef struct isl_ctx isl_ctx; @@ -181,16 +189,16 @@ int prefix ## _get_ ## field(isl_ctx *ctx) \ } #define ISL_CTX_SET_INT_DEF(prefix,st,args,field) \ -int prefix ## _set_ ## field(isl_ctx *ctx, int val) \ +isl_stat prefix ## _set_ ## field(isl_ctx *ctx, int val) \ { \ st *options; \ options = isl_ctx_peek_ ## prefix(ctx); \ if (!options) \ isl_die(ctx, isl_error_invalid, \ "isl_ctx does not reference " #prefix, \ - return -1); \ + return isl_stat_error); \ options->field = val; \ - return 0; \ + return isl_stat_ok; \ } #define ISL_CTX_GET_STR_DEF(prefix,st,args,field) \ @@ -206,21 +214,21 @@ const char *prefix ## _get_ ## field(isl_ctx *ctx) \ } #define ISL_CTX_SET_STR_DEF(prefix,st,args,field) \ -int prefix ## _set_ ## field(isl_ctx *ctx, const char *val) \ +isl_stat prefix ## _set_ ## field(isl_ctx *ctx, const char *val) \ { \ st *options; \ options = isl_ctx_peek_ ## prefix(ctx); \ if (!options) \ isl_die(ctx, isl_error_invalid, \ "isl_ctx does not reference " #prefix, \ - return -1); \ + return isl_stat_error); \ if (!val) \ - return -1; \ + return isl_stat_error; \ free(options->field); \ options->field = strdup(val); \ if (!options->field) \ - return -1; \ - return 0; \ + return isl_stat_error; \ + return isl_stat_ok; \ } #define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field) \ diff --git a/polly/lib/External/isl/include/isl/flow.h b/polly/lib/External/isl/include/isl/flow.h index 5e044216a1b2..4a6485ddc09f 100644 --- a/polly/lib/External/isl/include/isl/flow.h +++ b/polly/lib/External/isl/include/isl/flow.h @@ -55,8 +55,9 @@ __isl_null isl_access_info *isl_access_info_free( isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc); __isl_give isl_flow *isl_access_info_compute_flow(__isl_take isl_access_info *acc); -int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), +isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, + void *user), void *user); __isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must); void isl_flow_free(__isl_take isl_flow *deps); diff --git a/polly/lib/External/isl/include/isl/hash.h b/polly/lib/External/isl/include/isl/hash.h index 791f549ad3b2..d5de9ba29925 100644 --- a/polly/lib/External/isl/include/isl/hash.h +++ b/polly/lib/External/isl/include/isl/hash.h @@ -11,13 +11,8 @@ #define ISL_HASH_H #include - -// We do not generate isl/stdint.h in the Polly build. The configure logic has -// not yet been implemented and it is unclear if it actually needed on the -// platform LLVM is compiled for. - -#include -// #include +#include +#include #if defined(__cplusplus) extern "C" { @@ -58,8 +53,6 @@ struct isl_hash_table { struct isl_hash_table_entry *entries; }; -struct isl_ctx; - struct isl_hash_table *isl_hash_table_alloc(struct isl_ctx *ctx, int min_size); void isl_hash_table_free(struct isl_ctx *ctx, struct isl_hash_table *table); @@ -71,9 +64,8 @@ struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx, uint32_t key_hash, int (*eq)(const void *entry, const void *val), const void *val, int reserve); -int isl_hash_table_foreach(struct isl_ctx *ctx, - struct isl_hash_table *table, - int (*fn)(void **entry, void *user), void *user); +isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table, + isl_stat (*fn)(void **entry, void *user), void *user); void isl_hash_table_remove(struct isl_ctx *ctx, struct isl_hash_table *table, struct isl_hash_table_entry *entry); diff --git a/polly/lib/External/isl/include/isl/hmap.h b/polly/lib/External/isl/include/isl/hmap.h index 41cd06f8700f..eceee488134f 100644 --- a/polly/lib/External/isl/include/isl/hmap.h +++ b/polly/lib/External/isl/include/isl/hmap.h @@ -25,7 +25,8 @@ __isl_null ISL_HMAP *ISL_FN(ISL_HMAP,free)(__isl_take ISL_HMAP *hmap); isl_ctx *ISL_FN(ISL_HMAP,get_ctx)(__isl_keep ISL_HMAP *hmap); -int ISL_FN(ISL_HMAP,has)(__isl_keep ISL_HMAP *hmap, __isl_keep ISL_KEY *key); +isl_bool ISL_FN(ISL_HMAP,has)(__isl_keep ISL_HMAP *hmap, + __isl_keep ISL_KEY *key); __isl_give ISL_VAL *ISL_FN(ISL_HMAP,get)(__isl_keep ISL_HMAP *hmap, __isl_take ISL_KEY *key); __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,set)(__isl_take ISL_HMAP *hmap, @@ -33,8 +34,9 @@ __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,set)(__isl_take ISL_HMAP *hmap, __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,drop)(__isl_take ISL_HMAP *hmap, __isl_take ISL_KEY *key); -int ISL_FN(ISL_HMAP,foreach)(__isl_keep ISL_HMAP *hmap, - int (*fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user), +isl_stat ISL_FN(ISL_HMAP,foreach)(__isl_keep ISL_HMAP *hmap, + isl_stat (*fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, + void *user), void *user); __isl_give isl_printer *ISL_FN(isl_printer_print,ISL_HMAP_BASE)( diff --git a/polly/lib/External/isl/include/isl/id.h b/polly/lib/External/isl/include/isl/id.h index bd81d66562a9..093dd44c3e0a 100644 --- a/polly/lib/External/isl/include/isl/id.h +++ b/polly/lib/External/isl/include/isl/id.h @@ -4,6 +4,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { diff --git a/polly/lib/External/isl/include/isl/list.h b/polly/lib/External/isl/include/isl/list.h index 3dbde2e58e50..616d8dc39cee 100644 --- a/polly/lib/External/isl/include/isl/list.h +++ b/polly/lib/External/isl/include/isl/list.h @@ -47,19 +47,19 @@ __isl_give struct isl_##EL *isl_##EL##_list_get_##EL( \ __isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL( \ __isl_take struct isl_##EL##_list *list, int index, \ __isl_take struct isl_##EL *el); \ -int isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \ - int (*fn)(__isl_take struct isl_##EL *el, void *user), \ +isl_stat isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \ + isl_stat (*fn)(__isl_take struct isl_##EL *el, void *user), \ void *user); \ __isl_give isl_##EL##_list *isl_##EL##_list_sort( \ __isl_take isl_##EL##_list *list, \ int (*cmp)(__isl_keep struct isl_##EL *a, \ __isl_keep struct isl_##EL *b, \ void *user), void *user); \ -int isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \ - int (*follows)(__isl_keep struct isl_##EL *a, \ +isl_stat isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \ + isl_bool (*follows)(__isl_keep struct isl_##EL *a, \ __isl_keep struct isl_##EL *b, void *user), \ void *follows_user, \ - int (*fn)(__isl_take isl_##EL##_list *scc, void *user), \ + isl_stat (*fn)(__isl_take isl_##EL##_list *scc, void *user), \ void *fn_user); \ __isl_give isl_printer *isl_printer_print_##EL##_list( \ __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list); \ diff --git a/polly/lib/External/isl/include/isl/local_space.h b/polly/lib/External/isl/include/isl/local_space.h index 61d1d74f5dc4..5ad832997184 100644 --- a/polly/lib/External/isl/include/isl/local_space.h +++ b/polly/lib/External/isl/include/isl/local_space.h @@ -22,8 +22,8 @@ __isl_give isl_local_space *isl_local_space_copy( __isl_null isl_local_space *isl_local_space_free( __isl_take isl_local_space *ls); -int isl_local_space_is_params(__isl_keep isl_local_space *ls); -int isl_local_space_is_set(__isl_keep isl_local_space *ls); +isl_bool isl_local_space_is_params(__isl_keep isl_local_space *ls); +isl_bool isl_local_space_is_set(__isl_keep isl_local_space *ls); __isl_give isl_local_space *isl_local_space_set_tuple_id( __isl_take isl_local_space *ls, @@ -31,14 +31,14 @@ __isl_give isl_local_space *isl_local_space_set_tuple_id( int isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type); -int isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_local_space *isl_local_space_set_dim_name( __isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos, const char *s); -int isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_local_space_get_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos); @@ -73,7 +73,7 @@ __isl_give isl_local_space *isl_local_space_intersect( __isl_give isl_local_space *isl_local_space_wrap( __isl_take isl_local_space *ls); -int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, +isl_bool isl_local_space_is_equal(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2); __isl_give isl_basic_map *isl_local_space_lifting( diff --git a/polly/lib/External/isl/include/isl/map.h b/polly/lib/External/isl/include/isl/map.h index 8658d204cc59..7ac99ad2fa2c 100644 --- a/polly/lib/External/isl/include/isl/map.h +++ b/polly/lib/External/isl/include/isl/map.h @@ -22,6 +22,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -69,14 +70,15 @@ __isl_give isl_basic_map *isl_basic_map_set_tuple_name( __isl_take isl_basic_map *bmap, enum isl_dim_type type, const char *s); const char *isl_basic_map_get_tuple_name(__isl_keep isl_basic_map *bmap, enum isl_dim_type type); -int isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type); +isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, + enum isl_dim_type type); const char *isl_map_get_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_map *isl_map_set_tuple_name(__isl_take isl_map *map, enum isl_dim_type type, const char *s); const char *isl_basic_map_get_dim_name(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); -int isl_map_has_dim_name(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); const char *isl_map_get_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); @@ -91,9 +93,9 @@ __isl_give isl_basic_map *isl_basic_map_set_tuple_id( enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_map *isl_map_set_dim_id(__isl_take isl_map *map, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos); -int isl_map_has_dim_id(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_map_get_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos); @@ -101,7 +103,7 @@ __isl_give isl_map *isl_map_set_tuple_id(__isl_take isl_map *map, enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_map *isl_map_reset_tuple_id(__isl_take isl_map *map, enum isl_dim_type type); -int isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); +isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_id *isl_map_get_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type); __isl_give isl_map *isl_map_reset_user(__isl_take isl_map *map); @@ -115,18 +117,9 @@ int isl_map_find_dim_by_name(__isl_keep isl_map *map, enum isl_dim_type type, int isl_basic_map_is_rational(__isl_keep isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned in, unsigned out, unsigned extra, - unsigned n_eq, unsigned n_ineq); __isl_give isl_basic_map *isl_basic_map_identity(__isl_take isl_space *dim); -struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap); __isl_null isl_basic_map *isl_basic_map_free(__isl_take isl_basic_map *bmap); __isl_give isl_basic_map *isl_basic_map_copy(__isl_keep isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_extend(struct isl_basic_map *base, - unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_map *isl_basic_map_extend_constraints( - struct isl_basic_map *base, unsigned n_eq, unsigned n_ineq); __isl_give isl_basic_map *isl_basic_map_equal( __isl_take isl_space *dim, unsigned n_equal); __isl_give isl_basic_map *isl_basic_map_less_at(__isl_take isl_space *dim, @@ -194,10 +187,8 @@ __isl_give isl_basic_map *isl_basic_map_eliminate( enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_basic_map *isl_basic_map_from_basic_set( __isl_take isl_basic_set *bset, __isl_take isl_space *dim); -struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap); __isl_export __isl_give isl_basic_map *isl_basic_map_sample(__isl_take isl_basic_map *bmap); -struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap); __isl_export __isl_give isl_basic_map *isl_basic_map_detect_equalities( __isl_take isl_basic_map *bmap); @@ -237,10 +228,9 @@ __isl_give isl_map *isl_map_floordiv_val(__isl_take isl_map *map, __isl_take isl_val *d); __isl_export -int isl_basic_map_is_equal( - __isl_keep isl_basic_map *bmap1, - __isl_keep isl_basic_map *bmap2); -int isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_equal(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2); +isl_bool isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); __isl_give isl_map *isl_basic_map_partial_lexmax( @@ -288,23 +278,19 @@ __isl_give isl_val *isl_basic_map_plain_get_val_if_fixed( enum isl_dim_type type, unsigned pos); int isl_basic_map_image_is_bounded(__isl_keep isl_basic_map *bmap); -int isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); -int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap); __isl_export -int isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap); __isl_export -int isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); -int isl_basic_map_is_strict_subset(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_strict_subset(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); -struct isl_map *isl_map_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned in, unsigned out, int n, - unsigned flags); __isl_give isl_map *isl_map_universe(__isl_take isl_space *dim); __isl_give isl_map *isl_map_nat_universe(__isl_take isl_space *dim); __isl_give isl_map *isl_map_empty(__isl_take isl_space *dim); -struct isl_map *isl_map_dup(struct isl_map *map); __isl_give isl_map *isl_map_add_basic_map(__isl_take isl_map *map, __isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_identity(__isl_take isl_space *dim); @@ -316,11 +302,8 @@ __isl_give isl_map *isl_map_lex_gt_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_ge_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_gt(__isl_take isl_space *set_dim); __isl_give isl_map *isl_map_lex_ge(__isl_take isl_space *set_dim); -struct isl_map *isl_map_finalize(struct isl_map *map); __isl_null isl_map *isl_map_free(__isl_take isl_map *map); __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map); -struct isl_map *isl_map_extend(struct isl_map *base, - unsigned nparam, unsigned n_in, unsigned n_out); __isl_export __isl_give isl_map *isl_map_reverse(__isl_take isl_map *map); __isl_export @@ -377,8 +360,8 @@ __isl_give isl_map *isl_map_flat_domain_product(__isl_take isl_map *map1, __isl_take isl_map *map2); __isl_give isl_map *isl_map_flat_range_product(__isl_take isl_map *map1, __isl_take isl_map *map2); -int isl_map_domain_is_wrapping(__isl_keep isl_map *map); -int isl_map_range_is_wrapping(__isl_keep isl_map *map); +isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map); +isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map); __isl_give isl_map *isl_map_factor_domain(__isl_take isl_map *map); __isl_give isl_map *isl_map_factor_range(__isl_take isl_map *map); __isl_give isl_map *isl_map_domain_factor_domain(__isl_take isl_map *map); @@ -485,9 +468,9 @@ __isl_export __isl_give isl_map *isl_set_identity(__isl_take isl_set *set); __isl_export -int isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset); __isl_export -int isl_set_is_wrapping(__isl_keep isl_set *set); +isl_bool isl_set_is_wrapping(__isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_map_wrap(__isl_take isl_basic_map *bmap); __isl_give isl_set *isl_map_wrap(__isl_take isl_map *map); __isl_give isl_basic_map *isl_basic_set_unwrap(__isl_take isl_basic_set *bset); @@ -531,46 +514,47 @@ __isl_give isl_map *isl_map_from_domain_and_range(__isl_take isl_set *domain, __isl_take isl_set *range); __isl_give isl_map *isl_map_from_set(__isl_take isl_set *set, __isl_take isl_space *dim); -struct isl_set *isl_set_from_map(struct isl_map *map); __isl_export __isl_give isl_basic_map *isl_map_sample(__isl_take isl_map *map); -int isl_map_plain_is_empty(__isl_keep isl_map *map); -int isl_map_plain_is_universe(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_universe(__isl_keep isl_map *map); __isl_export -int isl_map_is_empty(__isl_keep isl_map *map); +isl_bool isl_map_is_empty(__isl_keep isl_map *map); __isl_export -int isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); __isl_export -int isl_map_is_strict_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_strict_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); __isl_export -int isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); __isl_export -int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2); -int isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap); -int isl_map_plain_is_single_valued(__isl_keep isl_map *map); +isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); +isl_bool isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_plain_is_single_valued(__isl_keep isl_map *map); __isl_export -int isl_map_is_single_valued(__isl_keep isl_map *map); -int isl_map_plain_is_injective(__isl_keep isl_map *map); +isl_bool isl_map_is_single_valued(__isl_keep isl_map *map); +isl_bool isl_map_plain_is_injective(__isl_keep isl_map *map); __isl_export -int isl_map_is_injective(__isl_keep isl_map *map); +isl_bool isl_map_is_injective(__isl_keep isl_map *map); __isl_export -int isl_map_is_bijective(__isl_keep isl_map *map); +isl_bool isl_map_is_bijective(__isl_keep isl_map *map); int isl_map_is_translation(__isl_keep isl_map *map); int isl_map_has_equal_space(__isl_keep isl_map *map1, __isl_keep isl_map *map2); -int isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap); -int isl_map_can_zip(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_zip(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_zip(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_zip(__isl_take isl_map *map); -int isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap); -int isl_map_can_curry(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_curry(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_curry(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_curry(__isl_take isl_map *map); -int isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap); -int isl_map_can_uncurry(__isl_keep isl_map *map); +isl_bool isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap); +isl_bool isl_map_can_uncurry(__isl_keep isl_map *map); __isl_give isl_basic_map *isl_basic_map_uncurry(__isl_take isl_basic_map *bmap); __isl_give isl_map *isl_map_uncurry(__isl_take isl_map *map); @@ -586,9 +570,9 @@ __isl_give isl_map *isl_map_drop_constraints_involving_dims( __isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); -int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n); -int isl_map_involves_dims(__isl_keep isl_map *map, +isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n); void isl_map_print_internal(__isl_keep isl_map *map, FILE *out, int indent); @@ -617,14 +601,15 @@ __isl_give isl_map *isl_map_gist_basic_map(__isl_take isl_map *map, __isl_export __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map); -int isl_map_plain_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2); +isl_bool isl_map_plain_is_equal(__isl_keep isl_map *map1, + __isl_keep isl_map *map2); uint32_t isl_map_get_hash(__isl_keep isl_map *map); int isl_map_n_basic_map(__isl_keep isl_map *map); __isl_export -int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user); +isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user); __isl_give isl_map *isl_set_lifting(__isl_take isl_set *set); diff --git a/polly/lib/External/isl/include/isl/multi.h b/polly/lib/External/isl/include/isl/multi.h index ee0d8cd36945..9842d6ca4fda 100644 --- a/polly/lib/External/isl/include/isl/multi.h +++ b/polly/lib/External/isl/include/isl/multi.h @@ -29,7 +29,7 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_copy( \ __isl_keep isl_multi_##BASE *multi); \ __isl_null isl_multi_##BASE *isl_multi_##BASE##_free( \ __isl_take isl_multi_##BASE *multi); \ -int isl_multi_##BASE##_plain_is_equal( \ +isl_bool isl_multi_##BASE##_plain_is_equal( \ __isl_keep isl_multi_##BASE *multi1, \ __isl_keep isl_multi_##BASE *multi2); \ int isl_multi_##BASE##_find_dim_by_id( \ @@ -46,8 +46,8 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_id( \ enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); \ const char *isl_multi_##BASE##_get_tuple_name( \ __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ -int isl_multi_##BASE##_has_tuple_id(__isl_keep isl_multi_##BASE *multi, \ - enum isl_dim_type type); \ +isl_bool isl_multi_##BASE##_has_tuple_id( \ + __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ __isl_give isl_id *isl_multi_##BASE##_get_tuple_id( \ __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_name( \ @@ -79,7 +79,7 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_flat_range_product( \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_range_product( \ __isl_take isl_multi_##BASE *multi1, \ __isl_take isl_multi_##BASE *multi2); \ -int isl_multi_##BASE##_range_is_wrapping( \ +isl_bool isl_multi_##BASE##_range_is_wrapping( \ __isl_keep isl_multi_##BASE *multi); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_range_factor_domain( \ __isl_take isl_multi_##BASE *multi); \ @@ -112,7 +112,7 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_neg( \ __isl_take isl_multi_##BASE *multi); #define ISL_DECLARE_MULTI_DIMS(BASE) \ -int isl_multi_##BASE##_involves_dims( \ +isl_bool isl_multi_##BASE##_involves_dims( \ __isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \ unsigned first, unsigned n); \ __isl_give isl_multi_##BASE *isl_multi_##BASE##_insert_dims( \ diff --git a/polly/lib/External/isl/include/isl/options.h b/polly/lib/External/isl/include/isl/options.h index b0c9a436967f..930e1c451d4f 100644 --- a/polly/lib/External/isl/include/isl/options.h +++ b/polly/lib/External/isl/include/isl/options.h @@ -23,24 +23,24 @@ ISL_ARG_DECL(isl_options, struct isl_options, isl_options_args) #define ISL_BOUND_BERNSTEIN 0 #define ISL_BOUND_RANGE 1 -int isl_options_set_bound(isl_ctx *ctx, int val); +isl_stat isl_options_set_bound(isl_ctx *ctx, int val); int isl_options_get_bound(isl_ctx *ctx); #define ISL_ON_ERROR_WARN 0 #define ISL_ON_ERROR_CONTINUE 1 #define ISL_ON_ERROR_ABORT 2 -int isl_options_set_on_error(isl_ctx *ctx, int val); +isl_stat isl_options_set_on_error(isl_ctx *ctx, int val); int isl_options_get_on_error(isl_ctx *ctx); -int isl_options_set_gbr_only_first(isl_ctx *ctx, int val); +isl_stat isl_options_set_gbr_only_first(isl_ctx *ctx, int val); int isl_options_get_gbr_only_first(isl_ctx *ctx); #define ISL_SCHEDULE_ALGORITHM_ISL 0 #define ISL_SCHEDULE_ALGORITHM_FEAUTRIER 1 -int isl_options_set_schedule_algorithm(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_algorithm(isl_ctx *ctx, int val); int isl_options_get_schedule_algorithm(isl_ctx *ctx); -int isl_options_set_coalesce_bounded_wrapping(isl_ctx *ctx, int val); +isl_stat isl_options_set_coalesce_bounded_wrapping(isl_ctx *ctx, int val); int isl_options_get_coalesce_bounded_wrapping(isl_ctx *ctx); #if defined(__cplusplus) diff --git a/polly/lib/External/isl/include/isl/point.h b/polly/lib/External/isl/include/isl/point.h index 7e604c3caa20..ae295d3bd818 100644 --- a/polly/lib/External/isl/include/isl/point.h +++ b/polly/lib/External/isl/include/isl/point.h @@ -30,7 +30,7 @@ __isl_give isl_point *isl_point_sub_ui(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, unsigned val); __isl_give isl_point *isl_point_void(__isl_take isl_space *dim); -int isl_point_is_void(__isl_keep isl_point *pnt); +isl_bool isl_point_is_void(__isl_keep isl_point *pnt); __isl_give isl_printer *isl_printer_print_point( __isl_take isl_printer *printer, __isl_keep isl_point *pnt); diff --git a/polly/lib/External/isl/include/isl/polynomial.h b/polly/lib/External/isl/include/isl/polynomial.h index bc1780aebdcb..fdc510f7253a 100644 --- a/polly/lib/External/isl/include/isl/polynomial.h +++ b/polly/lib/External/isl/include/isl/polynomial.h @@ -45,12 +45,12 @@ __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp) __isl_null isl_qpolynomial *isl_qpolynomial_free( __isl_take isl_qpolynomial *qp); -int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, +isl_bool isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2); -int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp); -int isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp); int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp); __isl_give isl_qpolynomial *isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp); @@ -109,8 +109,8 @@ int isl_term_get_exp(__isl_keep isl_term *term, enum isl_dim_type type, unsigned pos); __isl_give isl_aff *isl_term_get_div(__isl_keep isl_term *term, unsigned pos); -int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, void *user), void *user); +isl_stat isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user); __isl_give isl_val *isl_qpolynomial_eval(__isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt); @@ -135,7 +135,7 @@ void isl_qpolynomial_dump(__isl_keep isl_qpolynomial *qp); isl_ctx *isl_pw_qpolynomial_get_ctx(__isl_keep isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_plain_is_equal(__isl_keep isl_pw_qpolynomial *pwqp1, +isl_bool isl_pw_qpolynomial_plain_is_equal(__isl_keep isl_pw_qpolynomial *pwqp1, __isl_keep isl_pw_qpolynomial *pwqp2); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(__isl_take isl_space *dim); @@ -148,7 +148,7 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy( __isl_null isl_pw_qpolynomial *isl_pw_qpolynomial_free( __isl_take isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp); +isl_bool isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp); __isl_give isl_space *isl_pw_qpolynomial_get_domain_space( __isl_keep isl_pw_qpolynomial *pwqp); @@ -158,7 +158,7 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_domain_space( __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_space *dim); unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp, enum isl_dim_type type); -int isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp, +isl_bool isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp, enum isl_dim_type type, unsigned first, unsigned n); int isl_pw_qpolynomial_has_equal_space(__isl_keep isl_pw_qpolynomial *pwqp1, __isl_keep isl_pw_qpolynomial *pwqp2); @@ -232,11 +232,12 @@ __isl_give isl_val *isl_pw_qpolynomial_eval( __isl_give isl_val *isl_pw_qpolynomial_max(__isl_take isl_pw_qpolynomial *pwqp); __isl_give isl_val *isl_pw_qpolynomial_min(__isl_take isl_pw_qpolynomial *pwqp); -int isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, +isl_stat isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); -int isl_pw_qpolynomial_foreach_lifted_piece(__isl_keep isl_pw_qpolynomial *pwqp, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, +isl_stat isl_pw_qpolynomial_foreach_lifted_piece( + __isl_keep isl_pw_qpolynomial *pwqp, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user), void *user); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff( @@ -279,7 +280,7 @@ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_copy( void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold); int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold); -int isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold); +isl_bool isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold); int isl_qpolynomial_fold_plain_is_equal(__isl_keep isl_qpolynomial_fold *fold1, __isl_keep isl_qpolynomial_fold *fold2); @@ -313,9 +314,9 @@ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist_params( __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist( __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *context); -int isl_qpolynomial_fold_foreach_qpolynomial( +isl_stat isl_qpolynomial_fold_foreach_qpolynomial( __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user); + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user); __isl_give isl_printer *isl_printer_print_qpolynomial_fold( __isl_take isl_printer *p, __isl_keep isl_qpolynomial_fold *fold); @@ -325,7 +326,7 @@ void isl_qpolynomial_fold_dump(__isl_keep isl_qpolynomial_fold *fold); isl_ctx *isl_pw_qpolynomial_fold_get_ctx(__isl_keep isl_pw_qpolynomial_fold *pwf); -int isl_pw_qpolynomial_fold_plain_is_equal( +isl_bool isl_pw_qpolynomial_fold_plain_is_equal( __isl_keep isl_pw_qpolynomial_fold *pwf1, __isl_keep isl_pw_qpolynomial_fold *pwf2); @@ -340,7 +341,8 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy( __isl_null isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_free( __isl_take isl_pw_qpolynomial_fold *pwf); -int isl_pw_qpolynomial_fold_is_zero(__isl_keep isl_pw_qpolynomial_fold *pwf); +isl_bool isl_pw_qpolynomial_fold_is_zero( + __isl_keep isl_pw_qpolynomial_fold *pwf); __isl_give isl_space *isl_pw_qpolynomial_fold_get_domain_space( __isl_keep isl_pw_qpolynomial_fold *pwf); @@ -406,14 +408,14 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_move_dims( __isl_give isl_val *isl_pw_qpolynomial_fold_eval( __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_point *pnt); -int isl_pw_qpolynomial_fold_foreach_piece( +isl_stat isl_pw_qpolynomial_fold_foreach_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); -int isl_pw_qpolynomial_fold_foreach_lifted_piece( + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, void *user), void *user); +isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece( __isl_keep isl_pw_qpolynomial_fold *pwf, - int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, - void *user), void *user); + isl_stat (*fn)(__isl_take isl_set *set, + __isl_take isl_qpolynomial_fold *fold, void *user), void *user); __isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold( __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf); @@ -453,7 +455,7 @@ isl_ctx *isl_union_pw_qpolynomial_get_ctx( unsigned isl_union_pw_qpolynomial_dim( __isl_keep isl_union_pw_qpolynomial *upwqp, enum isl_dim_type type); -int isl_union_pw_qpolynomial_plain_is_equal( +isl_bool isl_union_pw_qpolynomial_plain_is_equal( __isl_keep isl_union_pw_qpolynomial *upwqp1, __isl_keep isl_union_pw_qpolynomial *upwqp2); @@ -536,9 +538,10 @@ __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_align_params( int isl_union_pw_qpolynomial_n_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp); -int isl_union_pw_qpolynomial_foreach_pw_qpolynomial( +isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp, - int (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), void *user); + isl_stat (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), + void *user); __isl_give isl_pw_qpolynomial *isl_union_pw_qpolynomial_extract_pw_qpolynomial( __isl_keep isl_union_pw_qpolynomial *upwqp, __isl_take isl_space *dim); @@ -551,7 +554,7 @@ isl_ctx *isl_union_pw_qpolynomial_fold_get_ctx( unsigned isl_union_pw_qpolynomial_fold_dim( __isl_keep isl_union_pw_qpolynomial_fold *upwf, enum isl_dim_type type); -int isl_union_pw_qpolynomial_fold_plain_is_equal( +isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal( __isl_keep isl_union_pw_qpolynomial_fold *upwf1, __isl_keep isl_union_pw_qpolynomial_fold *upwf2); @@ -635,9 +638,9 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_align_pa int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf); -int isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( +isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf, - int (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, + isl_stat (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf, void *user), void *user); __isl_give isl_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold( __isl_keep isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_space *dim); diff --git a/polly/lib/External/isl/include/isl/schedule.h b/polly/lib/External/isl/include/isl/schedule.h index 2d741d33110b..b28adc8c1cb9 100644 --- a/polly/lib/External/isl/include/isl/schedule.h +++ b/polly/lib/External/isl/include/isl/schedule.h @@ -17,27 +17,27 @@ extern "C" { struct isl_schedule_constraints; typedef struct isl_schedule_constraints isl_schedule_constraints; -int isl_options_set_schedule_max_coefficient(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_max_coefficient(isl_ctx *ctx, int val); int isl_options_get_schedule_max_coefficient(isl_ctx *ctx); -int isl_options_set_schedule_max_constant_term(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_max_constant_term(isl_ctx *ctx, int val); int isl_options_get_schedule_max_constant_term(isl_ctx *ctx); -int isl_options_set_schedule_maximize_band_depth(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_maximize_band_depth(isl_ctx *ctx, int val); int isl_options_get_schedule_maximize_band_depth(isl_ctx *ctx); -int isl_options_set_schedule_outer_coincidence(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_outer_coincidence(isl_ctx *ctx, int val); int isl_options_get_schedule_outer_coincidence(isl_ctx *ctx); -int isl_options_set_schedule_split_scaled(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_split_scaled(isl_ctx *ctx, int val); int isl_options_get_schedule_split_scaled(isl_ctx *ctx); -int isl_options_set_schedule_separate_components(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_separate_components(isl_ctx *ctx, int val); int isl_options_get_schedule_separate_components(isl_ctx *ctx); #define ISL_SCHEDULE_FUSE_MAX 0 #define ISL_SCHEDULE_FUSE_MIN 1 -int isl_options_set_schedule_fuse(isl_ctx *ctx, int val); +isl_stat isl_options_set_schedule_fuse(isl_ctx *ctx, int val); int isl_options_get_schedule_fuse(isl_ctx *ctx); __isl_give isl_schedule_constraints *isl_schedule_constraints_copy( @@ -93,7 +93,7 @@ __isl_null isl_schedule *isl_schedule_free(__isl_take isl_schedule *sched); __isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *sched); isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *sched); -int isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, +isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, __isl_keep isl_schedule *schedule2); __isl_give isl_schedule_node *isl_schedule_get_root( @@ -101,9 +101,11 @@ __isl_give isl_schedule_node *isl_schedule_get_root( __isl_give isl_union_set *isl_schedule_get_domain( __isl_keep isl_schedule *schedule); -int isl_schedule_foreach_schedule_node(__isl_keep isl_schedule *sched, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); -__isl_give isl_schedule *isl_schedule_map_schedule_node( +isl_stat isl_schedule_foreach_schedule_node_top_down( + __isl_keep isl_schedule *sched, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +__isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up( __isl_take isl_schedule *schedule, __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, void *user), void *user); diff --git a/polly/lib/External/isl/include/isl/schedule_node.h b/polly/lib/External/isl/include/isl/schedule_node.h index a97ff2ce03bd..9cb05e174944 100644 --- a/polly/lib/External/isl/include/isl/schedule_node.h +++ b/polly/lib/External/isl/include/isl/schedule_node.h @@ -21,7 +21,7 @@ __isl_give isl_schedule_node *isl_schedule_node_copy( __isl_null isl_schedule_node *isl_schedule_node_free( __isl_take isl_schedule_node *node); -int isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, +isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, __isl_keep isl_schedule_node *node2); isl_ctx *isl_schedule_node_get_ctx(__isl_keep isl_schedule_node *node); @@ -32,21 +32,25 @@ enum isl_schedule_node_type isl_schedule_node_get_parent_type( __isl_give isl_schedule *isl_schedule_node_get_schedule( __isl_keep isl_schedule_node *node); -int isl_schedule_node_foreach_descendant(__isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); -int isl_schedule_node_foreach_ancestor_top_down( +isl_stat isl_schedule_node_foreach_descendant_top_down( __isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user); -__isl_give isl_schedule_node *isl_schedule_node_map_descendant( + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +isl_stat isl_schedule_node_foreach_ancestor_top_down( + __isl_keep isl_schedule_node *node, + isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user); +__isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up( __isl_take isl_schedule_node *node, __isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node, void *user), void *user); int isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node); -int isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node); -int isl_schedule_node_has_children(__isl_keep isl_schedule_node *node); -int isl_schedule_node_has_previous_sibling(__isl_keep isl_schedule_node *node); -int isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_previous_sibling( + __isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node); int isl_schedule_node_n_children(__isl_keep isl_schedule_node *node); int isl_schedule_node_get_child_position(__isl_keep isl_schedule_node *node); int isl_schedule_node_get_ancestor_child_position( @@ -73,7 +77,8 @@ __isl_give isl_schedule_node *isl_schedule_node_previous_sibling( __isl_give isl_schedule_node *isl_schedule_node_next_sibling( __isl_take isl_schedule_node *node); -int isl_schedule_node_is_subtree_anchored(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node *isl_schedule_node_group( __isl_take isl_schedule_node *node, __isl_take isl_id *group_id); @@ -100,17 +105,18 @@ __isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options( __isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options( __isl_take isl_schedule_node *node, __isl_take isl_union_set *options); unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node); -int isl_schedule_node_band_member_get_coincident( +isl_bool isl_schedule_node_band_member_get_coincident( __isl_keep isl_schedule_node *node, int pos); __isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident( __isl_take isl_schedule_node *node, int pos, int coincident); -int isl_schedule_node_band_get_permutable(__isl_keep isl_schedule_node *node); +isl_bool isl_schedule_node_band_get_permutable( + __isl_keep isl_schedule_node *node); __isl_give isl_schedule_node *isl_schedule_node_band_set_permutable( __isl_take isl_schedule_node *node, int permutable); -int isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_scale_tile_loops(isl_ctx *ctx, int val); int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx); -int isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); +isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val); int isl_options_get_tile_shift_point_loops(isl_ctx *ctx); __isl_give isl_schedule_node *isl_schedule_node_band_scale( diff --git a/polly/lib/External/isl/include/isl/set.h b/polly/lib/External/isl/include/isl/set.h index 86159060c2f2..096c2230bfff 100644 --- a/polly/lib/External/isl/include/isl/set.h +++ b/polly/lib/External/isl/include/isl/set.h @@ -17,6 +17,7 @@ #include #include #include +#include #if defined(__cplusplus) extern "C" { @@ -46,7 +47,7 @@ __isl_give isl_local_space *isl_basic_set_get_local_space( __isl_keep isl_basic_set *bset); const char *isl_basic_set_get_tuple_name(__isl_keep isl_basic_set *bset); -int isl_set_has_tuple_name(__isl_keep isl_set *set); +isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set); const char *isl_set_get_tuple_name(__isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_set_set_tuple_name( __isl_take isl_basic_set *set, const char *s); @@ -57,7 +58,7 @@ const char *isl_basic_set_get_dim_name(__isl_keep isl_basic_set *bset, __isl_give isl_basic_set *isl_basic_set_set_dim_name( __isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned pos, const char *s); -int isl_set_has_dim_name(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); const char *isl_set_get_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); @@ -70,14 +71,14 @@ __isl_give isl_basic_set *isl_basic_set_set_tuple_id( __isl_take isl_basic_set *bset, __isl_take isl_id *id); __isl_give isl_set *isl_set_set_dim_id(__isl_take isl_set *set, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_set_has_dim_id(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_set_get_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_give isl_set *isl_set_set_tuple_id(__isl_take isl_set *set, __isl_take isl_id *id); __isl_give isl_set *isl_set_reset_tuple_id(__isl_take isl_set *set); -int isl_set_has_tuple_id(__isl_keep isl_set *set); +isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set); __isl_give isl_id *isl_set_get_tuple_id(__isl_keep isl_set *set); __isl_give isl_set *isl_set_reset_user(__isl_take isl_set *set); @@ -88,18 +89,8 @@ int isl_set_find_dim_by_name(__isl_keep isl_set *set, enum isl_dim_type type, int isl_basic_set_is_rational(__isl_keep isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned dim, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base, - unsigned nparam, unsigned dim, unsigned extra, - unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_extend_constraints( - struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq); -struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset); __isl_null isl_basic_set *isl_basic_set_free(__isl_take isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset); __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_space *dim); __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *dim); __isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_space *dim); @@ -128,7 +119,6 @@ __isl_give isl_basic_set *isl_basic_set_remove_dims( enum isl_dim_type type, unsigned first, unsigned n); __isl_export __isl_give isl_basic_set *isl_basic_set_sample(__isl_take isl_basic_set *bset); -struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset); __isl_export __isl_give isl_basic_set *isl_basic_set_detect_equalities( __isl_take isl_basic_set *bset); @@ -172,16 +162,10 @@ __isl_give isl_set *isl_set_upper_bound_val(__isl_take isl_set *set, __isl_give isl_set *isl_set_equate(__isl_take isl_set *set, enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2); -struct isl_basic_set *isl_basic_set_from_underlying_set( - struct isl_basic_set *bset, struct isl_basic_set *like); -struct isl_set *isl_set_from_underlying_set( - struct isl_set *set, struct isl_basic_set *like); -struct isl_set *isl_set_to_underlying_set(struct isl_set *set); - __isl_export -int isl_basic_set_is_equal( - struct isl_basic_set *bset1, struct isl_basic_set *bset2); -int isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_equal(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2); +isl_bool isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); __isl_give isl_set *isl_basic_set_partial_lexmin( @@ -234,30 +218,24 @@ __isl_give isl_set *isl_set_from_params(__isl_take isl_set *set); int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, unsigned n, int *signs); -int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); -int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_universe(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset); __isl_export -int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); +isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset); int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset); __isl_export -int isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); -int isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2); -struct isl_set *isl_set_alloc(struct isl_ctx *ctx, - unsigned nparam, unsigned dim, int n, unsigned flags); -struct isl_set *isl_set_extend(struct isl_set *base, - unsigned nparam, unsigned dim); __isl_give isl_set *isl_set_empty(__isl_take isl_space *dim); __isl_give isl_set *isl_set_universe(__isl_take isl_space *dim); __isl_give isl_set *isl_set_nat_universe(__isl_take isl_space *dim); __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set, __isl_take isl_basic_set *bset); -struct isl_set *isl_set_finalize(struct isl_set *set); __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set); __isl_null isl_set *isl_set_free(__isl_take isl_set *set); -struct isl_set *isl_set_dup(struct isl_set *set); __isl_constructor __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset); __isl_export @@ -374,27 +352,29 @@ __isl_give isl_set *isl_set_drop_constraints_involving_dims( __isl_take isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); -int isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, +isl_bool isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n); -int isl_set_involves_dims(__isl_keep isl_set *set, +isl_bool isl_set_involves_dims(__isl_keep isl_set *set, enum isl_dim_type type, unsigned first, unsigned n); void isl_set_print_internal(__isl_keep isl_set *set, FILE *out, int indent); -int isl_set_plain_is_empty(__isl_keep isl_set *set); -int isl_set_plain_is_universe(__isl_keep isl_set *set); -int isl_set_is_params(__isl_keep isl_set *set); +isl_bool isl_set_plain_is_empty(__isl_keep isl_set *set); +isl_bool isl_set_plain_is_universe(__isl_keep isl_set *set); +isl_bool isl_set_is_params(__isl_keep isl_set *set); __isl_export -int isl_set_is_empty(__isl_keep isl_set *set); +isl_bool isl_set_is_empty(__isl_keep isl_set *set); int isl_set_is_bounded(__isl_keep isl_set *set); __isl_export -int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); __isl_export -int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_strict_subset(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); __isl_export -int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); +isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); __isl_export -int isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_is_singleton(__isl_keep isl_set *set); +isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); +isl_bool isl_set_is_singleton(__isl_keep isl_set *set); int isl_set_is_box(__isl_keep isl_set *set); int isl_set_has_equal_space(__isl_keep isl_set *set1, __isl_keep isl_set *set2); @@ -416,13 +396,13 @@ __isl_give isl_val *isl_set_plain_get_val_if_fixed(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); int isl_set_dim_is_bounded(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); -int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos); __isl_export @@ -435,15 +415,16 @@ __isl_give isl_set *isl_set_gist(__isl_take isl_set *set, __isl_take isl_set *context); __isl_give isl_set *isl_set_gist_params(__isl_take isl_set *set, __isl_take isl_set *context); -int isl_set_dim_residue_class_val(__isl_keep isl_set *set, +isl_stat isl_set_dim_residue_class_val(__isl_keep isl_set *set, int pos, __isl_give isl_val **modulo, __isl_give isl_val **residue); __isl_export __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set); int isl_set_plain_cmp(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2); -int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, +isl_bool isl_set_plain_is_equal(__isl_keep isl_set *set1, + __isl_keep isl_set *set2); +isl_bool isl_set_plain_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2); uint32_t isl_set_get_hash(struct isl_set *set); @@ -452,11 +433,11 @@ int isl_set_dim_is_unique(struct isl_set *set, unsigned dim); int isl_set_n_basic_set(__isl_keep isl_set *set); __isl_export -int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user); +isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, void *user), void *user); -int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user); +isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user); __isl_give isl_val *isl_set_count_val(__isl_keep isl_set *set); __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt); diff --git a/polly/lib/External/isl/include/isl/space.h b/polly/lib/External/isl/include/isl/space.h index d6fce404156a..fdcbff1d3772 100644 --- a/polly/lib/External/isl/include/isl/space.h +++ b/polly/lib/External/isl/include/isl/space.h @@ -40,13 +40,13 @@ __isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam); __isl_give isl_space *isl_space_copy(__isl_keep isl_space *dim); __isl_null isl_space *isl_space_free(__isl_take isl_space *space); -int isl_space_is_params(__isl_keep isl_space *space); -int isl_space_is_set(__isl_keep isl_space *space); -int isl_space_is_map(__isl_keep isl_space *space); +isl_bool isl_space_is_params(__isl_keep isl_space *space); +isl_bool isl_space_is_set(__isl_keep isl_space *space); +isl_bool isl_space_is_map(__isl_keep isl_space *space); __isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *dim, enum isl_dim_type type, const char *s); -int isl_space_has_tuple_name(__isl_keep isl_space *space, +isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type); const char *isl_space_get_tuple_name(__isl_keep isl_space *dim, enum isl_dim_type type); @@ -54,14 +54,15 @@ __isl_give isl_space *isl_space_set_tuple_id(__isl_take isl_space *dim, enum isl_dim_type type, __isl_take isl_id *id); __isl_give isl_space *isl_space_reset_tuple_id(__isl_take isl_space *dim, enum isl_dim_type type); -int isl_space_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type); +isl_bool isl_space_has_tuple_id(__isl_keep isl_space *dim, + enum isl_dim_type type); __isl_give isl_id *isl_space_get_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type); __isl_give isl_space *isl_space_reset_user(__isl_take isl_space *space); __isl_give isl_space *isl_space_set_dim_id(__isl_take isl_space *dim, enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); -int isl_space_has_dim_id(__isl_keep isl_space *dim, +isl_bool isl_space_has_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos); __isl_give isl_id *isl_space_get_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos); @@ -71,7 +72,7 @@ int isl_space_find_dim_by_id(__isl_keep isl_space *dim, enum isl_dim_type type, int isl_space_find_dim_by_name(__isl_keep isl_space *space, enum isl_dim_type type, const char *name); -int isl_space_has_dim_name(__isl_keep isl_space *space, +isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos); __isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *dim, enum isl_dim_type type, unsigned pos, @@ -128,28 +129,28 @@ __isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space); __isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1, __isl_take isl_space *dim2); -int isl_space_is_wrapping(__isl_keep isl_space *dim); -int isl_space_domain_is_wrapping(__isl_keep isl_space *space); -int isl_space_range_is_wrapping(__isl_keep isl_space *space); +isl_bool isl_space_is_wrapping(__isl_keep isl_space *dim); +isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space); +isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space); __isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim); __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *dim); -int isl_space_can_zip(__isl_keep isl_space *dim); +isl_bool isl_space_can_zip(__isl_keep isl_space *dim); __isl_give isl_space *isl_space_zip(__isl_take isl_space *dim); -int isl_space_can_curry(__isl_keep isl_space *space); +isl_bool isl_space_can_curry(__isl_keep isl_space *space); __isl_give isl_space *isl_space_curry(__isl_take isl_space *space); -int isl_space_can_uncurry(__isl_keep isl_space *space); +isl_bool isl_space_can_uncurry(__isl_keep isl_space *space); __isl_give isl_space *isl_space_uncurry(__isl_take isl_space *space); -int isl_space_is_domain(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_range(__isl_keep isl_space *space1, +isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_equal(__isl_keep isl_space *space1, +isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_tuple_is_equal(__isl_keep isl_space *space1, +isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, enum isl_dim_type type2); int isl_space_match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type, diff --git a/polly/lib/External/isl/include/isl/stdint.h b/polly/lib/External/isl/include/isl/stdint.h new file mode 100644 index 000000000000..9a6118bd8590 --- /dev/null +++ b/polly/lib/External/isl/include/isl/stdint.h @@ -0,0 +1 @@ +#include diff --git a/polly/lib/External/isl/include/isl/union_map.h b/polly/lib/External/isl/include/isl/union_map.h index 31a942bb4a97..2dac338abed1 100644 --- a/polly/lib/External/isl/include/isl/union_map.h +++ b/polly/lib/External/isl/include/isl/union_map.h @@ -14,7 +14,7 @@ extern "C" { unsigned isl_union_map_dim(__isl_keep isl_union_map *umap, enum isl_dim_type type); -int isl_union_map_involves_dims(__isl_keep isl_union_map *umap, +isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n); __isl_give isl_id *isl_union_map_get_dim_id(__isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned pos); @@ -178,31 +178,31 @@ __isl_give isl_union_map *isl_union_map_project_out( enum isl_dim_type type, unsigned first, unsigned n); __isl_export -int isl_union_map_is_empty(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); -int isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_single_valued(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_injective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_injective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_bijective(__isl_keep isl_union_map *umap); +isl_bool isl_union_map_is_bijective(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_is_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); __isl_export -int isl_union_map_is_equal(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); -int isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); __isl_export -int isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2); int isl_union_map_n_map(__isl_keep isl_union_map *umap); __isl_export -int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), void *user); +isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user); __isl_give int isl_union_map_contains(__isl_keep isl_union_map *umap, __isl_keep isl_space *dim); __isl_give isl_map *isl_union_map_extract_map(__isl_keep isl_union_map *umap, diff --git a/polly/lib/External/isl/include/isl/union_set.h b/polly/lib/External/isl/include/isl/union_set.h index 7591ce2952d5..3d818fe9933a 100644 --- a/polly/lib/External/isl/include/isl/union_set.h +++ b/polly/lib/External/isl/include/isl/union_set.h @@ -90,33 +90,33 @@ __isl_give isl_union_set *isl_union_set_project_out( __isl_take isl_union_set *uset, enum isl_dim_type type, unsigned first, unsigned n); -int isl_union_set_is_params(__isl_keep isl_union_set *uset); +isl_bool isl_union_set_is_params(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_is_empty(__isl_keep isl_union_set *uset); +isl_bool isl_union_set_is_empty(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_is_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); __isl_export -int isl_union_set_is_equal(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); -int isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); __isl_export -int isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2); int isl_union_set_n_set(__isl_keep isl_union_set *uset); __isl_export -int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), void *user); +isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user); __isl_give int isl_union_set_contains(__isl_keep isl_union_set *uset, __isl_keep isl_space *dim); __isl_give isl_set *isl_union_set_extract_set(__isl_keep isl_union_set *uset, __isl_take isl_space *dim); __isl_give isl_set *isl_set_from_union_set(__isl_take isl_union_set *uset); -int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user); +isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user); __isl_give isl_basic_set *isl_union_set_sample(__isl_take isl_union_set *uset); diff --git a/polly/lib/External/isl/include/isl/val.h b/polly/lib/External/isl/include/isl/val.h index 4353c1087a1a..b5a56691c0b1 100644 --- a/polly/lib/External/isl/include/isl/val.h +++ b/polly/lib/External/isl/include/isl/val.h @@ -69,30 +69,31 @@ __isl_give isl_val *isl_val_gcdext(__isl_take isl_val *v1, __isl_take isl_val *v2, __isl_give isl_val **x, __isl_give isl_val **y); int isl_val_sgn(__isl_keep isl_val *v); -int isl_val_is_zero(__isl_keep isl_val *v); -int isl_val_is_one(__isl_keep isl_val *v); -int isl_val_is_negone(__isl_keep isl_val *v); -int isl_val_is_nonneg(__isl_keep isl_val *v); -int isl_val_is_nonpos(__isl_keep isl_val *v); -int isl_val_is_pos(__isl_keep isl_val *v); -int isl_val_is_neg(__isl_keep isl_val *v); -int isl_val_is_int(__isl_keep isl_val *v); -int isl_val_is_rat(__isl_keep isl_val *v); -int isl_val_is_nan(__isl_keep isl_val *v); -int isl_val_is_infty(__isl_keep isl_val *v); -int isl_val_is_neginfty(__isl_keep isl_val *v); +isl_bool isl_val_is_zero(__isl_keep isl_val *v); +isl_bool isl_val_is_one(__isl_keep isl_val *v); +isl_bool isl_val_is_negone(__isl_keep isl_val *v); +isl_bool isl_val_is_nonneg(__isl_keep isl_val *v); +isl_bool isl_val_is_nonpos(__isl_keep isl_val *v); +isl_bool isl_val_is_pos(__isl_keep isl_val *v); +isl_bool isl_val_is_neg(__isl_keep isl_val *v); +isl_bool isl_val_is_int(__isl_keep isl_val *v); +isl_bool isl_val_is_rat(__isl_keep isl_val *v); +isl_bool isl_val_is_nan(__isl_keep isl_val *v); +isl_bool isl_val_is_infty(__isl_keep isl_val *v); +isl_bool isl_val_is_neginfty(__isl_keep isl_val *v); int isl_val_cmp_si(__isl_keep isl_val *v, long i); -int isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2); -int isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2); +isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, + __isl_keep isl_val *v2); __isl_give isl_val *isl_val_read_from_str(isl_ctx *ctx, const char *str); __isl_give isl_printer *isl_printer_print_val(__isl_take isl_printer *p, diff --git a/polly/lib/External/isl/include/isl/vec.h b/polly/lib/External/isl/include/isl/vec.h index d2fb48ccdb9e..e73278cd2365 100644 --- a/polly/lib/External/isl/include/isl/vec.h +++ b/polly/lib/External/isl/include/isl/vec.h @@ -36,7 +36,7 @@ __isl_give isl_vec *isl_vec_set_element_si(__isl_take isl_vec *vec, __isl_give isl_vec *isl_vec_set_element_val(__isl_take isl_vec *vec, int pos, __isl_take isl_val *v); -int isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2); +isl_bool isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2); int isl_vec_cmp_element(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2, int pos); diff --git a/polly/lib/External/isl/include/isl/vertices.h b/polly/lib/External/isl/include/isl/vertices.h index 7a4b353a5a9d..a10b4f3003b4 100644 --- a/polly/lib/External/isl/include/isl/vertices.h +++ b/polly/lib/External/isl/include/isl/vertices.h @@ -27,18 +27,18 @@ __isl_give isl_vertices *isl_basic_set_compute_vertices( __isl_keep isl_basic_set *bset); isl_ctx *isl_vertices_get_ctx(__isl_keep isl_vertices *vertices); int isl_vertices_get_n_vertices(__isl_keep isl_vertices *vertices); -int isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); +isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); void isl_vertices_free(__isl_take isl_vertices *vertices); isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell); __isl_give isl_basic_set *isl_cell_get_domain(__isl_keep isl_cell *cell); -int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); +isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user); void isl_cell_free(__isl_take isl_cell *cell); -int isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), void *user); +isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_cell *cell, void *user), void *user); #if defined(__cplusplus) } diff --git a/polly/lib/External/isl/isl_aff.c b/polly/lib/External/isl/isl_aff.c index 28cd15745d64..f61ea3a7f504 100644 --- a/polly/lib/External/isl/isl_aff.c +++ b/polly/lib/External/isl/isl_aff.c @@ -469,59 +469,60 @@ error: * * If the denominator is zero, then "aff" is not equal to zero. */ -int isl_aff_plain_is_zero(__isl_keep isl_aff *aff) +isl_bool isl_aff_plain_is_zero(__isl_keep isl_aff *aff) { if (!aff) - return -1; + return isl_bool_error; if (isl_int_is_zero(aff->v->el[0])) - return 0; + return isl_bool_false; return isl_seq_first_non_zero(aff->v->el + 1, aff->v->size - 1) < 0; } /* Does "aff" represent NaN? */ -int isl_aff_is_nan(__isl_keep isl_aff *aff) +isl_bool isl_aff_is_nan(__isl_keep isl_aff *aff) { if (!aff) - return -1; + return isl_bool_error; return isl_seq_first_non_zero(aff->v->el, 2) < 0; } /* Does "pa" involve any NaNs? */ -int isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa) +isl_bool isl_pw_aff_involves_nan(__isl_keep isl_pw_aff *pa) { int i; if (!pa) - return -1; + return isl_bool_error; if (pa->n == 0) - return 0; + return isl_bool_false; for (i = 0; i < pa->n; ++i) { - int is_nan = isl_aff_is_nan(pa->p[i].aff); + isl_bool is_nan = isl_aff_is_nan(pa->p[i].aff); if (is_nan < 0 || is_nan) return is_nan; } - return 0; + return isl_bool_false; } /* Are "aff1" and "aff2" obviously equal? * * NaN is not equal to anything, not even to another NaN. */ -int isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2) +isl_bool isl_aff_plain_is_equal(__isl_keep isl_aff *aff1, + __isl_keep isl_aff *aff2) { - int equal; + isl_bool equal; if (!aff1 || !aff2) - return -1; + return isl_bool_error; if (isl_aff_is_nan(aff1) || isl_aff_is_nan(aff2)) - return 0; + return isl_bool_false; equal = isl_local_space_is_equal(aff1->ls, aff2->ls); if (equal < 0 || !equal) @@ -2328,23 +2329,23 @@ int isl_aff_is_empty(__isl_keep isl_aff *aff) * appear with non-zero coefficients in any of the integer divisions * involved in the affine expression. */ -int isl_aff_involves_dims(__isl_keep isl_aff *aff, +isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_ctx *ctx; int *active = NULL; - int involves = 0; + isl_bool involves = isl_bool_false; if (!aff) - return -1; + return isl_bool_error; if (n == 0) - return 0; + return isl_bool_false; ctx = isl_aff_get_ctx(aff); if (first + n > isl_aff_dim(aff, type)) isl_die(ctx, isl_error_invalid, - "range out of bounds", return -1); + "range out of bounds", return isl_bool_error); active = isl_local_space_get_active(aff->ls, aff->v->el + 2); if (!active) @@ -2353,7 +2354,7 @@ int isl_aff_involves_dims(__isl_keep isl_aff *aff, first += isl_local_space_offset(aff->ls, type) - 1; for (i = 0; i < n; ++i) if (active[first + i]) { - involves = 1; + involves = isl_bool_true; break; } @@ -2362,7 +2363,7 @@ int isl_aff_involves_dims(__isl_keep isl_aff *aff, return involves; error: free(active); - return -1; + return isl_bool_error; } __isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff, @@ -3299,30 +3300,30 @@ error: return NULL; } -int isl_aff_is_cst(__isl_keep isl_aff *aff) +isl_bool isl_aff_is_cst(__isl_keep isl_aff *aff) { if (!aff) - return -1; + return isl_bool_error; return isl_seq_first_non_zero(aff->v->el + 2, aff->v->size - 2) == -1; } /* Check whether pwaff is a piecewise constant. */ -int isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff) +isl_bool isl_pw_aff_is_cst(__isl_keep isl_pw_aff *pwaff) { int i; if (!pwaff) - return -1; + return isl_bool_error; for (i = 0; i < pwaff->n; ++i) { - int is_cst = isl_aff_is_cst(pwaff->p[i].aff); + isl_bool is_cst = isl_aff_is_cst(pwaff->p[i].aff); if (is_cst < 0 || !is_cst) return is_cst; } - return 1; + return isl_bool_true; } /* Return the product of "aff1" and "aff2". @@ -5018,7 +5019,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(__isl_take isl_set *set) /* Convert "map" into an isl_pw_multi_aff (if possible) and * add it to *user. */ -static int pw_multi_aff_from_map(__isl_take isl_map *map, void *user) +static isl_stat pw_multi_aff_from_map(__isl_take isl_map *map, void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; @@ -5026,7 +5027,7 @@ static int pw_multi_aff_from_map(__isl_take isl_map *map, void *user) pma = isl_pw_multi_aff_from_map(map); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); - return *upma ? 0 : -1; + return *upma ? isl_stat_ok : isl_stat_error; } /* Create an isl_union_pw_multi_aff with the given isl_aff on a universe @@ -5654,7 +5655,8 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_domain( /* Add an isl_pw_multi_aff with the given "set" as domain and * an unnamed zero-dimensional range to *user. */ -static int add_pw_multi_aff_from_domain(__isl_take isl_set *set, void *user) +static isl_stat add_pw_multi_aff_from_domain(__isl_take isl_set *set, + void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; @@ -5662,7 +5664,7 @@ static int add_pw_multi_aff_from_domain(__isl_take isl_set *set, void *user) pma = isl_pw_multi_aff_from_domain(set); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); - return 0; + return isl_stat_ok; } /* Return an isl_union_pw_multi_aff with the given "uset" as domain and @@ -5694,7 +5696,8 @@ error: /* Convert "pma" to an isl_map and add it to *umap. */ -static int map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, + void *user) { isl_union_map **umap = user; isl_map *map; @@ -5702,7 +5705,7 @@ static int map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma, void *user) map = isl_map_from_pw_multi_aff(pma); *umap = isl_union_map_add_map(*umap, map); - return 0; + return isl_stat_ok; } /* Construct a union map mapping the domain of the union @@ -5739,13 +5742,13 @@ struct isl_union_pw_multi_aff_bin_data { isl_union_pw_multi_aff *upma2; isl_union_pw_multi_aff *res; isl_pw_multi_aff *pma; - int (*fn)(void **entry, void *user); + isl_stat (*fn)(void **entry, void *user); }; /* Given an isl_pw_multi_aff from upma1, store it in data->pma * and call data->fn for each isl_pw_multi_aff in data->upma2. */ -static int bin_entry(void **entry, void *user) +static isl_stat bin_entry(void **entry, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_pw_multi_aff *pma = *entry; @@ -5753,9 +5756,9 @@ static int bin_entry(void **entry, void *user) data->pma = pma; if (isl_hash_table_foreach(data->upma2->space->ctx, &data->upma2->table, data->fn, data) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Call "fn" on each pair of isl_pw_multi_affs in "upma1" and "upma2". @@ -5766,7 +5769,7 @@ static int bin_entry(void **entry, void *user) static __isl_give isl_union_pw_multi_aff *bin_op( __isl_take isl_union_pw_multi_aff *upma1, __isl_take isl_union_pw_multi_aff *upma2, - int (*fn)(void **entry, void *user)) + isl_stat (*fn)(void **entry, void *user)) { isl_space *space; struct isl_union_pw_multi_aff_bin_data data = { NULL, NULL, NULL, fn }; @@ -5848,14 +5851,14 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_flat_range_product( /* If data->pma and *entry have the same domain space, then compute * their flat range product and the result to data->res. */ -static int flat_range_product_entry(void **entry, void *user) +static isl_stat flat_range_product_entry(void **entry, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_pw_multi_aff *pma2 = *entry; if (!isl_space_tuple_is_equal(data->pma->dim, isl_dim_in, pma2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; pma2 = isl_pw_multi_aff_flat_range_product( isl_pw_multi_aff_copy(data->pma), @@ -5863,7 +5866,7 @@ static int flat_range_product_entry(void **entry, void *user) data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); - return 0; + return isl_stat_ok; } /* Given two isl_union_pw_multi_affs A -> B and C -> D, @@ -6078,25 +6081,26 @@ struct isl_union_pw_multi_aff_scale_multi_val_data { * then apply isl_pw_multi_aff_scale_multi_val and add the result * to data->res. */ -static int union_pw_multi_aff_scale_multi_val_entry(void **entry, void *user) +static isl_stat union_pw_multi_aff_scale_multi_val_entry(void **entry, + void *user) { struct isl_union_pw_multi_aff_scale_multi_val_data *data = user; isl_pw_multi_aff *pma = *entry; if (!pma) - return -1; + return isl_stat_error; if (!isl_space_tuple_is_equal(pma->dim, isl_dim_out, data->mv->space, isl_dim_set)) - return 0; + return isl_stat_ok; pma = isl_pw_multi_aff_copy(pma); pma = isl_pw_multi_aff_scale_multi_val(pma, isl_multi_val_copy(data->mv)); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Scale the elements of "upma" by the corresponding elements of "mv", @@ -6372,21 +6376,21 @@ int isl_pw_aff_is_equal(__isl_keep isl_pw_aff *pa1, __isl_keep isl_pw_aff *pa2) * to a map because the domains of the piecewise affine expressions * may not be the same. */ -int isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, +isl_bool isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2) { int i; - int equal; + isl_bool equal; if (!mpa1 || !mpa2) - return -1; + return isl_bool_error; if (!isl_space_match(mpa1->space, isl_dim_param, mpa2->space, isl_dim_param)) { if (!isl_space_has_named_params(mpa1->space)) - return 0; + return isl_bool_false; if (!isl_space_has_named_params(mpa2->space)) - return 0; + return isl_bool_false; mpa1 = isl_multi_pw_aff_copy(mpa1); mpa2 = isl_multi_pw_aff_copy(mpa2); mpa1 = isl_multi_pw_aff_align_params(mpa1, @@ -6409,7 +6413,7 @@ int isl_multi_pw_aff_is_equal(__isl_keep isl_multi_pw_aff *mpa1, return equal; } - return 1; + return isl_bool_true; } /* Coalesce the elements of "mpa". @@ -7119,7 +7123,7 @@ struct isl_union_pw_multi_aff_multi_val_on_domain_data { /* Create an isl_pw_multi_aff equal to data->mv on "domain" * and add it to data->res. */ -static int pw_multi_aff_multi_val_on_domain(__isl_take isl_set *domain, +static isl_stat pw_multi_aff_multi_val_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_multi_aff_multi_val_on_domain_data *data = user; @@ -7130,7 +7134,7 @@ static int pw_multi_aff_multi_val_on_domain(__isl_take isl_set *domain, pma = isl_pw_multi_aff_multi_val_on_domain(domain, mv); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Return a union piecewise multi-affine expression @@ -7156,14 +7160,14 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_multi_val_on_domain( /* Compute the pullback of data->pma by the function represented by "pma2", * provided the spaces match, and add the results to data->res. */ -static int pullback_entry(void **entry, void *user) +static isl_stat pullback_entry(void **entry, void *user) { struct isl_union_pw_multi_aff_bin_data *data = user; isl_pw_multi_aff *pma2 = *entry; if (!isl_space_tuple_is_equal(data->pma->dim, isl_dim_in, pma2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; pma2 = isl_pw_multi_aff_pullback_pw_multi_aff( isl_pw_multi_aff_copy(data->pma), @@ -7171,9 +7175,9 @@ static int pullback_entry(void **entry, void *user) data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma2); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Compute the pullback of "upma1" by the function represented by "upma2". @@ -7260,7 +7264,7 @@ struct isl_union_pw_aff_reset_params_data { /* Replace the parameters of "pa" by data->space and * add the result to data->res. */ -static int reset_params(__isl_take isl_pw_aff *pa, void *user) +static isl_stat reset_params(__isl_take isl_pw_aff *pa, void *user) { struct isl_union_pw_aff_reset_params_data *data = user; isl_space *space; @@ -7270,7 +7274,7 @@ static int reset_params(__isl_take isl_pw_aff *pa, void *user) pa = isl_pw_aff_reset_space(pa, space); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Replace the domain space of "upa" by "space". @@ -7306,15 +7310,15 @@ static __isl_give isl_union_pw_aff *isl_union_pw_aff_reset_domain_space( /* Replace the entry of isl_union_pw_aff to which "entry" points * by its floor. */ -static int floor_entry(void **entry, void *user) +static isl_stat floor_entry(void **entry, void *user) { isl_pw_aff **pa = (isl_pw_aff **) entry; *pa = isl_pw_aff_floor(*pa); if (!*pa) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Given f, return floor(f). @@ -7382,7 +7386,7 @@ struct isl_union_pw_aff_aff_on_domain_data { /* Construct a piecewise affine expression that is equal to data->aff * on "domain" and add the result to data->res. */ -static int pw_aff_aff_on_domain(__isl_take isl_set *domain, void *user) +static isl_stat pw_aff_aff_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_aff_aff_on_domain_data *data = user; isl_pw_aff *pa; @@ -7396,7 +7400,7 @@ static int pw_aff_aff_on_domain(__isl_take isl_set *domain, void *user) pa = isl_pw_aff_alloc(domain, aff); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Internal data structure for isl_union_pw_multi_aff_get_union_pw_aff. @@ -7411,19 +7415,19 @@ struct isl_union_pw_multi_aff_get_union_pw_aff_data { /* Extract an isl_pw_aff corresponding to output dimension "pos" of "pma" * (assuming it has such a dimension) and add it to data->res. */ -static int get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_get_union_pw_aff_data *data = user; int n_out; isl_pw_aff *pa; if (!pma) - return -1; + return isl_stat_error; n_out = isl_pw_multi_aff_dim(pma, isl_dim_out); if (data->pos >= n_out) { isl_pw_multi_aff_free(pma); - return 0; + return isl_stat_ok; } pa = isl_pw_multi_aff_get_pw_aff(pma, data->pos); @@ -7431,7 +7435,7 @@ static int get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user) data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Extract an isl_union_pw_aff corresponding to @@ -7504,7 +7508,7 @@ struct isl_union_pw_aff_val_on_domain_data { /* Construct a piecewise affine expression that is equal to data->v * on "domain" and add the result to data->res. */ -static int pw_aff_val_on_domain(__isl_take isl_set *domain, void *user) +static isl_stat pw_aff_val_on_domain(__isl_take isl_set *domain, void *user) { struct isl_union_pw_aff_val_on_domain_data *data = user; isl_pw_aff *pa; @@ -7514,7 +7518,7 @@ static int pw_aff_val_on_domain(__isl_take isl_set *domain, void *user) pa = isl_pw_aff_val_on_domain(domain, v); data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Return a union piecewise affine expression @@ -7542,7 +7546,8 @@ __isl_give isl_union_pw_aff *isl_union_pw_aff_val_on_domain( /* Construct a piecewise multi affine expression * that is equal to "pa" and add it to upma. */ -static int pw_multi_aff_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) +static isl_stat pw_multi_aff_from_pw_aff_entry(__isl_take isl_pw_aff *pa, + void *user) { isl_union_pw_multi_aff **upma = user; isl_pw_multi_aff *pma; @@ -7550,7 +7555,7 @@ static int pw_multi_aff_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) pma = isl_pw_multi_aff_from_pw_aff(pa); *upma = isl_union_pw_multi_aff_add_pw_multi_aff(*upma, pma); - return *upma ? 0 : -1; + return *upma ? isl_stat_ok : isl_stat_error; } /* Construct and return a union piecewise multi affine expression @@ -7579,13 +7584,13 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff( /* Compute the set of elements in the domain of "pa" where it is zero and * add this set to "uset". */ -static int zero_union_set(__isl_take isl_pw_aff *pa, void *user) +static isl_stat zero_union_set(__isl_take isl_pw_aff *pa, void *user) { isl_union_set **uset = (isl_union_set **)user; *uset = isl_union_set_add_set(*uset, isl_pw_aff_zero_set(pa)); - return *uset ? 0 : -1; + return *uset ? isl_stat_ok : isl_stat_error; } /* Return a union set containing those elements in the domain @@ -7606,7 +7611,7 @@ __isl_give isl_union_set *isl_union_pw_aff_zero_union_set( /* Convert "pa" to an isl_map and add it to *umap. */ -static int map_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) +static isl_stat map_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) { isl_union_map **umap = user; isl_map *map; @@ -7614,7 +7619,7 @@ static int map_from_pw_aff_entry(__isl_take isl_pw_aff *pa, void *user) map = isl_map_from_pw_aff(pa); *umap = isl_union_map_add_map(*umap, map); - return *umap ? 0 : -1; + return *umap ? isl_stat_ok : isl_stat_error; } /* Construct a union map mapping the domain of the union @@ -7655,7 +7660,7 @@ struct isl_union_pw_aff_pullback_upma_data { /* Check if "pma" can be plugged into data->pa. * If so, perform the pullback and add the result to data->res. */ -static int pa_pb_pma(void **entry, void *user) +static isl_stat pa_pb_pma(void **entry, void *user) { struct isl_union_pw_aff_pullback_upma_data *data = user; isl_pw_multi_aff *pma = *entry; @@ -7663,7 +7668,7 @@ static int pa_pb_pma(void **entry, void *user) if (!isl_space_tuple_is_equal(data->pa->dim, isl_dim_in, pma->dim, isl_dim_out)) - return 0; + return isl_stat_ok; pma = isl_pw_multi_aff_copy(pma); pa = isl_pw_aff_copy(data->pa); @@ -7671,13 +7676,13 @@ static int pa_pb_pma(void **entry, void *user) data->res = isl_union_pw_aff_add_pw_aff(data->res, pa); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Check if any of the elements of data->upma can be plugged into pa, * add if so add the result to data->res. */ -static int upa_pb_upma(void **entry, void *user) +static isl_stat upa_pb_upma(void **entry, void *user) { struct isl_union_pw_aff_pullback_upma_data *data = user; isl_ctx *ctx; @@ -7687,9 +7692,9 @@ static int upa_pb_upma(void **entry, void *user) ctx = isl_union_pw_multi_aff_get_ctx(data->upma); if (isl_hash_table_foreach(ctx, &data->upma->table, &pa_pb_pma, data) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Compute the pullback of "upa" by the function represented by "upma". @@ -7857,31 +7862,31 @@ __isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_pw_aff( * If *space has already been set (through a previous call to this function), * then check that the range space is the same. */ -static int extract_space(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat extract_space(__isl_take isl_pw_multi_aff *pma, void *user) { isl_space **space = user; isl_space *pma_space; - int equal; + isl_bool equal; pma_space = isl_space_range(isl_pw_multi_aff_get_space(pma)); isl_pw_multi_aff_free(pma); if (!pma_space) - return -1; + return isl_stat_error; if (!*space) { *space = pma_space; - return 0; + return isl_stat_ok; } equal = isl_space_is_equal(pma_space, *space); isl_space_free(pma_space); if (equal < 0) - return -1; + return isl_stat_error; if (!equal) isl_die(isl_space_get_ctx(*space), isl_error_invalid, - "range spaces not the same", return -1); - return 0; + "range spaces not the same", return isl_stat_error); + return isl_stat_ok; } /* Construct and return a multi union piecewise affine expression @@ -8158,7 +8163,7 @@ struct isl_union_pw_multi_aff_reset_range_space_data { /* Replace the range space of "pma" by the range space of data->range and * add the result to data->res. */ -static int reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_reset_range_space_data *data = user; isl_space *space; @@ -8170,7 +8175,7 @@ static int reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user) pma = isl_pw_multi_aff_reset_space(pma, space); data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Replace the range space of all the piecewise affine expressions in "upma" by diff --git a/polly/lib/External/isl/isl_ast.c b/polly/lib/External/isl/isl_ast.c index dd3f5abd61f6..a2879ba7d69f 100644 --- a/polly/lib/External/isl/isl_ast.c +++ b/polly/lib/External/isl/isl_ast.c @@ -325,18 +325,18 @@ error: /* Is "expr1" equal to "expr2"? */ -int isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, +isl_bool isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, __isl_keep isl_ast_expr *expr2) { int i; if (!expr1 || !expr2) - return -1; + return isl_bool_error; if (expr1 == expr2) - return 1; + return isl_bool_true; if (expr1->type != expr2->type) - return 0; + return isl_bool_false; switch (expr1->type) { case isl_ast_expr_int: return isl_val_eq(expr1->u.v, expr2->u.v); @@ -344,11 +344,11 @@ int isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, return expr1->u.id == expr2->u.id; case isl_ast_expr_op: if (expr1->u.op.op != expr2->u.op.op) - return 0; + return isl_bool_false; if (expr1->u.op.n_arg != expr2->u.op.n_arg) - return 0; + return isl_bool_false; for (i = 0; i < expr1->u.op.n_arg; ++i) { - int equal; + isl_bool equal; equal = isl_ast_expr_is_equal(expr1->u.op.args[i], expr2->u.op.args[i]); if (equal < 0 || !equal) @@ -356,7 +356,7 @@ int isl_ast_expr_is_equal(__isl_keep isl_ast_expr *expr1, } return 1; case isl_ast_expr_error: - return -1; + return isl_bool_error; } } @@ -1104,13 +1104,13 @@ __isl_give isl_ast_node *isl_ast_node_for_mark_degenerate( return node; } -int isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node) +isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node) { if (!node) - return -1; + return isl_bool_error; if (node->type != isl_ast_node_for) isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, - "not a for node", return -1); + "not a for node", return isl_bool_error); return node->u.f.degenerate; } @@ -1210,14 +1210,14 @@ __isl_give isl_ast_node *isl_ast_node_if_get_then( return isl_ast_node_copy(node->u.i.then); } -int isl_ast_node_if_has_else( +isl_bool isl_ast_node_if_has_else( __isl_keep isl_ast_node *node) { if (!node) - return -1; + return isl_bool_error; if (node->type != isl_ast_node_if) isl_die(isl_ast_node_get_ctx(node), isl_error_invalid, - "not an if node", return -1); + "not an if node", return isl_bool_error); return node->u.i.else_node != NULL; } @@ -2167,33 +2167,33 @@ __isl_give isl_printer *isl_ast_op_type_print_macro( /* Call "fn" for each type of operation that appears in "node" * and that requires a macro definition. */ -int isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, - int (*fn)(enum isl_ast_op_type type, void *user), void *user) +isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node, + isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user) { int macros; if (!node) - return -1; + return isl_stat_error; macros = ast_node_required_macros(node, 0); if (macros & ISL_AST_MACRO_MIN && fn(isl_ast_op_min, user) < 0) - return -1; + return isl_stat_error; if (macros & ISL_AST_MACRO_MAX && fn(isl_ast_op_max, user) < 0) - return -1; + return isl_stat_error; if (macros & ISL_AST_MACRO_FLOORD && fn(isl_ast_op_fdiv_q, user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -static int ast_op_type_print_macro(enum isl_ast_op_type type, void *user) +static isl_stat ast_op_type_print_macro(enum isl_ast_op_type type, void *user) { isl_printer **p = user; *p = isl_ast_op_type_print_macro(type, *p); - return 0; + return isl_stat_ok; } /* Print macro definitions for all the macros used in the result diff --git a/polly/lib/External/isl/isl_ast_build.c b/polly/lib/External/isl/isl_ast_build.c index dc54b9772c9c..018d1154b41b 100644 --- a/polly/lib/External/isl/isl_ast_build.c +++ b/polly/lib/External/isl/isl_ast_build.c @@ -436,7 +436,7 @@ __isl_give isl_ast_build *isl_ast_build_set_after_each_for( */ __isl_give isl_ast_build *isl_ast_build_set_before_each_mark( __isl_take isl_ast_build *build, - int (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, + isl_stat (*fn)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, void *user), void *user) { build = isl_ast_build_cow(build); @@ -711,7 +711,7 @@ error: * the first (and presumably only) affine expression in the isl_pw_aff * on which this function is used. */ -static int extract_single_piece(__isl_take isl_set *set, +static isl_stat extract_single_piece(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { isl_aff **p = user; @@ -719,7 +719,7 @@ static int extract_single_piece(__isl_take isl_set *set, *p = aff; isl_set_free(set); - return -1; + return isl_stat_error; } /* Intersect "set" with the stride constraint of "build", if any. @@ -1460,7 +1460,7 @@ struct isl_detect_stride_data { * * The expression "-a h(p)/g" can therefore be used as offset. */ -static int detect_stride(__isl_take isl_constraint *c, void *user) +static isl_stat detect_stride(__isl_take isl_constraint *c, void *user) { struct isl_detect_stride_data *data = user; int i, n_div; @@ -1470,7 +1470,7 @@ static int detect_stride(__isl_take isl_constraint *c, void *user) if (!isl_constraint_is_equality(c) || !isl_constraint_involves_dims(c, isl_dim_set, data->pos, 1)) { isl_constraint_free(c); - return 0; + return isl_stat_ok; } ctx = isl_constraint_get_ctx(c); @@ -1510,7 +1510,7 @@ static int detect_stride(__isl_take isl_constraint *c, void *user) } isl_constraint_free(c); - return 0; + return isl_stat_ok; } /* Check if the constraints in "set" imply any stride on the current @@ -1555,7 +1555,7 @@ struct isl_ast_build_involves_data { /* Check if "map" involves the input dimension data->depth. */ -static int involves_depth(__isl_take isl_map *map, void *user) +static isl_stat involves_depth(__isl_take isl_map *map, void *user) { struct isl_ast_build_involves_data *data = user; @@ -1563,8 +1563,8 @@ static int involves_depth(__isl_take isl_map *map, void *user) isl_map_free(map); if (data->involves < 0 || data->involves) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } /* Do any options depend on the value of the dimension at the current depth? @@ -1603,7 +1603,7 @@ static __isl_give isl_map *construct_insertion_map(__isl_take isl_space *space, space = isl_space_set_from_params(space); space = isl_space_add_dims(space, isl_dim_set, 1); space = isl_space_map_from_set(space); - c = isl_equality_alloc(isl_local_space_from_space(space)); + c = isl_constraint_alloc_equality(isl_local_space_from_space(space)); c = isl_constraint_set_coefficient_si(c, isl_dim_in, 0, 1); c = isl_constraint_set_coefficient_si(c, isl_dim_out, 0, -1); bmap1 = isl_basic_map_from_constraint(isl_constraint_copy(c)); diff --git a/polly/lib/External/isl/isl_ast_build_expr.c b/polly/lib/External/isl/isl_ast_build_expr.c index 1b84d882b45f..bdd70e79bd0e 100644 --- a/polly/lib/External/isl/isl_ast_build_expr.c +++ b/polly/lib/External/isl/isl_ast_build_expr.c @@ -662,7 +662,8 @@ static int mod_constraint_is_simpler(struct isl_extract_mod_data *data, * very well involve such coefficients. This means that we may actually * miss some cases. */ -static int check_parallel_or_opposite(__isl_take isl_constraint *c, void *user) +static isl_stat check_parallel_or_opposite(__isl_take isl_constraint *c, + void *user) { struct isl_extract_mod_data *data = user; enum isl_dim_type c_type[2] = { isl_dim_param, isl_dim_set }; @@ -716,9 +717,9 @@ static int check_parallel_or_opposite(__isl_take isl_constraint *c, void *user) isl_constraint_free(c); if (data->sign != 0 && data->nonneg == NULL) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Given that data->v * div_i in data->aff is of the form @@ -1476,7 +1477,7 @@ struct isl_expr_from_set_data { * and add it to data->res. * The result is simplified in terms of data->build->domain. */ -static int expr_from_set(__isl_take isl_basic_set *bset, void *user) +static isl_stat expr_from_set(__isl_take isl_basic_set *bset, void *user) { struct isl_expr_from_set_data *data = user; isl_ast_expr *expr; @@ -1490,8 +1491,8 @@ static int expr_from_set(__isl_take isl_basic_set *bset, void *user) data->first = 0; if (!data->res) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } /* Construct an isl_ast_expr that evaluates the conditions defining "set". @@ -1567,7 +1568,7 @@ struct isl_from_pw_aff_data { * constraints of the build such that they can be exploited to simplify * the AST expression constructed from "aff". */ -static int ast_expr_from_pw_aff(__isl_take isl_set *set, +static isl_stat ast_expr_from_pw_aff(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { struct isl_from_pw_aff_data *data = user; @@ -1582,7 +1583,7 @@ static int ast_expr_from_pw_aff(__isl_take isl_set *set, *data->next = isl_ast_expr_from_aff(aff, build); isl_ast_build_free(build); if (!*data->next) - return -1; + return isl_stat_error; } else { isl_ast_expr *ternary, *arg; isl_set *gist; @@ -1597,13 +1598,13 @@ static int ast_expr_from_pw_aff(__isl_take isl_set *set, isl_ast_build_free(build); ternary = isl_ast_expr_set_op_arg(ternary, 1, arg); if (!ternary) - return -1; + return isl_stat_error; *data->next = ternary; data->next = &ternary->u.op.args[2]; } - return 0; + return isl_stat_ok; } /* Construct an isl_ast_expr that evaluates "pa". diff --git a/polly/lib/External/isl/isl_ast_build_private.h b/polly/lib/External/isl/isl_ast_build_private.h index fdc755c0a786..59eec25fd6b8 100644 --- a/polly/lib/External/isl/isl_ast_build_private.h +++ b/polly/lib/External/isl/isl_ast_build_private.h @@ -178,7 +178,7 @@ struct isl_ast_build { __isl_keep isl_ast_build *context, void *user); void *after_each_for_user; - int (*before_each_mark)(__isl_keep isl_id *mark, + isl_stat (*before_each_mark)(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build, void *user); void *before_each_mark_user; __isl_give isl_ast_node *(*after_each_mark)( diff --git a/polly/lib/External/isl/isl_ast_codegen.c b/polly/lib/External/isl/isl_ast_codegen.c index 565f3fed71fe..fc8e2d7ba594 100644 --- a/polly/lib/External/isl/isl_ast_codegen.c +++ b/polly/lib/External/isl/isl_ast_codegen.c @@ -62,7 +62,7 @@ static __isl_give isl_ast_graft_list *generate_code( * but will instead create calls to all elements of D that need * to be executed from the current schedule domain. */ -static int generate_non_single_valued(__isl_take isl_map *executed, +static isl_stat generate_non_single_valued(__isl_take isl_map *executed, struct isl_generate_domain_data *data) { isl_map *identity; @@ -79,7 +79,7 @@ static int generate_non_single_valued(__isl_take isl_map *executed, data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; } /* Call the at_each_domain callback, if requested by the user, @@ -153,7 +153,7 @@ static __isl_give isl_ast_graft *at_each_domain(__isl_take isl_ast_graft *graft, * If the user has set an at_each_domain callback, it is called * on the constructed call expression node. */ -static int generate_domain(__isl_take isl_map *executed, void *user) +static isl_stat generate_domain(__isl_take isl_map *executed, void *user) { struct isl_generate_domain_data *data = user; isl_ast_build *build; @@ -171,7 +171,7 @@ static int generate_domain(__isl_take isl_map *executed, void *user) goto error; if (empty) { isl_map_free(executed); - return 0; + return isl_stat_ok; } executed = isl_map_coalesce(executed); @@ -207,11 +207,11 @@ static int generate_domain(__isl_take isl_map *executed, void *user) list = isl_ast_graft_list_from_ast_graft(graft); data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; error: isl_map_free(map); isl_map_free(executed); - return -1; + return isl_stat_error; } /* Call build->create_leaf to a create "leaf" node in the AST, @@ -874,7 +874,7 @@ static __isl_give isl_ast_graft *set_enforced_from_list( /* Does "aff" have a negative constant term? */ -static int aff_constant_is_negative(__isl_take isl_set *set, +static isl_stat aff_constant_is_negative(__isl_take isl_set *set, __isl_take isl_aff *aff, void *user) { int *neg = user; @@ -886,20 +886,21 @@ static int aff_constant_is_negative(__isl_take isl_set *set, isl_set_free(set); isl_aff_free(aff); - return *neg ? 0 : -1; + return *neg ? isl_stat_ok : isl_stat_error; } /* Does "pa" have a negative constant term over its entire domain? */ -static int pw_aff_constant_is_negative(__isl_take isl_pw_aff *pa, void *user) +static isl_stat pw_aff_constant_is_negative(__isl_take isl_pw_aff *pa, + void *user) { - int r; + isl_stat r; int *neg = user; r = isl_pw_aff_foreach_piece(pa, &aff_constant_is_negative, user); isl_pw_aff_free(pa); - return (*neg && r >= 0) ? 0 : -1; + return (*neg && r >= 0) ? isl_stat_ok : isl_stat_error; } /* Does each element in "list" have a negative constant term? @@ -1201,7 +1202,7 @@ struct isl_ast_count_constraints_data { * on whether "c" is independenct of dimensions data->pos, * a lower bound or an upper bound. */ -static int count_constraints(__isl_take isl_constraint *c, void *user) +static isl_stat count_constraints(__isl_take isl_constraint *c, void *user) { struct isl_ast_count_constraints_data *data = user; @@ -1214,7 +1215,7 @@ static int count_constraints(__isl_take isl_constraint *c, void *user) isl_constraint_free(c); - return 0; + return isl_stat_ok; } /* Update "graft" based on "bounds" and "domain" for the generic, @@ -1524,7 +1525,8 @@ struct isl_check_scaled_data { * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int constraint_check_scaled(__isl_take isl_constraint *c, void *user) +static isl_stat constraint_check_scaled(__isl_take isl_constraint *c, + void *user) { struct isl_check_scaled_data *data = user; int i, j, n; @@ -1533,7 +1535,7 @@ static int constraint_check_scaled(__isl_take isl_constraint *c, void *user) if (!isl_constraint_involves_dims(c, isl_dim_in, data->depth, 1)) { isl_constraint_free(c); - return 0; + return isl_stat_ok; } for (i = 0; i < 4; ++i) { @@ -1556,7 +1558,7 @@ static int constraint_check_scaled(__isl_take isl_constraint *c, void *user) isl_constraint_free(c); - return i < 4 ? -1 : 0; + return i < 4 ? isl_stat_error : isl_stat_ok; } /* For each constraint of "bmap" that involves the input dimension data->depth, @@ -1564,9 +1566,10 @@ static int constraint_check_scaled(__isl_take isl_constraint *c, void *user) * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int basic_map_check_scaled(__isl_take isl_basic_map *bmap, void *user) +static isl_stat basic_map_check_scaled(__isl_take isl_basic_map *bmap, + void *user) { - int r; + isl_stat r; r = isl_basic_map_foreach_constraint(bmap, &constraint_check_scaled, user); @@ -1580,9 +1583,9 @@ static int basic_map_check_scaled(__isl_take isl_basic_map *bmap, void *user) * reducing data->m if needed. * Break out of the iteration if data->m has become equal to "1". */ -static int map_check_scaled(__isl_take isl_map *map, void *user) +static isl_stat map_check_scaled(__isl_take isl_map *map, void *user) { - int r; + isl_stat r; r = isl_map_foreach_basic_map(map, &basic_map_check_scaled, user); isl_map_free(map); @@ -1703,13 +1706,13 @@ static __isl_give isl_ast_graft *create_node(__isl_take isl_union_map *executed, /* Add the basic set to the list that "user" points to. */ -static int collect_basic_set(__isl_take isl_basic_set *bset, void *user) +static isl_stat collect_basic_set(__isl_take isl_basic_set *bset, void *user) { isl_basic_set_list **list = user; *list = isl_basic_set_list_add(*list, bset); - return 0; + return isl_stat_ok; } /* Extract the basic sets of "set" and collect them in an isl_basic_set_list. @@ -1798,12 +1801,12 @@ done: /* Does any element of i follow or coincide with any element of j * at the current depth for equal values of the outer dimensions? */ -static int domain_follows_at_depth(__isl_keep isl_basic_set *i, +static isl_bool domain_follows_at_depth(__isl_keep isl_basic_set *i, __isl_keep isl_basic_set *j, void *user) { int depth = *(int *) user; isl_basic_map *test; - int empty; + isl_bool empty; int l; test = isl_basic_map_from_domain_and_range(isl_basic_set_copy(i), @@ -1816,7 +1819,7 @@ static int domain_follows_at_depth(__isl_keep isl_basic_set *i, empty = isl_basic_map_is_empty(test); isl_basic_map_free(test); - return empty < 0 ? -1 : !empty; + return empty < 0 ? isl_bool_error : !empty; } /* Split up each element of "list" into a part that is related to "bset" @@ -1920,7 +1923,7 @@ struct isl_add_nodes_data { * this property to avoid running into an infinite recursion in case * they intersect due to some internal error. */ -static int add_nodes(__isl_take isl_basic_set_list *scc, void *user) +static isl_stat add_nodes(__isl_take isl_basic_set_list *scc, void *user) { struct isl_add_nodes_data *data = user; int i, n, depth; @@ -1936,7 +1939,7 @@ static int add_nodes(__isl_take isl_basic_set_list *scc, void *user) data->list = add_node(data->list, isl_union_map_copy(data->executed), bset, isl_ast_build_copy(data->build)); - return data->list ? 0 : -1; + return data->list ? isl_stat_ok : isl_stat_error; } depth = isl_ast_build_get_depth(data->build); @@ -1973,7 +1976,7 @@ static int add_nodes(__isl_take isl_basic_set_list *scc, void *user) generate_sorted_domains(scc, data->executed, data->build)); isl_basic_set_list_free(scc); - return data->list ? 0 : -1; + return data->list ? isl_stat_ok : isl_stat_error; } /* Sort the domains in "domain_list" according to the execution order @@ -2024,12 +2027,12 @@ static __isl_give isl_ast_graft_list *generate_sorted_domains( /* Do i and j share any values for the outer dimensions? */ -static int shared_outer(__isl_keep isl_basic_set *i, +static isl_bool shared_outer(__isl_keep isl_basic_set *i, __isl_keep isl_basic_set *j, void *user) { int depth = *(int *) user; isl_basic_map *test; - int empty; + isl_bool empty; int l; test = isl_basic_map_from_domain_and_range(isl_basic_set_copy(i), @@ -2040,7 +2043,7 @@ static int shared_outer(__isl_keep isl_basic_set *i, empty = isl_basic_map_is_empty(test); isl_basic_map_free(test); - return empty < 0 ? -1 : !empty; + return empty < 0 ? isl_bool_error : !empty; } /* Internal data structure for generate_sorted_domains_wrap. @@ -2071,7 +2074,7 @@ struct isl_ast_generate_parallel_domains_data { * then data->single is set to 1 and the result of generate_sorted_domains * is not fused. */ -static int generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc, +static isl_stat generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc, void *user) { struct isl_ast_generate_parallel_domains_data *data = user; @@ -2088,9 +2091,9 @@ static int generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc, isl_basic_set_list_free(scc); if (!data->list) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Look for any (weakly connected) components in the "domain_list" @@ -2202,7 +2205,7 @@ static __isl_give isl_set *explicit_bounds(__isl_take isl_map *map, * and then add that part of the range of "map" that does not intersect * with data->domain. */ -static int separate_domain(__isl_take isl_map *map, void *user) +static isl_stat separate_domain(__isl_take isl_map *map, void *user) { struct isl_separate_domain_data *data = user; isl_set *domain; @@ -2221,7 +2224,7 @@ static int separate_domain(__isl_take isl_map *map, void *user) data->domain = isl_set_union(data->domain, d1); data->domain = isl_set_union(data->domain, d2); - return 0; + return isl_stat_ok; } /* Separate the schedule domains of "executed". @@ -2293,8 +2296,8 @@ static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff, /* Update *user to the number of integer divsions in the first element * of "ma", if it is larger than the current value. */ -static int update_n_div(__isl_take isl_set *set, __isl_take isl_multi_aff *ma, - void *user) +static isl_stat update_n_div(__isl_take isl_set *set, + __isl_take isl_multi_aff *ma, void *user) { isl_aff *aff; int *n = user; @@ -2309,7 +2312,7 @@ static int update_n_div(__isl_take isl_set *set, __isl_take isl_multi_aff *ma, if (n_div > *n) *n = n_div; - return aff ? 0 : -1; + return aff ? isl_stat_ok : isl_stat_error; } /* Get the number of integer divisions in the expression for the iterator @@ -2415,7 +2418,7 @@ static int is_better_lower_bound(struct isl_find_unroll_data *data, * if the new lower bound is better (smaller n or fewer integer divisions) * than the previously found lower bounds. */ -static int update_unrolling_lower_bound(struct isl_find_unroll_data *data, +static isl_stat update_unrolling_lower_bound(struct isl_find_unroll_data *data, __isl_keep isl_constraint *c) { isl_aff *aff, *lower; @@ -2423,7 +2426,7 @@ static int update_unrolling_lower_bound(struct isl_find_unroll_data *data, int better; if (!isl_constraint_is_lower_bound(c, isl_dim_set, data->depth)) - return 0; + return isl_stat_ok; lower = isl_constraint_get_bound(c, isl_dim_set, data->depth); lower = isl_aff_ceil(lower); @@ -2438,7 +2441,7 @@ static int update_unrolling_lower_bound(struct isl_find_unroll_data *data, if (better < 0 || !better) { isl_val_free(max); isl_aff_free(lower); - return better < 0 ? -1 : 0; + return better < 0 ? isl_stat_error : isl_stat_ok; } isl_aff_free(data->lower); @@ -2446,16 +2449,16 @@ static int update_unrolling_lower_bound(struct isl_find_unroll_data *data, *data->n = isl_val_get_num_si(max); isl_val_free(max); - return 1; + return isl_stat_ok; } /* Check if we can use "c" as a lower bound and if it is better than * any previously found lower bound. */ -static int constraint_find_unroll(__isl_take isl_constraint *c, void *user) +static isl_stat constraint_find_unroll(__isl_take isl_constraint *c, void *user) { struct isl_find_unroll_data *data; - int r; + isl_stat r; data = (struct isl_find_unroll_data *) user; r = update_unrolling_lower_bound(data, c); @@ -2891,7 +2894,7 @@ static int compute_separate_domain(struct isl_codegen_domains *domains, * If anything is left after handling separate, unroll and atomic, * we split it up into basic sets and append the basic sets to domains->list. */ -static int compute_partial_domains(struct isl_codegen_domains *domains, +static isl_stat compute_partial_domains(struct isl_codegen_domains *domains, __isl_take isl_set *class_domain) { isl_basic_set_list *list; @@ -2926,11 +2929,11 @@ static int compute_partial_domains(struct isl_codegen_domains *domains, isl_set_free(class_domain); - return 0; + return isl_stat_ok; error: isl_set_free(domain); isl_set_free(class_domain); - return -1; + return isl_stat_error; } /* Split up the domain at the current depth into disjoint @@ -2940,7 +2943,7 @@ error: * We extract the corresponding class domain from domains->sep_class, * eliminate inner dimensions and pass control to compute_partial_domains. */ -static int compute_class_domains(__isl_take isl_point *pnt, void *user) +static isl_stat compute_class_domains(__isl_take isl_point *pnt, void *user) { struct isl_codegen_domains *domains = user; isl_set *class_set; @@ -2955,10 +2958,10 @@ static int compute_class_domains(__isl_take isl_point *pnt, void *user) disjoint = isl_set_plain_is_disjoint(domain, domains->schedule_domain); if (disjoint < 0) - return -1; + return isl_stat_error; if (disjoint) { isl_set_free(domain); - return 0; + return isl_stat_ok; } return compute_partial_domains(domains, domain); @@ -3671,7 +3674,7 @@ static __isl_give isl_union_map *contruct_shifted_executed( map = isl_map_insert_dims(map, isl_dim_out, depth + 1, 1); space = isl_space_insert_dims(space, isl_dim_out, depth + 1, 1); - c = isl_equality_alloc(isl_local_space_from_space(space)); + c = isl_constraint_alloc_equality(isl_local_space_from_space(space)); c = isl_constraint_set_coefficient_si(c, isl_dim_in, depth, 1); c = isl_constraint_set_coefficient_si(c, isl_dim_out, depth, -1); @@ -3969,7 +3972,7 @@ error: /* Store both "map" itself and its domain in the * structure pointed to by *next and advance to the next array element. */ -static int extract_domain(__isl_take isl_map *map, void *user) +static isl_stat extract_domain(__isl_take isl_map *map, void *user) { struct isl_set_map_pair **next = user; @@ -3977,7 +3980,7 @@ static int extract_domain(__isl_take isl_map *map, void *user) (*next)->set = isl_map_domain(map); (*next)++; - return 0; + return isl_stat_ok; } static int after_in_tree(__isl_keep isl_union_map *umap, @@ -4386,7 +4389,7 @@ struct isl_any_scheduled_after_data { * If data->group_coscheduled is set, then we also return 1 if there * is any pair of elements in the two domains that are scheduled together. */ -static int any_scheduled_after(int i, int j, void *user) +static isl_bool any_scheduled_after(int i, int j, void *user) { struct isl_any_scheduled_after_data *data = user; int dim = isl_set_dim(data->domain[i].set, isl_dim_set); @@ -4399,11 +4402,11 @@ static int any_scheduled_after(int i, int j, void *user) data->domain[j].set, pos); if (follows < -1) - return -1; + return isl_bool_error; if (follows > 0) - return 1; + return isl_bool_true; if (follows < 0) - return 0; + return isl_bool_false; } if (isl_ast_build_has_schedule_node(data->build)) { @@ -4633,7 +4636,7 @@ static __isl_give isl_union_map *internal_executed( * on the resulting isl_ast_node_list so that it can be used within * the outer AST build. */ -static int generate_code_in_space(struct isl_generate_code_data *data, +static isl_stat generate_code_in_space(struct isl_generate_code_data *data, __isl_take isl_set *set, __isl_take isl_space *space) { isl_union_map *executed; @@ -4664,7 +4667,7 @@ static int generate_code_in_space(struct isl_generate_code_data *data, data->list = isl_ast_graft_list_concat(data->list, list); - return 0; + return isl_stat_ok; } /* Generate an AST that visits the elements in the range of data->executed @@ -4684,7 +4687,7 @@ static int generate_code_in_space(struct isl_generate_code_data *data, * passing along T. * If the build space is not parametric, then T is the space of "set". */ -static int generate_code_set(__isl_take isl_set *set, void *user) +static isl_stat generate_code_set(__isl_take isl_set *set, void *user) { struct isl_generate_code_data *data = user; isl_space *space, *build_space; @@ -4711,7 +4714,7 @@ static int generate_code_set(__isl_take isl_set *set, void *user) error: isl_set_free(set); isl_space_free(space); - return -1; + return isl_stat_error; } /* Generate an AST that visits the elements in the range of "executed" @@ -5213,13 +5216,13 @@ static __isl_give isl_ast_graft_list *build_ast_from_guard( * The caller is responsible for recording the current inverse schedule * in "build". */ -static int before_each_mark(__isl_keep isl_id *mark, +static isl_stat before_each_mark(__isl_keep isl_id *mark, __isl_keep isl_ast_build *build) { if (!build) - return -1; + return isl_stat_error; if (!build->before_each_mark) - return 0; + return isl_stat_ok; return build->before_each_mark(mark, build, build->before_each_mark_user); } diff --git a/polly/lib/External/isl/isl_ast_graft.c b/polly/lib/External/isl/isl_ast_graft.c index e73672950860..cfcfbd38d722 100644 --- a/polly/lib/External/isl/isl_ast_graft.c +++ b/polly/lib/External/isl/isl_ast_graft.c @@ -258,7 +258,7 @@ struct isl_insert_if_data { isl_ast_build *build; }; -static int insert_if(__isl_take isl_basic_set *bset, void *user); +static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user); /* Insert an if node around "node" testing the condition encoded * in guard "guard". @@ -304,7 +304,7 @@ static __isl_give isl_ast_node *ast_node_insert_if( /* Insert an if node around a copy of "data->node" testing the condition * encoded in guard "bset" and add the result to data->list. */ -static int insert_if(__isl_take isl_basic_set *bset, void *user) +static isl_stat insert_if(__isl_take isl_basic_set *bset, void *user) { struct isl_insert_if_data *data = user; isl_ast_node *node; @@ -315,7 +315,7 @@ static int insert_if(__isl_take isl_basic_set *bset, void *user) node = ast_node_insert_if(node, set, data->build); data->list = isl_ast_node_list_add(data->list, node); - return 0; + return isl_stat_ok; } /* Insert an if node around graft->node testing the condition encoded diff --git a/polly/lib/External/isl/isl_band.c b/polly/lib/External/isl/isl_band.c index aaee1f1c9510..43569d65e893 100644 --- a/polly/lib/External/isl/isl_band.c +++ b/polly/lib/External/isl/isl_band.c @@ -361,7 +361,7 @@ struct isl_band_tile_data { * floor(s_i(x) / m_i) * */ -static int multi_aff_tile(__isl_take isl_set *set, +static isl_stat multi_aff_tile(__isl_take isl_set *set, __isl_take isl_multi_aff *ma, void *user) { struct isl_band_tile_data *data = user; @@ -389,14 +389,14 @@ static int multi_aff_tile(__isl_take isl_set *set, pma = isl_pw_multi_aff_alloc(set, ma); data->tiled = isl_pw_multi_aff_union_add(data->tiled, pma); - return 0; + return isl_stat_ok; } /* Given part of the schedule of a band, construct the corresponding * schedule for the tile loops based on the tile sizes in data->sizes * and add the result to data->res. */ -static int pw_multi_aff_tile(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat pw_multi_aff_tile(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_band_tile_data *data = user; @@ -409,11 +409,11 @@ static int pw_multi_aff_tile(__isl_take isl_pw_multi_aff *pma, void *user) data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, data->tiled); - return 0; + return isl_stat_ok; error: isl_pw_multi_aff_free(pma); isl_pw_multi_aff_free(data->tiled); - return -1; + return isl_stat_error; } /* Given the schedule of a band, construct the corresponding @@ -450,14 +450,15 @@ error: * All entries are expected to have the same range space, so we can * stop after extracting the range space from the first entry. */ -static int extract_range_space(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat extract_range_space(__isl_take isl_pw_multi_aff *pma, + void *user) { isl_space **space = user; *space = isl_space_range(isl_pw_multi_aff_get_space(pma)); isl_pw_multi_aff_free(pma); - return -1; + return isl_stat_error; } /* Extract the range space of "band". All entries in band->pma should @@ -603,7 +604,7 @@ struct isl_union_pw_multi_aff_drop_data { /* Drop the data->n output dimensions starting at data->pos from "pma" * and add the result to data->res. */ -static int pw_multi_aff_drop(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat pw_multi_aff_drop(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_pw_multi_aff_drop_data *data = user; @@ -611,9 +612,9 @@ static int pw_multi_aff_drop(__isl_take isl_pw_multi_aff *pma, void *user) data->res = isl_union_pw_multi_aff_add_pw_multi_aff(data->res, pma); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Drop the "n" output dimensions starting at "pos" from "sched". diff --git a/polly/lib/External/isl/isl_bound.c b/polly/lib/External/isl/isl_bound.c index 04c76a0ffb23..0774d9af4c56 100644 --- a/polly/lib/External/isl/isl_bound.c +++ b/polly/lib/External/isl/isl_bound.c @@ -153,10 +153,10 @@ static int guarded_poly_bound(__isl_take isl_basic_set *bset, return r; } -static int guarded_qp(__isl_take isl_qpolynomial *qp, void *user) +static isl_stat guarded_qp(__isl_take isl_qpolynomial *qp, void *user) { struct isl_bound *bound = (struct isl_bound *)user; - int r; + isl_stat r; r = isl_qpolynomial_as_polynomial_on_domain(qp, bound->bset, &guarded_poly_bound, user); @@ -164,10 +164,10 @@ static int guarded_qp(__isl_take isl_qpolynomial *qp, void *user) return r; } -static int basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) +static isl_stat basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) { struct isl_bound *bound = (struct isl_bound *)user; - int r; + isl_stat r; bound->bset = bset; r = isl_qpolynomial_fold_foreach_qpolynomial(bound->fold, @@ -176,7 +176,7 @@ static int basic_guarded_fold(__isl_take isl_basic_set *bset, void *user) return r; } -static int guarded_fold(__isl_take isl_set *set, +static isl_stat guarded_fold(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold, void *user) { struct isl_bound *bound = (struct isl_bound *)user; @@ -195,11 +195,11 @@ static int guarded_fold(__isl_take isl_set *set, isl_set_free(set); isl_qpolynomial_fold_free(fold); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_fold_free(fold); - return -1; + return isl_stat_error; } __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound( @@ -287,7 +287,7 @@ struct isl_union_bound_data { isl_union_pw_qpolynomial_fold *res; }; -static int bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) { struct isl_union_bound_data *data = user; isl_pw_qpolynomial_fold *pwf; @@ -297,7 +297,7 @@ static int bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user) data->res = isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold( data->res, pwf); - return 0; + return isl_stat_ok; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound( diff --git a/polly/lib/External/isl/isl_constraint.c b/polly/lib/External/isl/isl_constraint.c index a6e6add0e8d4..9411fd14a422 100644 --- a/polly/lib/External/isl/isl_constraint.c +++ b/polly/lib/External/isl/isl_constraint.c @@ -135,12 +135,14 @@ struct isl_constraint *isl_basic_set_constraint(struct isl_basic_set *bset, return isl_basic_map_constraint((struct isl_basic_map *)bset, line); } -__isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls) +__isl_give isl_constraint *isl_constraint_alloc_equality( + __isl_take isl_local_space *ls) { return isl_constraint_alloc(1, ls); } -__isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls) +__isl_give isl_constraint *isl_constraint_alloc_inequality( + __isl_take isl_local_space *ls) { return isl_constraint_alloc(0, ls); } @@ -210,41 +212,41 @@ int isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset) return isl_basic_map_n_constraint(bset); } -int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user) +isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user) { int i; struct isl_constraint *c; if (!bmap) - return -1; + return isl_stat_error; isl_assert(bmap->ctx, ISL_F_ISSET(bmap, ISL_BASIC_MAP_FINAL), - return -1); + return isl_stat_error); for (i = 0; i < bmap->n_eq; ++i) { c = isl_basic_map_constraint(isl_basic_map_copy(bmap), &bmap->eq[i]); if (!c) - return -1; + return isl_stat_error; if (fn(c, user) < 0) - return -1; + return isl_stat_error; } for (i = 0; i < bmap->n_ineq; ++i) { c = isl_basic_map_constraint(isl_basic_map_copy(bmap), &bmap->ineq[i]); if (!c) - return -1; + return isl_stat_error; if (fn(c, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, - int (*fn)(__isl_take isl_constraint *c, void *user), void *user) +isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, + isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user) { return isl_basic_map_foreach_constraint((isl_basic_map *)bset, fn, user); } @@ -252,7 +254,7 @@ int isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, /* Add the constraint to the list that "user" points to, if it is not * a div constraint. */ -static int collect_constraint(__isl_take isl_constraint *constraint, +static isl_stat collect_constraint(__isl_take isl_constraint *constraint, void *user) { isl_constraint_list **list = user; @@ -262,7 +264,7 @@ static int collect_constraint(__isl_take isl_constraint *constraint, else *list = isl_constraint_list_add(*list, constraint); - return 0; + return isl_stat_ok; } /* Return a list of constraints that, when combined, are equivalent @@ -390,23 +392,23 @@ int isl_constraint_dim(struct isl_constraint *constraint, return n(constraint, type); } -int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n) { int i; isl_ctx *ctx; int *active = NULL; - int involves = 0; + isl_bool involves = isl_bool_false; if (!constraint) - return -1; + return isl_bool_error; if (n == 0) - return 0; + return isl_bool_false; ctx = isl_constraint_get_ctx(constraint); if (first + n > isl_constraint_dim(constraint, type)) isl_die(ctx, isl_error_invalid, - "range out of bounds", return -1); + "range out of bounds", return isl_bool_error); active = isl_local_space_get_active(constraint->ls, constraint->v->el + 1); @@ -416,7 +418,7 @@ int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, first += isl_local_space_offset(constraint->ls, type) - 1; for (i = 0; i < n; ++i) if (active[first + i]) { - involves = 1; + involves = isl_bool_true; break; } @@ -425,21 +427,21 @@ int isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, return involves; error: free(active); - return -1; + return isl_bool_error; } /* Does the given constraint represent a lower bound on the given * dimension? */ -int isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos) { if (!constraint) - return -1; + return isl_bool_error; if (pos >= isl_local_space_dim(constraint->ls, type)) isl_die(isl_constraint_get_ctx(constraint), isl_error_invalid, - "position out of bounds", return -1); + "position out of bounds", return isl_bool_error); pos += isl_local_space_offset(constraint->ls, type); return isl_int_is_pos(constraint->v->el[pos]); @@ -448,15 +450,15 @@ int isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, /* Does the given constraint represent an upper bound on the given * dimension? */ -int isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, +isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos) { if (!constraint) - return -1; + return isl_bool_error; if (pos >= isl_local_space_dim(constraint->ls, type)) isl_die(isl_constraint_get_ctx(constraint), isl_error_invalid, - "position out of bounds", return -1); + "position out of bounds", return isl_bool_error); pos += isl_local_space_offset(constraint->ls, type); return isl_int_is_neg(constraint->v->el[pos]); @@ -750,10 +752,10 @@ struct isl_constraint *isl_constraint_negate(struct isl_constraint *constraint) return constraint; } -int isl_constraint_is_equality(struct isl_constraint *constraint) +isl_bool isl_constraint_is_equality(struct isl_constraint *constraint) { if (!constraint) - return -1; + return isl_bool_error; return constraint->eq; } @@ -1037,10 +1039,10 @@ static __isl_give isl_basic_set *set_largest_lower_bound( return context; } -static int foreach_upper_bound(__isl_keep isl_basic_set *bset, +static isl_stat foreach_upper_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_upper, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1069,20 +1071,20 @@ static int foreach_upper_bound(__isl_keep isl_basic_set *bset, isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(upper); isl_basic_set_free(context_i); isl_basic_set_free(context); - return -1; + return isl_stat_error; } -static int foreach_lower_bound(__isl_keep isl_basic_set *bset, +static isl_stat foreach_lower_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1111,20 +1113,20 @@ static int foreach_lower_bound(__isl_keep isl_basic_set *bset, isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(lower); isl_basic_set_free(context_i); isl_basic_set_free(context); - return -1; + return isl_stat_error; } -static int foreach_bound_pair(__isl_keep isl_basic_set *bset, +static isl_stat foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, int n_upper, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1179,16 +1181,16 @@ static int foreach_bound_pair(__isl_keep isl_basic_set *bset, isl_basic_set_free(context); if (i < bset->n_ineq) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; error: isl_constraint_free(lower); isl_constraint_free(upper); isl_basic_set_free(context_i); isl_basic_set_free(context_j); isl_basic_set_free(context); - return -1; + return isl_stat_error; } /* For each pair of lower and upper bounds on the variable "pos" @@ -1207,9 +1209,9 @@ error: * If not, we count the number of lower and upper bounds and * act accordingly. */ -int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, +isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_take isl_constraint *lower, + isl_stat (*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user) { @@ -1221,10 +1223,11 @@ int isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, int n_lower, n_upper; if (!bset) - return -1; - isl_assert(bset->ctx, pos < isl_basic_set_dim(bset, type), return -1); + return isl_stat_error; + isl_assert(bset->ctx, pos < isl_basic_set_dim(bset, type), + return isl_stat_error); isl_assert(bset->ctx, type == isl_dim_param || type == isl_dim_set, - return -1); + return isl_stat_error); abs_pos = pos; if (type == isl_dim_set) diff --git a/polly/lib/External/isl/isl_deprecated.c b/polly/lib/External/isl/isl_deprecated.c index babe0def4610..6c21f7d748d1 100644 --- a/polly/lib/External/isl/isl_deprecated.c +++ b/polly/lib/External/isl/isl_deprecated.c @@ -1,3 +1,4 @@ +#include #include /* This function was never documented and has been replaced by @@ -8,3 +9,17 @@ __isl_give isl_basic_set *isl_basic_set_add(__isl_take isl_basic_set *bset, { return isl_basic_set_add_dims(bset, type, n); } + +/* This function was replaced by isl_constraint_alloc_equality. + */ +__isl_give isl_constraint *isl_equality_alloc(__isl_take isl_local_space *ls) +{ + return isl_constraint_alloc_equality(ls); +} + +/* This function was replaced by isl_constraint_alloc_inequality. + */ +__isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls) +{ + return isl_constraint_alloc_inequality(ls); +} diff --git a/polly/lib/External/isl/isl_equalities.c b/polly/lib/External/isl/isl_equalities.c index 6256faa16ed6..44cf8f06e451 100644 --- a/polly/lib/External/isl/isl_equalities.c +++ b/polly/lib/External/isl/isl_equalities.c @@ -758,13 +758,13 @@ error: * If i_dim does not belong to such a residue class, then *modulo * is set to 1 and *residue is set to 0. */ -int isl_set_dim_residue_class_val(__isl_keep isl_set *set, +isl_stat isl_set_dim_residue_class_val(__isl_keep isl_set *set, int pos, __isl_give isl_val **modulo, __isl_give isl_val **residue) { *modulo = NULL; *residue = NULL; if (!set) - return -1; + return isl_stat_error; *modulo = isl_val_alloc(isl_set_get_ctx(set)); *residue = isl_val_alloc(isl_set_get_ctx(set)); if (!*modulo || !*residue) @@ -774,9 +774,9 @@ int isl_set_dim_residue_class_val(__isl_keep isl_set *set, goto error; isl_int_set_si((*modulo)->d, 1); isl_int_set_si((*residue)->d, 1); - return 0; + return isl_stat_ok; error: isl_val_free(*modulo); isl_val_free(*residue); - return -1; + return isl_stat_error; } diff --git a/polly/lib/External/isl/isl_flow.c b/polly/lib/External/isl/isl_flow.c index 2f026d508413..374a50754092 100644 --- a/polly/lib/External/isl/isl_flow.c +++ b/polly/lib/External/isl/isl_flow.c @@ -436,24 +436,25 @@ error: * while the third argument correspond to the final argument of * the isl_flow_foreach call. */ -int isl_flow_foreach(__isl_keep isl_flow *deps, - int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user), +isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, + isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, + void *user), void *user) { int i; if (!deps) - return -1; + return isl_stat_error; for (i = 0; i < deps->n_source; ++i) { if (isl_map_plain_is_empty(deps->dep[i].map)) continue; if (fn(isl_map_copy(deps->dep[i].map), deps->dep[i].must, deps->dep[i].data, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } /* Return a copy of the subset of the sink for which no source could be found. @@ -1617,7 +1618,7 @@ struct isl_compute_flow_data { isl_access_info *accesses; }; -static int count_matching_array(__isl_take isl_map *map, void *user) +static isl_stat count_matching_array(__isl_take isl_map *map, void *user) { int eq; isl_space *dim; @@ -1633,14 +1634,14 @@ static int count_matching_array(__isl_take isl_map *map, void *user) isl_map_free(map); if (eq < 0) - return -1; + return isl_stat_error; if (eq) data->count++; - return 0; + return isl_stat_ok; } -static int collect_matching_array(__isl_take isl_map *map, void *user) +static isl_stat collect_matching_array(__isl_take isl_map *map, void *user) { int eq; isl_space *dim; @@ -1659,7 +1660,7 @@ static int collect_matching_array(__isl_take isl_map *map, void *user) goto error; if (!eq) { isl_map_free(map); - return 0; + return isl_stat_ok; } info = sched_info_alloc(map); @@ -1670,10 +1671,10 @@ static int collect_matching_array(__isl_take isl_map *map, void *user) data->count++; - return 0; + return isl_stat_ok; error: isl_map_free(map); - return -1; + return isl_stat_error; } /* Determine the shared nesting level and the "textual order" of @@ -1725,7 +1726,7 @@ static int before(void *first, void *second) * the same array and perform dataflow analysis on them using * isl_access_info_compute_flow. */ -static int compute_flow(__isl_take isl_map *map, void *user) +static isl_stat compute_flow(__isl_take isl_map *map, void *user) { int i; isl_ctx *ctx; @@ -1801,7 +1802,7 @@ static int compute_flow(__isl_take isl_map *map, void *user) isl_space_free(data->dim); isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_access_info_free(data->accesses); sched_info_free(data->sink_info); @@ -1813,7 +1814,7 @@ error: isl_space_free(data->dim); isl_map_free(map); - return -1; + return isl_stat_error; } /* Remove the must accesses from the may accesses. @@ -1978,7 +1979,7 @@ static void isl_compute_flow_schedule_data_clear( free(data->sink); } -/* isl_schedule_foreach_schedule_node callback for counting +/* isl_schedule_foreach_schedule_node_top_down callback for counting * (an upper bound on) the number of sinks and sources. * * Sinks and sources are only extracted at leaves of the tree, @@ -1987,15 +1988,16 @@ static void isl_compute_flow_schedule_data_clear( * the number of spaces in the sink and source access domains * that reach this node. */ -static int count_sink_source(__isl_keep isl_schedule_node *node, void *user) +static isl_bool count_sink_source(__isl_keep isl_schedule_node *node, + void *user) { struct isl_compute_flow_schedule_data *data = user; isl_union_set *domain; isl_union_map *umap; - int r = 0; + isl_bool r = isl_bool_false; if (isl_schedule_node_get_type(node) != isl_schedule_node_leaf) - return 1; + return isl_bool_true; domain = isl_schedule_node_get_universe_domain(node); @@ -2004,21 +2006,21 @@ static int count_sink_source(__isl_keep isl_schedule_node *node, void *user) data->n_sink += isl_union_map_n_map(umap); isl_union_map_free(umap); if (!umap) - r = -1; + r = isl_bool_error; umap = isl_union_map_copy(data->access->must_source); umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(domain)); data->n_source += isl_union_map_n_map(umap); isl_union_map_free(umap); if (!umap) - r = -1; + r = isl_bool_error; umap = isl_union_map_copy(data->access->may_source); umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(domain)); data->n_source += isl_union_map_n_map(umap); isl_union_map_free(umap); if (!umap) - r = -1; + r = isl_bool_error; isl_union_set_free(domain); @@ -2029,7 +2031,7 @@ static int count_sink_source(__isl_keep isl_schedule_node *node, void *user) * with scheduled access relation "map", must property data->must and * schedule node data->node to the list of sinks or sources. */ -static int extract_sink_source(__isl_take isl_map *map, void *user) +static isl_stat extract_sink_source(__isl_take isl_map *map, void *user) { struct isl_compute_flow_schedule_data *data = user; struct isl_scheduled_access *access; @@ -2043,10 +2045,10 @@ static int extract_sink_source(__isl_take isl_map *map, void *user) access->must = data->must; access->node = isl_schedule_node_copy(data->node); - return 0; + return isl_stat_ok; } -/* isl_schedule_foreach_schedule_node callback for collecting +/* isl_schedule_foreach_schedule_node_top_down callback for collecting * individual scheduled source and sink accesses. * * We only collect accesses at the leaves of the schedule tree. @@ -2069,15 +2071,16 @@ static int extract_sink_source(__isl_take isl_map *map, void *user) * Note that S consists of a single space such that introducing S * in the access relations does not increase the number of spaces. */ -static int collect_sink_source(__isl_keep isl_schedule_node *node, void *user) +static isl_bool collect_sink_source(__isl_keep isl_schedule_node *node, + void *user) { struct isl_compute_flow_schedule_data *data = user; isl_union_map *prefix; isl_union_map *umap; - int r = 0; + isl_bool r = isl_bool_false; if (isl_schedule_node_get_type(node) != isl_schedule_node_leaf) - return 1; + return isl_bool_true; data->node = node; @@ -2089,7 +2092,7 @@ static int collect_sink_source(__isl_keep isl_schedule_node *node, void *user) umap = isl_union_map_copy(data->access->sink); umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) - r = -1; + r = isl_bool_error; isl_union_map_free(umap); data->set_sink = 0; @@ -2097,7 +2100,7 @@ static int collect_sink_source(__isl_keep isl_schedule_node *node, void *user) umap = isl_union_map_copy(data->access->must_source); umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) - r = -1; + r = isl_bool_error; isl_union_map_free(umap); data->set_sink = 0; @@ -2105,7 +2108,7 @@ static int collect_sink_source(__isl_keep isl_schedule_node *node, void *user) umap = isl_union_map_copy(data->access->may_source); umap = isl_union_map_apply_range(isl_union_map_copy(prefix), umap); if (isl_union_map_foreach_map(umap, &extract_sink_source, data) < 0) - r = -1; + r = isl_bool_error; isl_union_map_free(umap); isl_union_map_free(prefix); @@ -2273,7 +2276,7 @@ static __isl_give isl_union_flow *compute_flow_schedule( data.n_sink = 0; data.n_source = 0; - if (isl_schedule_foreach_schedule_node(access->schedule, + if (isl_schedule_foreach_schedule_node_top_down(access->schedule, &count_sink_source, &data) < 0) goto error; @@ -2285,7 +2288,7 @@ static __isl_give isl_union_flow *compute_flow_schedule( data.n_sink = 0; data.n_source = 0; - if (isl_schedule_foreach_schedule_node(access->schedule, + if (isl_schedule_foreach_schedule_node_top_down(access->schedule, &collect_sink_source, &data) < 0) goto error; diff --git a/polly/lib/External/isl/isl_fold.c b/polly/lib/External/isl/isl_fold.c index 77f1fee0a05c..a7f088ad13f9 100644 --- a/polly/lib/External/isl/isl_fold.c +++ b/polly/lib/External/isl/isl_fold.c @@ -787,12 +787,12 @@ int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold) /* Does "fold" represent max(NaN) or min(NaN)? */ -int isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold) +isl_bool isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold) { if (!fold) - return -1; + return isl_bool_error; if (fold->n != 1) - return 0; + return isl_bool_false; return isl_qpolynomial_is_nan(fold->qp[0]); } @@ -963,14 +963,14 @@ error: return NULL; } -static int fold_part(__isl_take isl_pw_qpolynomial_fold *part, void *user) +static isl_stat fold_part(__isl_take isl_pw_qpolynomial_fold *part, void *user) { isl_union_pw_qpolynomial_fold **u; u = (isl_union_pw_qpolynomial_fold **)user; *u = isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold(*u, part); - return 0; + return isl_stat_ok; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold( @@ -1316,20 +1316,20 @@ error: return NULL; } -int isl_qpolynomial_fold_foreach_qpolynomial( +isl_stat isl_qpolynomial_fold_foreach_qpolynomial( __isl_keep isl_qpolynomial_fold *fold, - int (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user) + isl_stat (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user) { int i; if (!fold) - return -1; + return isl_stat_error; for (i = 0; i < fold->n; ++i) if (fn(isl_qpolynomial_copy(fold->qp[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_move_dims( @@ -1394,7 +1394,7 @@ error: return NULL; } -static int add_pwqp(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat add_pwqp(__isl_take isl_pw_qpolynomial *pwqp, void *user) { isl_ctx *ctx; isl_pw_qpolynomial_fold *pwf; @@ -1418,17 +1418,17 @@ static int add_pwqp(__isl_take isl_pw_qpolynomial *pwqp, void *user) else { entry->data = isl_pw_qpolynomial_fold_add(entry->data, pwf); if (!entry->data) - return -1; + return isl_stat_error; if (isl_pw_qpolynomial_fold_is_zero(entry->data)) { isl_pw_qpolynomial_fold_free(entry->data); isl_hash_table_remove(ctx, &(*upwf)->table, entry); } } - return 0; + return isl_stat_ok; error: isl_pw_qpolynomial_free(pwqp); - return -1; + return isl_stat_error; } __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial( @@ -1530,8 +1530,8 @@ struct isl_apply_fold_data { int tight; }; -static int pw_qpolynomial_fold_apply(__isl_take isl_pw_qpolynomial_fold *pwf, - void *user) +static isl_stat pw_qpolynomial_fold_apply( + __isl_take isl_pw_qpolynomial_fold *pwf, void *user) { isl_space *map_dim; isl_space *pwf_dim; @@ -1552,13 +1552,13 @@ static int pw_qpolynomial_fold_apply(__isl_take isl_pw_qpolynomial_fold *pwf, } else isl_pw_qpolynomial_fold_free(pwf); - return 0; + return isl_stat_ok; } -static int map_apply(__isl_take isl_map *map, void *user) +static isl_stat map_apply(__isl_take isl_map *map, void *user) { struct isl_apply_fold_data *data = user; - int r; + isl_stat r; data->map = map; r = isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold( diff --git a/polly/lib/External/isl/isl_hash.c b/polly/lib/External/isl/isl_hash.c index 36817d7fb42d..290807bca514 100644 --- a/polly/lib/External/isl/isl_hash.c +++ b/polly/lib/External/isl/isl_hash.c @@ -180,23 +180,22 @@ struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx, return &table->entries[h]; } -int isl_hash_table_foreach(struct isl_ctx *ctx, - struct isl_hash_table *table, - int (*fn)(void **entry, void *user), void *user) +isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table, + isl_stat (*fn)(void **entry, void *user), void *user) { size_t size; uint32_t h; if (!table->entries) - return -1; + return isl_stat_error; size = 1 << table->bits; for (h = 0; h < size; ++ h) if (table->entries[h].data && fn(&table->entries[h].data, user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } void isl_hash_table_remove(struct isl_ctx *ctx, diff --git a/polly/lib/External/isl/isl_hmap_templ.c b/polly/lib/External/isl/isl_hmap_templ.c index 983dfbddcad6..c6a67473bce0 100644 --- a/polly/lib/External/isl/isl_hmap_templ.c +++ b/polly/lib/External/isl/isl_hmap_templ.c @@ -56,14 +56,14 @@ __isl_give HMAP *FN(HMAP,alloc)(isl_ctx *ctx, int min_size) return hmap; } -static int free_pair(void **entry, void *user) +static isl_stat free_pair(void **entry, void *user) { S(pair) *pair = *entry; FN(KEY,free)(pair->key); FN(VAL,free)(pair->val); free(pair); *entry = NULL; - return 0; + return isl_stat_ok; } __isl_null HMAP *FN(HMAP,free)(__isl_take HMAP *hmap) @@ -87,16 +87,17 @@ isl_ctx *FN(HMAP,get_ctx)(__isl_keep HMAP *hmap) /* Add a mapping from "key" to "val" to the associative array * pointed to by user. */ -static int add_key_val(__isl_take KEY *key, __isl_take VAL *val, void *user) +static isl_stat add_key_val(__isl_take KEY *key, __isl_take VAL *val, + void *user) { HMAP **hmap = (HMAP **) user; *hmap = FN(HMAP,set)(*hmap, key, val); if (!*hmap) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give HMAP *FN(HMAP,dup)(__isl_keep HMAP *hmap) @@ -141,12 +142,12 @@ static int has_key(const void *entry, const void *c_key) return KEY_EQUAL(pair->key, key); } -int FN(HMAP,has)(__isl_keep HMAP *hmap, __isl_keep KEY *key) +isl_bool FN(HMAP,has)(__isl_keep HMAP *hmap, __isl_keep KEY *key) { uint32_t hash; if (!hmap) - return -1; + return isl_bool_error; hash = FN(KEY,get_hash)(key); return !!isl_hash_table_find(hmap->ctx, &hmap->table, hash, @@ -294,13 +295,13 @@ error: * user is the user-specified final argument to fn. */ S(foreach_data) { - int (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user); + isl_stat (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user); void *user; }; /* Call data->fn on a copy of the key and value in *entry. */ -static int call_on_copy(void **entry, void *user) +static isl_stat call_on_copy(void **entry, void *user) { S(pair) *pair = *entry; S(foreach_data) *data = (S(foreach_data) *) user; @@ -311,14 +312,14 @@ static int call_on_copy(void **entry, void *user) /* Call "fn" on each pair of key and value in "hmap". */ -int FN(HMAP,foreach)(__isl_keep HMAP *hmap, - int (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user), +isl_stat FN(HMAP,foreach)(__isl_keep HMAP *hmap, + isl_stat (*fn)(__isl_take KEY *key, __isl_take VAL *val, void *user), void *user) { S(foreach_data) data = { fn, user }; if (!hmap) - return -1; + return isl_stat_error; return isl_hash_table_foreach(hmap->ctx, &hmap->table, &call_on_copy, &data); @@ -336,7 +337,7 @@ S(print_data) { /* Print the given key-value pair to data->p. */ -static int print_pair(__isl_take KEY *key, __isl_take VAL *val, void *user) +static isl_stat print_pair(__isl_take KEY *key, __isl_take VAL *val, void *user) { S(print_data) *data = user; @@ -349,7 +350,7 @@ static int print_pair(__isl_take KEY *key, __isl_take VAL *val, void *user) FN(KEY,free)(key); FN(VAL,free)(val); - return 0; + return isl_stat_ok; } /* Print the associative array to "p". diff --git a/polly/lib/External/isl/isl_list_templ.c b/polly/lib/External/isl/isl_list_templ.c index bee624835a24..aa900b95a0c7 100644 --- a/polly/lib/External/isl/isl_list_templ.c +++ b/polly/lib/External/isl/isl_list_templ.c @@ -273,23 +273,23 @@ error: return NULL; } -int FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list, - int (*fn)(__isl_take EL *el, void *user), void *user) +isl_stat FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list, + isl_stat (*fn)(__isl_take EL *el, void *user), void *user) { int i; if (!list) - return -1; + return isl_stat_error; for (i = 0; i < list->n; ++i) { EL *el = FN(EL,copy(list->p[i])); if (!el) - return -1; + return isl_stat_error; if (fn(el, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } /* Internal data structure for isl_*_list_sort. @@ -344,7 +344,7 @@ __isl_give LIST(EL) *FN(LIST(EL),sort)(__isl_take LIST(EL) *list, */ S(LIST(EL),foreach_scc_data) { LIST(EL) *list; - int (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user); + isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user); void *follows_user; }; @@ -352,7 +352,7 @@ S(LIST(EL),foreach_scc_data) { * * Use the user provided callback to find out. */ -static int FN(LIST(EL),follows)(int i, int j, void *user) +static isl_bool FN(LIST(EL),follows)(int i, int j, void *user) { S(LIST(EL),foreach_scc_data) *data = user; @@ -363,8 +363,8 @@ static int FN(LIST(EL),follows)(int i, int j, void *user) /* Call "fn" on the sublist of "list" that consists of the elements * with indices specified by the "n" elements of "pos". */ -static int FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos, int n, - int (*fn)(__isl_take LIST(EL) *scc, void *user), void *user) +static isl_stat FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos, + int n, isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *user) { int i; isl_ctx *ctx; @@ -394,10 +394,10 @@ static int FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos, int n, * We simply call isl_tarjan_graph_init, extract the SCCs from the result and * call fn on each of them. */ -int FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, - int (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user), +isl_stat FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, + isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user), void *follows_user, - int (*fn)(__isl_take LIST(EL) *scc, void *user), void *fn_user) + isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *fn_user) { S(LIST(EL),foreach_scc_data) data = { list, follows, follows_user }; int i, n; @@ -405,9 +405,9 @@ int FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, struct isl_tarjan_graph *g; if (!list) - return -1; + return isl_stat_error; if (list->n == 0) - return 0; + return isl_stat_ok; if (list->n == 1) return fn(FN(LIST(EL),copy)(list), fn_user); @@ -415,7 +415,7 @@ int FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, n = list->n; g = isl_tarjan_graph_init(ctx, n, &FN(LIST(EL),follows), &data); if (!g) - return -1; + return isl_stat_error; i = 0; do { @@ -440,7 +440,7 @@ int FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list, isl_tarjan_graph_free(g); - return n > 0 ? -1 : 0; + return n > 0 ? isl_stat_error : isl_stat_ok; } __isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el) diff --git a/polly/lib/External/isl/isl_local_space.c b/polly/lib/External/isl/isl_local_space.c index 189083871916..7b3347cffac3 100644 --- a/polly/lib/External/isl/isl_local_space.c +++ b/polly/lib/External/isl/isl_local_space.c @@ -121,39 +121,39 @@ __isl_null isl_local_space *isl_local_space_free( /* Is the local space that of a parameter domain? */ -int isl_local_space_is_params(__isl_keep isl_local_space *ls) +isl_bool isl_local_space_is_params(__isl_keep isl_local_space *ls) { if (!ls) - return -1; + return isl_bool_error; return isl_space_is_params(ls->dim); } /* Is the local space that of a set? */ -int isl_local_space_is_set(__isl_keep isl_local_space *ls) +isl_bool isl_local_space_is_set(__isl_keep isl_local_space *ls) { - return ls ? isl_space_is_set(ls->dim) : -1; + return ls ? isl_space_is_set(ls->dim) : isl_bool_error; } /* Return true if the two local spaces are identical, with identical * expressions for the integer divisions. */ -int isl_local_space_is_equal(__isl_keep isl_local_space *ls1, +isl_bool isl_local_space_is_equal(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2) { - int equal; + isl_bool equal; if (!ls1 || !ls2) - return -1; + return isl_bool_error; equal = isl_space_is_equal(ls1->dim, ls2->dim); if (equal < 0 || !equal) return equal; if (!isl_local_space_divs_known(ls1)) - return 0; + return isl_bool_false; if (!isl_local_space_divs_known(ls2)) - return 0; + return isl_bool_false; return isl_mat_is_equal(ls1->div, ls2->div); } @@ -259,10 +259,10 @@ int isl_local_space_find_dim_by_name(__isl_keep isl_local_space *ls, /* Does the given dimension have a name? */ -int isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) { - return ls ? isl_space_has_dim_name(ls->dim, type, pos) : -1; + return ls ? isl_space_has_dim_name(ls->dim, type, pos) : isl_bool_error; } const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, @@ -271,10 +271,10 @@ const char *isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, return ls ? isl_space_get_dim_name(ls->dim, type, pos) : NULL; } -int isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, +isl_bool isl_local_space_has_dim_id(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos) { - return ls ? isl_space_has_dim_id(ls->dim, type, pos) : -1; + return ls ? isl_space_has_dim_id(ls->dim, type, pos) : isl_bool_error; } __isl_give isl_id *isl_local_space_get_dim_id(__isl_keep isl_local_space *ls, diff --git a/polly/lib/External/isl/isl_map.c b/polly/lib/External/isl/isl_map.c index 99ab9c2f9240..6dbb57593ea9 100644 --- a/polly/lib/External/isl/isl_map.c +++ b/polly/lib/External/isl/isl_map.c @@ -456,9 +456,9 @@ __isl_give isl_basic_set *isl_basic_set_set_tuple_id( /* Does the input or output tuple have a name? */ -int isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type) +isl_bool isl_map_has_tuple_name(__isl_keep isl_map *map, enum isl_dim_type type) { - return map ? isl_space_has_tuple_name(map->dim, type) : -1; + return map ? isl_space_has_tuple_name(map->dim, type) : isl_bool_error; } const char *isl_map_get_tuple_name(__isl_keep isl_map *map, @@ -511,9 +511,9 @@ __isl_give isl_set *isl_set_reset_tuple_id(__isl_take isl_set *set) return isl_map_reset_tuple_id(set, isl_dim_set); } -int isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type) +isl_bool isl_map_has_tuple_id(__isl_keep isl_map *map, enum isl_dim_type type) { - return map ? isl_space_has_tuple_id(map->dim, type) : -1; + return map ? isl_space_has_tuple_id(map->dim, type) : isl_bool_error; } __isl_give isl_id *isl_map_get_tuple_id(__isl_keep isl_map *map, @@ -522,7 +522,7 @@ __isl_give isl_id *isl_map_get_tuple_id(__isl_keep isl_map *map, return map ? isl_space_get_tuple_id(map->dim, type) : NULL; } -int isl_set_has_tuple_id(__isl_keep isl_set *set) +isl_bool isl_set_has_tuple_id(__isl_keep isl_set *set) { return isl_map_has_tuple_id(set, isl_dim_set); } @@ -534,9 +534,11 @@ __isl_give isl_id *isl_set_get_tuple_id(__isl_keep isl_set *set) /* Does the set tuple have a name? */ -int isl_set_has_tuple_name(__isl_keep isl_set *set) +isl_bool isl_set_has_tuple_name(__isl_keep isl_set *set) { - return set ? isl_space_has_tuple_name(set->dim, isl_dim_set) : -1; + if (!set) + return isl_bool_error; + return isl_space_has_tuple_name(set->dim, isl_dim_set); } @@ -564,10 +566,12 @@ const char *isl_basic_set_get_dim_name(__isl_keep isl_basic_set *bset, /* Does the given dimension have a name? */ -int isl_map_has_dim_name(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_name(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos) { - return map ? isl_space_has_dim_name(map->dim, type, pos) : -1; + if (!map) + return isl_bool_error; + return isl_space_has_dim_name(map->dim, type, pos); } const char *isl_map_get_dim_name(__isl_keep isl_map *map, @@ -584,10 +588,12 @@ const char *isl_set_get_dim_name(__isl_keep isl_set *set, /* Does the given dimension have a name? */ -int isl_set_has_dim_name(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_name(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { - return set ? isl_space_has_dim_name(set->dim, type, pos) : -1; + if (!set) + return isl_bool_error; + return isl_space_has_dim_name(set->dim, type, pos); } __isl_give isl_basic_map *isl_basic_map_set_dim_name( @@ -645,10 +651,12 @@ __isl_give isl_set *isl_set_set_dim_name(__isl_take isl_set *set, return (isl_set *)isl_map_set_dim_name((isl_map *)set, type, pos, s); } -int isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_has_dim_id(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { - return bmap ? isl_space_has_dim_id(bmap->dim, type, pos) : -1; + if (!bmap) + return isl_bool_error; + return isl_space_has_dim_id(bmap->dim, type, pos); } __isl_give isl_id *isl_basic_set_get_dim_id(__isl_keep isl_basic_set *bset, @@ -657,10 +665,10 @@ __isl_give isl_id *isl_basic_set_get_dim_id(__isl_keep isl_basic_set *bset, return bset ? isl_space_get_dim_id(bset->dim, type, pos) : NULL; } -int isl_map_has_dim_id(__isl_keep isl_map *map, +isl_bool isl_map_has_dim_id(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos) { - return map ? isl_space_has_dim_id(map->dim, type, pos) : -1; + return map ? isl_space_has_dim_id(map->dim, type, pos) : isl_bool_error; } __isl_give isl_id *isl_map_get_dim_id(__isl_keep isl_map *map, @@ -669,7 +677,7 @@ __isl_give isl_id *isl_map_get_dim_id(__isl_keep isl_map *map, return map ? isl_space_get_dim_id(map->dim, type, pos) : NULL; } -int isl_set_has_dim_id(__isl_keep isl_set *set, +isl_bool isl_set_has_dim_id(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return isl_map_has_dim_id(set, type, pos); @@ -857,10 +865,10 @@ int isl_basic_set_is_params(__isl_keep isl_basic_set *bset) /* Is this set a parameter domain? */ -int isl_set_is_params(__isl_keep isl_set *set) +isl_bool isl_set_is_params(__isl_keep isl_set *set) { if (!set) - return -1; + return isl_bool_error; return isl_space_is_params(set->dim); } @@ -1134,20 +1142,20 @@ error: return NULL; } -int isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, +isl_bool isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, __isl_keep isl_map *map2, - int (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)) + isl_bool (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)) { - int r; + isl_bool r; if (!map1 || !map2) - return -1; + return isl_bool_error; if (isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param)) return fn(map1, map2); if (!isl_space_has_named_params(map1->dim) || !isl_space_has_named_params(map2->dim)) isl_die(map1->ctx, isl_error_invalid, - "unaligned unnamed parameters", return -1); + "unaligned unnamed parameters", return isl_bool_error); map1 = isl_map_copy(map1); map2 = isl_map_copy(map2); map1 = isl_map_align_params(map1, isl_map_get_space(map2)); @@ -1709,25 +1717,6 @@ error: return NULL; } -static __isl_give isl_basic_set *isl_basic_set_swap_vars( - __isl_take isl_basic_set *bset, unsigned n) -{ - unsigned dim; - unsigned nparam; - - if (!bset) - return NULL; - - nparam = isl_basic_set_n_param(bset); - dim = isl_basic_set_n_dim(bset); - isl_assert(bset->ctx, n <= dim, goto error); - - return isl_basic_map_swap_vars(bset, 1 + nparam, n, dim - n); -error: - isl_basic_set_free(bset); - return NULL; -} - struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap) { int i = 0; @@ -2209,64 +2198,64 @@ __isl_give isl_set *isl_set_remove_divs_involving_dims(__isl_take isl_set *set, * in a div definition, they also appear in the defining constraints of that * div. */ -int isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n) { int i; if (!bmap) - return -1; + return isl_bool_error; if (first + n > isl_basic_map_dim(bmap, type)) isl_die(bmap->ctx, isl_error_invalid, - "index out of bounds", return -1); + "index out of bounds", return isl_bool_error); first += isl_basic_map_offset(bmap, type); for (i = 0; i < bmap->n_eq; ++i) if (isl_seq_first_non_zero(bmap->eq[i] + first, n) >= 0) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_ineq; ++i) if (isl_seq_first_non_zero(bmap->ineq[i] + first, n) >= 0) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_div; ++i) { if (isl_int_is_zero(bmap->div[i][0])) continue; if (isl_seq_first_non_zero(bmap->div[i] + 1 + first, n) >= 0) - return 1; + return isl_bool_true; } - return 0; + return isl_bool_false; } -int isl_map_involves_dims(__isl_keep isl_map *map, +isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n) { int i; if (!map) - return -1; + return isl_bool_error; if (first + n > isl_map_dim(map, type)) isl_die(map->ctx, isl_error_invalid, - "index out of bounds", return -1); + "index out of bounds", return isl_bool_error); for (i = 0; i < map->n; ++i) { - int involves = isl_basic_map_involves_dims(map->p[i], + isl_bool involves = isl_basic_map_involves_dims(map->p[i], type, first, n); if (involves < 0 || involves) return involves; } - return 0; + return isl_bool_false; } -int isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, +isl_bool isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n) { return isl_basic_map_involves_dims(bset, type, first, n); } -int isl_set_involves_dims(__isl_keep isl_set *set, +isl_bool isl_set_involves_dims(__isl_keep isl_set *set, enum isl_dim_type type, unsigned first, unsigned n) { return isl_map_involves_dims(set, type, first, n); @@ -2804,18 +2793,19 @@ error: return NULL; } -int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec) +isl_bool isl_basic_map_contains(__isl_keep isl_basic_map *bmap, + __isl_keep isl_vec *vec) { int i; unsigned total; isl_int s; if (!bmap || !vec) - return -1; + return isl_bool_error; total = 1 + isl_basic_map_total_dim(bmap); if (total != vec->size) - return -1; + return isl_bool_error; isl_int_init(s); @@ -2823,7 +2813,7 @@ int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec) isl_seq_inner_product(vec->el, bmap->eq[i], total, &s); if (!isl_int_is_zero(s)) { isl_int_clear(s); - return 0; + return isl_bool_false; } } @@ -2831,16 +2821,17 @@ int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec) isl_seq_inner_product(vec->el, bmap->ineq[i], total, &s); if (isl_int_is_neg(s)) { isl_int_clear(s); - return 0; + return isl_bool_false; } } isl_int_clear(s); - return 1; + return isl_bool_true; } -int isl_basic_set_contains(struct isl_basic_set *bset, struct isl_vec *vec) +isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, + __isl_keep isl_vec *vec) { return isl_basic_map_contains((struct isl_basic_map *)bset, vec); } @@ -3084,20 +3075,20 @@ __isl_give isl_set *isl_set_intersect_params(__isl_take isl_set *set, struct isl_basic_map *isl_basic_map_reverse(struct isl_basic_map *bmap) { - isl_space *dim; - struct isl_basic_set *bset; - unsigned in; + isl_space *space; + unsigned pos, n1, n2; if (!bmap) return NULL; bmap = isl_basic_map_cow(bmap); if (!bmap) return NULL; - dim = isl_space_reverse(isl_space_copy(bmap->dim)); - in = isl_basic_map_n_in(bmap); - bset = isl_basic_set_from_basic_map(bmap); - bset = isl_basic_set_swap_vars(bset, in); - return isl_basic_map_from_basic_set(bset, dim); + space = isl_space_reverse(isl_space_copy(bmap->dim)); + pos = isl_basic_map_offset(bmap, isl_dim_in); + n1 = isl_basic_map_dim(bmap, isl_dim_in); + n2 = isl_basic_map_dim(bmap, isl_dim_out); + bmap = isl_basic_map_swap_vars(bmap, pos, n1, n2); + return isl_basic_map_reset_space(bmap, space); } static __isl_give isl_basic_map *basic_map_space_reset( @@ -4362,25 +4353,6 @@ error: return NULL; } -struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap) -{ - if (!bmap) - goto error; - if (bmap->dim->n_in == 0) - return (struct isl_basic_set *)bmap; - bmap = isl_basic_map_cow(bmap); - if (!bmap) - goto error; - bmap->dim = isl_space_as_set_space(bmap->dim); - if (!bmap->dim) - goto error; - bmap = isl_basic_map_finalize(bmap); - return (struct isl_basic_set *)bmap; -error: - isl_basic_map_free(bmap); - return NULL; -} - /* For a div d = floor(f/m), add the constraint * * f - m d >= 0 @@ -4856,23 +4828,17 @@ __isl_give isl_set *isl_map_params(__isl_take isl_map *map) struct isl_basic_set *isl_basic_map_domain(struct isl_basic_map *bmap) { - isl_space *dim; - struct isl_basic_set *domain; - unsigned n_in; + isl_space *space; unsigned n_out; if (!bmap) return NULL; - dim = isl_space_domain(isl_basic_map_get_space(bmap)); + space = isl_space_domain(isl_basic_map_get_space(bmap)); - n_in = isl_basic_map_n_in(bmap); n_out = isl_basic_map_n_out(bmap); - domain = isl_basic_set_from_basic_map(bmap); - domain = isl_basic_set_project_out(domain, isl_dim_set, n_in, n_out); + bmap = isl_basic_map_project_out(bmap, isl_dim_out, 0, n_out); - domain = isl_basic_set_reset_space(domain, dim); - - return domain; + return isl_basic_map_reset_space(bmap, space); } int isl_basic_map_may_be_set(__isl_keep isl_basic_map *bmap) @@ -5175,31 +5141,6 @@ __isl_give isl_map *isl_map_from_domain_and_range(__isl_take isl_set *domain, return isl_map_apply_range(isl_map_reverse(domain), range); } -struct isl_set *isl_set_from_map(struct isl_map *map) -{ - int i; - struct isl_set *set = NULL; - - if (!map) - return NULL; - map = isl_map_cow(map); - if (!map) - return NULL; - map->dim = isl_space_as_set_space(map->dim); - if (!map->dim) - goto error; - set = (struct isl_set *)map; - for (i = 0; i < map->n; ++i) { - set->p[i] = isl_basic_set_from_basic_map(map->p[i]); - if (!set->p[i]) - goto error; - } - return set; -error: - isl_map_free(map); - return NULL; -} - __isl_give isl_map *isl_map_alloc_space(__isl_take isl_space *dim, int n, unsigned flags) { @@ -5396,37 +5337,6 @@ __isl_null isl_map *isl_map_free(__isl_take isl_map *map) return NULL; } -struct isl_map *isl_map_extend(struct isl_map *base, - unsigned nparam, unsigned n_in, unsigned n_out) -{ - int i; - - base = isl_map_cow(base); - if (!base) - return NULL; - - base->dim = isl_space_extend(base->dim, nparam, n_in, n_out); - if (!base->dim) - goto error; - for (i = 0; i < base->n; ++i) { - base->p[i] = isl_basic_map_extend_space(base->p[i], - isl_space_copy(base->dim), 0, 0, 0); - if (!base->p[i]) - goto error; - } - return base; -error: - isl_map_free(base); - return NULL; -} - -struct isl_set *isl_set_extend(struct isl_set *base, - unsigned nparam, unsigned dim) -{ - return (struct isl_set *)isl_map_extend((struct isl_map *)base, - nparam, 0, dim); -} - static struct isl_basic_map *isl_basic_map_fix_pos_si( struct isl_basic_map *bmap, unsigned pos, int value) { @@ -7403,7 +7313,7 @@ __isl_give isl_map *isl_map_apply_range(__isl_take isl_map *map1, */ struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap) { - isl_space *dims, *target_dim; + isl_space *target_space; struct isl_basic_set *bset; unsigned dim; unsigned nparam; @@ -7414,29 +7324,25 @@ struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap) isl_assert(bmap->ctx, isl_space_tuple_is_equal(bmap->dim, isl_dim_in, bmap->dim, isl_dim_out), goto error); - target_dim = isl_space_domain(isl_basic_map_get_space(bmap)); + target_space = isl_space_domain(isl_basic_map_get_space(bmap)); dim = isl_basic_map_n_in(bmap); nparam = isl_basic_map_n_param(bmap); - bset = isl_basic_set_from_basic_map(bmap); - bset = isl_basic_set_cow(bset); - dims = isl_basic_set_get_space(bset); - dims = isl_space_add_dims(dims, isl_dim_set, dim); - bset = isl_basic_set_extend_space(bset, dims, 0, dim, 0); - bset = isl_basic_set_swap_vars(bset, 2*dim); + bmap = isl_basic_map_from_range(isl_basic_map_wrap(bmap)); + bmap = isl_basic_map_add_dims(bmap, isl_dim_in, dim); + bmap = isl_basic_map_extend_constraints(bmap, dim, 0); for (i = 0; i < dim; ++i) { - int j = isl_basic_map_alloc_equality( - (struct isl_basic_map *)bset); + int j = isl_basic_map_alloc_equality(bmap); if (j < 0) { - bset = isl_basic_set_free(bset); + bmap = isl_basic_map_free(bmap); break; } - isl_seq_clr(bset->eq[j], 1 + isl_basic_set_total_dim(bset)); - isl_int_set_si(bset->eq[j][1+nparam+i], 1); - isl_int_set_si(bset->eq[j][1+nparam+dim+i], 1); - isl_int_set_si(bset->eq[j][1+nparam+2*dim+i], -1); + isl_seq_clr(bmap->eq[j], 1 + isl_basic_map_total_dim(bmap)); + isl_int_set_si(bmap->eq[j][1+nparam+i], 1); + isl_int_set_si(bmap->eq[j][1+nparam+dim+i], 1); + isl_int_set_si(bmap->eq[j][1+nparam+2*dim+i], -1); } - bset = isl_basic_set_project_out(bset, isl_dim_set, dim, 2*dim); - bset = isl_basic_set_reset_space(bset, target_dim); + bset = isl_basic_map_domain(bmap); + bset = isl_basic_set_reset_space(bset, target_space); return bset; error: isl_basic_map_free(bmap); @@ -7780,20 +7686,20 @@ int isl_set_foreach_orthant(__isl_keep isl_set *set, return r; } -int isl_set_is_equal(struct isl_set *set1, struct isl_set *set2) +isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_equal((struct isl_map *)set1, (struct isl_map *)set2); } -int isl_basic_map_is_subset( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +isl_bool isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2) { int is_subset; struct isl_map *map1; struct isl_map *map2; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; map1 = isl_map_from_basic_map(isl_basic_map_copy(bmap1)); map2 = isl_map_from_basic_map(isl_basic_map_copy(bmap2)); @@ -7806,61 +7712,61 @@ int isl_basic_map_is_subset( return is_subset; } -int isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2) { return isl_basic_map_is_subset(bset1, bset2); } -int isl_basic_map_is_equal( - struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) +isl_bool isl_basic_map_is_equal(__isl_keep isl_basic_map *bmap1, + __isl_keep isl_basic_map *bmap2) { - int is_subset; + isl_bool is_subset; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; is_subset = isl_basic_map_is_subset(bmap1, bmap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_basic_map_is_subset(bmap2, bmap1); return is_subset; } -int isl_basic_set_is_equal( - struct isl_basic_set *bset1, struct isl_basic_set *bset2) +isl_bool isl_basic_set_is_equal(__isl_keep isl_basic_set *bset1, + __isl_keep isl_basic_set *bset2) { return isl_basic_map_is_equal( (struct isl_basic_map *)bset1, (struct isl_basic_map *)bset2); } -int isl_map_is_empty(struct isl_map *map) +isl_bool isl_map_is_empty(__isl_keep isl_map *map) { int i; int is_empty; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { is_empty = isl_basic_map_is_empty(map->p[i]); if (is_empty < 0) - return -1; + return isl_bool_error; if (!is_empty) - return 0; + return isl_bool_false; } - return 1; + return isl_bool_true; } -int isl_map_plain_is_empty(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map) { - return map ? map->n == 0 : -1; + return map ? map->n == 0 : isl_bool_error; } -int isl_set_plain_is_empty(struct isl_set *set) +isl_bool isl_set_plain_is_empty(__isl_keep isl_set *set) { - return set ? set->n == 0 : -1; + return set ? set->n == 0 : isl_bool_error; } -int isl_set_is_empty(struct isl_set *set) +isl_bool isl_set_is_empty(__isl_keep isl_set *set) { return isl_map_is_empty((struct isl_map *)set); } @@ -7881,110 +7787,112 @@ int isl_set_has_equal_space(__isl_keep isl_set *set1, __isl_keep isl_set *set2) return isl_space_is_equal(set1->dim, set2->dim); } -static int map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { - int is_subset; + isl_bool is_subset; if (!map1 || !map2) - return -1; + return isl_bool_error; is_subset = isl_map_is_subset(map1, map2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_map_is_subset(map2, map1); return is_subset; } -int isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { return isl_map_align_params_map_map_and_test(map1, map2, &map_is_equal); } -int isl_basic_map_is_strict_subset( +isl_bool isl_basic_map_is_strict_subset( struct isl_basic_map *bmap1, struct isl_basic_map *bmap2) { - int is_subset; + isl_bool is_subset; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; is_subset = isl_basic_map_is_subset(bmap1, bmap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_basic_map_is_subset(bmap2, bmap1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_map_is_strict_subset(struct isl_map *map1, struct isl_map *map2) +isl_bool isl_map_is_strict_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { - int is_subset; + isl_bool is_subset; if (!map1 || !map2) - return -1; + return isl_bool_error; is_subset = isl_map_is_subset(map1, map2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_map_is_subset(map2, map1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_is_strict_subset(__isl_keep isl_set *set1, + __isl_keep isl_set *set2) { return isl_map_is_strict_subset((isl_map *)set1, (isl_map *)set2); } -int isl_basic_map_is_universe(struct isl_basic_map *bmap) +isl_bool isl_basic_map_is_universe(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return bmap->n_eq == 0 && bmap->n_ineq == 0; } -int isl_basic_set_is_universe(struct isl_basic_set *bset) +isl_bool isl_basic_set_is_universe(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return bset->n_eq == 0 && bset->n_ineq == 0; } -int isl_map_plain_is_universe(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_universe(__isl_keep isl_map *map) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int r = isl_basic_map_is_universe(map->p[i]); + isl_bool r = isl_basic_map_is_universe(map->p[i]); if (r < 0 || r) return r; } - return 0; + return isl_bool_false; } -int isl_set_plain_is_universe(__isl_keep isl_set *set) +isl_bool isl_set_plain_is_universe(__isl_keep isl_set *set) { return isl_map_plain_is_universe((isl_map *) set); } -int isl_basic_map_is_empty(struct isl_basic_map *bmap) +isl_bool isl_basic_map_is_empty(__isl_keep isl_basic_map *bmap) { struct isl_basic_set *bset = NULL; struct isl_vec *sample = NULL; - int empty; + isl_bool empty; unsigned total; if (!bmap) - return -1; + return isl_bool_error; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY)) - return 1; + return isl_bool_true; if (isl_basic_map_is_universe(bmap)) - return 0; + return isl_bool_false; if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_RATIONAL)) { struct isl_basic_map *copy = isl_basic_map_copy(bmap); @@ -7998,18 +7906,18 @@ int isl_basic_map_is_empty(struct isl_basic_map *bmap) if (bmap->sample && bmap->sample->size == total) { int contains = isl_basic_map_contains(bmap, bmap->sample); if (contains < 0) - return -1; + return isl_bool_error; if (contains) - return 0; + return isl_bool_false; } isl_vec_free(bmap->sample); bmap->sample = NULL; bset = isl_basic_map_underlying_set(isl_basic_map_copy(bmap)); if (!bset) - return -1; + return isl_bool_error; sample = isl_basic_set_sample_vec(bset); if (!sample) - return -1; + return isl_bool_error; empty = sample->size == 0; isl_vec_free(bmap->sample); bmap->sample = sample; @@ -8019,21 +7927,21 @@ int isl_basic_map_is_empty(struct isl_basic_map *bmap) return empty; } -int isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY); } -int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset) +isl_bool isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return ISL_F_ISSET(bset, ISL_BASIC_SET_EMPTY); } -int isl_basic_set_is_empty(struct isl_basic_set *bset) +isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset) { return isl_basic_map_is_empty((struct isl_basic_map *)bset); } @@ -8999,15 +8907,15 @@ int isl_set_plain_cmp(__isl_keep isl_set *set1, __isl_keep isl_set *set2) return 0; } -int isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2) { if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; return isl_basic_map_plain_cmp(bmap1, bmap2) == 0; } -int isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2) { return isl_basic_map_plain_is_equal((isl_basic_map *)bset1, @@ -9117,18 +9025,19 @@ struct isl_set *isl_set_normalize(struct isl_set *set) return (struct isl_set *)isl_map_normalize((struct isl_map *)set); } -int isl_map_plain_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_plain_is_equal(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { int i; - int equal; + isl_bool equal; if (!map1 || !map2) - return -1; + return isl_bool_error; if (map1 == map2) - return 1; + return isl_bool_true; if (!isl_space_is_equal(map1->dim, map2->dim)) - return 0; + return isl_bool_false; map1 = isl_map_copy(map1); map2 = isl_map_copy(map2); @@ -9148,10 +9057,11 @@ int isl_map_plain_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2) error: isl_map_free(map1); isl_map_free(map2); - return -1; + return isl_bool_error; } -int isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_plain_is_equal(__isl_keep isl_set *set1, + __isl_keep isl_set *set2) { return isl_map_plain_is_equal((struct isl_map *)set1, (struct isl_map *)set2); @@ -9892,34 +9802,34 @@ int isl_set_n_basic_set(__isl_keep isl_set *set) return set ? set->n : 0; } -int isl_map_foreach_basic_map(__isl_keep isl_map *map, - int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user) +isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map, + isl_stat (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user) { int i; if (!map) - return -1; + return isl_stat_error; for (i = 0; i < map->n; ++i) if (fn(isl_basic_map_copy(map->p[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int isl_set_foreach_basic_set(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) +isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) { int i; if (!set) - return -1; + return isl_stat_error; for (i = 0; i < set->n; ++i) if (fn(isl_basic_set_copy(set->p[i]), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset) @@ -10079,15 +9989,16 @@ int isl_set_size(__isl_keep isl_set *set) /* Check if there is any lower bound (if lower == 0) and/or upper * bound (if upper == 0) on the specified dim. */ -static int basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, +static isl_bool basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int lower, int upper) { int i; if (!bmap) - return -1; + return isl_bool_error; - isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), return -1); + isl_assert(bmap->ctx, pos < isl_basic_map_dim(bmap, type), + return isl_bool_error); pos += isl_basic_map_offset(bmap, type); @@ -10095,12 +10006,12 @@ static int basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, if (isl_int_is_zero(bmap->div[i][0])) continue; if (!isl_int_is_zero(bmap->div[i][1 + pos])) - return 1; + return isl_bool_true; } for (i = 0; i < bmap->n_eq; ++i) if (!isl_int_is_zero(bmap->eq[i][pos])) - return 1; + return isl_bool_true; for (i = 0; i < bmap->n_ineq; ++i) { int sgn = isl_int_sgn(bmap->ineq[i][pos]); @@ -10119,13 +10030,13 @@ int isl_basic_map_dim_is_bounded(__isl_keep isl_basic_map *bmap, return basic_map_dim_is_bounded(bmap, type, pos, 0, 0); } -int isl_basic_map_dim_has_lower_bound(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_dim_has_lower_bound(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { return basic_map_dim_is_bounded(bmap, type, pos, 0, 1); } -int isl_basic_map_dim_has_upper_bound(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_dim_has_upper_bound(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos) { return basic_map_dim_is_bounded(bmap, type, pos, 1, 0); @@ -10160,29 +10071,29 @@ int isl_set_dim_is_bounded(__isl_keep isl_set *set, /* Does "map" have a bound (according to "fn") for any of its basic maps? */ -static int has_any_bound(__isl_keep isl_map *map, +static isl_bool has_any_bound(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_keep isl_basic_map *bmap, + isl_bool (*fn)(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos)) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int bounded; + isl_bool bounded; bounded = fn(map->p[i], type, pos); if (bounded < 0 || bounded) return bounded; } - return 0; + return isl_bool_false; } /* Return 1 if the specified dim is involved in any lower bound. */ -int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_any_bound(set, type, pos, @@ -10191,7 +10102,7 @@ int isl_set_dim_has_any_lower_bound(__isl_keep isl_set *set, /* Return 1 if the specified dim is involved in any upper bound. */ -int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_any_bound(set, type, pos, @@ -10200,29 +10111,29 @@ int isl_set_dim_has_any_upper_bound(__isl_keep isl_set *set, /* Does "map" have a bound (according to "fn") for all of its basic maps? */ -static int has_bound(__isl_keep isl_map *map, +static isl_bool has_bound(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos, - int (*fn)(__isl_keep isl_basic_map *bmap, + isl_bool (*fn)(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned pos)) { int i; if (!map) - return -1; + return isl_bool_error; for (i = 0; i < map->n; ++i) { - int bounded; + isl_bool bounded; bounded = fn(map->p[i], type, pos); if (bounded < 0 || !bounded) return bounded; } - return 1; + return isl_bool_true; } /* Return 1 if the specified dim has a lower bound (in each of its basic sets). */ -int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_lower_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_bound(set, type, pos, &isl_basic_map_dim_has_lower_bound); @@ -10230,7 +10141,7 @@ int isl_set_dim_has_lower_bound(__isl_keep isl_set *set, /* Return 1 if the specified dim has an upper bound (in each of its basic sets). */ -int isl_set_dim_has_upper_bound(__isl_keep isl_set *set, +isl_bool isl_set_dim_has_upper_bound(__isl_keep isl_set *set, enum isl_dim_type type, unsigned pos) { return has_bound(set, type, pos, &isl_basic_map_dim_has_upper_bound); @@ -10395,13 +10306,13 @@ int isl_basic_map_output_defining_equality(__isl_keep isl_basic_map *bmap, * an equality that defines the output dimension in terms of * earlier dimensions. */ -int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) { int i; unsigned n_out; if (!bmap) - return -1; + return isl_bool_error; n_out = isl_basic_map_dim(bmap, isl_dim_out); @@ -10410,12 +10321,12 @@ int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) eq = isl_basic_map_output_defining_equality(bmap, i); if (eq < 0) - return -1; + return isl_bool_error; if (eq >= bmap->n_eq) - return 0; + return isl_bool_false; } - return 1; + return isl_bool_true; } /* Check if the given basic map is single-valued. @@ -10425,12 +10336,12 @@ int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap) * * and check if the result is a subset of the identity mapping. */ -int isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap) { isl_space *space; isl_basic_map *test; isl_basic_map *id; - int sv; + isl_bool sv; sv = isl_basic_map_plain_is_single_valued(bmap); if (sv < 0 || sv) @@ -10453,14 +10364,14 @@ int isl_basic_map_is_single_valued(__isl_keep isl_basic_map *bmap) /* Check if the given map is obviously single-valued. */ -int isl_map_plain_is_single_valued(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_single_valued(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; if (map->n == 0) - return 1; + return isl_bool_true; if (map->n >= 2) - return 0; + return isl_bool_false; return isl_basic_map_plain_is_single_valued(map->p[0]); } @@ -10472,12 +10383,12 @@ int isl_map_plain_is_single_valued(__isl_keep isl_map *map) * * and check if the result is a subset of the identity mapping. */ -int isl_map_is_single_valued(__isl_keep isl_map *map) +isl_bool isl_map_is_single_valued(__isl_keep isl_map *map) { isl_space *dim; isl_map *test; isl_map *id; - int sv; + isl_bool sv; sv = isl_map_plain_is_single_valued(map); if (sv < 0 || sv) @@ -10497,9 +10408,9 @@ int isl_map_is_single_valued(__isl_keep isl_map *map) return sv; } -int isl_map_is_injective(__isl_keep isl_map *map) +isl_bool isl_map_is_injective(__isl_keep isl_map *map) { - int in; + isl_bool in; map = isl_map_copy(map); map = isl_map_reverse(map); @@ -10511,9 +10422,9 @@ int isl_map_is_injective(__isl_keep isl_map *map) /* Check if the given map is obviously injective. */ -int isl_map_plain_is_injective(__isl_keep isl_map *map) +isl_bool isl_map_plain_is_injective(__isl_keep isl_map *map) { - int in; + isl_bool in; map = isl_map_copy(map); map = isl_map_reverse(map); @@ -10523,9 +10434,9 @@ int isl_map_plain_is_injective(__isl_keep isl_map *map) return in; } -int isl_map_is_bijective(__isl_keep isl_map *map) +isl_bool isl_map_is_bijective(__isl_keep isl_map *map) { - int sv; + isl_bool sv; sv = isl_map_is_single_valued(map); if (sv < 0 || !sv) @@ -10534,7 +10445,7 @@ int isl_map_is_bijective(__isl_keep isl_map *map) return isl_map_is_injective(map); } -int isl_set_is_singleton(__isl_keep isl_set *set) +isl_bool isl_set_is_singleton(__isl_keep isl_set *set) { return isl_map_is_single_valued((isl_map *)set); } @@ -10612,38 +10523,38 @@ int isl_set_is_box(__isl_keep isl_set *set) return isl_basic_set_is_box(set->p[0]); } -int isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset) +isl_bool isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset) { if (!bset) - return -1; + return isl_bool_error; return isl_space_is_wrapping(bset->dim); } -int isl_set_is_wrapping(__isl_keep isl_set *set) +isl_bool isl_set_is_wrapping(__isl_keep isl_set *set) { if (!set) - return -1; + return isl_bool_error; return isl_space_is_wrapping(set->dim); } /* Is the domain of "map" a wrapped relation? */ -int isl_map_domain_is_wrapping(__isl_keep isl_map *map) +isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_domain_is_wrapping(map->dim); } /* Is the range of "map" a wrapped relation? */ -int isl_map_range_is_wrapping(__isl_keep isl_map *map) +isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_range_is_wrapping(map->dim); } @@ -11309,18 +11220,18 @@ __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices( c1, c2, c3, c4, isl_dim_in); } -int isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_zip(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_zip(bmap->dim); } -int isl_map_can_zip(__isl_keep isl_map *map) +isl_bool isl_map_can_zip(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_zip(map->dim); } @@ -11394,10 +11305,10 @@ error: /* Can we apply isl_basic_map_curry to "bmap"? * That is, does it have a nested relation in its domain? */ -int isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_curry(bmap->dim); } @@ -11405,10 +11316,10 @@ int isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap) /* Can we apply isl_map_curry to "map"? * That is, does it have a nested relation in its domain? */ -int isl_map_can_curry(__isl_keep isl_map *map) +isl_bool isl_map_can_curry(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_curry(map->dim); } @@ -11474,10 +11385,10 @@ error: /* Can we apply isl_basic_map_uncurry to "bmap"? * That is, does it have a nested relation in its domain? */ -int isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap) +isl_bool isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap) { if (!bmap) - return -1; + return isl_bool_error; return isl_space_can_uncurry(bmap->dim); } @@ -11485,10 +11396,10 @@ int isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap) /* Can we apply isl_map_uncurry to "map"? * That is, does it have a nested relation in its domain? */ -int isl_map_can_uncurry(__isl_keep isl_map *map) +isl_bool isl_map_can_uncurry(__isl_keep isl_map *map) { if (!map) - return -1; + return isl_bool_error; return isl_space_can_uncurry(map->dim); } @@ -11801,7 +11712,7 @@ static __isl_give isl_constraint *constraint_order_ge( if (!space) return NULL; - c = isl_inequality_alloc(isl_local_space_from_space(space)); + c = isl_constraint_alloc_inequality(isl_local_space_from_space(space)); if (pos1 >= isl_constraint_dim(c, type1)) isl_die(isl_constraint_get_ctx(c), isl_error_invalid, diff --git a/polly/lib/External/isl/isl_map_private.h b/polly/lib/External/isl/isl_map_private.h index a424ef99ec3b..257bf41cc3f1 100644 --- a/polly/lib/External/isl/isl_map_private.h +++ b/polly/lib/External/isl/isl_map_private.h @@ -111,6 +111,49 @@ struct isl_map { #include +__isl_give isl_basic_set *isl_basic_set_alloc(isl_ctx *ctx, + unsigned nparam, unsigned dim, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_extend(__isl_take isl_basic_set *base, + unsigned nparam, unsigned dim, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_extend_constraints( + __isl_take isl_basic_set *base, unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_set *isl_basic_set_finalize( + __isl_take isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_dup(__isl_keep isl_basic_set *bset); +__isl_give isl_basic_set *isl_basic_set_simplify( + __isl_take isl_basic_set *bset); + +__isl_give isl_basic_map *isl_basic_map_alloc(isl_ctx *ctx, + unsigned nparam, unsigned in, unsigned out, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_finalize( + __isl_take isl_basic_map *bmap); +__isl_give isl_basic_map *isl_basic_map_extend(__isl_take isl_basic_map *base, + unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra, + unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_extend_constraints( + __isl_take isl_basic_map *base, unsigned n_eq, unsigned n_ineq); +__isl_give isl_basic_map *isl_basic_map_simplify( + __isl_take isl_basic_map *bmap); + +__isl_give isl_set *isl_set_alloc(isl_ctx *ctx, + unsigned nparam, unsigned dim, int n, unsigned flags); +__isl_give isl_set *isl_set_finalize(__isl_take isl_set *set); +__isl_give isl_set *isl_set_dup(__isl_keep isl_set *set); + +__isl_give isl_map *isl_map_alloc(isl_ctx *ctx, + unsigned nparam, unsigned in, unsigned out, int n, unsigned flags); +__isl_give isl_map *isl_map_dup(__isl_keep isl_map *map); +__isl_give isl_map *isl_map_finalize(__isl_take isl_map *map); + +__isl_give isl_basic_set *isl_basic_set_from_underlying_set( + __isl_take isl_basic_set *bset, __isl_take isl_basic_set *like); +__isl_give isl_set *isl_set_from_underlying_set( + __isl_take isl_set *set, __isl_take isl_basic_set *like); +__isl_give isl_set *isl_set_to_underlying_set(__isl_take isl_set *set); + __isl_give isl_map *isl_map_realign(__isl_take isl_map *map, __isl_take isl_reordering *r); __isl_give isl_set *isl_set_realign(__isl_take isl_set *set, @@ -151,8 +194,10 @@ struct isl_basic_set *isl_basic_set_add_constraints(struct isl_basic_set *bset1, struct isl_map *isl_map_grow(struct isl_map *map, int n); struct isl_set *isl_set_grow(struct isl_set *set, int n); -int isl_basic_set_contains(struct isl_basic_set *bset, struct isl_vec *vec); -int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec); +isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, + __isl_keep isl_vec *vec); +isl_bool isl_basic_map_contains(__isl_keep isl_basic_map *bmap, + __isl_keep isl_vec *vec); __isl_give isl_basic_set *isl_basic_set_alloc_space(__isl_take isl_space *dim, unsigned extra, unsigned n_eq, unsigned n_ineq); @@ -226,7 +271,7 @@ __isl_give isl_basic_set *isl_basic_set_sort_constraints( __isl_take isl_basic_set *bset); int isl_basic_map_plain_cmp(const __isl_keep isl_basic_map *bmap1, const __isl_keep isl_basic_map *bmap2); -int isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_equal(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2); struct isl_basic_map *isl_basic_map_normalize_constraints( struct isl_basic_map *bmap); @@ -321,9 +366,10 @@ __isl_give isl_basic_set *isl_basic_set_transform_dims( isl_int *isl_set_wrap_facet(__isl_keep isl_set *set, isl_int *facet, isl_int *ridge); -int isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, + __isl_keep isl_point *point); +isl_bool isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point); -int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point); int isl_basic_set_vars_get_sign(__isl_keep isl_basic_set *bset, unsigned first, unsigned n, int *signs); @@ -358,9 +404,9 @@ __isl_give isl_map *isl_map_align_params_map_map_and( __isl_take isl_map *map1, __isl_take isl_map *map2, __isl_give isl_map *(*fn)(__isl_take isl_map *map1, __isl_take isl_map *map2)); -int isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, +isl_bool isl_map_align_params_map_map_and_test(__isl_keep isl_map *map1, __isl_keep isl_map *map2, - int (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)); + isl_bool (*fn)(__isl_keep isl_map *map1, __isl_keep isl_map *map2)); int isl_basic_map_foreach_lexopt(__isl_keep isl_basic_map *bmap, int max, int (*fn)(__isl_take isl_basic_set *dom, __isl_take isl_aff_list *list, @@ -379,7 +425,7 @@ __isl_give isl_set *isl_set_gist_params_basic_set(__isl_take isl_set *set, int isl_map_compatible_range(__isl_keep isl_map *map, __isl_keep isl_set *set); -int isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap); +isl_bool isl_basic_map_plain_is_single_valued(__isl_keep isl_basic_map *bmap); int isl_map_is_set(__isl_keep isl_map *map); diff --git a/polly/lib/External/isl/isl_map_simplify.c b/polly/lib/External/isl/isl_map_simplify.c index fa915ca898be..0f3da78cb5d4 100644 --- a/polly/lib/External/isl/isl_map_simplify.c +++ b/polly/lib/External/isl/isl_map_simplify.c @@ -497,14 +497,16 @@ static void eliminate_var_using_equality(struct isl_basic_map *bmap, /* Assumes divs have been ordered if keep_divs is set. */ -static void eliminate_div(struct isl_basic_map *bmap, isl_int *eq, - unsigned div, int keep_divs) +static __isl_give isl_basic_map *eliminate_div(__isl_take isl_basic_map *bmap, + isl_int *eq, unsigned div, int keep_divs) { unsigned pos = isl_space_dim(bmap->dim, isl_dim_all) + div; eliminate_var_using_equality(bmap, pos, eq, keep_divs, NULL); - isl_basic_map_drop_div(bmap, div); + bmap = isl_basic_map_drop_div(bmap, div); + + return bmap; } /* Check if elimination of div "div" using equality "eq" would not @@ -558,8 +560,9 @@ static struct isl_basic_map *eliminate_divs_eq( continue; modified = 1; *progress = 1; - eliminate_div(bmap, bmap->eq[i], d, 1); - isl_basic_map_drop_equality(bmap, i); + bmap = eliminate_div(bmap, bmap->eq[i], d, 1); + if (isl_basic_map_drop_equality(bmap, i) < 0) + return isl_basic_map_free(bmap); break; } } @@ -773,7 +776,9 @@ static struct isl_basic_map *remove_duplicate_divs( k = elim_for[l] - 1; isl_int_set_si(eq.data[1+total_var+k], -1); isl_int_set_si(eq.data[1+total_var+l], 1); - eliminate_div(bmap, eq.data, l, 1); + bmap = eliminate_div(bmap, eq.data, l, 1); + if (!bmap) + break; isl_int_set_si(eq.data[1+total_var+k], 0); isl_int_set_si(eq.data[1+total_var+l], 0); } @@ -2523,7 +2528,7 @@ __isl_give isl_set *isl_set_gist_params(__isl_take isl_set *set, * one basic map in the context of the equalities of the other * basic map and check if we get a contradiction. */ -int isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2) { struct isl_vec *v = NULL; @@ -2532,17 +2537,17 @@ int isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, int i; if (!bmap1 || !bmap2) - return -1; + return isl_bool_error; isl_assert(bmap1->ctx, isl_space_is_equal(bmap1->dim, bmap2->dim), - return -1); + return isl_bool_error); if (bmap1->n_div || bmap2->n_div) - return 0; + return isl_bool_false; if (!bmap1->n_eq && !bmap2->n_eq) - return 0; + return isl_bool_false; total = isl_space_dim(bmap1->dim, isl_dim_all); if (total == 0) - return 0; + return isl_bool_false; v = isl_vec_alloc(bmap1->ctx, 1 + total); if (!v) goto error; @@ -2577,15 +2582,15 @@ int isl_basic_map_plain_is_disjoint(__isl_keep isl_basic_map *bmap1, } isl_vec_free(v); free(elim); - return 0; + return isl_bool_false; disjoint: isl_vec_free(v); free(elim); - return 1; + return isl_bool_true; error: isl_vec_free(v); free(elim); - return -1; + return isl_bool_error; } int isl_basic_set_plain_is_disjoint(__isl_keep isl_basic_set *bset1, @@ -2608,16 +2613,16 @@ int isl_basic_set_plain_is_disjoint(__isl_keep isl_basic_set *bset1, * Otherwise we check if each basic map in "map1" is obviously disjoint * from each basic map in "map2". */ -int isl_map_plain_is_disjoint(__isl_keep isl_map *map1, +isl_bool isl_map_plain_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { int i, j; - int disjoint; - int intersect; - int match; + isl_bool disjoint; + isl_bool intersect; + isl_bool match; if (!map1 || !map2) - return -1; + return isl_bool_error; disjoint = isl_map_plain_is_empty(map1); if (disjoint < 0 || disjoint) @@ -2630,31 +2635,31 @@ int isl_map_plain_is_disjoint(__isl_keep isl_map *map1, match = isl_space_tuple_is_equal(map1->dim, isl_dim_in, map2->dim, isl_dim_in); if (match < 0 || !match) - return match < 0 ? -1 : 1; + return match < 0 ? isl_bool_error : isl_bool_true; match = isl_space_tuple_is_equal(map1->dim, isl_dim_out, map2->dim, isl_dim_out); if (match < 0 || !match) - return match < 0 ? -1 : 1; + return match < 0 ? isl_bool_error : isl_bool_true; match = isl_space_match(map1->dim, isl_dim_param, map2->dim, isl_dim_param); if (match < 0 || !match) - return match < 0 ? -1 : 0; + return match < 0 ? isl_bool_error : isl_bool_false; intersect = isl_map_plain_is_equal(map1, map2); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; for (i = 0; i < map1->n; ++i) { for (j = 0; j < map2->n; ++j) { - int d = isl_basic_map_plain_is_disjoint(map1->p[i], - map2->p[j]); - if (d != 1) + isl_bool d = isl_basic_map_plain_is_disjoint(map1->p[i], + map2->p[j]); + if (d != isl_bool_true) return d; } } - return 1; + return isl_bool_true; } /* Are "map1" and "map2" disjoint? @@ -2664,10 +2669,10 @@ int isl_map_plain_is_disjoint(__isl_keep isl_map *map1, * If none of these cases apply, we compute the intersection and see if * the result is empty. */ -int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { - int disjoint; - int intersect; + isl_bool disjoint; + isl_bool intersect; isl_map *test; disjoint = isl_map_plain_is_disjoint(map1, map2); @@ -2684,11 +2689,11 @@ int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) intersect = isl_map_plain_is_universe(map1); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; intersect = isl_map_plain_is_universe(map2); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; test = isl_map_intersect(isl_map_copy(map1), isl_map_copy(map2)); disjoint = isl_map_is_empty(test); @@ -2704,11 +2709,11 @@ int isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2) * If none of these cases apply, we compute the intersection and see if * the result is empty. */ -int isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, +isl_bool isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, __isl_keep isl_basic_map *bmap2) { - int disjoint; - int intersect; + isl_bool disjoint; + isl_bool intersect; isl_basic_map *test; disjoint = isl_basic_map_plain_is_disjoint(bmap1, bmap2); @@ -2725,11 +2730,11 @@ int isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, intersect = isl_basic_map_is_universe(bmap1); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; intersect = isl_basic_map_is_universe(bmap2); if (intersect < 0 || intersect) - return intersect < 0 ? -1 : 0; + return intersect < 0 ? isl_bool_error : isl_bool_false; test = isl_basic_map_intersect(isl_basic_map_copy(bmap1), isl_basic_map_copy(bmap2)); @@ -2741,13 +2746,13 @@ int isl_basic_map_is_disjoint(__isl_keep isl_basic_map *bmap1, /* Are "bset1" and "bset2" disjoint? */ -int isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, +isl_bool isl_basic_set_is_disjoint(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2) { return isl_basic_map_is_disjoint(bset1, bset2); } -int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, +isl_bool isl_set_plain_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_plain_is_disjoint((struct isl_map *)set1, @@ -2756,7 +2761,7 @@ int isl_set_plain_is_disjoint(__isl_keep isl_set *set1, /* Are "set1" and "set2" disjoint? */ -int isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) +isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_disjoint(set1, set2); } diff --git a/polly/lib/External/isl/isl_map_subtract.c b/polly/lib/External/isl/isl_map_subtract.c index ec16beb17c1c..cc75a95e06f3 100644 --- a/polly/lib/External/isl/isl_map_subtract.c +++ b/polly/lib/External/isl/isl_map_subtract.c @@ -287,14 +287,14 @@ struct isl_diff_collector { * has been removed when we end up in a leaf, we simply pass along * the original basic map. */ -static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, +static isl_stat basic_map_collect_diff(__isl_take isl_basic_map *bmap, __isl_take isl_map *map, struct isl_diff_collector *dc) { int i; int modified; int level; int init; - int empty; + isl_bool empty; isl_ctx *ctx; struct isl_tab *tab = NULL; struct isl_tab_undo **snap = NULL; @@ -307,7 +307,7 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, if (empty) { isl_basic_map_free(bmap); isl_map_free(map); - return empty < 0 ? -1 : 0; + return empty < 0 ? isl_stat_error : isl_stat_ok; } bmap = isl_basic_map_cow(bmap); @@ -437,7 +437,7 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, isl_basic_map_free(bmap); isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_tab_free(tab); free(snap); @@ -451,7 +451,7 @@ error: free(div_map); isl_basic_map_free(bmap); isl_map_free(map); - return -1; + return isl_stat_error; } /* A diff collector that actually collects all parts of the @@ -637,7 +637,7 @@ __isl_give isl_map *isl_map_subtract_range(__isl_take isl_map *map, */ struct isl_is_empty_diff_collector { struct isl_diff_collector dc; - int empty; + isl_bool empty; }; /* isl_is_empty_diff_collector callback. @@ -657,36 +657,38 @@ static int basic_map_is_empty_add(struct isl_diff_collector *dc, /* Check if bmap \ map is empty by computing this set difference * and breaking off as soon as the difference is known to be non-empty. */ -static int basic_map_diff_is_empty(__isl_keep isl_basic_map *bmap, +static isl_bool basic_map_diff_is_empty(__isl_keep isl_basic_map *bmap, __isl_keep isl_map *map) { - int r; + isl_bool empty; + isl_stat r; struct isl_is_empty_diff_collector edc; - r = isl_basic_map_plain_is_empty(bmap); - if (r) - return r; + empty = isl_basic_map_plain_is_empty(bmap); + if (empty) + return empty; edc.dc.add = &basic_map_is_empty_add; - edc.empty = 1; + edc.empty = isl_bool_true; r = basic_map_collect_diff(isl_basic_map_copy(bmap), isl_map_copy(map), &edc.dc); if (!edc.empty) - return 0; + return isl_bool_false; - return r < 0 ? -1 : 1; + return r < 0 ? isl_bool_error : isl_bool_true; } /* Check if map1 \ map2 is empty by checking if the set difference is empty * for each of the basic maps in map1. */ -static int map_diff_is_empty(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_diff_is_empty(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { int i; - int is_empty = 1; + isl_bool is_empty = isl_bool_true; if (!map1 || !map2) - return -1; + return isl_bool_error; for (i = 0; i < map1->n; ++i) { is_empty = basic_map_diff_is_empty(map1->p[i], map2); @@ -775,26 +777,27 @@ error: return NULL; } -/* Return 1 if the singleton map "map1" is a subset of "map2", +/* Return isl_bool_true if the singleton map "map1" is a subset of "map2", * i.e., if the single element of "map1" is also an element of "map2". * Assumes "map2" has known divs. */ -static int map_is_singleton_subset(__isl_keep isl_map *map1, +static isl_bool map_is_singleton_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { int i; - int is_subset = 0; + isl_bool is_subset = isl_bool_false; struct isl_point *point; if (!map1 || !map2) - return -1; + return isl_bool_error; if (map1->n != 1) - isl_die(isl_map_get_ctx(map1), isl_error_internal, - "expecting single-disjunct input", return -1); + isl_die(isl_map_get_ctx(map1), isl_error_invalid, + "expecting single-disjunct input", + return isl_bool_error); point = singleton_extract_point(map1->p[0]); if (!point) - return -1; + return isl_bool_error; for (i = 0; i < map2->n; ++i) { is_subset = isl_basic_map_contains_point(map2->p[i], point); @@ -806,39 +809,40 @@ static int map_is_singleton_subset(__isl_keep isl_map *map1, return is_subset; } -static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +static isl_bool map_is_subset(__isl_keep isl_map *map1, + __isl_keep isl_map *map2) { - int is_subset = 0; - int empty; + isl_bool is_subset = isl_bool_false; + isl_bool empty; int rat1, rat2; if (!map1 || !map2) - return -1; + return isl_bool_error; if (!isl_map_has_equal_space(map1, map2)) - return 0; + return isl_bool_false; empty = isl_map_is_empty(map1); if (empty < 0) - return -1; + return isl_bool_error; if (empty) - return 1; + return isl_bool_true; empty = isl_map_is_empty(map2); if (empty < 0) - return -1; + return isl_bool_error; if (empty) - return 0; + return isl_bool_false; rat1 = isl_map_has_rational(map1); rat2 = isl_map_has_rational(map2); if (rat1 < 0 || rat2 < 0) - return -1; + return isl_bool_error; if (rat1 && !rat2) - return 0; + return isl_bool_false; if (isl_map_plain_is_universe(map2)) - return 1; + return isl_bool_true; map2 = isl_map_compute_divs(isl_map_copy(map2)); if (isl_map_plain_is_singleton(map1)) { @@ -852,13 +856,13 @@ static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) return is_subset; } -int isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) +isl_bool isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { return isl_map_align_params_map_map_and_test(map1, map2, &map_is_subset); } -int isl_set_is_subset(struct isl_set *set1, struct isl_set *set2) +isl_bool isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2) { return isl_map_is_subset( (struct isl_map *)set1, (struct isl_map *)set2); diff --git a/polly/lib/External/isl/isl_multi_templ.c b/polly/lib/External/isl/isl_multi_templ.c index c60aff0b309e..b7efbc1bece3 100644 --- a/polly/lib/External/isl/isl_multi_templ.c +++ b/polly/lib/External/isl/isl_multi_templ.c @@ -134,25 +134,25 @@ __isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi) * in the given range or if any of these dimensions appear * with non-zero coefficients in any of the integer divisions involved. */ -int FN(MULTI(BASE),involves_dims)(__isl_keep MULTI(BASE) *multi, +isl_bool FN(MULTI(BASE),involves_dims)(__isl_keep MULTI(BASE) *multi, enum isl_dim_type type, unsigned first, unsigned n) { int i; if (!multi) - return -1; + return isl_bool_error; if (multi->n == 0 || n == 0) - return 0; + return isl_bool_false; for (i = 0; i < multi->n; ++i) { - int involves; + isl_bool involves; involves = FN(EL,involves_dims)(multi->p[i], type, first, n); if (involves < 0 || involves) return involves; } - return 0; + return isl_bool_false; } __isl_give MULTI(BASE) *FN(MULTI(BASE),insert_dims)( @@ -256,10 +256,12 @@ const char *FN(MULTI(BASE),get_tuple_name)(__isl_keep MULTI(BASE) *multi, /* Does the specified tuple have an id? */ -int FN(MULTI(BASE),has_tuple_id)(__isl_keep MULTI(BASE) *multi, +isl_bool FN(MULTI(BASE),has_tuple_id)(__isl_keep MULTI(BASE) *multi, enum isl_dim_type type) { - return multi ? isl_space_has_tuple_id(multi->space, type) : -1; + if (!multi) + return isl_bool_error; + return isl_space_has_tuple_id(multi->space, type); } /* Return the id of the specified tuple. @@ -809,10 +811,10 @@ __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)( /* Is the range of "multi" a wrapped relation? */ -int FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi) +isl_bool FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi) { if (!multi) - return -1; + return isl_bool_error; return isl_space_range_is_wrapping(multi->space); } @@ -1374,16 +1376,16 @@ __isl_give MULTI(BASE) *FN(MULTI(BASE),from_range)( /* Are "multi1" and "multi2" obviously equal? */ -int FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1, +isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1, __isl_keep MULTI(BASE) *multi2) { int i; - int equal; + isl_bool equal; if (!multi1 || !multi2) - return -1; + return isl_bool_error; if (multi1->n != multi2->n) - return 0; + return isl_bool_false; equal = isl_space_is_equal(multi1->space, multi2->space); if (equal < 0 || !equal) return equal; @@ -1394,7 +1396,7 @@ int FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1, return equal; } - return 1; + return isl_bool_true; } #ifndef NO_DOMAIN diff --git a/polly/lib/External/isl/isl_output.c b/polly/lib/External/isl/isl_output.c index aa96b9d824be..8ebe10ef565c 100644 --- a/polly/lib/External/isl/isl_output.c +++ b/polly/lib/External/isl/isl_output.c @@ -1078,7 +1078,7 @@ struct isl_union_print_data { int first; }; -static int print_map_body(__isl_take isl_map *map, void *user) +static isl_stat print_map_body(__isl_take isl_map *map, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1090,7 +1090,7 @@ static int print_map_body(__isl_take isl_map *map, void *user) data->p = isl_map_print_isl_body(map, data->p); isl_map_free(map); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *isl_union_map_print_isl( @@ -1115,7 +1115,7 @@ static __isl_give isl_printer *isl_union_map_print_isl( return p; } -static int print_latex_map_body(__isl_take isl_map *map, void *user) +static isl_stat print_latex_map_body(__isl_take isl_map *map, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1127,7 +1127,7 @@ static int print_latex_map_body(__isl_take isl_map *map, void *user) data->p = isl_map_print_latex(map, data->p); isl_map_free(map); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *isl_union_map_print_latex( @@ -1750,7 +1750,7 @@ error: return NULL; } -static int print_pwqp_body(__isl_take isl_pw_qpolynomial *pwqp, void *user) +static isl_stat print_pwqp_body(__isl_take isl_pw_qpolynomial *pwqp, void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1762,7 +1762,7 @@ static int print_pwqp_body(__isl_take isl_pw_qpolynomial *pwqp, void *user) data->p = isl_pwqp_print_isl_body(data->p, pwqp); isl_pw_qpolynomial_free(pwqp); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_qpolynomial_isl( @@ -1893,7 +1893,8 @@ void isl_pw_qpolynomial_fold_print(__isl_keep isl_pw_qpolynomial_fold *pwf, isl_printer_free(p); } -static int print_pwf_body(__isl_take isl_pw_qpolynomial_fold *pwf, void *user) +static isl_stat print_pwf_body(__isl_take isl_pw_qpolynomial_fold *pwf, + void *user) { struct isl_union_print_data *data; data = (struct isl_union_print_data *)user; @@ -1905,7 +1906,7 @@ static int print_pwf_body(__isl_take isl_pw_qpolynomial_fold *pwf, void *user) data->p = isl_pwf_print_isl_body(data->p, pwf); isl_pw_qpolynomial_fold_free(pwf); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_qpolynomial_fold_isl( @@ -2302,7 +2303,7 @@ error: * If data->first = 1, then this is the first in the sequence. * Update data->first to tell the next element that it is not the first. */ -static int print_pw_aff_body_wrap(__isl_take isl_pw_aff *pa, +static isl_stat print_pw_aff_body_wrap(__isl_take isl_pw_aff *pa, void *user) { struct isl_union_print_data *data; @@ -2315,7 +2316,7 @@ static int print_pw_aff_body_wrap(__isl_take isl_pw_aff *pa, data->p = print_pw_aff_body(data->p, pa); isl_pw_aff_free(pa); - return data->p ? 0 : -1; + return data->p ? isl_stat_ok : isl_stat_error; } /* Print the body of an isl_union_pw_aff, i.e., a semicolon delimited @@ -2546,7 +2547,7 @@ error: return NULL; } -static int print_pw_multi_aff_body_wrap(__isl_take isl_pw_multi_aff *pma, +static isl_stat print_pw_multi_aff_body_wrap(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_print_data *data; @@ -2559,7 +2560,7 @@ static int print_pw_multi_aff_body_wrap(__isl_take isl_pw_multi_aff *pma, data->p = print_pw_multi_aff_body(data->p, pma); isl_pw_multi_aff_free(pma); - return 0; + return isl_stat_ok; } static __isl_give isl_printer *print_union_pw_multi_aff_isl( diff --git a/polly/lib/External/isl/isl_point.c b/polly/lib/External/isl/isl_point.c index f5320f2ede88..a78662fea9bc 100644 --- a/polly/lib/External/isl/isl_point.c +++ b/polly/lib/External/isl/isl_point.c @@ -120,10 +120,10 @@ __isl_give isl_point *isl_point_void(__isl_take isl_space *dim) return isl_point_alloc(dim, isl_vec_alloc(dim->ctx, 0)); } -int isl_point_is_void(__isl_keep isl_point *pnt) +isl_bool isl_point_is_void(__isl_keep isl_point *pnt) { if (!pnt) - return -1; + return isl_bool_error; return pnt->vec->size == 0; } @@ -298,12 +298,13 @@ error: struct isl_foreach_point { struct isl_scan_callback callback; - int (*fn)(__isl_take isl_point *pnt, void *user); + isl_stat (*fn)(__isl_take isl_point *pnt, void *user); void *user; isl_space *dim; }; -static int foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sample) +static isl_stat foreach_point(struct isl_scan_callback *cb, + __isl_take isl_vec *sample) { struct isl_foreach_point *fp = (struct isl_foreach_point *)cb; isl_point *pnt; @@ -313,18 +314,18 @@ static int foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sampl return fp->fn(pnt, fp->user); } -int isl_set_foreach_point(__isl_keep isl_set *set, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user) +isl_stat isl_set_foreach_point(__isl_keep isl_set *set, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) { struct isl_foreach_point fp = { { &foreach_point }, fn, user }; int i; if (!set) - return -1; + return isl_stat_error; fp.dim = isl_set_get_space(set); if (!fp.dim) - return -1; + return isl_stat_error; set = isl_set_copy(set); set = isl_set_cow(set); @@ -341,11 +342,11 @@ int isl_set_foreach_point(__isl_keep isl_set *set, isl_set_free(set); isl_space_free(fp.dim); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_space_free(fp.dim); - return -1; + return isl_stat_error; } /* Return 1 if "bmap" contains the point "point". @@ -353,24 +354,25 @@ error: * The point is first extended with the divs and then passed * to basic_map_contains. */ -int isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, +isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, __isl_keep isl_point *point) { int i; struct isl_vec *vec; unsigned dim; - int contains; + isl_bool contains; if (!bmap || !point) - return -1; - isl_assert(bmap->ctx, isl_space_is_equal(bmap->dim, point->dim), return -1); + return isl_bool_error; + isl_assert(bmap->ctx, isl_space_is_equal(bmap->dim, point->dim), + return isl_bool_error); if (bmap->n_div == 0) return isl_basic_map_contains(bmap, point->vec); dim = isl_basic_map_total_dim(bmap) - bmap->n_div; vec = isl_vec_alloc(bmap->ctx, 1 + dim + bmap->n_div); if (!vec) - return -1; + return isl_bool_error; isl_seq_cpy(vec->el, point->vec->el, point->vec->size); for (i = 0; i < bmap->n_div; ++i) { @@ -414,7 +416,8 @@ error: return -1; } -int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point) +isl_bool isl_set_contains_point(__isl_keep isl_set *set, + __isl_keep isl_point *point) { return isl_map_contains_point((isl_map *)set, point); } diff --git a/polly/lib/External/isl/isl_polynomial.c b/polly/lib/External/isl/isl_polynomial.c index b3bc8c207523..32f9d1c9982c 100644 --- a/polly/lib/External/isl/isl_polynomial.c +++ b/polly/lib/External/isl/isl_polynomial.c @@ -67,24 +67,24 @@ __isl_keep struct isl_upoly_rec *isl_upoly_as_rec(__isl_keep struct isl_upoly *u return (struct isl_upoly_rec *)up; } -int isl_upoly_is_equal(__isl_keep struct isl_upoly *up1, +isl_bool isl_upoly_is_equal(__isl_keep struct isl_upoly *up1, __isl_keep struct isl_upoly *up2) { int i; struct isl_upoly_rec *rec1, *rec2; if (!up1 || !up2) - return -1; + return isl_bool_error; if (up1 == up2) - return 1; + return isl_bool_true; if (up1->var != up2->var) - return 0; + return isl_bool_false; if (isl_upoly_is_cst(up1)) { struct isl_upoly_cst *cst1, *cst2; cst1 = isl_upoly_as_cst(up1); cst2 = isl_upoly_as_cst(up2); if (!cst1 || !cst2) - return -1; + return isl_bool_error; return isl_int_eq(cst1->n, cst2->n) && isl_int_eq(cst1->d, cst2->d); } @@ -92,18 +92,18 @@ int isl_upoly_is_equal(__isl_keep struct isl_upoly *up1, rec1 = isl_upoly_as_rec(up1); rec2 = isl_upoly_as_rec(up2); if (!rec1 || !rec2) - return -1; + return isl_bool_error; if (rec1->n != rec2->n) - return 0; + return isl_bool_false; for (i = 0; i < rec1->n; ++i) { - int eq = isl_upoly_is_equal(rec1->p[i], rec2->p[i]); + isl_bool eq = isl_upoly_is_equal(rec1->p[i], rec2->p[i]); if (eq < 0 || !eq) return eq; } - return 1; + return isl_bool_true; } int isl_upoly_is_zero(__isl_keep struct isl_upoly *up) @@ -412,29 +412,29 @@ unsigned isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp, return isl_space_dim(qp->dim, type); } -int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_zero(qp->upoly) : -1; + return qp ? isl_upoly_is_zero(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_one(qp->upoly) : -1; + return qp ? isl_upoly_is_one(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_nan(qp->upoly) : -1; + return qp ? isl_upoly_is_nan(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_infty(qp->upoly) : -1; + return qp ? isl_upoly_is_infty(qp->upoly) : isl_bool_error; } -int isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp) +isl_bool isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp) { - return qp ? isl_upoly_is_neginfty(qp->upoly) : -1; + return qp ? isl_upoly_is_neginfty(qp->upoly) : isl_bool_error; } int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp) @@ -1896,16 +1896,16 @@ error: * * NaN is not equal to anything, not even to another NaN. */ -int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, +isl_bool isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2) { - int equal; + isl_bool equal; if (!qp1 || !qp2) - return -1; + return isl_bool_error; if (isl_qpolynomial_is_nan(qp1) || isl_qpolynomial_is_nan(qp2)) - return 0; + return isl_bool_false; equal = isl_space_is_equal(qp1->dim, qp2->dim); if (equal < 0 || !equal) @@ -3740,7 +3740,7 @@ __isl_give isl_aff *isl_term_get_div(__isl_keep isl_term *term, unsigned pos) } __isl_give isl_term *isl_upoly_foreach_term(__isl_keep struct isl_upoly *up, - int (*fn)(__isl_take isl_term *term, void *user), + isl_stat (*fn)(__isl_take isl_term *term, void *user), __isl_take isl_term *term, void *user) { int i; @@ -3792,23 +3792,23 @@ error: return NULL; } -int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, - int (*fn)(__isl_take isl_term *term, void *user), void *user) +isl_stat isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp, + isl_stat (*fn)(__isl_take isl_term *term, void *user), void *user) { isl_term *term; if (!qp) - return -1; + return isl_stat_error; term = isl_term_alloc(isl_space_copy(qp->dim), isl_mat_copy(qp->div)); if (!term) - return -1; + return isl_stat_error; term = isl_upoly_foreach_term(qp->upoly, fn, term, user); isl_term_free(term); - return term ? 0 : -1; + return term ? isl_stat_ok : isl_stat_error; } __isl_give isl_qpolynomial *isl_qpolynomial_from_term(__isl_take isl_term *term) @@ -3957,7 +3957,7 @@ struct isl_opt_data { int max; }; -static int opt_fn(__isl_take isl_point *pnt, void *user) +static isl_stat opt_fn(__isl_take isl_point *pnt, void *user) { struct isl_opt_data *data = (struct isl_opt_data *)user; isl_val *val; @@ -3972,7 +3972,7 @@ static int opt_fn(__isl_take isl_point *pnt, void *user) data->opt = isl_val_min(data->opt, val); } - return 0; + return isl_stat_ok; } __isl_give isl_val *isl_qpolynomial_opt_on_domain( @@ -4217,14 +4217,14 @@ error: return NULL; } -static int split_periods(__isl_take isl_set *set, +static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user); /* Create a slice of the domain "set" such that integer division "div" * has the fixed value "v" and add the results to data->res, * replacing the integer division by "v" in "qp". */ -static int set_div(__isl_take isl_set *set, +static isl_stat set_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int v, struct isl_split_periods_data *data) { @@ -4263,7 +4263,7 @@ error: * has a fixed value (ranging from "min" to "max") on each slice * and add the results to data->res. */ -static int split_div(__isl_take isl_set *set, +static isl_stat split_div(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, int div, isl_int min, isl_int max, struct isl_split_periods_data *data) { @@ -4276,11 +4276,11 @@ static int split_div(__isl_take isl_set *set, } isl_set_free(set); isl_qpolynomial_free(qp); - return 0; + return isl_stat_ok; error: isl_set_free(set); isl_qpolynomial_free(qp); - return -1; + return isl_stat_error; } /* If "qp" refers to any integer division @@ -4289,7 +4289,7 @@ error: * Add the results (or the original if no splitting occurs) * to data->res. */ -static int split_periods(__isl_take isl_set *set, +static isl_stat split_periods(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp, void *user) { int i; @@ -4297,7 +4297,7 @@ static int split_periods(__isl_take isl_set *set, struct isl_split_periods_data *data; isl_int min, max; int total; - int r = 0; + isl_stat r = isl_stat_ok; data = (struct isl_split_periods_data *)user; @@ -4307,7 +4307,7 @@ static int split_periods(__isl_take isl_set *set, if (qp->div->n_row == 0) { pwqp = isl_pw_qpolynomial_alloc(set, qp); data->res = isl_pw_qpolynomial_add_disjoint(data->res, pwqp); - return 0; + return isl_stat_ok; } isl_int_init(min); @@ -4360,7 +4360,7 @@ error2: error: isl_set_free(set); isl_qpolynomial_free(qp); - return -1; + return isl_stat_error; } /* If any quasi-polynomial in pwqp refers to any integer division @@ -4769,14 +4769,14 @@ error: return NULL; } -static int poly_entry(void **entry, void *user) +static isl_stat poly_entry(void **entry, void *user) { int *sign = user; isl_pw_qpolynomial **pwqp = (isl_pw_qpolynomial **)entry; *pwqp = isl_pw_qpolynomial_to_polynomial(*pwqp, *sign); - return *pwqp ? 0 : -1; + return *pwqp ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_to_polynomial( diff --git a/polly/lib/External/isl/isl_polynomial_private.h b/polly/lib/External/isl/isl_polynomial_private.h index a668469e1243..7b7ef190ef09 100644 --- a/polly/lib/External/isl/isl_polynomial_private.h +++ b/polly/lib/External/isl/isl_polynomial_private.h @@ -129,7 +129,7 @@ __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain( __isl_take isl_space *space, const isl_int n, const isl_int d); __isl_give isl_qpolynomial *isl_qpolynomial_var_pow_on_domain(__isl_take isl_space *dim, int pos, int power); -int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp); +isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp); int isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial *qp); int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp, isl_int *n, isl_int *d); diff --git a/polly/lib/External/isl/isl_pw_templ.c b/polly/lib/External/isl/isl_pw_templ.c index f9e2a5fdcdf2..f7106cf6bcd2 100644 --- a/polly/lib/External/isl/isl_pw_templ.c +++ b/polly/lib/External/isl/isl_pw_templ.c @@ -195,9 +195,10 @@ const char *FN(PW,get_dim_name)(__isl_keep PW *pw, enum isl_dim_type type, return pw ? isl_space_get_dim_name(pw->dim, type, pos) : NULL; } -int FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos) +isl_bool FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, + unsigned pos) { - return pw ? isl_space_has_dim_id(pw->dim, type, pos) : -1; + return pw ? isl_space_has_dim_id(pw->dim, type, pos) : isl_bool_error; } __isl_give isl_id *FN(PW,get_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, @@ -206,9 +207,9 @@ __isl_give isl_id *FN(PW,get_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, return pw ? isl_space_get_dim_id(pw->dim, type, pos) : NULL; } -int FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) +isl_bool FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) { - return pw ? isl_space_has_tuple_name(pw->dim, type) : -1; + return pw ? isl_space_has_tuple_name(pw->dim, type) : isl_bool_error; } const char *FN(PW,get_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) @@ -216,9 +217,9 @@ const char *FN(PW,get_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type) return pw ? isl_space_get_tuple_name(pw->dim, type) : NULL; } -int FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) +isl_bool FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) { - return pw ? isl_space_has_tuple_id(pw->dim, type) : -1; + return pw ? isl_space_has_tuple_id(pw->dim, type) : isl_bool_error; } __isl_give isl_id *FN(PW,get_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type) @@ -226,10 +227,10 @@ __isl_give isl_id *FN(PW,get_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type return pw ? isl_space_get_tuple_id(pw->dim, type) : NULL; } -int FN(PW,IS_ZERO)(__isl_keep PW *pw) +isl_bool FN(PW,IS_ZERO)(__isl_keep PW *pw) { if (!pw) - return -1; + return isl_bool_error; return pw->n == 0; } @@ -1086,21 +1087,21 @@ isl_ctx *FN(PW,get_ctx)(__isl_keep PW *pw) } #ifndef NO_INVOLVES_DIMS -int FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, +isl_bool FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, unsigned first, unsigned n) { int i; enum isl_dim_type set_type; if (!pw) - return -1; + return isl_bool_error; if (pw->n == 0 || n == 0) - return 0; + return isl_bool_false; set_type = type == isl_dim_in ? isl_dim_set : type; for (i = 0; i < pw->n; ++i) { - int involves = FN(EL,involves_dims)(pw->p[i].FIELD, + isl_bool involves = FN(EL,involves_dims)(pw->p[i].FIELD, type, first, n); if (involves < 0 || involves) return involves; @@ -1109,7 +1110,7 @@ int FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type, if (involves < 0 || involves) return involves; } - return 0; + return isl_bool_false; } #endif @@ -1603,21 +1604,21 @@ int FN(PW,n_piece)(__isl_keep PW *pw) return pw ? pw->n : 0; } -int FN(PW,foreach_piece)(__isl_keep PW *pw, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), +isl_stat FN(PW,foreach_piece)(__isl_keep PW *pw, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user) { int i; if (!pw) - return -1; + return isl_stat_error; for (i = 0; i < pw->n; ++i) if (fn(isl_set_copy(pw->p[i].set), FN(EL,copy)(pw->p[i].FIELD), user) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } #ifndef NO_LIFT @@ -1635,9 +1636,10 @@ static int any_divs(__isl_keep isl_set *set) return 0; } -static int foreach_lifted_subset(__isl_take isl_set *set, __isl_take EL *el, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, - void *user), void *user) +static isl_stat foreach_lifted_subset(__isl_take isl_set *set, + __isl_take EL *el, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, + void *user), void *user) { int i; @@ -1661,21 +1663,21 @@ static int foreach_lifted_subset(__isl_take isl_set *set, __isl_take EL *el, isl_set_free(set); FN(EL,free)(el); - return 0; + return isl_stat_ok; error: isl_set_free(set); FN(EL,free)(el); - return -1; + return isl_stat_error; } -int FN(PW,foreach_lifted_piece)(__isl_keep PW *pw, - int (*fn)(__isl_take isl_set *set, __isl_take EL *el, +isl_stat FN(PW,foreach_lifted_piece)(__isl_keep PW *pw, + isl_stat (*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user) { int i; if (!pw) - return -1; + return isl_stat_error; for (i = 0; i < pw->n; ++i) { isl_set *set; @@ -1685,14 +1687,14 @@ int FN(PW,foreach_lifted_piece)(__isl_keep PW *pw, el = FN(EL,copy)(pw->p[i].FIELD); if (!any_divs(set)) { if (fn(set, el, user) < 0) - return -1; + return isl_stat_error; continue; } if (foreach_lifted_subset(set, el, fn, user) < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } #endif @@ -1934,18 +1936,18 @@ __isl_give PW *FN(PW,normalize)(__isl_take PW *pw) * That is, do they have obviously identical cells and obviously identical * elements on each cell? */ -int FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) +isl_bool FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) { int i; - int equal; + isl_bool equal; if (!pw1 || !pw2) - return -1; + return isl_bool_error; if (pw1 == pw2) - return 1; + return isl_bool_true; if (!isl_space_is_equal(pw1->dim, pw2->dim)) - return 0; + return isl_bool_false; pw1 = FN(PW,copy)(pw1); pw2 = FN(PW,copy)(pw2); @@ -1972,7 +1974,7 @@ int FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2) error: FN(PW,free)(pw1); FN(PW,free)(pw2); - return -1; + return isl_bool_error; } #ifndef NO_PULLBACK diff --git a/polly/lib/External/isl/isl_range.c b/polly/lib/External/isl/isl_range.c index 517db032b022..1bf81ed78ae0 100644 --- a/polly/lib/External/isl/isl_range.c +++ b/polly/lib/External/isl/isl_range.c @@ -17,7 +17,7 @@ struct range_data { isl_pw_qpolynomial_fold *pwf_tight; }; -static int propagate_on_domain(__isl_take isl_basic_set *bset, +static isl_stat propagate_on_domain(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data); /* Check whether the polynomial "poly" has sign "sign" over "bset", @@ -177,7 +177,7 @@ struct isl_fixed_sign_data { * and variables in data->signs. The integer divisions, if * any, are assumed to be non-negative. */ -static int collect_fixed_sign_terms(__isl_take isl_term *term, void *user) +static isl_stat collect_fixed_sign_terms(__isl_take isl_term *term, void *user) { struct isl_fixed_sign_data *data = (struct isl_fixed_sign_data *)user; isl_int n; @@ -187,7 +187,7 @@ static int collect_fixed_sign_terms(__isl_take isl_term *term, void *user) unsigned nvar; if (!term) - return -1; + return isl_stat_error; nparam = isl_term_dim(term, isl_dim_param); nvar = isl_term_dim(term, isl_dim_set); @@ -219,7 +219,7 @@ static int collect_fixed_sign_terms(__isl_take isl_term *term, void *user) isl_int_clear(n); - return 0; + return isl_stat_ok; } /* Construct and return a polynomial that consists of the terms @@ -247,7 +247,7 @@ error: /* Helper function to add a guarded polynomial to either pwf_tight or pwf, * depending on whether the result has been determined to be tight. */ -static int add_guarded_poly(__isl_take isl_basic_set *bset, +static isl_stat add_guarded_poly(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data) { enum isl_fold type = data->sign < 0 ? isl_fold_min : isl_fold_max; @@ -267,7 +267,7 @@ static int add_guarded_poly(__isl_take isl_basic_set *bset, else data->pwf = isl_pw_qpolynomial_fold_fold(data->pwf, pwf); - return 0; + return isl_stat_ok; } /* Given a lower and upper bound on the final variable and constraints @@ -285,14 +285,14 @@ static int add_guarded_poly(__isl_take isl_basic_set *bset, * If all variables have been eliminated, then record the result. * Ohterwise, recurse on the next variable. */ -static int propagate_on_bound_pair(__isl_take isl_constraint *lower, +static isl_stat propagate_on_bound_pair(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user) { struct range_data *data = (struct range_data *)user; int save_tight = data->tight; isl_qpolynomial *poly; - int r; + isl_stat r; unsigned nvar; nvar = isl_basic_set_dim(bset, isl_dim_set); @@ -354,7 +354,7 @@ static int propagate_on_bound_pair(__isl_take isl_constraint *lower, /* Recursively perform range propagation on the polynomial "poly" * defined over the basic set "bset" and collect the results in "data". */ -static int propagate_on_domain(__isl_take isl_basic_set *bset, +static isl_stat propagate_on_domain(__isl_take isl_basic_set *bset, __isl_take isl_qpolynomial *poly, struct range_data *data) { isl_ctx *ctx; @@ -392,22 +392,23 @@ static int propagate_on_domain(__isl_take isl_basic_set *bset, data->monotonicity = save_monotonicity; data->poly = save_poly; - return 0; + return isl_stat_ok; error: isl_basic_set_free(bset); isl_qpolynomial_free(poly); data->monotonicity = save_monotonicity; data->poly = save_poly; - return -1; + return isl_stat_error; } -static int basic_guarded_poly_bound(__isl_take isl_basic_set *bset, void *user) +static isl_stat basic_guarded_poly_bound(__isl_take isl_basic_set *bset, + void *user) { struct range_data *data = (struct range_data *)user; isl_ctx *ctx; unsigned nparam = isl_basic_set_dim(bset, isl_dim_param); unsigned dim = isl_basic_set_dim(bset, isl_dim_set); - int r; + isl_stat r; data->signs = NULL; @@ -430,7 +431,7 @@ static int basic_guarded_poly_bound(__isl_take isl_basic_set *bset, void *user) error: free(data->signs); isl_basic_set_free(bset); - return -1; + return isl_stat_error; } static int qpolynomial_bound_on_domain_range(__isl_take isl_basic_set *bset, diff --git a/polly/lib/External/isl/isl_scan.c b/polly/lib/External/isl/isl_scan.c index eb8423c6e353..e8cd0c0e6ca0 100644 --- a/polly/lib/External/isl/isl_scan.c +++ b/polly/lib/External/isl/isl_scan.c @@ -22,7 +22,7 @@ struct isl_counter { isl_int max; }; -static int increment_counter(struct isl_scan_callback *cb, +static isl_stat increment_counter(struct isl_scan_callback *cb, __isl_take isl_vec *sample) { struct isl_counter *cnt = (struct isl_counter *)cb; @@ -32,8 +32,8 @@ static int increment_counter(struct isl_scan_callback *cb, isl_vec_free(sample); if (isl_int_is_zero(cnt->max) || isl_int_lt(cnt->count, cnt->max)) - return 0; - return -1; + return isl_stat_ok; + return isl_stat_error; } static int increment_range(struct isl_scan_callback *cb, isl_int min, isl_int max) diff --git a/polly/lib/External/isl/isl_scan.h b/polly/lib/External/isl/isl_scan.h index d186df4e53fb..5d31d1b981bb 100644 --- a/polly/lib/External/isl/isl_scan.h +++ b/polly/lib/External/isl/isl_scan.h @@ -14,7 +14,8 @@ #include struct isl_scan_callback { - int (*add)(struct isl_scan_callback *cb, __isl_take isl_vec *sample); + isl_stat (*add)(struct isl_scan_callback *cb, + __isl_take isl_vec *sample); }; int isl_basic_set_scan(struct isl_basic_set *bset, diff --git a/polly/lib/External/isl/isl_schedule.c b/polly/lib/External/isl/isl_schedule.c index df149c25e5b4..62b458369008 100644 --- a/polly/lib/External/isl/isl_schedule.c +++ b/polly/lib/External/isl/isl_schedule.c @@ -182,13 +182,13 @@ __isl_keep isl_schedule_tree *isl_schedule_peek_leaf( /* Are "schedule1" and "schedule2" obviously equal to each other? */ -int isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, +isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1, __isl_keep isl_schedule *schedule2) { if (!schedule1 || !schedule2) - return -1; + return isl_bool_error; if (schedule1 == schedule2) - return 1; + return isl_bool_true; return isl_schedule_tree_plain_is_equal(schedule1->root, schedule2->root); } @@ -248,7 +248,7 @@ __isl_give isl_schedule_node *isl_schedule_get_root( /* Set max_out to the maximal number of output dimensions over * all maps. */ -static int update_max_out(__isl_take isl_map *map, void *user) +static isl_stat update_max_out(__isl_take isl_map *map, void *user) { int *max_out = user; int n_out = isl_map_dim(map, isl_dim_out); @@ -257,7 +257,7 @@ static int update_max_out(__isl_take isl_map *map, void *user) *max_out = n_out; isl_map_free(map); - return 0; + return isl_stat_ok; } /* Internal data structure for map_pad_range. @@ -273,7 +273,7 @@ struct isl_pad_schedule_map_data { /* Pad the range of the given map with zeros to data->max_out and * then add the result to data->res. */ -static int map_pad_range(__isl_take isl_map *map, void *user) +static isl_stat map_pad_range(__isl_take isl_map *map, void *user) { struct isl_pad_schedule_map_data *data = user; int i; @@ -285,9 +285,9 @@ static int map_pad_range(__isl_take isl_map *map, void *user) data->res = isl_union_map_add_map(data->res, map); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Pad the ranges of the maps in the union map with zeros such they all have @@ -337,17 +337,19 @@ __isl_give isl_union_set *isl_schedule_get_domain( * * Return 0 on success and -1 on failure. */ -int isl_schedule_foreach_schedule_node(__isl_keep isl_schedule *sched, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user) +isl_stat isl_schedule_foreach_schedule_node_top_down( + __isl_keep isl_schedule *sched, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) { isl_schedule_node *node; - int r; + isl_stat r; if (!sched) - return -1; + return isl_stat_error; node = isl_schedule_get_root(sched); - r = isl_schedule_node_foreach_descendant(node, fn, user); + r = isl_schedule_node_foreach_descendant_top_down(node, fn, user); isl_schedule_node_free(node); return r; @@ -360,7 +362,7 @@ int isl_schedule_foreach_schedule_node(__isl_keep isl_schedule *sched, * lead to an infinite loop. It is safest to always return a pointer * to the same position (same ancestors and child positions) as the input node. */ -__isl_give isl_schedule *isl_schedule_map_schedule_node( +__isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up( __isl_take isl_schedule *schedule, __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, void *user), void *user) @@ -370,7 +372,7 @@ __isl_give isl_schedule *isl_schedule_map_schedule_node( node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); - node = isl_schedule_node_map_descendant(node, fn, user); + node = isl_schedule_node_map_descendant_bottom_up(node, fn, user); schedule = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); @@ -378,7 +380,7 @@ __isl_give isl_schedule *isl_schedule_map_schedule_node( } /* Wrapper around isl_schedule_node_reset_user for use as - * an isl_schedule_map_schedule_node callback. + * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *reset_user( __isl_take isl_schedule_node *node, void *user) @@ -392,11 +394,12 @@ static __isl_give isl_schedule_node *reset_user( __isl_give isl_schedule *isl_schedule_reset_user( __isl_take isl_schedule *schedule) { - return isl_schedule_map_schedule_node(schedule, &reset_user, NULL); + return isl_schedule_map_schedule_node_bottom_up(schedule, &reset_user, + NULL); } /* Wrapper around isl_schedule_node_align_params for use as - * an isl_schedule_map_schedule_node callback. + * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *align_params( __isl_take isl_schedule_node *node, void *user) @@ -412,14 +415,14 @@ static __isl_give isl_schedule_node *align_params( __isl_give isl_schedule *isl_schedule_align_params( __isl_take isl_schedule *schedule, __isl_take isl_space *space) { - schedule = isl_schedule_map_schedule_node(schedule, + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, &align_params, space); isl_space_free(space); return schedule; } /* Wrapper around isl_schedule_node_pullback_union_pw_multi_aff for use as - * an isl_schedule_map_schedule_node callback. + * an isl_schedule_map_schedule_node_bottom_up callback. */ static __isl_give isl_schedule_node *pullback_upma( __isl_take isl_schedule_node *node, void *user) @@ -439,7 +442,7 @@ __isl_give isl_schedule *isl_schedule_pullback_union_pw_multi_aff( __isl_take isl_schedule *schedule, __isl_take isl_union_pw_multi_aff *upma) { - schedule = isl_schedule_map_schedule_node(schedule, + schedule = isl_schedule_map_schedule_node_bottom_up(schedule, &pullback_upma, upma); isl_union_pw_multi_aff_free(upma); return schedule; diff --git a/polly/lib/External/isl/isl_schedule_band.c b/polly/lib/External/isl/isl_schedule_band.c index cd36c5242bd2..42d1564e4097 100644 --- a/polly/lib/External/isl/isl_schedule_band.c +++ b/polly/lib/External/isl/isl_schedule_band.c @@ -175,43 +175,43 @@ __isl_null isl_schedule_band *isl_schedule_band_free( /* Are "band1" and "band2" obviously equal? */ -int isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, +isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, __isl_keep isl_schedule_band *band2) { int i; - int equal; + isl_bool equal; if (!band1 || !band2) - return -1; + return isl_bool_error; if (band1 == band2) - return 1; + return isl_bool_true; if (band1->n != band2->n) - return 0; + return isl_bool_false; for (i = 0; i < band1->n; ++i) if (band1->coincident[i] != band2->coincident[i]) - return 0; + return isl_bool_false; if (band1->permutable != band2->permutable) - return 0; + return isl_bool_false; equal = isl_multi_union_pw_aff_plain_is_equal(band1->mupa, band2->mupa); if (equal < 0 || !equal) return equal; if (!band1->loop_type != !band2->loop_type) - return 0; + return isl_bool_false; if (band1->loop_type) for (i = 0; i < band1->n; ++i) if (band1->loop_type[i] != band2->loop_type[i]) - return 0; + return isl_bool_false; if (!band1->isolate_loop_type != !band2->isolate_loop_type) - return 0; + return isl_bool_false; if (band1->isolate_loop_type) for (i = 0; i < band1->n; ++i) if (band1->isolate_loop_type[i] != band2->isolate_loop_type[i]) - return 0; + return isl_bool_false; return isl_union_set_is_equal(band1->ast_build_options, band2->ast_build_options); @@ -227,15 +227,15 @@ int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band) /* Is the given scheduling dimension coincident within the band and * with respect to the coincidence constraints? */ -int isl_schedule_band_member_get_coincident(__isl_keep isl_schedule_band *band, - int pos) +isl_bool isl_schedule_band_member_get_coincident( + __isl_keep isl_schedule_band *band, int pos) { if (!band) - return -1; + return isl_bool_error; if (pos < 0 || pos >= band->n) isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, - "invalid member position", return -1); + "invalid member position", return isl_bool_error); return band->coincident[pos]; } @@ -266,10 +266,10 @@ __isl_give isl_schedule_band *isl_schedule_band_member_set_coincident( /* Is the schedule band mark permutable? */ -int isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band) +isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band) { if (!band) - return -1; + return isl_bool_error; return band->permutable; } @@ -575,7 +575,7 @@ __isl_give isl_union_set *isl_schedule_band_get_ast_build_options( * "is" is assumed to set its integer argument to 1 if it is satisfied. */ static int has_any(__isl_keep isl_union_set *uset, - int (*is)(__isl_take isl_set *set, void *user)) + isl_stat (*is)(__isl_take isl_set *set, void *user)) { int found = 0; @@ -593,7 +593,7 @@ static int has_any(__isl_keep isl_union_set *uset, * * If so, set *found and abort the search. */ -static int is_isolate(__isl_take isl_set *set, void *user) +static isl_stat is_isolate(__isl_take isl_set *set, void *user) { int *found = user; @@ -605,7 +605,7 @@ static int is_isolate(__isl_take isl_set *set, void *user) } isl_set_free(set); - return *found ? -1 : 0; + return *found ? isl_stat_error : isl_stat_ok; } /* Does "options" include an option of the ofrm @@ -621,7 +621,7 @@ static int has_isolate_option(__isl_keep isl_union_set *options) /* Does "set" encode a loop AST generation option? */ -static int is_loop_type_option(__isl_take isl_set *set, void *user) +static isl_stat is_loop_type_option(__isl_take isl_set *set, void *user) { int *found = user; @@ -640,7 +640,7 @@ static int is_loop_type_option(__isl_take isl_set *set, void *user) } isl_set_free(set); - return *found ? -1 : 0; + return *found ? isl_stat_error : isl_stat_ok; } /* Does "set" encode a loop AST generation option for the isolated part? @@ -650,7 +650,7 @@ static int is_loop_type_option(__isl_take isl_set *set, void *user) * * with t equal to "atomic", "unroll" or "separate"? */ -static int is_isolate_loop_type_option(__isl_take isl_set *set, void *user) +static isl_stat is_isolate_loop_type_option(__isl_take isl_set *set, void *user) { int *found = user; const char *name; @@ -659,13 +659,13 @@ static int is_isolate_loop_type_option(__isl_take isl_set *set, void *user) if (!isl_set_is_wrapping(set)) { isl_set_free(set); - return 0; + return isl_stat_ok; } map = isl_set_unwrap(set); if (!isl_map_has_tuple_name(map, isl_dim_in) || !isl_map_has_tuple_name(map, isl_dim_out)) { isl_map_free(map); - return 0; + return isl_stat_ok; } name = isl_map_get_tuple_name(map, isl_dim_in); if (!strcmp(name, "isolate")) { @@ -680,7 +680,7 @@ static int is_isolate_loop_type_option(__isl_take isl_set *set, void *user) } isl_map_free(map); - return *found ? -1 : 0; + return *found ? isl_stat_error : isl_stat_ok; } /* Does "options" encode any loop AST generation options diff --git a/polly/lib/External/isl/isl_schedule_band.h b/polly/lib/External/isl/isl_schedule_band.h index 63a624ddfca1..bb86fcac6cec 100644 --- a/polly/lib/External/isl/isl_schedule_band.h +++ b/polly/lib/External/isl/isl_schedule_band.h @@ -51,7 +51,7 @@ __isl_null isl_schedule_band *isl_schedule_band_free( isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band); -int isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, +isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, __isl_keep isl_schedule_band *band2); int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band); @@ -82,11 +82,11 @@ __isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( __isl_take isl_schedule_band *band, __isl_take isl_union_set *options); int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band); -int isl_schedule_band_member_get_coincident( +isl_bool isl_schedule_band_member_get_coincident( __isl_keep isl_schedule_band *band, int pos); __isl_give isl_schedule_band *isl_schedule_band_member_set_coincident( __isl_take isl_schedule_band *band, int pos, int coincident); -int isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band); +isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band); __isl_give isl_schedule_band *isl_schedule_band_set_permutable( __isl_take isl_schedule_band *band, int permutable); diff --git a/polly/lib/External/isl/isl_schedule_node.c b/polly/lib/External/isl/isl_schedule_node.c index 8f91120f6482..2540d15ed6a9 100644 --- a/polly/lib/External/isl/isl_schedule_node.c +++ b/polly/lib/External/isl/isl_schedule_node.c @@ -247,27 +247,27 @@ __isl_null isl_schedule_node *isl_schedule_node_free( /* Do "node1" and "node2" point to the same position in the same * schedule? */ -int isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, +isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1, __isl_keep isl_schedule_node *node2) { int i, n1, n2; if (!node1 || !node2) - return -1; + return isl_bool_error; if (node1 == node2) - return 1; + return isl_bool_true; if (node1->schedule != node2->schedule) - return 0; + return isl_bool_false; n1 = isl_schedule_node_get_tree_depth(node1); n2 = isl_schedule_node_get_tree_depth(node2); if (n1 != n2) - return 0; + return isl_bool_false; for (i = 0; i < n1; ++i) if (node1->child_pos[i] != node2->child_pos[i]) - return 0; + return isl_bool_false; - return 1; + return isl_bool_true; } /* Return the number of outer schedule dimensions of "node" @@ -944,12 +944,12 @@ int isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node) * * That is, does it point to any node of the schedule other than the root? */ -int isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node) { if (!node) - return -1; + return isl_bool_error; if (!node->ancestors) - return -1; + return isl_bool_error; return isl_schedule_tree_list_n_schedule_tree(node->ancestors) != 0; } @@ -977,13 +977,14 @@ int isl_schedule_node_get_child_position(__isl_keep isl_schedule_node *node) /* Does the parent (if any) of "node" have any children with a smaller child * position than this one? */ -int isl_schedule_node_has_previous_sibling(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_has_previous_sibling( + __isl_keep isl_schedule_node *node) { int n; - int has_parent; + isl_bool has_parent; if (!node) - return -1; + return isl_bool_error; has_parent = isl_schedule_node_has_parent(node); if (has_parent < 0 || !has_parent) return has_parent; @@ -996,14 +997,14 @@ int isl_schedule_node_has_previous_sibling(__isl_keep isl_schedule_node *node) /* Does the parent (if any) of "node" have any children with a greater child * position than this one? */ -int isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node) { int n, n_child; - int has_parent; + isl_bool has_parent; isl_schedule_tree *tree; if (!node) - return -1; + return isl_bool_error; has_parent = isl_schedule_node_has_parent(node); if (has_parent < 0 || !has_parent) return has_parent; @@ -1011,7 +1012,7 @@ int isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node) n = isl_schedule_tree_list_n_schedule_tree(node->ancestors); tree = isl_schedule_tree_list_get_schedule_tree(node->ancestors, n - 1); if (!tree) - return -1; + return isl_bool_error; n_child = isl_schedule_tree_list_n_schedule_tree(tree->children); isl_schedule_tree_free(tree); @@ -1024,10 +1025,10 @@ int isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node) * one child, even if the corresponding isl_schedule_tree does not * have any children. */ -int isl_schedule_node_has_children(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node) { if (!node) - return -1; + return isl_bool_error; return !isl_schedule_tree_is_leaf(node->tree); } @@ -1287,13 +1288,13 @@ static __isl_give isl_schedule_node *traverse( return node; } -/* Internal data structure for isl_schedule_node_foreach_descendant. +/* Internal data structure for isl_schedule_node_foreach_descendant_top_down. * * "fn" is the user-specified callback function. * "user" is the user-specified argument for the callback. */ struct isl_schedule_node_preorder_data { - int (*fn)(__isl_keep isl_schedule_node *node, void *user); + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user); void *user; }; @@ -1316,12 +1317,12 @@ static __isl_give isl_schedule_node *preorder_enter( return NULL; do { - int r; + isl_bool r; r = data->fn(node, data->user); if (r < 0) return isl_schedule_node_free(node); - if (r == 0) + if (r == isl_bool_false) return node; } while (isl_schedule_node_has_children(node) && (node = isl_schedule_node_first_child(node)) != NULL); @@ -1349,8 +1350,10 @@ static __isl_give isl_schedule_node *preorder_leave( * * Return 0 on success and -1 on failure. */ -int isl_schedule_node_foreach_descendant(__isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user) +isl_stat isl_schedule_node_foreach_descendant_top_down( + __isl_keep isl_schedule_node *node, + isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) { struct isl_schedule_node_preorder_data data = { fn, user }; @@ -1358,10 +1361,10 @@ int isl_schedule_node_foreach_descendant(__isl_keep isl_schedule_node *node, node = traverse(node, &preorder_enter, &preorder_leave, &data); isl_schedule_node_free(node); - return node ? 0 : -1; + return node ? isl_stat_ok : isl_stat_error; } -/* Internal data structure for isl_schedule_node_map_descendant. +/* Internal data structure for isl_schedule_node_map_descendant_bottom_up. * * "fn" is the user-specified callback function. * "user" is the user-specified argument for the callback. @@ -1409,7 +1412,7 @@ static __isl_give isl_schedule_node *postorder_leave( * lead to an infinite loop. It is safest to always return a pointer * to the same position (same ancestors and child positions) as the input node. */ -__isl_give isl_schedule_node *isl_schedule_node_map_descendant( +__isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up( __isl_take isl_schedule_node *node, __isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node, void *user), void *user) @@ -1426,38 +1429,40 @@ __isl_give isl_schedule_node *isl_schedule_node_map_descendant( * * Return 0 on success and -1 on failure. */ -int isl_schedule_node_foreach_ancestor_top_down( +isl_stat isl_schedule_node_foreach_ancestor_top_down( __isl_keep isl_schedule_node *node, - int (*fn)(__isl_keep isl_schedule_node *node, void *user), void *user) + isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user), + void *user) { int i, n; if (!node) - return -1; + return isl_stat_error; n = isl_schedule_node_get_tree_depth(node); for (i = 0; i < n; ++i) { isl_schedule_node *ancestor; - int r; + isl_stat r; ancestor = isl_schedule_node_copy(node); ancestor = isl_schedule_node_ancestor(ancestor, n - i); r = fn(ancestor, user); isl_schedule_node_free(ancestor); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } /* Is any node in the subtree rooted at "node" anchored? * That is, do any of these nodes reference the outer band nodes? */ -int isl_schedule_node_is_subtree_anchored(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node) { if (!node) - return -1; + return isl_bool_error; return isl_schedule_tree_is_subtree_anchored(node->tree); } @@ -1471,11 +1476,11 @@ unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node) /* Is the band member at position "pos" of the band node "node" * marked coincident? */ -int isl_schedule_node_band_member_get_coincident( +isl_bool isl_schedule_node_band_member_get_coincident( __isl_keep isl_schedule_node *node, int pos) { if (!node) - return -1; + return isl_bool_error; return isl_schedule_tree_band_member_get_coincident(node->tree, pos); } @@ -1504,10 +1509,11 @@ __isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident( /* Is the band node "node" marked permutable? */ -int isl_schedule_node_band_get_permutable(__isl_keep isl_schedule_node *node) +isl_bool isl_schedule_node_band_get_permutable( + __isl_keep isl_schedule_node *node) { if (!node) - return -1; + return isl_bool_error; return isl_schedule_tree_band_get_permutable(node->tree); } diff --git a/polly/lib/External/isl/isl_schedule_tree.c b/polly/lib/External/isl/isl_schedule_tree.c index 09becd3bc8ee..78fcf49ddb1a 100644 --- a/polly/lib/External/isl/isl_schedule_tree.c +++ b/polly/lib/External/isl/isl_schedule_tree.c @@ -450,9 +450,10 @@ error: /* Does "tree" have any node that depends on its position * in the complete schedule tree? */ -int isl_schedule_tree_is_subtree_anchored(__isl_keep isl_schedule_tree *tree) +isl_bool isl_schedule_tree_is_subtree_anchored( + __isl_keep isl_schedule_tree *tree) { - return tree ? tree->anchored : -1; + return tree ? tree->anchored : isl_bool_error; } /* Does the root node of "tree" depend on its position in the complete @@ -622,18 +623,18 @@ enum isl_schedule_node_type isl_schedule_tree_get_type( /* Are "tree1" and "tree2" obviously equal to each other? */ -int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, +isl_bool isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, __isl_keep isl_schedule_tree *tree2) { - int equal; + isl_bool equal; int i, n; if (!tree1 || !tree2) - return -1; + return isl_bool_error; if (tree1 == tree2) - return 1; + return isl_bool_true; if (tree1->type != tree2->type) - return 0; + return isl_bool_false; switch (tree1->type) { case isl_schedule_node_band: @@ -669,10 +670,10 @@ int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, case isl_schedule_node_leaf: case isl_schedule_node_sequence: case isl_schedule_node_set: - equal = 1; + equal = isl_bool_true; break; case isl_schedule_node_error: - equal = -1; + equal = isl_bool_error; break; } @@ -681,7 +682,7 @@ int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, n = isl_schedule_tree_n_children(tree1); if (n != isl_schedule_tree_n_children(tree2)) - return 0; + return isl_bool_false; for (i = 0; i < n; ++i) { isl_schedule_tree *child1, *child2; @@ -695,7 +696,7 @@ int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, return equal; } - return 1; + return isl_bool_true; } /* Does "tree" have any children, other than an implicit leaf. @@ -1006,15 +1007,15 @@ unsigned isl_schedule_tree_band_n_member(__isl_keep isl_schedule_tree *tree) /* Is the band member at position "pos" of the band tree root * marked coincident? */ -int isl_schedule_tree_band_member_get_coincident( +isl_bool isl_schedule_tree_band_member_get_coincident( __isl_keep isl_schedule_tree *tree, int pos) { if (!tree) - return -1; + return isl_bool_error; if (tree->type != isl_schedule_node_band) isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, - "not a band node", return -1); + "not a band node", return isl_bool_error); return isl_schedule_band_member_get_coincident(tree->band, pos); } @@ -1046,14 +1047,15 @@ __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_coincident( /* Is the band tree root marked permutable? */ -int isl_schedule_tree_band_get_permutable(__isl_keep isl_schedule_tree *tree) +isl_bool isl_schedule_tree_band_get_permutable( + __isl_keep isl_schedule_tree *tree) { if (!tree) - return -1; + return isl_bool_error; if (tree->type != isl_schedule_node_band) isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, - "not a band node", return -1); + "not a band node", return isl_bool_error); return isl_schedule_band_get_permutable(tree->band); } @@ -1504,14 +1506,14 @@ __isl_give isl_id *isl_schedule_tree_mark_get_id( /* Set dim to the range dimension of "map" and abort the search. */ -static int set_range_dim(__isl_take isl_map *map, void *user) +static isl_stat set_range_dim(__isl_take isl_map *map, void *user) { int *dim = user; *dim = isl_map_dim(map, isl_dim_out); isl_map_free(map); - return -1; + return isl_stat_error; } /* Return the dimension of the range of "umap". diff --git a/polly/lib/External/isl/isl_schedule_tree.h b/polly/lib/External/isl/isl_schedule_tree.h index fee70c14aa6a..4c18e956af11 100644 --- a/polly/lib/External/isl/isl_schedule_tree.h +++ b/polly/lib/External/isl/isl_schedule_tree.h @@ -83,7 +83,7 @@ enum isl_schedule_node_type isl_schedule_tree_get_type( __isl_give isl_schedule_tree *isl_schedule_tree_leaf(isl_ctx *ctx); int isl_schedule_tree_is_leaf(__isl_keep isl_schedule_tree *tree); -int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, +isl_bool isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, __isl_keep isl_schedule_tree *tree2); __isl_give isl_schedule_tree *isl_schedule_tree_copy( @@ -116,7 +116,8 @@ __isl_give isl_schedule_tree *isl_schedule_tree_sequence_pair( __isl_take isl_schedule_tree *tree1, __isl_take isl_schedule_tree *tree2); -int isl_schedule_tree_is_subtree_anchored(__isl_keep isl_schedule_tree *tree); +isl_bool isl_schedule_tree_is_subtree_anchored( + __isl_keep isl_schedule_tree *tree); __isl_give isl_space *isl_schedule_tree_band_get_space( __isl_keep isl_schedule_tree *tree); @@ -178,11 +179,12 @@ __isl_give isl_union_map *isl_schedule_tree_get_subtree_schedule_union_map( unsigned isl_schedule_tree_band_n_member(__isl_keep isl_schedule_tree *tree); -int isl_schedule_tree_band_member_get_coincident( +isl_bool isl_schedule_tree_band_member_get_coincident( __isl_keep isl_schedule_tree *tree, int pos); __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_coincident( __isl_take isl_schedule_tree *tree, int pos, int coincident); -int isl_schedule_tree_band_get_permutable(__isl_keep isl_schedule_tree *tree); +isl_bool isl_schedule_tree_band_get_permutable( + __isl_keep isl_schedule_tree *tree); __isl_give isl_schedule_tree *isl_schedule_tree_band_set_permutable( __isl_take isl_schedule_tree *tree, int permutable); diff --git a/polly/lib/External/isl/isl_scheduler.c b/polly/lib/External/isl/isl_scheduler.c index 863e45022672..41e839e5d1f4 100644 --- a/polly/lib/External/isl/isl_scheduler.c +++ b/polly/lib/External/isl/isl_scheduler.c @@ -634,8 +634,9 @@ static int edge_has_src_and_dst(const void *entry, const void *val) /* Add the given edge to graph->edge_table[type]. */ -static int graph_edge_table_add(isl_ctx *ctx, struct isl_sched_graph *graph, - enum isl_edge_type type, struct isl_sched_edge *edge) +static isl_stat graph_edge_table_add(isl_ctx *ctx, + struct isl_sched_graph *graph, enum isl_edge_type type, + struct isl_sched_edge *edge) { struct isl_hash_table_entry *entry; uint32_t hash; @@ -646,10 +647,10 @@ static int graph_edge_table_add(isl_ctx *ctx, struct isl_sched_graph *graph, entry = isl_hash_table_find(ctx, graph->edge_table[type], hash, &edge_has_src_and_dst, edge, 1); if (!entry) - return -1; + return isl_stat_error; entry->data = edge; - return 0; + return isl_stat_ok; } /* Allocate the edge_tables based on the maximal number of edges of @@ -710,12 +711,12 @@ static struct isl_sched_edge *graph_find_edge(struct isl_sched_graph *graph, /* Check whether the dependence graph has an edge of the given type * between the given two nodes. */ -static int graph_has_edge(struct isl_sched_graph *graph, +static isl_bool graph_has_edge(struct isl_sched_graph *graph, enum isl_edge_type type, struct isl_sched_node *src, struct isl_sched_node *dst) { struct isl_sched_edge *edge; - int empty; + isl_bool empty; edge = graph_find_edge(graph, type, src, dst); if (!edge) @@ -723,7 +724,7 @@ static int graph_has_edge(struct isl_sched_graph *graph, empty = isl_map_plain_is_empty(edge->map); if (empty < 0) - return -1; + return isl_bool_error; return !empty; } @@ -779,11 +780,11 @@ static void graph_remove_edge(struct isl_sched_graph *graph, /* Check whether the dependence graph has any edge * between the given two nodes. */ -static int graph_has_any_edge(struct isl_sched_graph *graph, +static isl_bool graph_has_any_edge(struct isl_sched_graph *graph, struct isl_sched_node *src, struct isl_sched_node *dst) { enum isl_edge_type i; - int r; + isl_bool r; for (i = isl_edge_first; i <= isl_edge_last; ++i) { r = graph_has_edge(graph, i, src, dst); @@ -805,10 +806,10 @@ static int graph_has_any_edge(struct isl_sched_graph *graph, * of strongly connected components and we cannot ignore * conditional validity edges during this detection. */ -static int graph_has_validity_edge(struct isl_sched_graph *graph, +static isl_bool graph_has_validity_edge(struct isl_sched_graph *graph, struct isl_sched_node *src, struct isl_sched_node *dst) { - int r; + isl_bool r; r = graph_has_edge(graph, isl_edge_validity, src, dst); if (r < 0 || r) @@ -882,7 +883,7 @@ static void graph_free(isl_ctx *ctx, struct isl_sched_graph *graph) /* For each "set" on which this function is called, increment * graph->n by one and update graph->maxvar. */ -static int init_n_maxvar(__isl_take isl_set *set, void *user) +static isl_stat init_n_maxvar(__isl_take isl_set *set, void *user) { struct isl_sched_graph *graph = user; int nvar = isl_set_dim(set, isl_dim_set); @@ -893,19 +894,19 @@ static int init_n_maxvar(__isl_take isl_set *set, void *user) isl_set_free(set); - return 0; + return isl_stat_ok; } /* Add the number of basic maps in "map" to *n. */ -static int add_n_basic_map(__isl_take isl_map *map, void *user) +static isl_stat add_n_basic_map(__isl_take isl_map *map, void *user) { int *n = user; *n += isl_map_n_basic_map(map); isl_map_free(map); - return 0; + return isl_stat_ok; } /* Compute the number of rows that should be allocated for the schedule. @@ -967,9 +968,9 @@ static int has_any_defining_equality(__isl_keep isl_basic_set *bset) * If "compressed" is not set, then "hull", "compress" and "decompress" * should be NULL. */ -static int add_node(struct isl_sched_graph *graph, __isl_take isl_space *space, - int nvar, int compressed, __isl_take isl_set *hull, - __isl_take isl_multi_aff *compress, +static isl_stat add_node(struct isl_sched_graph *graph, + __isl_take isl_space *space, int nvar, int compressed, + __isl_take isl_set *hull, __isl_take isl_multi_aff *compress, __isl_take isl_multi_aff *decompress) { int nparam; @@ -978,7 +979,7 @@ static int add_node(struct isl_sched_graph *graph, __isl_take isl_space *space, int *coincident; if (!space) - return -1; + return isl_stat_error; ctx = isl_space_get_ctx(space); nparam = isl_space_dim(space, isl_dim_param); @@ -999,11 +1000,11 @@ static int add_node(struct isl_sched_graph *graph, __isl_take isl_space *space, graph->n++; if (!space || !sched || (graph->max_row && !coincident)) - return -1; + return isl_stat_error; if (compressed && (!hull || !compress || !decompress)) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Add a new node to the graph representing the given set. @@ -1012,7 +1013,7 @@ static int add_node(struct isl_sched_graph *graph, __isl_take isl_space *space, * we perform variable compression such that we can perform * the scheduling on the compressed domain. */ -static int extract_node(__isl_take isl_set *set, void *user) +static isl_stat extract_node(__isl_take isl_set *set, void *user) { int nvar; int has_equality; @@ -1048,7 +1049,7 @@ static int extract_node(__isl_take isl_set *set, void *user) error: isl_basic_set_free(hull); isl_space_free(space); - return -1; + return isl_stat_error; } struct isl_extract_edge_data { @@ -1195,7 +1196,7 @@ static __isl_give isl_map *map_intersect_domains(__isl_take isl_map *tagged, * outside of these domains, while the scheduler no longer has * any control over those outside parts. */ -static int extract_edge(__isl_take isl_map *map, void *user) +static isl_stat extract_edge(__isl_take isl_map *map, void *user) { isl_ctx *ctx = isl_map_get_ctx(map); struct isl_extract_edge_data *data = user; @@ -1225,7 +1226,7 @@ static int extract_edge(__isl_take isl_map *map, void *user) if (!src || !dst) { isl_map_free(map); isl_map_free(tagged); - return 0; + return isl_stat_ok; } if (src->compressed || dst->compressed) { @@ -1267,7 +1268,7 @@ static int extract_edge(__isl_take isl_map *map, void *user) edge = graph_find_matching_edge(graph, &graph->edge[graph->n_edge]); if (!edge) { graph->n_edge++; - return -1; + return isl_stat_error; } if (edge == &graph->edge[graph->n_edge]) return graph_edge_table_add(ctx, graph, data->type, @@ -1282,9 +1283,9 @@ static int extract_edge(__isl_take isl_map *map, void *user) /* Check whether there is any dependence from node[j] to node[i] * or from node[i] to node[j]. */ -static int node_follows_weak(int i, int j, void *user) +static isl_bool node_follows_weak(int i, int j, void *user) { - int f; + isl_bool f; struct isl_sched_graph *graph = user; f = graph_has_any_edge(graph, &graph->node[j], &graph->node[i]); @@ -1296,7 +1297,7 @@ static int node_follows_weak(int i, int j, void *user) /* Check whether there is a (conditional) validity dependence from node[j] * to node[i], forcing node[i] to follow node[j]. */ -static int node_follows_strong(int i, int j, void *user) +static isl_bool node_follows_strong(int i, int j, void *user) { struct isl_sched_graph *graph = user; @@ -3047,7 +3048,6 @@ static __isl_give isl_schedule_node *compute_split_schedule( __isl_take isl_schedule_node *node, struct isl_sched_graph *graph) { int i, n, e1, e2; - int orig_total_row; isl_ctx *ctx; isl_union_set_list *filters; @@ -3082,14 +3082,12 @@ static __isl_give isl_schedule_node *compute_split_schedule( node = isl_schedule_node_child(node, 0); node = isl_schedule_node_child(node, 0); - orig_total_row = graph->n_total_row; node = compute_sub_schedule(node, ctx, graph, n, e1, &node_scc_at_most, &edge_dst_scc_at_most, graph->src_scc, 0); node = isl_schedule_node_parent(node); node = isl_schedule_node_next_sibling(node); node = isl_schedule_node_child(node, 0); - graph->n_total_row = orig_total_row; node = compute_sub_schedule(node, ctx, graph, graph->n - n, e2, &node_scc_at_least, &edge_src_scc_at_least, graph->src_scc + 1, 0); @@ -4190,7 +4188,6 @@ static __isl_give isl_schedule_node *compute_component_schedule( { int component, i; int n, n_edge; - int orig_total_row; isl_ctx *ctx; isl_union_set_list *filters; @@ -4204,7 +4201,6 @@ static __isl_give isl_schedule_node *compute_component_schedule( else node = isl_schedule_node_insert_sequence(node, filters); - orig_total_row = graph->n_total_row; for (component = 0; component < graph->scc; ++component) { n = 0; for (i = 0; i < graph->n; ++i) @@ -4223,7 +4219,6 @@ static __isl_give isl_schedule_node *compute_component_schedule( &edge_scc_exactly, component, wcc); node = isl_schedule_node_parent(node); node = isl_schedule_node_parent(node); - graph->n_total_row = orig_total_row; } return node; @@ -4336,7 +4331,8 @@ __isl_give isl_schedule *isl_schedule_constraints_compute_schedule( node = isl_schedule_node_from_domain(isl_union_set_copy(sc->domain)); node = isl_schedule_node_child(node, 0); - node = compute_schedule(node, &graph); + if (graph.n > 0) + node = compute_schedule(node, &graph); sched = isl_schedule_node_get_schedule(node); isl_schedule_node_free(node); diff --git a/polly/lib/External/isl/isl_space.c b/polly/lib/External/isl/isl_space.c index ceb556076a71..688bc6018fd3 100644 --- a/polly/lib/External/isl/isl_space.c +++ b/polly/lib/External/isl/isl_space.c @@ -65,23 +65,23 @@ static __isl_give isl_space *mark_as_set(__isl_take isl_space *space) /* Is the space that of a set? */ -int isl_space_is_set(__isl_keep isl_space *space) +isl_bool isl_space_is_set(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (space->n_in != 0 || space->nested[0]) - return 0; + return isl_bool_false; if (space->tuple_id[0] != &isl_id_none) - return 0; - return 1; + return isl_bool_false; + return isl_bool_true; } /* Is the given space that of a map? */ -int isl_space_is_map(__isl_keep isl_space *space) +isl_bool isl_space_is_map(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return space->tuple_id[0] != &isl_id_none && space->tuple_id[1] != &isl_id_none; } @@ -109,18 +109,18 @@ static __isl_give isl_space *mark_as_params(isl_space *space) /* Is the space that of a parameter domain? */ -int isl_space_is_params(__isl_keep isl_space *space) +isl_bool isl_space_is_params(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (space->n_in != 0 || space->nested[0] || space->n_out != 0 || space->nested[1]) - return 0; + return isl_bool_false; if (space->tuple_id[0] != &isl_id_none) - return 0; + return isl_bool_false; if (space->tuple_id[1] != &isl_id_none) - return 0; - return 1; + return isl_bool_false; + return isl_bool_true; } /* Create a space for a parameter domain. @@ -405,10 +405,11 @@ static int space_can_have_id(__isl_keep isl_space *space, /* Does the tuple have an id? */ -int isl_space_has_tuple_id(__isl_keep isl_space *dim, enum isl_dim_type type) +isl_bool isl_space_has_tuple_id(__isl_keep isl_space *dim, + enum isl_dim_type type) { if (!space_can_have_id(dim, type)) - return -1; + return isl_bool_error; return dim->tuple_id[type - isl_dim_in] != NULL; } @@ -536,11 +537,11 @@ error: return NULL; } -int isl_space_has_dim_id(__isl_keep isl_space *dim, +isl_bool isl_space_has_dim_id(__isl_keep isl_space *dim, enum isl_dim_type type, unsigned pos) { if (!dim) - return -1; + return isl_bool_error; return get_id(dim, type, pos) != NULL; } @@ -578,13 +579,13 @@ error: /* Does the tuple have a name? */ -int isl_space_has_tuple_name(__isl_keep isl_space *space, +isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space, enum isl_dim_type type) { isl_id *id; if (!space_can_have_id(space, type)) - return -1; + return isl_bool_error; id = space->tuple_id[type - isl_dim_in]; return id && id->name; } @@ -622,13 +623,13 @@ error: /* Does the given dimension have a name? */ -int isl_space_has_dim_name(__isl_keep isl_space *space, +isl_bool isl_space_has_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos) { isl_id *id; if (!space) - return -1; + return isl_bool_error; id = get_id(space, type, pos); return id && id->name; } @@ -789,7 +790,7 @@ static int isl_space_has_equal_tuples(__isl_keep isl_space *space1, * to have result affected by possibly differing parameters * in those nested tuples. */ -int isl_space_tuple_is_equal(__isl_keep isl_space *space1, +isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, enum isl_dim_type type2) { @@ -797,26 +798,26 @@ int isl_space_tuple_is_equal(__isl_keep isl_space *space1, isl_space *nested1, *nested2; if (!space1 || !space2) - return -1; + return isl_bool_error; if (space1 == space2 && type1 == type2) - return 1; + return isl_bool_true; if (n(space1, type1) != n(space2, type2)) - return 0; + return isl_bool_false; id1 = tuple_id(space1, type1); id2 = tuple_id(space2, type2); if (!id1 ^ !id2) - return 0; + return isl_bool_false; if (id1 && id1 != id2) - return 0; + return isl_bool_false; nested1 = nested(space1, type1); nested2 = nested(space2, type2); if (!nested1 ^ !nested2) - return 0; + return isl_bool_false; if (nested1 && !isl_space_has_equal_tuples(nested1, nested2)) - return 0; - return 1; + return isl_bool_false; + return isl_bool_true; } /* This is the old, undocumented, name for isl_space_tuple_is_equal. @@ -1781,12 +1782,13 @@ __isl_give isl_space *isl_space_underlying(__isl_take isl_space *dim, /* Are the two spaces the same, including positions and names of parameters? */ -int isl_space_is_equal(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2) +isl_bool isl_space_is_equal(__isl_keep isl_space *dim1, + __isl_keep isl_space *dim2) { if (!dim1 || !dim2) - return -1; + return isl_bool_error; if (dim1 == dim2) - return 1; + return isl_bool_true; return match(dim1, isl_dim_param, dim2, isl_dim_param) && isl_space_tuple_is_equal(dim1, isl_dim_in, dim2, isl_dim_in) && isl_space_tuple_is_equal(dim1, isl_dim_out, dim2, isl_dim_out); @@ -1797,13 +1799,13 @@ int isl_space_is_equal(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2) * In the internal version we also allow space2 to be the space of a set, * provided space1 is a parameter space. */ -int isl_space_is_domain_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space1 || !space2) - return -1; + return isl_bool_error; if (!isl_space_is_set(space1)) - return 0; + return isl_bool_false; return match(space1, isl_dim_param, space2, isl_dim_param) && isl_space_tuple_is_equal(space1, isl_dim_set, space2, isl_dim_in); @@ -1811,13 +1813,13 @@ int isl_space_is_domain_internal(__isl_keep isl_space *space1, /* Is space1 equal to the domain of space2? */ -int isl_space_is_domain(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space2) - return -1; + return isl_bool_error; if (!isl_space_is_map(space2)) - return 0; + return isl_bool_false; return isl_space_is_domain_internal(space1, space2); } @@ -1826,13 +1828,13 @@ int isl_space_is_domain(__isl_keep isl_space *space1, * In the internal version, space2 is allowed to be the space of a set, * in which case it should be equal to space1. */ -int isl_space_is_range_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_range_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space1 || !space2) - return -1; + return isl_bool_error; if (!isl_space_is_set(space1)) - return 0; + return isl_bool_false; return match(space1, isl_dim_param, space2, isl_dim_param) && isl_space_tuple_is_equal(space1, isl_dim_set, space2, isl_dim_out); @@ -1840,13 +1842,13 @@ int isl_space_is_range_internal(__isl_keep isl_space *space1, /* Is space1 equal to the range of space2? */ -int isl_space_is_range(__isl_keep isl_space *space1, +isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space2) - return -1; + return isl_bool_error; if (!isl_space_is_map(space2)) - return 0; + return isl_bool_false; return isl_space_is_range_internal(space1, space2); } @@ -1898,39 +1900,39 @@ uint32_t isl_space_get_hash(__isl_keep isl_space *dim) return hash; } -int isl_space_is_wrapping(__isl_keep isl_space *dim) +isl_bool isl_space_is_wrapping(__isl_keep isl_space *dim) { if (!dim) - return -1; + return isl_bool_error; if (!isl_space_is_set(dim)) - return 0; + return isl_bool_false; return dim->nested[1] != NULL; } /* Is "space" the space of a map where the domain is a wrapped map space? */ -int isl_space_domain_is_wrapping(__isl_keep isl_space *space) +isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (isl_space_is_set(space)) - return 0; + return isl_bool_false; return space->nested[0] != NULL; } /* Is "space" the space of a map where the range is a wrapped map space? */ -int isl_space_range_is_wrapping(__isl_keep isl_space *space) +isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; if (isl_space_is_set(space)) - return 0; + return isl_bool_false; return space->nested[1] != NULL; } @@ -2115,10 +2117,10 @@ __isl_give isl_space *isl_space_lift(__isl_take isl_space *dim, unsigned n_local return dim; } -int isl_space_can_zip(__isl_keep isl_space *dim) +isl_bool isl_space_can_zip(__isl_keep isl_space *dim) { if (!dim) - return -1; + return isl_bool_error; return dim->nested[0] && dim->nested[1]; } @@ -2154,10 +2156,10 @@ error: /* Can we apply isl_space_curry to "space"? * That is, does it have a nested relation in its domain? */ -int isl_space_can_curry(__isl_keep isl_space *space) +isl_bool isl_space_can_curry(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return !!space->nested[0]; } @@ -2193,10 +2195,10 @@ error: /* Can we apply isl_space_uncurry to "space"? * That is, does it have a nested relation in its range? */ -int isl_space_can_uncurry(__isl_keep isl_space *space) +isl_bool isl_space_can_uncurry(__isl_keep isl_space *space) { if (!space) - return -1; + return isl_bool_error; return !!space->nested[1]; } diff --git a/polly/lib/External/isl/isl_space_private.h b/polly/lib/External/isl/isl_space_private.h index 3c892a4986ab..a07acea7047f 100644 --- a/polly/lib/External/isl/isl_space_private.h +++ b/polly/lib/External/isl/isl_space_private.h @@ -29,9 +29,9 @@ __isl_give isl_space *isl_space_underlying(__isl_take isl_space *dim, uint32_t isl_space_get_hash(__isl_keep isl_space *dim); -int isl_space_is_domain_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); -int isl_space_is_range_internal(__isl_keep isl_space *space1, +isl_bool isl_space_is_range_internal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); __isl_give isl_space *isl_space_as_set_space(__isl_take isl_space *dim); diff --git a/polly/lib/External/isl/isl_stream.c b/polly/lib/External/isl/isl_stream.c index 0957751fe430..ee62aca5ab90 100644 --- a/polly/lib/External/isl/isl_stream.c +++ b/polly/lib/External/isl/isl_stream.c @@ -750,14 +750,14 @@ int isl_stream_is_empty(__isl_keep isl_stream *s) return 0; } -static int free_keyword(void **p, void *user) +static isl_stat free_keyword(void **p, void *user) { struct isl_keyword *keyword = *p; free(keyword->name); free(keyword); - return 0; + return isl_stat_ok; } void isl_stream_flush_tokens(__isl_keep isl_stream *s) diff --git a/polly/lib/External/isl/isl_tarjan.c b/polly/lib/External/isl/isl_tarjan.c index 61e6b6e2f0d6..414a2e09cc2a 100644 --- a/polly/lib/External/isl/isl_tarjan.c +++ b/polly/lib/External/isl/isl_tarjan.c @@ -58,8 +58,8 @@ error: /* Perform Tarjan's algorithm for computing the strongly connected components * in the graph with g->len nodes and with edges defined by "follows". */ -static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, - int (*follows)(int i, int j, void *user), void *user) +static isl_stat isl_tarjan_components(struct isl_tarjan_graph *g, int i, + isl_bool (*follows)(int i, int j, void *user), void *user) { int j; @@ -70,7 +70,7 @@ static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, g->stack[g->sp++] = i; for (j = g->len - 1; j >= 0; --j) { - int f; + isl_bool f; if (j == i) continue; @@ -81,7 +81,7 @@ static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, f = follows(i, j, user); if (f < 0) - return -1; + return isl_stat_error; if (!f) continue; @@ -94,7 +94,7 @@ static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, } if (g->node[i].index != g->node[i].min_index) - return 0; + return isl_stat_ok; do { j = g->stack[--g->sp]; @@ -103,7 +103,7 @@ static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, } while (j != i); g->order[g->op++] = -1; - return 0; + return isl_stat_ok; } /* Decompose the graph with "len" nodes and edges defined by "follows" @@ -116,7 +116,7 @@ static int isl_tarjan_components(struct isl_tarjan_graph *g, int i, * in the result. */ struct isl_tarjan_graph *isl_tarjan_graph_init(isl_ctx *ctx, int len, - int (*follows)(int i, int j, void *user), void *user) + isl_bool (*follows)(int i, int j, void *user), void *user) { int i; struct isl_tarjan_graph *g = NULL; diff --git a/polly/lib/External/isl/isl_tarjan.h b/polly/lib/External/isl/isl_tarjan.h index 0767d0916dec..1f8f02e1fb4c 100644 --- a/polly/lib/External/isl/isl_tarjan.h +++ b/polly/lib/External/isl/isl_tarjan.h @@ -34,7 +34,7 @@ struct isl_tarjan_graph { }; struct isl_tarjan_graph *isl_tarjan_graph_init(isl_ctx *ctx, int len, - int (*follows)(int i, int j, void *user), void *user); + isl_bool (*follows)(int i, int j, void *user), void *user); void isl_tarjan_graph_free(struct isl_tarjan_graph *g); #endif diff --git a/polly/lib/External/isl/isl_test.c b/polly/lib/External/isl/isl_test.c index 05b953634d86..242e8dee0969 100644 --- a/polly/lib/External/isl/isl_test.c +++ b/polly/lib/External/isl/isl_test.c @@ -363,14 +363,14 @@ static int test_construction(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_param, 0, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_inequality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_inequality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -5); @@ -674,7 +674,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -683,7 +683,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -703,7 +703,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -712,7 +712,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -732,7 +732,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -741,7 +741,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -3); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -761,7 +761,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 2); isl_constraint_set_constant(c, v); isl_int_set_si(v, -1); @@ -770,7 +770,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 1, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_constant(c, v); isl_int_set_si(v, 1); @@ -790,14 +790,14 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 3); isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -815,14 +815,14 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 6); isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -849,7 +849,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -874,7 +874,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -3); @@ -885,7 +885,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 4, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 1); @@ -908,7 +908,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -1); @@ -917,7 +917,7 @@ static int test_div(isl_ctx *ctx) isl_constraint_set_coefficient(c, isl_dim_set, 2, v); bset = isl_basic_set_add_constraint(bset, c); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, -1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, 3); @@ -940,7 +940,7 @@ static int test_div(isl_ctx *ctx) bset = isl_basic_set_universe(isl_space_copy(dim)); ls = isl_local_space_from_space(dim); - c = isl_equality_alloc(isl_local_space_copy(ls)); + c = isl_constraint_alloc_equality(isl_local_space_copy(ls)); isl_int_set_si(v, 1); isl_constraint_set_coefficient(c, isl_dim_set, 0, v); isl_int_set_si(v, -2); @@ -2077,7 +2077,7 @@ struct must_may { isl_map *may; }; -static int collect_must_may(__isl_take isl_map *dep, int must, +static isl_stat collect_must_may(__isl_take isl_map *dep, int must, void *dep_user, void *user) { struct must_may *mm = (struct must_may *)user; @@ -2087,7 +2087,7 @@ static int collect_must_may(__isl_take isl_map *dep, int must, else mm->may = isl_map_union(mm->may, dep); - return 0; + return isl_stat_ok; } static int common_space(void *first, void *second) @@ -2842,7 +2842,7 @@ int test_factorize(isl_ctx *ctx) return 0; } -static int check_injective(__isl_take isl_map *map, void *user) +static isl_stat check_injective(__isl_take isl_map *map, void *user) { int *injective = user; @@ -2850,9 +2850,9 @@ static int check_injective(__isl_take isl_map *map, void *user) isl_map_free(map); if (*injective < 0 || !*injective) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } int test_one_schedule(isl_ctx *ctx, const char *d, const char *w, @@ -2983,9 +2983,15 @@ int test_one_schedule(isl_ctx *ctx, const char *d, const char *w, return 0; } -static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, - const char *domain, const char *validity, const char *proximity) +/* Compute a schedule for the given instance set, validity constraints, + * proximity constraints and context and return a corresponding union map + * representation. + */ +static __isl_give isl_union_map *compute_schedule_with_context(isl_ctx *ctx, + const char *domain, const char *validity, const char *proximity, + const char *context) { + isl_set *con; isl_union_set *dom; isl_union_map *dep; isl_union_map *prox; @@ -2993,10 +2999,12 @@ static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, isl_schedule *schedule; isl_union_map *sched; + con = isl_set_read_from_str(ctx, context); dom = isl_union_set_read_from_str(ctx, domain); dep = isl_union_map_read_from_str(ctx, validity); prox = isl_union_map_read_from_str(ctx, proximity); sc = isl_schedule_constraints_on_domain(dom); + sc = isl_schedule_constraints_set_context(sc, con); sc = isl_schedule_constraints_set_validity(sc, dep); sc = isl_schedule_constraints_set_proximity(sc, prox); schedule = isl_schedule_constraints_compute_schedule(sc); @@ -3006,6 +3014,16 @@ static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, return sched; } +/* Compute a schedule for the given instance set, validity constraints and + * proximity constraints and return a corresponding union map representation. + */ +static __isl_give isl_union_map *compute_schedule(isl_ctx *ctx, + const char *domain, const char *validity, const char *proximity) +{ + return compute_schedule_with_context(ctx, domain, validity, proximity, + "{ : }"); +} + /* Check that a schedule can be constructed on the given domain * with the given validity and proximity constraints. */ @@ -3339,6 +3357,27 @@ static int test_strongly_satisfying_schedule(isl_ctx *ctx) return 0; } +/* Compute a schedule for input where the instance set constraints + * conflict with the context constraints. + * Earlier versions of isl did not properly handle this situation. + */ +static int test_conflicting_context_schedule(isl_ctx *ctx) +{ + isl_union_map *schedule; + const char *domain, *context; + + domain = "[n] -> { A[] : n >= 0 }"; + context = "[n] -> { : n < 0 }"; + schedule = compute_schedule_with_context(ctx, + domain, "{}", "{}", context); + isl_union_map_free(schedule); + + if (!schedule) + return -1; + + return 0; +} + int test_schedule(isl_ctx *ctx) { const char *D, *W, *R, *V, *P, *S; @@ -3634,6 +3673,9 @@ int test_schedule(isl_ctx *ctx) if (test_strongly_satisfying_schedule(ctx) < 0) return -1; + if (test_conflicting_context_schedule(ctx) < 0) + return -1; + return 0; } @@ -4214,7 +4256,7 @@ struct isl_vertices_test_data { /* Check that "vertex" corresponds to one of the vertices in data->vertex. */ -static int find_vertex(__isl_take isl_vertex *vertex, void *user) +static isl_stat find_vertex(__isl_take isl_vertex *vertex, void *user) { struct isl_vertices_test_data *data = user; isl_ctx *ctx; @@ -4222,7 +4264,7 @@ static int find_vertex(__isl_take isl_vertex *vertex, void *user) isl_basic_set *bset; isl_pw_multi_aff *pma; int i; - int equal; + isl_bool equal; ctx = isl_vertex_get_ctx(vertex); bset = isl_vertex_get_domain(vertex); @@ -4244,9 +4286,9 @@ static int find_vertex(__isl_take isl_vertex *vertex, void *user) isl_vertex_free(vertex); if (equal < 0) - return -1; + return isl_stat_error; - return equal ? 0 : - 1; + return equal ? isl_stat_ok : isl_stat_error; } int test_vertices(isl_ctx *ctx) diff --git a/polly/lib/External/isl/isl_transitive_closure.c b/polly/lib/External/isl/isl_transitive_closure.c index 40083ab8db0c..f031f67acfd0 100644 --- a/polly/lib/External/isl/isl_transitive_closure.c +++ b/polly/lib/External/isl/isl_transitive_closure.c @@ -1766,16 +1766,16 @@ struct isl_tc_follows_data { * *check_closed is set if the subset relation holds while * R_1 \circ R_2 is not empty. */ -static int basic_map_follows(int i, int j, void *user) +static isl_bool basic_map_follows(int i, int j, void *user) { struct isl_tc_follows_data *data = user; struct isl_map *map12 = NULL; struct isl_map *map21 = NULL; - int subset; + isl_bool subset; if (!isl_space_tuple_is_equal(data->list[i]->dim, isl_dim_in, data->list[j]->dim, isl_dim_out)) - return 0; + return isl_bool_false; map21 = isl_map_from_basic_map( isl_basic_map_apply_range( @@ -1786,7 +1786,7 @@ static int basic_map_follows(int i, int j, void *user) goto error; if (subset) { isl_map_free(map21); - return 0; + return isl_bool_false; } if (!isl_space_tuple_is_equal(data->list[i]->dim, isl_dim_in, @@ -1794,7 +1794,7 @@ static int basic_map_follows(int i, int j, void *user) !isl_space_tuple_is_equal(data->list[j]->dim, isl_dim_in, data->list[j]->dim, isl_dim_out)) { isl_map_free(map21); - return 1; + return isl_bool_true; } map12 = isl_map_from_basic_map( @@ -1810,10 +1810,10 @@ static int basic_map_follows(int i, int j, void *user) if (subset) data->check_closed = 1; - return subset < 0 ? -1 : !subset; + return subset < 0 ? isl_bool_error : !subset; error: isl_map_free(map21); - return -1; + return isl_bool_error; } /* Given a union of basic maps R = \cup_i R_i \subseteq D \times D @@ -2610,7 +2610,7 @@ error: return NULL; } -static int inc_count(__isl_take isl_map *map, void *user) +static isl_stat inc_count(__isl_take isl_map *map, void *user) { int *n = user; @@ -2618,10 +2618,10 @@ static int inc_count(__isl_take isl_map *map, void *user) isl_map_free(map); - return 0; + return isl_stat_ok; } -static int collect_basic_map(__isl_take isl_map *map, void *user) +static isl_stat collect_basic_map(__isl_take isl_map *map, void *user) { int i; isl_basic_map ***next = user; @@ -2634,10 +2634,10 @@ static int collect_basic_map(__isl_take isl_map *map, void *user) } isl_map_free(map); - return 0; + return isl_stat_ok; error: isl_map_free(map); - return -1; + return isl_stat_error; } /* Perform Floyd-Warshall on the given list of basic relations. @@ -2905,14 +2905,14 @@ struct isl_union_power { int *exact; }; -static int power(__isl_take isl_map *map, void *user) +static isl_stat power(__isl_take isl_map *map, void *user) { struct isl_union_power *up = user; map = isl_map_power(map, up->exact); up->pow = isl_union_map_from_map(map); - return -1; + return isl_stat_error; } /* Construct a map [x] -> [x+1], with parameters prescribed by "dim". diff --git a/polly/lib/External/isl/isl_union_map.c b/polly/lib/External/isl/isl_union_map.c index 103c9d314927..2cae0bc447b1 100644 --- a/polly/lib/External/isl/isl_union_map.c +++ b/polly/lib/External/isl/isl_union_map.c @@ -66,15 +66,15 @@ __isl_give isl_id *isl_union_map_get_dim_id(__isl_keep isl_union_map *umap, /* Is this union set a parameter domain? */ -int isl_union_set_is_params(__isl_keep isl_union_set *uset) +isl_bool isl_union_set_is_params(__isl_keep isl_union_set *uset) { isl_set *set; - int params; + isl_bool params; if (!uset) - return -1; + return isl_bool_error; if (uset->table.n != 1) - return 0; + return isl_bool_false; set = isl_set_from_union_set(isl_union_set_copy(uset)); params = isl_set_is_params(set); @@ -149,20 +149,20 @@ __isl_give isl_space *isl_union_set_get_space(__isl_keep isl_union_set *uset) return isl_union_map_get_space(uset); } -static int free_umap_entry(void **entry, void *user) +static isl_stat free_umap_entry(void **entry, void *user) { isl_map *map = *entry; isl_map_free(map); - return 0; + return isl_stat_ok; } -static int add_map(__isl_take isl_map *map, void *user) +static isl_stat add_map(__isl_take isl_map *map, void *user) { isl_union_map **umap = (isl_union_map **)user; *umap = isl_union_map_add_map(*umap, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_dup(__isl_keep isl_union_map *umap) @@ -197,7 +197,7 @@ struct isl_union_align { isl_union_map *res; }; -static int align_entry(void **entry, void *user) +static isl_stat align_entry(void **entry, void *user) { isl_map *map = *entry; isl_reordering *exp; @@ -209,7 +209,7 @@ static int align_entry(void **entry, void *user) data->res = isl_union_map_add_map(data->res, isl_map_realign(isl_map_copy(map), exp)); - return 0; + return isl_stat_ok; } /* Align the parameters of umap along those of model. @@ -418,11 +418,11 @@ __isl_give isl_union_set *isl_union_set_from_basic_set( struct isl_union_map_foreach_data { - int (*fn)(__isl_take isl_map *map, void *user); + isl_stat (*fn)(__isl_take isl_map *map, void *user); void *user; }; -static int call_on_copy(void **entry, void *user) +static isl_stat call_on_copy(void **entry, void *user) { isl_map *map = *entry; struct isl_union_map_foreach_data *data; @@ -441,26 +441,26 @@ int isl_union_set_n_set(__isl_keep isl_union_set *uset) return uset ? uset->table.n : 0; } -int isl_union_map_foreach_map(__isl_keep isl_union_map *umap, - int (*fn)(__isl_take isl_map *map, void *user), void *user) +isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap, + isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user) { struct isl_union_map_foreach_data data = { fn, user }; if (!umap) - return -1; + return isl_stat_error; return isl_hash_table_foreach(umap->dim->ctx, &umap->table, &call_on_copy, &data); } -static int copy_map(void **entry, void *user) +static isl_stat copy_map(void **entry, void *user) { isl_map *map = *entry; isl_map **map_p = user; *map_p = isl_map_copy(map); - return -1; + return isl_stat_error; } __isl_give isl_map *isl_map_from_union_map(__isl_take isl_union_map *umap) @@ -547,22 +547,22 @@ __isl_give int isl_union_set_contains(__isl_keep isl_union_set *uset, return isl_union_map_contains(uset, dim); } -int isl_union_set_foreach_set(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_set *set, void *user), void *user) +isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user) { return isl_union_map_foreach_map(uset, - (int(*)(__isl_take isl_map *, void*))fn, user); + (isl_stat(*)(__isl_take isl_map *, void*))fn, user); } struct isl_union_set_foreach_point_data { - int (*fn)(__isl_take isl_point *pnt, void *user); + isl_stat (*fn)(__isl_take isl_point *pnt, void *user); void *user; }; -static int foreach_point(__isl_take isl_set *set, void *user) +static isl_stat foreach_point(__isl_take isl_set *set, void *user) { struct isl_union_set_foreach_point_data *data = user; - int r; + isl_stat r; r = isl_set_foreach_point(set, data->fn, data->user); isl_set_free(set); @@ -570,8 +570,8 @@ static int foreach_point(__isl_take isl_set *set, void *user) return r; } -int isl_union_set_foreach_point(__isl_keep isl_union_set *uset, - int (*fn)(__isl_take isl_point *pnt, void *user), void *user) +isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset, + isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user) { struct isl_union_set_foreach_point_data data = { fn, user }; return isl_union_set_foreach_set(uset, &foreach_point, &data); @@ -582,7 +582,7 @@ struct isl_union_map_gen_bin_data { isl_union_map *res; }; -static int subtract_entry(void **entry, void *user) +static isl_stat subtract_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; @@ -600,20 +600,20 @@ static int subtract_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *gen_bin_op(__isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2, int (*fn)(void **, void *)) + __isl_take isl_union_map *umap2, isl_stat (*fn)(void **, void *)) { struct isl_union_map_gen_bin_data data = { NULL, NULL }; @@ -657,7 +657,7 @@ struct isl_union_map_gen_bin_set_data { isl_union_map *res; }; -static int intersect_params_entry(void **entry, void *user) +static isl_stat intersect_params_entry(void **entry, void *user) { struct isl_union_map_gen_bin_set_data *data = user; isl_map *map = *entry; @@ -669,16 +669,16 @@ static int intersect_params_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *gen_bin_set_op(__isl_take isl_union_map *umap, - __isl_take isl_set *set, int (*fn)(void **, void *)) + __isl_take isl_set *set, isl_stat (*fn)(void **, void *)) { struct isl_union_map_gen_bin_set_data data = { NULL, NULL }; @@ -754,7 +754,7 @@ struct isl_union_map_match_bin_data { __isl_give isl_map *(*fn)(__isl_take isl_map*, __isl_take isl_map*); }; -static int match_bin_entry(void **entry, void *user) +static isl_stat match_bin_entry(void **entry, void *user) { struct isl_union_map_match_bin_data *data = user; uint32_t hash; @@ -766,7 +766,7 @@ static int match_bin_entry(void **entry, void *user) entry2 = isl_hash_table_find(data->umap2->dim->ctx, &data->umap2->table, hash, &has_dim, map->dim, 0); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = data->fn(map, isl_map_copy(entry2->data)); @@ -774,16 +774,16 @@ static int match_bin_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *match_bin_op(__isl_take isl_union_map *umap1, @@ -846,7 +846,7 @@ error: return NULL; } -static int gist_params_entry(void **entry, void *user) +static isl_stat gist_params_entry(void **entry, void *user) { struct isl_union_map_gen_bin_set_data *data = user; isl_map *map = *entry; @@ -858,12 +858,12 @@ static int gist_params_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_gist_params( @@ -940,14 +940,14 @@ __isl_give isl_union_map *isl_union_map_lex_ge_union_map( return isl_union_map_reverse(isl_union_map_lex_le_union_map(umap2, umap1)); } -static int intersect_domain_entry(void **entry, void *user) +static isl_stat intersect_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -956,7 +956,7 @@ static int intersect_domain_entry(void **entry, void *user) hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_intersect_domain(map, isl_set_copy(entry2->data)); @@ -964,16 +964,16 @@ static int intersect_domain_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Intersect the domain of "umap" with "uset". @@ -991,14 +991,14 @@ __isl_give isl_union_map *isl_union_map_intersect_domain( /* Remove the elements of data->umap2 from the domain of *entry * and add the result to data->res. */ -static int subtract_domain_entry(void **entry, void *user) +static isl_stat subtract_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -1011,7 +1011,7 @@ static int subtract_domain_entry(void **entry, void *user) if (!entry2) { data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } map = isl_map_subtract_domain(map, isl_set_copy(entry2->data)); @@ -1019,16 +1019,16 @@ static int subtract_domain_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Remove the elements of "uset" from the domain of "umap". @@ -1042,14 +1042,14 @@ __isl_give isl_union_map *isl_union_map_subtract_domain( /* Remove the elements of data->umap2 from the range of *entry * and add the result to data->res. */ -static int subtract_range_entry(void **entry, void *user) +static isl_stat subtract_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *space; isl_map *map = *entry; - int empty; + isl_bool empty; space = isl_map_get_space(map); space = isl_space_range(space); @@ -1062,7 +1062,7 @@ static int subtract_range_entry(void **entry, void *user) if (!entry2) { data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } map = isl_map_subtract_range(map, isl_set_copy(entry2->data)); @@ -1070,16 +1070,16 @@ static int subtract_range_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Remove the elements of "uset" from the range of "umap". @@ -1090,14 +1090,14 @@ __isl_give isl_union_map *isl_union_map_subtract_range( return gen_bin_op(umap, dom, &subtract_range_entry); } -static int gist_domain_entry(void **entry, void *user) +static isl_stat gist_domain_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_domain(dim); @@ -1106,7 +1106,7 @@ static int gist_domain_entry(void **entry, void *user) hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_gist_domain(map, isl_set_copy(entry2->data)); @@ -1114,12 +1114,12 @@ static int gist_domain_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the gist of "umap" with respect to the domain "uset". @@ -1134,14 +1134,14 @@ __isl_give isl_union_map *isl_union_map_gist_domain( return gen_bin_op(umap, uset, &gist_domain_entry); } -static int gist_range_entry(void **entry, void *user) +static isl_stat gist_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *space; isl_map *map = *entry; - int empty; + isl_bool empty; space = isl_map_get_space(map); space = isl_space_range(space); @@ -1150,7 +1150,7 @@ static int gist_range_entry(void **entry, void *user) hash, &has_dim, space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_gist_range(map, isl_set_copy(entry2->data)); @@ -1158,12 +1158,12 @@ static int gist_range_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the gist of "umap" with respect to the range "uset". @@ -1174,14 +1174,14 @@ __isl_give isl_union_map *isl_union_map_gist_range( return gen_bin_op(umap, uset, &gist_range_entry); } -static int intersect_range_entry(void **entry, void *user) +static isl_stat intersect_range_entry(void **entry, void *user) { struct isl_union_map_gen_bin_data *data = user; uint32_t hash; struct isl_hash_table_entry *entry2; isl_space *dim; isl_map *map = *entry; - int empty; + isl_bool empty; dim = isl_map_get_space(map); dim = isl_space_range(dim); @@ -1190,7 +1190,7 @@ static int intersect_range_entry(void **entry, void *user) hash, &has_dim, dim, 0); isl_space_free(dim); if (!entry2) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = isl_map_intersect_range(map, isl_set_copy(entry2->data)); @@ -1198,16 +1198,16 @@ static int intersect_range_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0) { isl_map_free(map); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_intersect_range( @@ -1220,37 +1220,37 @@ struct isl_union_map_bin_data { isl_union_map *umap2; isl_union_map *res; isl_map *map; - int (*fn)(void **entry, void *user); + isl_stat (*fn)(void **entry, void *user); }; -static int apply_range_entry(void **entry, void *user) +static isl_stat apply_range_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; - int empty; + isl_bool empty; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_apply_range(isl_map_copy(data->map), isl_map_copy(map2)); empty = isl_map_is_empty(map2); if (empty < 0) { isl_map_free(map2); - return -1; + return isl_stat_error; } if (empty) { isl_map_free(map2); - return 0; + return isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } -static int bin_entry(void **entry, void *user) +static isl_stat bin_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map = *entry; @@ -1258,13 +1258,14 @@ static int bin_entry(void **entry, void *user) data->map = map; if (isl_hash_table_foreach(data->umap2->dim->ctx, &data->umap2->table, data->fn, data) < 0) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *bin_op(__isl_take isl_union_map *umap1, - __isl_take isl_union_map *umap2, int (*fn)(void **entry, void *user)) + __isl_take isl_union_map *umap2, + isl_stat (*fn)(void **entry, void *user)) { struct isl_union_map_bin_data data = { NULL, NULL, NULL, fn }; @@ -1311,20 +1312,20 @@ __isl_give isl_union_set *isl_union_set_apply( return isl_union_map_apply_range(uset, umap); } -static int map_lex_lt_entry(void **entry, void *user) +static isl_stat map_lex_lt_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_lex_lt_map(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_lex_lt_union_map( @@ -1333,20 +1334,20 @@ __isl_give isl_union_map *isl_union_map_lex_lt_union_map( return bin_op(umap1, umap2, &map_lex_lt_entry); } -static int map_lex_le_entry(void **entry, void *user) +static isl_stat map_lex_le_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_lex_le_map(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_lex_le_union_map( @@ -1355,7 +1356,7 @@ __isl_give isl_union_map *isl_union_map_lex_le_union_map( return bin_op(umap1, umap2, &map_lex_le_entry); } -static int product_entry(void **entry, void *user) +static isl_stat product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; @@ -1364,7 +1365,7 @@ static int product_entry(void **entry, void *user) data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_product(__isl_take isl_union_map *umap1, @@ -1373,7 +1374,7 @@ __isl_give isl_union_map *isl_union_map_product(__isl_take isl_union_map *umap1, return bin_op(umap1, umap2, &product_entry); } -static int set_product_entry(void **entry, void *user) +static isl_stat set_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_set *set2 = *entry; @@ -1382,7 +1383,7 @@ static int set_product_entry(void **entry, void *user) data->res = isl_union_set_add_set(data->res, set2); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_product(__isl_take isl_union_set *uset1, @@ -1391,21 +1392,21 @@ __isl_give isl_union_set *isl_union_set_product(__isl_take isl_union_set *uset1, return bin_op(uset1, uset2, &set_product_entry); } -static int domain_product_entry(void **entry, void *user) +static isl_stat domain_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_domain_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } /* Given two maps A -> B and C -> D, construct a map [A -> C] -> (B * D) @@ -1416,21 +1417,21 @@ __isl_give isl_union_map *isl_union_map_domain_product( return bin_op(umap1, umap2, &domain_product_entry); } -static int range_product_entry(void **entry, void *user) +static isl_stat range_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_in, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_range_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_range_product( @@ -1442,21 +1443,21 @@ __isl_give isl_union_map *isl_union_map_range_product( /* If data->map A -> B and "map2" C -> D have the same range space, * then add (A, C) -> (B * D) to data->res. */ -static int flat_domain_product_entry(void **entry, void *user) +static isl_stat flat_domain_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_out, map2->dim, isl_dim_out)) - return 0; + return isl_stat_ok; map2 = isl_map_flat_domain_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } /* Given two maps A -> B and C -> D, construct a map (A, C) -> (B * D). @@ -1467,21 +1468,21 @@ __isl_give isl_union_map *isl_union_map_flat_domain_product( return bin_op(umap1, umap2, &flat_domain_product_entry); } -static int flat_range_product_entry(void **entry, void *user) +static isl_stat flat_range_product_entry(void **entry, void *user) { struct isl_union_map_bin_data *data = user; isl_map *map2 = *entry; if (!isl_space_tuple_is_equal(data->map->dim, isl_dim_in, map2->dim, isl_dim_in)) - return 0; + return isl_stat_ok; map2 = isl_map_flat_range_product(isl_map_copy(data->map), isl_map_copy(map2)); data->res = isl_union_map_add_map(data->res, map2); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_flat_range_product( @@ -1491,7 +1492,7 @@ __isl_give isl_union_map *isl_union_map_flat_range_product( } static __isl_give isl_union_set *cond_un_op(__isl_take isl_union_map *umap, - int (*fn)(void **, void *)) + isl_stat (*fn)(void **, void *)) { isl_union_set *res; @@ -1510,7 +1511,7 @@ error: return NULL; } -static int from_range_entry(void **entry, void *user) +static isl_stat from_range_entry(void **entry, void *user) { isl_map *set = *entry; isl_union_set **res = user; @@ -1518,7 +1519,7 @@ static int from_range_entry(void **entry, void *user) *res = isl_union_map_add_map(*res, isl_map_from_range(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_from_range( @@ -1541,7 +1542,7 @@ __isl_give isl_union_map *isl_union_map_from_domain_and_range( } static __isl_give isl_union_map *un_op(__isl_take isl_union_map *umap, - int (*fn)(void **, void *)) + isl_stat (*fn)(void **, void *)) { umap = isl_union_map_cow(umap); if (!umap) @@ -1556,13 +1557,13 @@ error: return NULL; } -static int affine_entry(void **entry, void *user) +static isl_stat affine_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_affine_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_affine_hull( @@ -1577,13 +1578,13 @@ __isl_give isl_union_set *isl_union_set_affine_hull( return isl_union_map_affine_hull(uset); } -static int polyhedral_entry(void **entry, void *user) +static isl_stat polyhedral_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_polyhedral_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_polyhedral_hull( @@ -1598,13 +1599,13 @@ __isl_give isl_union_set *isl_union_set_polyhedral_hull( return isl_union_map_polyhedral_hull(uset); } -static int simple_entry(void **entry, void *user) +static isl_stat simple_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_from_basic_map(isl_map_simple_hull(*map)); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_simple_hull( @@ -1619,7 +1620,7 @@ __isl_give isl_union_set *isl_union_set_simple_hull( return isl_union_map_simple_hull(uset); } -static int inplace_entry(void **entry, void *user) +static isl_stat inplace_entry(void **entry, void *user) { __isl_give isl_map *(*fn)(__isl_take isl_map *); isl_map **map = (isl_map **)entry; @@ -1628,12 +1629,12 @@ static int inplace_entry(void **entry, void *user) fn = *(__isl_give isl_map *(**)(__isl_take isl_map *)) user; copy = fn(isl_map_copy(*map)); if (!copy) - return -1; + return isl_stat_error; isl_map_free(*map); *map = copy; - return 0; + return isl_stat_ok; } static __isl_give isl_union_map *inplace(__isl_take isl_union_map *umap, @@ -1706,13 +1707,13 @@ __isl_give isl_union_set *isl_union_set_compute_divs( return isl_union_map_compute_divs(uset); } -static int lexmin_entry(void **entry, void *user) +static isl_stat lexmin_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_lexmin(*map); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_lexmin( @@ -1727,13 +1728,13 @@ __isl_give isl_union_set *isl_union_set_lexmin( return isl_union_map_lexmin(uset); } -static int lexmax_entry(void **entry, void *user) +static isl_stat lexmax_entry(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_lexmax(*map); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } __isl_give isl_union_map *isl_union_map_lexmax( @@ -1748,7 +1749,7 @@ __isl_give isl_union_set *isl_union_set_lexmax( return isl_union_map_lexmax(uset); } -static int universe_entry(void **entry, void *user) +static isl_stat universe_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; @@ -1756,7 +1757,7 @@ static int universe_entry(void **entry, void *user) map = isl_map_universe(isl_map_get_space(map)); *res = isl_union_map_add_map(*res, map); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_universe(__isl_take isl_union_map *umap) @@ -1769,14 +1770,14 @@ __isl_give isl_union_set *isl_union_set_universe(__isl_take isl_union_set *uset) return isl_union_map_universe(uset); } -static int reverse_entry(void **entry, void *user) +static isl_stat reverse_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; *res = isl_union_map_add_map(*res, isl_map_reverse(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_reverse(__isl_take isl_union_map *umap) @@ -1784,14 +1785,14 @@ __isl_give isl_union_map *isl_union_map_reverse(__isl_take isl_union_map *umap) return cond_un_op(umap, &reverse_entry); } -static int params_entry(void **entry, void *user) +static isl_stat params_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_params(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Compute the parameter domain of the given union map. @@ -1822,14 +1823,14 @@ __isl_give isl_set *isl_union_set_params(__isl_take isl_union_set *uset) return isl_union_map_params(uset); } -static int domain_entry(void **entry, void *user) +static isl_stat domain_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_domain(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_domain(__isl_take isl_union_map *umap) @@ -1837,14 +1838,14 @@ __isl_give isl_union_set *isl_union_map_domain(__isl_take isl_union_map *umap) return cond_un_op(umap, &domain_entry); } -static int range_entry(void **entry, void *user) +static isl_stat range_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_range(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_range(__isl_take isl_union_map *umap) @@ -1852,7 +1853,7 @@ __isl_give isl_union_set *isl_union_map_range(__isl_take isl_union_map *umap) return cond_un_op(umap, &range_entry); } -static int domain_map_entry(void **entry, void *user) +static isl_stat domain_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; @@ -1860,7 +1861,7 @@ static int domain_map_entry(void **entry, void *user) *res = isl_union_map_add_map(*res, isl_map_domain_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_domain_map( @@ -1872,7 +1873,7 @@ __isl_give isl_union_map *isl_union_map_domain_map( /* Construct an isl_pw_multi_aff that maps "map" to its domain and * add the result to "res". */ -static int domain_map_upma(__isl_take isl_map *map, void *user) +static isl_stat domain_map_upma(__isl_take isl_map *map, void *user) { isl_union_pw_multi_aff **res = user; isl_multi_aff *ma; @@ -1882,7 +1883,7 @@ static int domain_map_upma(__isl_take isl_map *map, void *user) pma = isl_pw_multi_aff_alloc(isl_map_wrap(map), ma); *res = isl_union_pw_multi_aff_add_pw_multi_aff(*res, pma); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } @@ -1902,7 +1903,7 @@ __isl_give isl_union_pw_multi_aff *isl_union_map_domain_map_union_pw_multi_aff( return res; } -static int range_map_entry(void **entry, void *user) +static isl_stat range_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; @@ -1910,7 +1911,7 @@ static int range_map_entry(void **entry, void *user) *res = isl_union_map_add_map(*res, isl_map_range_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_range_map( @@ -1922,7 +1923,7 @@ __isl_give isl_union_map *isl_union_map_range_map( /* Check if "set" is of the form A[B -> C]. * If so, add A[B -> C] -> B to "res". */ -static int wrapped_domain_map_entry(void **entry, void *user) +static isl_stat wrapped_domain_map_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; @@ -1930,14 +1931,14 @@ static int wrapped_domain_map_entry(void **entry, void *user) wrapping = isl_set_is_wrapping(set); if (wrapping < 0) - return -1; + return isl_stat_error; if (!wrapping) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_set_wrapped_domain_map(isl_set_copy(set))); - return 0; + return isl_stat_ok; } /* Given a collection of wrapped maps of the form A[B -> C], @@ -1949,18 +1950,18 @@ __isl_give isl_union_map *isl_union_set_wrapped_domain_map( return cond_un_op(uset, &wrapped_domain_map_entry); } -static int deltas_entry(void **entry, void *user) +static isl_stat deltas_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + return isl_stat_ok; *res = isl_union_set_add_set(*res, isl_map_deltas(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_deltas(__isl_take isl_union_map *umap) @@ -1968,19 +1969,19 @@ __isl_give isl_union_set *isl_union_map_deltas(__isl_take isl_union_map *umap) return cond_un_op(umap, &deltas_entry); } -static int deltas_map_entry(void **entry, void *user) +static isl_stat deltas_map_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_deltas_map(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_deltas_map( @@ -1989,14 +1990,14 @@ __isl_give isl_union_map *isl_union_map_deltas_map( return cond_un_op(umap, &deltas_map_entry); } -static int identity_entry(void **entry, void *user) +static isl_stat identity_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_map **res = user; *res = isl_union_map_add_map(*res, isl_set_identity(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_set_identity(__isl_take isl_union_set *uset) @@ -2006,7 +2007,7 @@ __isl_give isl_union_map *isl_union_set_identity(__isl_take isl_union_set *uset) /* Construct an identity isl_pw_multi_aff on "set" and add it to *res. */ -static int identity_upma(__isl_take isl_set *set, void *user) +static isl_stat identity_upma(__isl_take isl_set *set, void *user) { isl_union_pw_multi_aff **res = user; isl_space *space; @@ -2017,7 +2018,7 @@ static int identity_upma(__isl_take isl_set *set, void *user) pma = isl_pw_multi_aff_intersect_domain(pma, set); *res = isl_union_pw_multi_aff_add_pw_multi_aff(*res, pma); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* Return an identity function on "uset" in the form @@ -2038,18 +2039,18 @@ __isl_give isl_union_pw_multi_aff *isl_union_set_identity_union_pw_multi_aff( /* If "map" is of the form [A -> B] -> C, then add A -> C to "res". */ -static int domain_factor_domain_entry(void **entry, void *user) +static isl_stat domain_factor_domain_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_domain_is_wrapping(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_domain_factor_domain(isl_map_copy(map))); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* For each map in "umap" of the form [A -> B] -> C, @@ -2063,18 +2064,18 @@ __isl_give isl_union_map *isl_union_map_domain_factor_domain( /* If "map" is of the form [A -> B] -> C, then add B -> C to "res". */ -static int domain_factor_range_entry(void **entry, void *user) +static isl_stat domain_factor_range_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_domain_is_wrapping(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_domain_factor_range(isl_map_copy(map))); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* For each map in "umap" of the form [A -> B] -> C, @@ -2088,18 +2089,18 @@ __isl_give isl_union_map *isl_union_map_domain_factor_range( /* If "map" is of the form A -> [B -> C], then add A -> C to "res". */ -static int range_factor_range_entry(void **entry, void *user) +static isl_stat range_factor_range_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_range_is_wrapping(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_range_factor_range(isl_map_copy(map))); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* For each map in "umap" of the form A -> [B -> C], @@ -2113,18 +2114,18 @@ __isl_give isl_union_map *isl_union_map_range_factor_range( /* If "map" is of the form [A -> B] -> [C -> D], then add A -> C to "res". */ -static int factor_domain_entry(void **entry, void *user) +static isl_stat factor_domain_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_domain_is_wrapping(map) || !isl_map_range_is_wrapping(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_factor_domain(isl_map_copy(map))); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* For each map in "umap" of the form [A -> B] -> [C -> D], @@ -2138,18 +2139,18 @@ __isl_give isl_union_map *isl_union_map_factor_domain( /* If "map" is of the form [A -> B] -> [C -> D], then add B -> D to "res". */ -static int factor_range_entry(void **entry, void *user) +static isl_stat factor_range_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_domain_is_wrapping(map) || !isl_map_range_is_wrapping(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_factor_range(isl_map_copy(map))); - return *res ? 0 : -1; + return *res ? isl_stat_ok : isl_stat_error; } /* For each map in "umap" of the form [A -> B] -> [C -> D], @@ -2161,17 +2162,17 @@ __isl_give isl_union_map *isl_union_map_factor_range( return cond_un_op(umap, &factor_range_entry); } -static int unwrap_entry(void **entry, void *user) +static isl_stat unwrap_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; if (!isl_set_is_wrapping(set)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_set_unwrap(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_set_unwrap(__isl_take isl_union_set *uset) @@ -2179,14 +2180,14 @@ __isl_give isl_union_map *isl_union_set_unwrap(__isl_take isl_union_set *uset) return cond_un_op(uset, &unwrap_entry); } -static int wrap_entry(void **entry, void *user) +static isl_stat wrap_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_map_wrap(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_map_wrap(__isl_take isl_union_map *umap) @@ -2196,10 +2197,10 @@ __isl_give isl_union_set *isl_union_map_wrap(__isl_take isl_union_map *umap) struct isl_union_map_is_subset_data { isl_union_map *umap2; - int is_subset; + isl_bool is_subset; }; -static int is_subset_entry(void **entry, void *user) +static isl_stat is_subset_entry(void **entry, void *user) { struct isl_union_map_is_subset_data *data = user; uint32_t hash; @@ -2212,24 +2213,24 @@ static int is_subset_entry(void **entry, void *user) if (!entry2) { int empty = isl_map_is_empty(map); if (empty < 0) - return -1; + return isl_stat_error; if (empty) - return 0; + return isl_stat_ok; data->is_subset = 0; - return -1; + return isl_stat_error; } data->is_subset = isl_map_is_subset(map, entry2->data); if (data->is_subset < 0 || !data->is_subset) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int isl_union_map_is_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - struct isl_union_map_is_subset_data data = { NULL, 1 }; + struct isl_union_map_is_subset_data data = { NULL, isl_bool_true }; umap1 = isl_union_map_copy(umap1); umap2 = isl_union_map_copy(umap2); @@ -2252,52 +2253,52 @@ int isl_union_map_is_subset(__isl_keep isl_union_map *umap1, error: isl_union_map_free(umap1); isl_union_map_free(umap2); - return -1; + return isl_bool_error; } -int isl_union_set_is_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_subset(uset1, uset2); } -int isl_union_map_is_equal(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - int is_subset; + isl_bool is_subset; if (!umap1 || !umap2) - return -1; + return isl_bool_error; is_subset = isl_union_map_is_subset(umap1, umap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_union_map_is_subset(umap2, umap1); return is_subset; } -int isl_union_set_is_equal(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_equal(uset1, uset2); } -int isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - int is_subset; + isl_bool is_subset; if (!umap1 || !umap2) - return -1; + return isl_bool_error; is_subset = isl_union_map_is_subset(umap1, umap2); - if (is_subset != 1) + if (is_subset != isl_bool_true) return is_subset; is_subset = isl_union_map_is_subset(umap2, umap1); - if (is_subset == -1) + if (is_subset == isl_bool_error) return is_subset; return !is_subset; } -int isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_strict_subset(uset1, uset2); @@ -2310,13 +2311,13 @@ int isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, */ struct isl_union_map_is_disjoint_data { isl_union_map *umap2; - int is_disjoint; + isl_bool is_disjoint; }; /* Check if "map" is disjoint from data->umap2 and abort * the search if it is not. */ -static int is_disjoint_entry(void **entry, void *user) +static isl_stat is_disjoint_entry(void **entry, void *user) { struct isl_union_map_is_disjoint_data *data = user; uint32_t hash; @@ -2327,21 +2328,21 @@ static int is_disjoint_entry(void **entry, void *user) entry2 = isl_hash_table_find(data->umap2->dim->ctx, &data->umap2->table, hash, &has_dim, map->dim, 0); if (!entry2) - return 0; + return isl_stat_ok; data->is_disjoint = isl_map_is_disjoint(map, entry2->data); if (data->is_disjoint < 0 || !data->is_disjoint) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Are "umap1" and "umap2" disjoint? */ -int isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, +isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2) { - struct isl_union_map_is_disjoint_data data = { NULL, 1 }; + struct isl_union_map_is_disjoint_data data = { NULL, isl_bool_true }; umap1 = isl_union_map_copy(umap1); umap2 = isl_union_map_copy(umap2); @@ -2366,28 +2367,28 @@ int isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, error: isl_union_map_free(umap1); isl_union_map_free(umap2); - return -1; + return isl_bool_error; } /* Are "uset1" and "uset2" disjoint? */ -int isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, +isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2) { return isl_union_map_is_disjoint(uset1, uset2); } -static int sample_entry(void **entry, void *user) +static isl_stat sample_entry(void **entry, void *user) { isl_basic_map **sample = (isl_basic_map **)user; isl_map *map = *entry; *sample = isl_map_sample(isl_map_copy(map)); if (!*sample) - return -1; + return isl_stat_error; if (!isl_basic_map_plain_is_empty(*sample)) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } __isl_give isl_basic_map *isl_union_map_sample(__isl_take isl_union_map *umap) @@ -2419,100 +2420,100 @@ __isl_give isl_basic_set *isl_union_set_sample(__isl_take isl_union_set *uset) } struct isl_forall_data { - int res; - int (*fn)(__isl_keep isl_map *map); + isl_bool res; + isl_bool (*fn)(__isl_keep isl_map *map); }; -static int forall_entry(void **entry, void *user) +static isl_stat forall_entry(void **entry, void *user) { struct isl_forall_data *data = user; isl_map *map = *entry; data->res = data->fn(map); if (data->res < 0) - return -1; + return isl_stat_error; if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -static int union_map_forall(__isl_keep isl_union_map *umap, - int (*fn)(__isl_keep isl_map *map)) +static isl_bool union_map_forall(__isl_keep isl_union_map *umap, + isl_bool (*fn)(__isl_keep isl_map *map)) { - struct isl_forall_data data = { 1, fn }; + struct isl_forall_data data = { isl_bool_true, fn }; if (!umap) - return -1; + return isl_bool_error; if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, &forall_entry, &data) < 0 && data.res) - return -1; + return isl_bool_error; return data.res; } struct isl_forall_user_data { - int res; - int (*fn)(__isl_keep isl_map *map, void *user); + isl_bool res; + isl_bool (*fn)(__isl_keep isl_map *map, void *user); void *user; }; -static int forall_user_entry(void **entry, void *user) +static isl_stat forall_user_entry(void **entry, void *user) { struct isl_forall_user_data *data = user; isl_map *map = *entry; data->res = data->fn(map, data->user); if (data->res < 0) - return -1; + return isl_stat_error; if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Check if fn(map, user) returns true for all maps "map" in umap. */ -static int union_map_forall_user(__isl_keep isl_union_map *umap, - int (*fn)(__isl_keep isl_map *map, void *user), void *user) +static isl_bool union_map_forall_user(__isl_keep isl_union_map *umap, + isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user) { - struct isl_forall_user_data data = { 1, fn, user }; + struct isl_forall_user_data data = { isl_bool_true, fn, user }; if (!umap) - return -1; + return isl_bool_error; if (isl_hash_table_foreach(umap->dim->ctx, &umap->table, &forall_user_entry, &data) < 0 && data.res) - return -1; + return isl_bool_error; return data.res; } -int isl_union_map_is_empty(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap) { return union_map_forall(umap, &isl_map_is_empty); } -int isl_union_set_is_empty(__isl_keep isl_union_set *uset) +isl_bool isl_union_set_is_empty(__isl_keep isl_union_set *uset) { return isl_union_map_is_empty(uset); } -static int is_subset_of_identity(__isl_keep isl_map *map) +static isl_bool is_subset_of_identity(__isl_keep isl_map *map) { - int is_subset; + isl_bool is_subset; isl_space *dim; isl_map *id; if (!map) - return -1; + return isl_bool_error; if (!isl_space_tuple_is_equal(map->dim, isl_dim_in, map->dim, isl_dim_out)) - return 0; + return isl_bool_false; dim = isl_map_get_space(map); id = isl_map_identity(dim); @@ -2527,10 +2528,10 @@ static int is_subset_of_identity(__isl_keep isl_map *map) /* Given an isl_union_map that consists of a single map, check * if it is single-valued. */ -static int single_map_is_single_valued(__isl_keep isl_union_map *umap) +static isl_bool single_map_is_single_valued(__isl_keep isl_union_map *umap) { isl_map *map; - int sv; + isl_bool sv; umap = isl_union_map_copy(umap); map = isl_map_from_union_map(umap); @@ -2547,7 +2548,7 @@ static int single_map_is_single_valued(__isl_keep isl_union_map *umap) */ struct isl_union_map_is_sv_data { isl_union_map *umap; - int sv; + isl_bool sv; }; /* Check if the data->umap is single-valued on "set". @@ -2565,7 +2566,7 @@ struct isl_union_map_is_sv_data { * Terminate as soon as data->umap has been determined not to * be single-valued. */ -static int single_valued_on_domain(__isl_take isl_set *set, void *user) +static isl_stat single_valued_on_domain(__isl_take isl_set *set, void *user) { struct isl_union_map_is_sv_data *data = user; isl_union_map *umap, *test; @@ -2587,8 +2588,8 @@ static int single_valued_on_domain(__isl_take isl_set *set, void *user) } if (data->sv < 0 || !data->sv) - return -1; - return 0; + return isl_stat_error; + return isl_stat_ok; } /* Check if the given map is single-valued. @@ -2597,7 +2598,7 @@ static int single_valued_on_domain(__isl_take isl_set *set, void *user) * Otherwise, check if the union map is single-valued on each of its * domain spaces. */ -int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_single_valued(__isl_keep isl_union_map *umap) { isl_union_map *universe; isl_union_set *domain; @@ -2609,19 +2610,19 @@ int isl_union_map_is_single_valued(__isl_keep isl_union_map *umap) universe = isl_union_map_universe(isl_union_map_copy(umap)); domain = isl_union_map_domain(universe); - data.sv = 1; + data.sv = isl_bool_true; data.umap = umap; if (isl_union_set_foreach_set(domain, &single_valued_on_domain, &data) < 0 && data.sv) - data.sv = -1; + data.sv = isl_bool_error; isl_union_set_free(domain); return data.sv; } -int isl_union_map_is_injective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_injective(__isl_keep isl_union_map *umap) { - int in; + isl_bool in; umap = isl_union_map_copy(umap); umap = isl_union_map_reverse(umap); @@ -2689,7 +2690,7 @@ struct isl_fixed_dim_data { int pos; }; -static int fixed_at_pos(__isl_keep isl_map *map, void *user) +static isl_bool fixed_at_pos(__isl_keep isl_map *map, void *user) { struct isl_fixed_dim_data *data = user; @@ -2698,7 +2699,7 @@ static int fixed_at_pos(__isl_keep isl_map *map, void *user) &data->v[data->n++].v); } -static int plain_injective_on_range(__isl_take isl_union_map *umap, +static isl_bool plain_injective_on_range(__isl_take isl_union_map *umap, int first, int n_range); /* Given a list of the maps, with their fixed values at output dimension "pos", @@ -2762,7 +2763,7 @@ error: * and then check if these values, possibly along with fixed values * at later dimensions, entail distinct ranges. */ -static int plain_injective_on_range(__isl_take isl_union_map *umap, +static isl_bool plain_injective_on_range(__isl_take isl_union_map *umap, int first, int n_range) { isl_ctx *ctx; @@ -2777,12 +2778,12 @@ static int plain_injective_on_range(__isl_take isl_union_map *umap, if (n <= 1) { isl_union_map_free(umap); - return 1; + return isl_bool_true; } if (first >= n_range) { isl_union_map_free(umap); - return 0; + return isl_bool_false; } data.v = alloc_isl_fixed_map_array(ctx, n); @@ -2790,7 +2791,7 @@ static int plain_injective_on_range(__isl_take isl_union_map *umap, goto error; for (data.pos = first; data.pos < n_range; ++data.pos) { - int fixed; + isl_bool fixed; int injective; isl_space *dim; @@ -2809,17 +2810,18 @@ static int plain_injective_on_range(__isl_take isl_union_map *umap, free_isl_fixed_map_array(data.v, n); isl_union_map_free(umap); - return 0; + return isl_bool_false; error: free_isl_fixed_map_array(data.v, n); isl_union_map_free(umap); - return -1; + return isl_bool_error; } /* Check whether the maps in umap that map to subsets of "ran" * have obviously distinct ranges. */ -static int plain_injective_on_range_wrap(__isl_keep isl_set *ran, void *user) +static isl_bool plain_injective_on_range_wrap(__isl_keep isl_set *ran, + void *user) { isl_union_map *umap = user; @@ -2835,17 +2837,17 @@ static int plain_injective_on_range_wrap(__isl_keep isl_set *ran, void *user) * injective and then check if all the ranges of these maps are * obviously disjoint. */ -int isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap) { - int in; + isl_bool in; isl_union_map *univ; isl_union_set *ran; in = union_map_forall(umap, &isl_map_plain_is_injective); if (in < 0) - return -1; + return isl_bool_error; if (!in) - return 0; + return isl_bool_false; univ = isl_union_map_universe(isl_union_map_copy(umap)); ran = isl_union_map_range(univ); @@ -2857,9 +2859,9 @@ int isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap) return in; } -int isl_union_map_is_bijective(__isl_keep isl_union_map *umap) +isl_bool isl_union_map_is_bijective(__isl_keep isl_union_map *umap) { - int sv; + isl_bool sv; sv = isl_union_map_is_single_valued(umap); if (sv < 0 || !sv) @@ -2868,17 +2870,17 @@ int isl_union_map_is_bijective(__isl_keep isl_union_map *umap) return isl_union_map_is_injective(umap); } -static int zip_entry(void **entry, void *user) +static isl_stat zip_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_zip(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_zip(isl_map_copy(map))); - return 0; + return isl_stat_ok; } __isl_give isl_union_map *isl_union_map_zip(__isl_take isl_union_map *umap) @@ -2886,17 +2888,17 @@ __isl_give isl_union_map *isl_union_map_zip(__isl_take isl_union_map *umap) return cond_un_op(umap, &zip_entry); } -static int uncurry_entry(void **entry, void *user) +static isl_stat uncurry_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_uncurry(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_uncurry(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Given a union map, take the maps of the form A -> (B -> C) and @@ -2907,17 +2909,17 @@ __isl_give isl_union_map *isl_union_map_uncurry(__isl_take isl_union_map *umap) return cond_un_op(umap, &uncurry_entry); } -static int curry_entry(void **entry, void *user) +static isl_stat curry_entry(void **entry, void *user) { isl_map *map = *entry; isl_union_map **res = user; if (!isl_map_can_curry(map)) - return 0; + return isl_stat_ok; *res = isl_union_map_add_map(*res, isl_map_curry(isl_map_copy(map))); - return 0; + return isl_stat_ok; } /* Given a union map, take the maps of the form (A -> B) -> C and @@ -2928,14 +2930,14 @@ __isl_give isl_union_map *isl_union_map_curry(__isl_take isl_union_map *umap) return cond_un_op(umap, &curry_entry); } -static int lift_entry(void **entry, void *user) +static isl_stat lift_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; *res = isl_union_set_add_set(*res, isl_set_lift(isl_set_copy(set))); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_lift(__isl_take isl_union_set *uset) @@ -2943,7 +2945,7 @@ __isl_give isl_union_set *isl_union_set_lift(__isl_take isl_union_set *uset) return cond_un_op(uset, &lift_entry); } -static int coefficients_entry(void **entry, void *user) +static isl_stat coefficients_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; @@ -2952,7 +2954,7 @@ static int coefficients_entry(void **entry, void *user) set = isl_set_from_basic_set(isl_set_coefficients(set)); *res = isl_union_set_add_set(*res, set); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_coefficients( @@ -2980,7 +2982,7 @@ error: return NULL; } -static int solutions_entry(void **entry, void *user) +static isl_stat solutions_entry(void **entry, void *user) { isl_set *set = *entry; isl_union_set **res = user; @@ -2993,9 +2995,9 @@ static int solutions_entry(void **entry, void *user) *res = isl_union_set_add_set(*res, set); if (!*res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give isl_union_set *isl_union_set_solutions( @@ -3070,18 +3072,18 @@ struct isl_union_map_preimage_data { * space of *entry matches the target space of data->pma * (as given by data->match), and add the result to data->res. */ -static int preimage_entry(void **entry, void *user) +static isl_stat preimage_entry(void **entry, void *user) { int m; isl_map *map = *entry; struct isl_union_map_preimage_data *data = user; - int empty; + isl_bool empty; m = data->match(map, data->space); if (m < 0) - return -1; + return isl_stat_error; if (!m) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = data->fn(map, isl_pw_multi_aff_copy(data->pma)); @@ -3089,12 +3091,12 @@ static int preimage_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0 || empty) { isl_map_free(map); - return empty < 0 ? -1 : 0; + return empty < 0 ? isl_stat_error : isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the preimage of the domain or range of "umap" under the function @@ -3245,18 +3247,18 @@ struct isl_union_map_preimage_mpa_data { * space of *entry matches the target space of data->mpa * (as given by data->match), and add the result to data->res. */ -static int preimage_mpa_entry(void **entry, void *user) +static isl_stat preimage_mpa_entry(void **entry, void *user) { int m; isl_map *map = *entry; struct isl_union_map_preimage_mpa_data *data = user; - int empty; + isl_bool empty; m = data->match(map, data->space); if (m < 0) - return -1; + return isl_stat_error; if (!m) - return 0; + return isl_stat_ok; map = isl_map_copy(map); map = data->fn(map, isl_multi_pw_aff_copy(data->mpa)); @@ -3264,12 +3266,12 @@ static int preimage_mpa_entry(void **entry, void *user) empty = isl_map_is_empty(map); if (empty < 0 || empty) { isl_map_free(map); - return empty < 0 ? -1 : 0; + return empty < 0 ? isl_stat_error : isl_stat_ok; } data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Compute the preimage of the domain or range of "umap" under the function @@ -3346,7 +3348,7 @@ struct isl_union_map_preimage_upma_data { /* Call data->fn to compute the preimage of the domain or range of data->umap * under the function represented by pma and add the result to data->res. */ -static int preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user) +static isl_stat preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user) { struct isl_union_map_preimage_upma_data *data = user; isl_union_map *umap; @@ -3355,7 +3357,7 @@ static int preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user) umap = data->fn(umap, pma); data->res = isl_union_map_union(data->res, umap); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Compute the preimage of the domain or range of "umap" under the function @@ -3435,13 +3437,13 @@ __isl_give isl_union_set *isl_union_set_preimage_union_pw_multi_aff( /* Reset the user pointer on all identifiers of parameters and tuples * of the space of *entry. */ -static int reset_user(void **entry, void *user) +static isl_stat reset_user(void **entry, void *user) { isl_map **map = (isl_map **)entry; *map = isl_map_reset_user(*map); - return *map ? 0 : -1; + return *map ? isl_stat_ok : isl_stat_error; } /* Reset the user pointer on all identifiers of parameters and tuples @@ -3486,14 +3488,14 @@ struct isl_union_map_project_out_data { /* Turn the data->n dimensions of type data->type, starting at data->first * into existentially quantified variables and add the result to data->res. */ -static int project_out(__isl_take isl_map *map, void *user) +static isl_stat project_out(__isl_take isl_map *map, void *user) { struct isl_union_map_project_out_data *data = user; map = isl_map_project_out(map, data->type, data->first, data->n); data->res = isl_union_map_add_map(data->res, map); - return 0; + return isl_stat_ok; } /* Turn the "n" dimensions of type "type", starting at "first" @@ -3549,15 +3551,15 @@ struct isl_union_map_involves_dims_data { /* Does "map" _not_ involve the data->n parameters starting at data->first? */ -static int map_excludes(__isl_keep isl_map *map, void *user) +static isl_bool map_excludes(__isl_keep isl_map *map, void *user) { struct isl_union_map_involves_dims_data *data = user; - int involves; + isl_bool involves; involves = isl_map_involves_dims(map, isl_dim_param, data->first, data->n); if (involves < 0) - return -1; + return isl_bool_error; return !involves; } @@ -3569,20 +3571,20 @@ static int map_excludes(__isl_keep isl_map *map, void *user) * involve any of the parameters if all its maps to not * involve the parameters. */ -int isl_union_map_involves_dims(__isl_keep isl_union_map *umap, +isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n) { struct isl_union_map_involves_dims_data data = { first, n }; - int excludes; + isl_bool excludes; if (type != isl_dim_param) isl_die(isl_union_map_get_ctx(umap), isl_error_invalid, - "can only reference parameters", return -1); + "can only reference parameters", return isl_bool_error); excludes = union_map_forall_user(umap, &map_excludes, &data); if (excludes < 0) - return -1; + return isl_bool_error; return !excludes; } @@ -3599,7 +3601,7 @@ struct isl_union_map_reset_range_space_data { /* Replace the range space of "map" by the range space of data->range and * add the result to data->res. */ -static int reset_range_space(__isl_take isl_map *map, void *user) +static isl_stat reset_range_space(__isl_take isl_map *map, void *user) { struct isl_union_map_reset_range_space_data *data = user; isl_space *space; @@ -3611,7 +3613,7 @@ static int reset_range_space(__isl_take isl_map *map, void *user) map = isl_map_reset_space(map, space); data->res = isl_union_map_add_map(data->res, map); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Replace the range space of all the maps in "umap" by @@ -3654,7 +3656,7 @@ struct isl_union_order_at_data { * the functions in data->mupa that apply to the domain and the range * of "map" and add the result to data->res. */ -static int order_at(__isl_take isl_map *map, void *user) +static isl_stat order_at(__isl_take isl_map *map, void *user) { struct isl_union_order_at_data *data = user; isl_space *space; @@ -3669,7 +3671,7 @@ static int order_at(__isl_take isl_map *map, void *user) map = isl_map_intersect(map, order); data->res = isl_union_map_add_map(data->res, map); - return data->res ? 0 : -1; + return data->res ? isl_stat_ok : isl_stat_error; } /* Intersect each map in "umap" with the result of calling "order" diff --git a/polly/lib/External/isl/isl_union_templ.c b/polly/lib/External/isl/isl_union_templ.c index 729187138fdc..f0fb6b38e3cf 100644 --- a/polly/lib/External/isl/isl_union_templ.c +++ b/polly/lib/External/isl/isl_union_templ.c @@ -127,11 +127,11 @@ int FN(FN(UNION,n),PARTS)(__isl_keep UNION *u) S(UNION,foreach_data) { - int (*fn)(__isl_take PART *part, void *user); + isl_stat (*fn)(__isl_take PART *part, void *user); void *user; }; -static int FN(UNION,call_on_copy)(void **entry, void *user) +static isl_stat FN(UNION,call_on_copy)(void **entry, void *user) { PART *part = *entry; S(UNION,foreach_data) *data = (S(UNION,foreach_data) *)user; @@ -139,13 +139,13 @@ static int FN(UNION,call_on_copy)(void **entry, void *user) return data->fn(FN(PART,copy)(part), data->user); } -int FN(FN(UNION,foreach),PARTS)(__isl_keep UNION *u, - int (*fn)(__isl_take PART *part, void *user), void *user) +isl_stat FN(FN(UNION,foreach),PARTS)(__isl_keep UNION *u, + isl_stat (*fn)(__isl_take PART *part, void *user), void *user) { S(UNION,foreach_data) data = { fn, user }; if (!u) - return -1; + return isl_stat_error; return isl_hash_table_foreach(u->space->ctx, &u->table, &FN(UNION,call_on_copy), &data); @@ -314,13 +314,13 @@ __isl_give UNION *FN(FN(UNION,add),PARTS)(__isl_take UNION *u, return FN(UNION,add_part_generic)(u, part, 1); } -static int FN(UNION,add_part)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,add_part)(__isl_take PART *part, void *user) { UNION **u = (UNION **)user; *u = FN(FN(UNION,add),PARTS)(*u, part); - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,dup)(__isl_keep UNION *u) @@ -354,11 +354,11 @@ __isl_give UNION *FN(UNION,cow)(__isl_take UNION *u) return FN(UNION,dup)(u); } -static int FN(UNION,free_u_entry)(void **entry, void *user) +static isl_stat FN(UNION,free_u_entry)(void **entry, void *user) { PART *part = *entry; FN(PART,free)(part); - return 0; + return isl_stat_ok; } __isl_null UNION *FN(UNION,free)(__isl_take UNION *u) @@ -382,7 +382,7 @@ S(UNION,align) { UNION *res; }; -static int FN(UNION,align_entry)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,align_entry)(__isl_take PART *part, void *user) { isl_reordering *exp; S(UNION,align) *data = user; @@ -393,7 +393,7 @@ static int FN(UNION,align_entry)(__isl_take PART *part, void *user) data->res = FN(FN(UNION,add),PARTS)(data->res, FN(PART,realign_domain)(part, exp)); - return 0; + return isl_stat_ok; } /* Reorder the parameters of "u" according to the given reordering. @@ -453,13 +453,13 @@ error: /* Add "part" to *u, taking the union sum if "u" already has * a part defined on the same space as "part". */ -static int FN(UNION,union_add_part)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,union_add_part)(__isl_take PART *part, void *user) { UNION **u = (UNION **)user; *u = FN(UNION,add_part_generic)(*u, part, 0); - return 0; + return isl_stat_ok; } /* Compute the sum of "u1" and "u2" on the union of their domains, @@ -526,7 +526,7 @@ S(UNION,match_bin_data) { * If so, call data->fn on the two elements and add the result to * data->res. */ -static int FN(UNION,match_bin_entry)(void **entry, void *user) +static isl_stat FN(UNION,match_bin_entry)(void **entry, void *user) { S(UNION,match_bin_data) *data = user; uint32_t hash; @@ -542,23 +542,23 @@ static int FN(UNION,match_bin_entry)(void **entry, void *user) space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; part2 = entry2->data; if (!isl_space_tuple_is_equal(part->dim, isl_dim_out, part2->dim, isl_dim_out)) isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid, "entries should have the same range space", - return -1); + return isl_stat_error); part = FN(PART, copy)(part); part = data->fn(part, FN(PART, copy)(entry2->data)); data->res = FN(FN(UNION,add),PARTS)(data->res, part); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* This function is currently only used from isl_polynomial.c @@ -634,7 +634,7 @@ S(UNION,any_set_data) { __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*); }; -static int FN(UNION,any_set_entry)(void **entry, void *user) +static isl_stat FN(UNION,any_set_entry)(void **entry, void *user) { S(UNION,any_set_data) *data = user; PW *pw = *entry; @@ -644,9 +644,9 @@ static int FN(UNION,any_set_entry)(void **entry, void *user) data->res = FN(FN(UNION,add),PARTS)(data->res, pw); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Update each element of "u" by calling "fn" on the element and "set". @@ -719,7 +719,7 @@ static int FN(UNION,set_has_dim)(const void *entry, const void *val) * of *entry, apply data->fn to *entry and this set (if any), and add * the result to data->res. */ -static int FN(UNION,match_domain_entry)(void **entry, void *user) +static isl_stat FN(UNION,match_domain_entry)(void **entry, void *user) { S(UNION,match_domain_data) *data = user; uint32_t hash; @@ -733,16 +733,16 @@ static int FN(UNION,match_domain_entry)(void **entry, void *user) hash, &FN(UNION,set_has_dim), space, 0); isl_space_free(space); if (!entry2) - return 0; + return isl_stat_ok; pw = FN(PW,copy)(pw); pw = data->fn(pw, isl_set_copy(entry2->data)); data->res = FN(FN(UNION,add),PARTS)(data->res, pw); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Apply fn to each pair of PW in u and set in uset such that @@ -808,7 +808,7 @@ S(UNION,subtract_domain_data) { * in the same space as the domain of "pw", subtract it from the domain * of "pw" and add the result to data->res. */ -static int FN(UNION,subtract_domain_entry)(__isl_take PW *pw, void *user) +static isl_stat FN(UNION,subtract_domain_entry)(__isl_take PW *pw, void *user) { S(UNION,subtract_domain_data) *data = user; isl_space *space; @@ -819,7 +819,7 @@ static int FN(UNION,subtract_domain_entry)(__isl_take PW *pw, void *user) pw = FN(PW,subtract_domain)(pw, set); data->res = FN(FN(UNION,add),PARTS)(data->res, pw); - return 0; + return isl_stat_ok; } /* Subtract "uset' from the domain of "u". @@ -895,15 +895,15 @@ error: } #endif -static int FN(UNION,coalesce_entry)(void **entry, void *user) +static isl_stat FN(UNION,coalesce_entry)(void **entry, void *user) { PW **pw = (PW **)entry; *pw = FN(PW,coalesce)(*pw); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,coalesce)(__isl_take UNION *u) @@ -921,13 +921,13 @@ error: return NULL; } -static int FN(UNION,domain_entry)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,domain_entry)(__isl_take PART *part, void *user) { isl_union_set **uset = (isl_union_set **)user; *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part)); - return 0; + return isl_stat_ok; } __isl_give isl_union_set *FN(UNION,domain)(__isl_take UNION *u) @@ -947,16 +947,16 @@ error: return NULL; } -static int FN(UNION,mul_isl_int_entry)(void **entry, void *user) +static isl_stat FN(UNION,mul_isl_int_entry)(void **entry, void *user) { PW **pw = (PW **)entry; isl_int *v = user; *pw = FN(PW,mul_isl_int)(*pw, *v); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } __isl_give UNION *FN(UNION,mul_isl_int)(__isl_take UNION *u, isl_int v) @@ -985,7 +985,7 @@ __isl_give UNION *FN(UNION,mul_isl_int)(__isl_take UNION *u, isl_int v) u->type = isl_fold_type_negate(u->type); #endif if (isl_hash_table_foreach(u->space->ctx, &u->table, - &FN(UNION,mul_isl_int_entry), v) < 0) + &FN(UNION,mul_isl_int_entry), &v) < 0) goto error; return u; @@ -998,16 +998,16 @@ error: * * Return 0 on success and -1 on error. */ -static int FN(UNION,scale_val_entry)(void **entry, void *user) +static isl_stat FN(UNION,scale_val_entry)(void **entry, void *user) { PW **pw = (PW **)entry; isl_val *v = user; *pw = FN(PW,scale_val)(*pw, isl_val_copy(v)); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Multiply "u" by "v" and return the result. @@ -1063,16 +1063,16 @@ error: * * Return 0 on success and -1 on error. */ -static int FN(UNION,scale_down_val_entry)(void **entry, void *user) +static isl_stat FN(UNION,scale_down_val_entry)(void **entry, void *user) { PW **pw = (PW **)entry; isl_val *v = user; *pw = FN(PW,scale_down_val)(*pw, isl_val_copy(v)); if (!*pw) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Divide "u" by "v" and return the result. @@ -1117,10 +1117,10 @@ error: S(UNION,plain_is_equal_data) { UNION *u2; - int is_equal; + isl_bool is_equal; }; -static int FN(UNION,plain_is_equal_entry)(void **entry, void *user) +static isl_stat FN(UNION,plain_is_equal_entry)(void **entry, void *user) { S(UNION,plain_is_equal_data) *data = user; uint32_t hash; @@ -1132,27 +1132,27 @@ static int FN(UNION,plain_is_equal_entry)(void **entry, void *user) hash, &FN(UNION,has_same_domain_space), pw->dim, 0); if (!entry2) { - data->is_equal = 0; - return -1; + data->is_equal = isl_bool_false; + return isl_stat_error; } data->is_equal = FN(PW,plain_is_equal)(pw, entry2->data); if (data->is_equal < 0 || !data->is_equal) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } -int FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2) +isl_bool FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2) { - S(UNION,plain_is_equal_data) data = { NULL, 1 }; + S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true }; if (!u1 || !u2) - return -1; + return isl_bool_error; if (u1 == u2) - return 1; + return isl_bool_true; if (u1->table.n != u2->table.n) - return 0; + return isl_bool_false; u1 = FN(UNION,copy)(u1); u2 = FN(UNION,copy)(u2); @@ -1174,7 +1174,7 @@ int FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2) error: FN(UNION,free)(u1); FN(UNION,free)(u2); - return -1; + return isl_bool_error; } #ifndef NO_NEG @@ -1182,13 +1182,13 @@ error: * * Return 0 on success and -1 on error. */ -static int FN(UNION,neg_entry)(void **entry, void *user) +static isl_stat FN(UNION,neg_entry)(void **entry, void *user) { PW **pw = (PW **) entry; *pw = FN(PW,neg)(*pw); - return *pw ? 0 : -1; + return *pw ? isl_stat_ok : isl_stat_error; } /* Return the opposite of "u". @@ -1222,16 +1222,16 @@ S(UNION,drop_dims_data) { /* Drop the parameters specified by "data" from "part" and * add the results to data->res. */ -static int FN(UNION,drop_dims_entry)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,drop_dims_entry)(__isl_take PART *part, void *user) { S(UNION,drop_dims_data) *data = user; part = FN(PART,drop_dims)(part, data->type, data->first, data->n); data->res = FN(FN(UNION,add),PARTS)(data->res, part); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Drop the specified parameters from "u". @@ -1282,16 +1282,16 @@ S(UNION,set_dim_name_data) { /* Change the name of the parameter at position data->pos of "part" to data->s * and add the result to data->res. */ -static int FN(UNION,set_dim_name_entry)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,set_dim_name_entry)(__isl_take PART *part, void *user) { S(UNION,set_dim_name_data) *data = user; part = FN(PART,set_dim_name)(part, isl_dim_param, data->pos, data->s); data->res = FN(FN(UNION,add),PARTS)(data->res, part); if (!data->res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Change the name of the parameter at position "pos" to "s". @@ -1331,16 +1331,16 @@ __isl_give UNION *FN(UNION,set_dim_name)(__isl_take UNION *u, /* Reset the user pointer on all identifiers of parameters and tuples * of the space of "part" and add the result to *res. */ -static int FN(UNION,reset_user_entry)(__isl_take PART *part, void *user) +static isl_stat FN(UNION,reset_user_entry)(__isl_take PART *part, void *user) { UNION **res = user; part = FN(PART,reset_user)(part); *res = FN(FN(UNION,add),PARTS)(*res, part); if (!*res) - return -1; + return isl_stat_error; - return 0; + return isl_stat_ok; } /* Reset the user pointer on all identifiers of parameters and tuples diff --git a/polly/lib/External/isl/isl_val.c b/polly/lib/External/isl/isl_val.c index 2343153068b7..d0dc674342eb 100644 --- a/polly/lib/External/isl/isl_val.c +++ b/polly/lib/External/isl/isl_val.c @@ -898,14 +898,14 @@ __isl_give isl_val *isl_val_scale_down_val(__isl_take isl_val *v1, /* Given two integer values "v1" and "v2", check if "v1" is divisible by "v2". */ -int isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (!isl_val_is_int(v1) || !isl_val_is_int(v2)) isl_die(isl_val_get_ctx(v1), isl_error_invalid, - "expecting two integers", return -1); + "expecting two integers", return isl_bool_error); return isl_int_is_divisible_by(v1->n, v2->n); } @@ -1075,126 +1075,126 @@ error: /* Does "v" represent an integer value? */ -int isl_val_is_int(__isl_keep isl_val *v) +isl_bool isl_val_is_int(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_one(v->d); } /* Does "v" represent a rational value? */ -int isl_val_is_rat(__isl_keep isl_val *v) +isl_bool isl_val_is_rat(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return !isl_int_is_zero(v->d); } /* Does "v" represent NaN? */ -int isl_val_is_nan(__isl_keep isl_val *v) +isl_bool isl_val_is_nan(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_zero(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent +infinity? */ -int isl_val_is_infty(__isl_keep isl_val *v) +isl_bool isl_val_is_infty(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_pos(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent -infinity? */ -int isl_val_is_neginfty(__isl_keep isl_val *v) +isl_bool isl_val_is_neginfty(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n) && isl_int_is_zero(v->d); } /* Does "v" represent the integer zero? */ -int isl_val_is_zero(__isl_keep isl_val *v) +isl_bool isl_val_is_zero(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_zero(v->n) && !isl_int_is_zero(v->d); } /* Does "v" represent the integer one? */ -int isl_val_is_one(__isl_keep isl_val *v) +isl_bool isl_val_is_one(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_eq(v->n, v->d); } /* Does "v" represent the integer negative one? */ -int isl_val_is_negone(__isl_keep isl_val *v) +isl_bool isl_val_is_negone(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n) && isl_int_abs_eq(v->n, v->d); } /* Is "v" (strictly) positive? */ -int isl_val_is_pos(__isl_keep isl_val *v) +isl_bool isl_val_is_pos(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_pos(v->n); } /* Is "v" (strictly) negative? */ -int isl_val_is_neg(__isl_keep isl_val *v) +isl_bool isl_val_is_neg(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; return isl_int_is_neg(v->n); } /* Is "v" non-negative? */ -int isl_val_is_nonneg(__isl_keep isl_val *v) +isl_bool isl_val_is_nonneg(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; if (isl_val_is_nan(v)) - return 0; + return isl_bool_false; return isl_int_is_nonneg(v->n); } /* Is "v" non-positive? */ -int isl_val_is_nonpos(__isl_keep isl_val *v) +isl_bool isl_val_is_nonpos(__isl_keep isl_val *v) { if (!v) - return -1; + return isl_bool_error; if (isl_val_is_nan(v)) - return 0; + return isl_bool_false; return isl_int_is_nonpos(v->n); } @@ -1216,27 +1216,27 @@ int isl_val_sgn(__isl_keep isl_val *v) /* Is "v1" (strictly) less than "v2"? */ -int isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { isl_int t; - int lt; + isl_bool lt; if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_int(v1) && isl_val_is_int(v2)) return isl_int_lt(v1->n, v2->n); if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; if (isl_val_eq(v1, v2)) - return 0; + return isl_bool_false; if (isl_val_is_infty(v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v1)) - return 0; + return isl_bool_false; if (isl_val_is_neginfty(v1)) - return 1; + return isl_bool_true; if (isl_val_is_neginfty(v2)) - return 0; + return isl_bool_false; isl_int_init(t); isl_int_mul(t, v1->n, v2->d); @@ -1249,34 +1249,34 @@ int isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) /* Is "v1" (strictly) greater than "v2"? */ -int isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { return isl_val_lt(v2, v1); } /* Is "v1" less than or equal to "v2"? */ -int isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { isl_int t; - int le; + isl_bool le; if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_int(v1) && isl_val_is_int(v2)) return isl_int_le(v1->n, v2->n); if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; if (isl_val_eq(v1, v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v2)) - return 1; + return isl_bool_true; if (isl_val_is_infty(v1)) - return 0; + return isl_bool_false; if (isl_val_is_neginfty(v1)) - return 1; + return isl_bool_true; if (isl_val_is_neginfty(v2)) - return 0; + return isl_bool_false; isl_int_init(t); isl_int_mul(t, v1->n, v2->d); @@ -1289,7 +1289,7 @@ int isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2) /* Is "v1" greater than or equal to "v2"? */ -int isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { return isl_val_le(v2, v1); } @@ -1327,36 +1327,36 @@ int isl_val_cmp_si(__isl_keep isl_val *v, long i) /* Is "v1" equal to "v2"? */ -int isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; return isl_int_eq(v1->n, v2->n) && isl_int_eq(v1->d, v2->d); } /* Is "v1" equal to "v2" in absolute value? */ -int isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; return isl_int_abs_eq(v1->n, v2->n) && isl_int_eq(v1->d, v2->d); } /* Is "v1" different from "v2"? */ -int isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2) +isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2) { if (!v1 || !v2) - return -1; + return isl_bool_error; if (isl_val_is_nan(v1) || isl_val_is_nan(v2)) - return 0; + return isl_bool_false; return isl_int_ne(v1->n, v2->n) || isl_int_ne(v1->d, v2->d); } diff --git a/polly/lib/External/isl/isl_vec.c b/polly/lib/External/isl/isl_vec.c index a8582be39961..0ed6f7d55e5a 100644 --- a/polly/lib/External/isl/isl_vec.c +++ b/polly/lib/External/isl/isl_vec.c @@ -270,13 +270,13 @@ int isl_vec_cmp_element(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2, return isl_int_cmp(vec1->el[pos], vec2->el[pos]); } -int isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2) +isl_bool isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2) { if (!vec1 || !vec2) - return -1; + return isl_bool_error; if (vec1->size != vec2->size) - return 0; + return isl_bool_false; return isl_seq_eq(vec1->el, vec2->el, vec1->size); } diff --git a/polly/lib/External/isl/isl_vertices.c b/polly/lib/External/isl/isl_vertices.c index 4e17b11cc214..6e74a4fa3688 100644 --- a/polly/lib/External/isl/isl_vertices.c +++ b/polly/lib/External/isl/isl_vertices.c @@ -623,7 +623,7 @@ static int add_chamber(struct isl_chamber_list **list, c->c.vertices = isl_alloc_array(tab->mat->ctx, int, n_vertices); if (n_vertices && !c->c.vertices) goto error; - c->c.dom = isl_basic_set_from_basic_map(isl_basic_map_copy(tab->bmap)); + c->c.dom = isl_basic_set_copy(isl_tab_peek_bset(tab)); c->c.dom = isl_basic_set_set_rational(c->c.dom); c->c.dom = isl_basic_set_cow(c->c.dom); c->c.dom = isl_basic_set_update_from_tab(c->c.dom, tab); @@ -700,7 +700,7 @@ static struct isl_facet_todo *create_todo(struct isl_tab *tab, int con) if (!todo->constraint) goto error; isl_seq_neg(todo->constraint->el, tab->bmap->ineq[con], 1 + tab->n_var); - todo->bset = isl_basic_set_from_basic_map(isl_basic_map_copy(tab->bmap)); + todo->bset = isl_basic_set_copy(isl_tab_peek_bset(tab)); todo->bset = isl_basic_set_set_rational(todo->bset); todo->bset = isl_basic_set_cow(todo->bset); todo->bset = isl_basic_set_update_from_tab(todo->bset, tab); @@ -1260,87 +1260,87 @@ error: return -1; } -int isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_cell *cell, void *user), void *user) +isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_cell *cell, void *user), void *user) { int i; isl_cell *cell; if (!vertices) - return -1; + return isl_stat_error; if (vertices->n_chambers == 0) - return 0; + return isl_stat_ok; for (i = 0; i < vertices->n_chambers; ++i) { - int r; + isl_stat r; isl_basic_set *dom = isl_basic_set_copy(vertices->c[i].dom); cell = isl_cell_alloc(isl_vertices_copy(vertices), dom, i); if (!cell) - return -1; + return isl_stat_error; r = fn(cell, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) +isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) { int i; isl_vertex *vertex; if (!vertices) - return -1; + return isl_stat_error; if (vertices->n_vertices == 0) - return 0; + return isl_stat_ok; for (i = 0; i < vertices->n_vertices; ++i) { - int r; + isl_stat r; vertex = isl_vertex_alloc(isl_vertices_copy(vertices), i); if (!vertex) - return -1; + return isl_stat_error; r = fn(vertex, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } -int isl_cell_foreach_vertex(__isl_keep isl_cell *cell, - int (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) +isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, + isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user) { int i; isl_vertex *vertex; if (!cell) - return -1; + return isl_stat_error; if (cell->n_vertices == 0) - return 0; + return isl_stat_ok; for (i = 0; i < cell->n_vertices; ++i) { - int r; + isl_stat r; vertex = isl_vertex_alloc(isl_vertices_copy(cell->vertices), cell->ids[i]); if (!vertex) - return -1; + return isl_stat_error; r = fn(vertex, user); if (r < 0) - return -1; + return isl_stat_error; } - return 0; + return isl_stat_ok; } isl_ctx *isl_vertices_get_ctx(__isl_keep isl_vertices *vertices) diff --git a/polly/lib/External/isl/pip.c b/polly/lib/External/isl/pip.c index 707da1c4993f..449293bd91c5 100644 --- a/polly/lib/External/isl/pip.c +++ b/polly/lib/External/isl/pip.c @@ -199,7 +199,7 @@ struct isl_scan_pip { * Otherwise, the optimal solution, should be equal to the result of * plugging in the value of the parameters in "sol". */ -static int scan_one(struct isl_scan_callback *callback, +static isl_stat scan_one(struct isl_scan_callback *callback, __isl_take isl_vec *sample) { struct isl_scan_pip *sp = (struct isl_scan_pip *)callback; @@ -231,7 +231,7 @@ static int scan_one(struct isl_scan_callback *callback, fflush(stdout); } - return sp->n >= 1 ? 0 : -1; + return sp->n >= 1 ? isl_stat_ok : isl_stat_error; } static void check_solution(isl_basic_set *bset, isl_basic_set *context, diff --git a/polly/lib/External/isl/polytope_scan.c b/polly/lib/External/isl/polytope_scan.c index 3fb3a4da4604..c78743252fbd 100644 --- a/polly/lib/External/isl/polytope_scan.c +++ b/polly/lib/External/isl/polytope_scan.c @@ -28,7 +28,7 @@ struct scan_samples { struct isl_mat *samples; }; -static int scan_samples_add_sample(struct isl_scan_callback *cb, +static isl_stat scan_samples_add_sample(struct isl_scan_callback *cb, __isl_take isl_vec *sample) { struct scan_samples *ss = (struct scan_samples *)cb; @@ -42,10 +42,10 @@ static int scan_samples_add_sample(struct isl_scan_callback *cb, sample->el, sample->size); isl_vec_free(sample); - return 0; + return isl_stat_ok; error: isl_vec_free(sample); - return -1; + return isl_stat_error; } static struct isl_mat *isl_basic_set_scan_samples(struct isl_basic_set *bset) diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index bef235406669..97b701c11308 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -315,7 +315,7 @@ isl_schedule_node *IslScheduleOptimizer::optimizeBand(isl_schedule_node *Node, __isl_give isl_union_map * IslScheduleOptimizer::getScheduleMap(__isl_keep isl_schedule *Schedule) { isl_schedule_node *Root = isl_schedule_get_root(Schedule); - Root = isl_schedule_node_map_descendant( + Root = isl_schedule_node_map_descendant_bottom_up( Root, IslScheduleOptimizer::optimizeBand, NULL); auto ScheduleMap = isl_schedule_node_get_subtree_schedule_union_map(Root); ScheduleMap = isl_union_map_detect_equalities(ScheduleMap);