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
This commit is contained in:
Tobias Grosser 2015-05-28 13:32:11 +00:00
parent b1f24ad3cf
commit b2f399264d
99 changed files with 2419 additions and 3534 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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<struct FindValuesUser *>(UserPtr);
const ScopStmt *Stmt = static_cast<const ScopStmt *>(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,

View File

@ -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,

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -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.

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

File diff suppressed because it is too large Load Diff

View File

@ -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 */

View File

@ -30,8 +30,6 @@
#include <ctype.h>
#include <assert.h>
/* {{{ 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 */

View File

@ -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 */

View File

@ -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;
}
/* }}} */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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(

View File

@ -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(

View File

@ -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,

View File

@ -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);

View File

@ -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(

View File

@ -14,7 +14,6 @@
#include <stdlib.h>
#include <isl/arg.h>
#include <isl/hash.h>
#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) \

View File

@ -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);

View File

@ -11,13 +11,8 @@
#define ISL_HASH_H
#include <stdlib.h>
// 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 <stdint.h>
// #include <isl/stdint.h>
#include <isl/stdint.h>
#include <isl/ctx.h>
#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);

View File

@ -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)(

View File

@ -4,6 +4,7 @@
#include <isl/ctx.h>
#include <isl/list.h>
#include <isl/printer.h>
#include <isl/stdint.h>
#if defined(__cplusplus)
extern "C" {

View File

@ -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); \

View File

@ -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(

View File

@ -22,6 +22,7 @@
#include <isl/list.h>
#include <isl/map_type.h>
#include <isl/val.h>
#include <isl/stdint.h>
#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);

View File

@ -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( \

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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(

View File

@ -17,6 +17,7 @@
#include <isl/point.h>
#include <isl/local_space.h>
#include <isl/val.h>
#include <isl/stdint.h>
#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);

View File

@ -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,

View File

@ -0,0 +1 @@
#include <stdint.h>

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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)
}

View File

@ -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

View File

@ -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

View File

@ -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));

View File

@ -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".

View File

@ -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)(

View File

@ -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);
}

View File

@ -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

View File

@ -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".

View File

@ -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(

View File

@ -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)

View File

@ -1,3 +1,4 @@
#include <isl/constraint.h>
#include <isl/set.h>
/* 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);
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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(

View File

@ -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,

View File

@ -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".

View File

@ -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)

View File

@ -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,

File diff suppressed because it is too large Load Diff

View File

@ -111,6 +111,49 @@ struct isl_map {
#include <isl_list_templ.h>
__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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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

View File

@ -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(

View File

@ -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);
}

View File

@ -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(

View File

@ -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);

View File

@ -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

View File

@ -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,

View File

@ -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)

View File

@ -14,7 +14,8 @@
#include <isl/vec.h>
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,

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);
}

View File

@ -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".

View File

@ -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);

View File

@ -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);

View File

@ -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];
}

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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".

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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,

View File

@ -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)

View File

@ -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);