Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
#ifndef ISL_AFF_TYPE_H
#define ISL_AFF_TYPE_H
#include <isl/list.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct __isl_subclass(isl_multi_aff) __isl_subclass(isl_pw_aff) isl_aff;
typedef struct isl_aff isl_aff;
ISL_DECLARE_LIST(aff)
struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_pw_multi_aff)
__isl_subclass(isl_union_pw_aff) isl_pw_aff;
typedef struct isl_pw_aff isl_pw_aff;
ISL_DECLARE_LIST(pw_aff)
struct __isl_subclass(isl_multi_union_pw_aff)
__isl_subclass(isl_union_pw_multi_aff) isl_union_pw_aff;
typedef struct isl_union_pw_aff isl_union_pw_aff;
ISL_DECLARE_LIST_TYPE(union_pw_aff)
struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_pw_multi_aff)
isl_multi_aff;
typedef struct isl_multi_aff isl_multi_aff;
struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_union_pw_multi_aff)
isl_pw_multi_aff;
typedef struct isl_pw_multi_aff isl_pw_multi_aff;
struct __isl_export isl_union_pw_multi_aff;
typedef struct isl_union_pw_multi_aff isl_union_pw_multi_aff;
ISL_DECLARE_LIST_TYPE(union_pw_multi_aff)
struct __isl_subclass(isl_multi_union_pw_aff) isl_multi_pw_aff;
typedef struct isl_multi_pw_aff isl_multi_pw_aff;
struct __isl_export isl_multi_union_pw_aff;
typedef struct isl_multi_union_pw_aff isl_multi_union_pw_aff;
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,324 @@
/*
* Copyright 2008-2009 Katholieke Universiteit Leuven
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, K.U.Leuven, Departement
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
#ifndef ISL_ARG_H
#define ISL_ARG_H
#include <stddef.h>
#include <stdlib.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct isl_arg_choice {
const char *name;
unsigned value;
};
struct isl_arg_flags {
const char *name;
unsigned mask;
unsigned value;
};
enum isl_arg_type {
isl_arg_end,
isl_arg_alias,
isl_arg_arg,
isl_arg_bool,
isl_arg_child,
isl_arg_choice,
isl_arg_flags,
isl_arg_footer,
isl_arg_int,
isl_arg_user,
isl_arg_long,
isl_arg_ulong,
isl_arg_str,
isl_arg_str_list,
isl_arg_version
};
struct isl_args;
struct isl_arg {
enum isl_arg_type type;
char short_name;
const char *long_name;
const char *argument_name;
size_t offset;
const char *help_msg;
#define ISL_ARG_SINGLE_DASH (1 << 0)
#define ISL_ARG_BOOL_ARG (1 << 1)
#define ISL_ARG_HIDDEN (1 << 2)
unsigned flags;
union {
struct {
struct isl_arg_choice *choice;
unsigned default_value;
unsigned default_selected;
int (*set)(void *opt, unsigned val);
} choice;
struct {
struct isl_arg_flags *flags;
unsigned default_value;
} flags;
struct {
unsigned default_value;
int (*set)(void *opt, unsigned val);
} b;
struct {
int default_value;
} i;
struct {
long default_value;
long default_selected;
int (*set)(void *opt, long val);
} l;
struct {
unsigned long default_value;
} ul;
struct {
const char *default_value;
} str;
struct {
size_t offset_n;
} str_list;
struct {
struct isl_args *child;
} child;
struct {
void (*print_version)(void);
} version;
struct {
int (*init)(void*);
void (*clear)(void*);
} user;
} u;
};
struct isl_args {
size_t options_size;
struct isl_arg *args;
};
#define ISL_ARGS_START(s,name) \
struct isl_arg name ## LIST[]; \
struct isl_args name = { sizeof(s), name ## LIST }; \
struct isl_arg name ## LIST[] = {
#define ISL_ARGS_END \
{ isl_arg_end } };
#define ISL_ARG_ALIAS(l) { \
.type = isl_arg_alias, \
.long_name = l, \
},
#define ISL_ARG_ARG(st,f,a,d) { \
.type = isl_arg_arg, \
.argument_name = a, \
.offset = offsetof(st, f), \
.u = { .str = { .default_value = d } } \
},
#define ISL_ARG_FOOTER(h) { \
.type = isl_arg_footer, \
.help_msg = h, \
},
#define ISL_ARG_CHOICE(st,f,s,l,c,d,h) { \
.type = isl_arg_choice, \
.short_name = s, \
.long_name = l, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .choice = { .choice = c, .default_value = d, \
.default_selected = d, .set = NULL } } \
},
#define ISL_ARG_OPT_CHOICE(st,f,s,l,c,d,ds,h) { \
.type = isl_arg_choice, \
.short_name = s, \
.long_name = l, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .choice = { .choice = c, .default_value = d, \
.default_selected = ds, .set = NULL } } \
},
#define ISL_ARG_PHANTOM_USER_CHOICE_F(s,l,c,setter,d,h,fl) { \
.type = isl_arg_choice, \
.short_name = s, \
.long_name = l, \
.offset = -1, \
.help_msg = h, \
.flags = fl, \
.u = { .choice = { .choice = c, .default_value = d, \
.default_selected = d, .set = setter } } \
},
#define ISL_ARG_USER_OPT_CHOICE(st,f,s,l,c,setter,d,ds,h) { \
.type = isl_arg_choice, \
.short_name = s, \
.long_name = l, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .choice = { .choice = c, .default_value = d, \
.default_selected = ds, .set = setter } } \
},
#define _ISL_ARG_BOOL_F(o,s,l,setter,d,h,fl) { \
.type = isl_arg_bool, \
.short_name = s, \
.long_name = l, \
.offset = o, \
.help_msg = h, \
.flags = fl, \
.u = { .b = { .default_value = d, .set = setter } } \
},
#define ISL_ARG_BOOL_F(st,f,s,l,d,h,fl) \
_ISL_ARG_BOOL_F(offsetof(st, f),s,l,NULL,d,h,fl)
#define ISL_ARG_BOOL(st,f,s,l,d,h) \
ISL_ARG_BOOL_F(st,f,s,l,d,h,0)
#define ISL_ARG_PHANTOM_BOOL_F(s,l,setter,h,fl) \
_ISL_ARG_BOOL_F(-1,s,l,setter,0,h,fl)
#define ISL_ARG_PHANTOM_BOOL(s,l,setter,h) \
ISL_ARG_PHANTOM_BOOL_F(s,l,setter,h,0)
#define ISL_ARG_INT_F(st,f,s,l,a,d,h,fl) { \
.type = isl_arg_int, \
.short_name = s, \
.long_name = l, \
.argument_name = a, \
.offset = offsetof(st, f), \
.help_msg = h, \
.flags = fl, \
.u = { .ul = { .default_value = d } } \
},
#define ISL_ARG_INT(st,f,s,l,a,d,h) \
ISL_ARG_INT_F(st,f,s,l,a,d,h,0)
#define ISL_ARG_LONG(st,f,s,lo,d,h) { \
.type = isl_arg_long, \
.short_name = s, \
.long_name = lo, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .l = { .default_value = d, .default_selected = d, \
.set = NULL } } \
},
#define ISL_ARG_USER_LONG(st,f,s,lo,setter,d,h) { \
.type = isl_arg_long, \
.short_name = s, \
.long_name = lo, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .l = { .default_value = d, .default_selected = d, \
.set = setter } } \
},
#define ISL_ARG_OPT_LONG(st,f,s,lo,d,ds,h) { \
.type = isl_arg_long, \
.short_name = s, \
.long_name = lo, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .l = { .default_value = d, .default_selected = ds, \
.set = NULL } } \
},
#define ISL_ARG_ULONG(st,f,s,l,d,h) { \
.type = isl_arg_ulong, \
.short_name = s, \
.long_name = l, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .ul = { .default_value = d } } \
},
#define ISL_ARG_STR_F(st,f,s,l,a,d,h,fl) { \
.type = isl_arg_str, \
.short_name = s, \
.long_name = l, \
.argument_name = a, \
.offset = offsetof(st, f), \
.help_msg = h, \
.flags = fl, \
.u = { .str = { .default_value = d } } \
},
#define ISL_ARG_STR(st,f,s,l,a,d,h) \
ISL_ARG_STR_F(st,f,s,l,a,d,h,0)
#define ISL_ARG_STR_LIST(st,f_n,f_l,s,l,a,h) { \
.type = isl_arg_str_list, \
.short_name = s, \
.long_name = l, \
.argument_name = a, \
.offset = offsetof(st, f_l), \
.help_msg = h, \
.u = { .str_list = { .offset_n = offsetof(st, f_n) } } \
},
#define _ISL_ARG_CHILD(o,l,c,h,fl) { \
.type = isl_arg_child, \
.long_name = l, \
.offset = o, \
.help_msg = h, \
.flags = fl, \
.u = { .child = { .child = c } } \
},
#define ISL_ARG_CHILD(st,f,l,c,h) \
_ISL_ARG_CHILD(offsetof(st, f),l,c,h,0)
#define ISL_ARG_GROUP_F(l,c,h,fl) \
_ISL_ARG_CHILD(-1,l,c,h,fl)
#define ISL_ARG_GROUP(l,c,h) \
ISL_ARG_GROUP_F(l,c,h,0)
#define ISL_ARG_FLAGS(st,f,s,l,c,d,h) { \
.type = isl_arg_flags, \
.short_name = s, \
.long_name = l, \
.offset = offsetof(st, f), \
.help_msg = h, \
.u = { .flags = { .flags = c, .default_value = d } } \
},
#define ISL_ARG_USER(st,f,i,c) { \
.type = isl_arg_user, \
.offset = offsetof(st, f), \
.u = { .user = { .init = i, .clear = c} } \
},
#define ISL_ARG_VERSION(print) { \
.type = isl_arg_version, \
.u = { .version = { .print_version = print } } \
},
#define ISL_ARG_ALL (1 << 0)
#define ISL_ARG_SKIP_HELP (1 << 1)
void isl_args_set_defaults(struct isl_args *args, void *opt);
void isl_args_free(struct isl_args *args, void *opt);
int isl_args_parse(struct isl_args *args, int argc, char **argv, void *opt,
unsigned flags);
#define ISL_ARG_DECL(prefix,st,args) \
extern struct isl_args args; \
st *prefix ## _new_with_defaults(void); \
void prefix ## _free(st *opt); \
int prefix ## _parse(st *opt, int argc, char **argv, unsigned flags);
#define ISL_ARG_DEF(prefix,st,args) \
st *prefix ## _new_with_defaults() \
{ \
st *opt = (st *)calloc(1, sizeof(st)); \
if (opt) \
isl_args_set_defaults(&(args), opt); \
return opt; \
} \
\
void prefix ## _free(st *opt) \
{ \
isl_args_free(&(args), opt); \
} \
\
int prefix ## _parse(st *opt, int argc, char **argv, unsigned flags) \
{ \
return isl_args_parse(&(args), argc, argv, opt, flags); \
}
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,193 @@
#ifndef ISL_AST_H
#define ISL_AST_H
#include <isl/ctx.h>
#include <isl/ast_type.h>
#include <isl/id.h>
#include <isl/id_to_ast_expr.h>
#include <isl/val.h>
#include <isl/list.h>
#include <isl/printer.h>
#if defined(__cplusplus)
extern "C" {
#endif
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);
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);
__isl_give isl_ast_expr *isl_ast_expr_from_id(__isl_take isl_id *id);
__isl_give isl_ast_expr *isl_ast_expr_neg(__isl_take isl_ast_expr *expr);
__isl_give isl_ast_expr *isl_ast_expr_add(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_sub(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_mul(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_div(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_pdiv_q(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_pdiv_r(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_and(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_and_then(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_or(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_or_else(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_le(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_lt(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_ge(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_gt(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_eq(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2);
__isl_give isl_ast_expr *isl_ast_expr_access(__isl_take isl_ast_expr *array,
__isl_take isl_ast_expr_list *indices);
__isl_give isl_ast_expr *isl_ast_expr_call(__isl_take isl_ast_expr *function,
__isl_take isl_ast_expr_list *arguments);
__isl_give isl_ast_expr *isl_ast_expr_address_of(__isl_take isl_ast_expr *expr);
__isl_give isl_ast_expr *isl_ast_expr_copy(__isl_keep isl_ast_expr *expr);
__isl_null isl_ast_expr *isl_ast_expr_free(__isl_take isl_ast_expr *expr);
isl_ctx *isl_ast_expr_get_ctx(__isl_keep isl_ast_expr *expr);
enum isl_ast_expr_type isl_ast_expr_get_type(__isl_keep isl_ast_expr *expr);
__isl_give isl_val *isl_ast_expr_get_val(__isl_keep isl_ast_expr *expr);
__isl_give isl_id *isl_ast_expr_get_id(__isl_keep isl_ast_expr *expr);
enum isl_ast_op_type isl_ast_expr_get_op_type(__isl_keep isl_ast_expr *expr);
int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr);
__isl_give isl_ast_expr *isl_ast_expr_get_op_arg(__isl_keep isl_ast_expr *expr,
int pos);
__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);
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(
__isl_take isl_ast_expr *expr, __isl_take isl_id_to_ast_expr *id2expr);
__isl_give isl_printer *isl_printer_print_ast_expr(__isl_take isl_printer *p,
__isl_keep isl_ast_expr *expr);
void isl_ast_expr_dump(__isl_keep isl_ast_expr *expr);
__isl_give char *isl_ast_expr_to_str(__isl_keep isl_ast_expr *expr);
__isl_export
__isl_give char *isl_ast_expr_to_C_str(__isl_keep isl_ast_expr *expr);
__isl_give isl_ast_node *isl_ast_node_alloc_user(__isl_take isl_ast_expr *expr);
__isl_give isl_ast_node *isl_ast_node_copy(__isl_keep isl_ast_node *node);
__isl_null isl_ast_node *isl_ast_node_free(__isl_take isl_ast_node *node);
isl_ctx *isl_ast_node_get_ctx(__isl_keep isl_ast_node *node);
enum isl_ast_node_type isl_ast_node_get_type(__isl_keep isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_set_annotation(
__isl_take isl_ast_node *node, __isl_take isl_id *annotation);
__isl_give isl_id *isl_ast_node_get_annotation(__isl_keep isl_ast_node *node);
__isl_give isl_ast_expr *isl_ast_node_for_get_iterator(
__isl_keep isl_ast_node *node);
__isl_give isl_ast_expr *isl_ast_node_for_get_init(
__isl_keep isl_ast_node *node);
__isl_give isl_ast_expr *isl_ast_node_for_get_cond(
__isl_keep isl_ast_node *node);
__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);
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);
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);
__isl_give isl_ast_node_list *isl_ast_node_block_get_children(
__isl_keep isl_ast_node *node);
__isl_give isl_id *isl_ast_node_mark_get_id(__isl_keep isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_mark_get_node(
__isl_keep isl_ast_node *node);
__isl_give isl_ast_expr *isl_ast_node_user_get_expr(
__isl_keep isl_ast_node *node);
isl_stat isl_ast_node_foreach_descendant_top_down(
__isl_keep isl_ast_node *node,
isl_bool (*fn)(__isl_keep isl_ast_node *node, void *user), void *user);
__isl_give isl_printer *isl_printer_print_ast_node(__isl_take isl_printer *p,
__isl_keep isl_ast_node *node);
void isl_ast_node_dump(__isl_keep isl_ast_node *node);
__isl_give char *isl_ast_node_to_str(__isl_keep isl_ast_node *node);
__isl_give isl_ast_print_options *isl_ast_print_options_alloc(isl_ctx *ctx);
__isl_give isl_ast_print_options *isl_ast_print_options_copy(
__isl_keep isl_ast_print_options *options);
__isl_null isl_ast_print_options *isl_ast_print_options_free(
__isl_take isl_ast_print_options *options);
isl_ctx *isl_ast_print_options_get_ctx(
__isl_keep isl_ast_print_options *options);
__isl_give isl_ast_print_options *isl_ast_print_options_set_print_user(
__isl_take isl_ast_print_options *options,
__isl_give isl_printer *(*print_user)(__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options,
__isl_keep isl_ast_node *node, void *user),
void *user);
__isl_give isl_ast_print_options *isl_ast_print_options_set_print_for(
__isl_take isl_ast_print_options *options,
__isl_give isl_printer *(*print_for)(__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options,
__isl_keep isl_ast_node *node, void *user),
void *user);
isl_stat isl_options_set_ast_print_macro_once(isl_ctx *ctx, int val);
int isl_options_get_ast_print_macro_once(isl_ctx *ctx);
isl_stat isl_ast_expr_foreach_ast_op_type(__isl_keep isl_ast_expr *expr,
isl_stat (*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_set_print_name(
__isl_take isl_printer *p, enum isl_ast_op_type type,
__isl_keep const char *name);
__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_expr_print_macros(
__isl_keep isl_ast_expr *expr, __isl_take isl_printer *p);
__isl_give isl_printer *isl_ast_node_print_macros(
__isl_keep isl_ast_node *node, __isl_take isl_printer *p);
__isl_give isl_printer *isl_ast_node_print(__isl_keep isl_ast_node *node,
__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options);
__isl_give isl_printer *isl_ast_node_for_print(__isl_keep isl_ast_node *node,
__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options);
__isl_give isl_printer *isl_ast_node_if_print(__isl_keep isl_ast_node *node,
__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options);
__isl_export
__isl_give char *isl_ast_node_to_C_str(__isl_keep isl_ast_node *node);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,128 @@
#ifndef ISL_AST_CONTEXT_H
#define ISL_AST_CONTEXT_H
#include <isl/ctx.h>
#include <isl/set.h>
#include <isl/ast.h>
#include <isl/schedule.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct __isl_export isl_ast_build;
typedef struct isl_ast_build isl_ast_build;
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);
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);
isl_stat isl_options_set_ast_build_detect_min_max(isl_ctx *ctx, int val);
int isl_options_get_ast_build_detect_min_max(isl_ctx *ctx);
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);
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
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);
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);
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);
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);
__isl_constructor
__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx);
__isl_export
__isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set);
__isl_give isl_space *isl_ast_build_get_schedule_space(
__isl_keep isl_ast_build *build);
__isl_give isl_union_map *isl_ast_build_get_schedule(
__isl_keep isl_ast_build *build);
__isl_give isl_ast_build *isl_ast_build_restrict(
__isl_take isl_ast_build *build, __isl_take isl_set *set);
__isl_give isl_ast_build *isl_ast_build_copy(
__isl_keep isl_ast_build *build);
__isl_null isl_ast_build *isl_ast_build_free(
__isl_take isl_ast_build *build);
__isl_give isl_ast_build *isl_ast_build_set_options(
__isl_take isl_ast_build *build,
__isl_take isl_union_map *options);
__isl_give isl_ast_build *isl_ast_build_set_iterators(
__isl_take isl_ast_build *build,
__isl_take isl_id_list *iterators);
__isl_give isl_ast_build *isl_ast_build_set_at_each_domain(
__isl_take isl_ast_build *build,
__isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node,
__isl_keep isl_ast_build *build, void *user), void *user);
__isl_give isl_ast_build *isl_ast_build_set_before_each_for(
__isl_take isl_ast_build *build,
__isl_give isl_id *(*fn)(__isl_keep isl_ast_build *build,
void *user), void *user);
__isl_give isl_ast_build *isl_ast_build_set_after_each_for(
__isl_take isl_ast_build *build,
__isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node,
__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,
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,
__isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node,
__isl_keep isl_ast_build *build, void *user), void *user);
__isl_give isl_ast_build *isl_ast_build_set_create_leaf(
__isl_take isl_ast_build *build,
__isl_give isl_ast_node *(*fn)(__isl_take isl_ast_build *build,
void *user), void *user);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_expr_from_set(
__isl_keep isl_ast_build *build, __isl_take isl_set *set);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_access_from_pw_multi_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa);
__isl_give isl_ast_node *isl_ast_build_node_from_schedule(
__isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule);
__isl_export
__isl_give isl_ast_node *isl_ast_build_node_from_schedule_map(
__isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule);
__isl_give isl_ast_node *isl_ast_build_ast_from_schedule(
__isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,80 @@
#ifndef ISL_AST_TYPE_H
#define ISL_AST_TYPE_H
#include <isl/list.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct __isl_export isl_ast_expr;
typedef struct isl_ast_expr isl_ast_expr;
struct __isl_export isl_ast_node;
typedef struct isl_ast_node isl_ast_node;
enum isl_ast_op_type {
isl_ast_op_error = -1,
isl_ast_op_and,
isl_ast_op_and_then,
isl_ast_op_or,
isl_ast_op_or_else,
isl_ast_op_max,
isl_ast_op_min,
isl_ast_op_minus,
isl_ast_op_add,
isl_ast_op_sub,
isl_ast_op_mul,
isl_ast_op_div,
isl_ast_op_fdiv_q, /* Round towards -infty */
isl_ast_op_pdiv_q, /* Dividend is non-negative */
isl_ast_op_pdiv_r, /* Dividend is non-negative */
isl_ast_op_zdiv_r, /* Result only compared against zero */
isl_ast_op_cond,
isl_ast_op_select,
isl_ast_op_eq,
isl_ast_op_le,
isl_ast_op_lt,
isl_ast_op_ge,
isl_ast_op_gt,
isl_ast_op_call,
isl_ast_op_access,
isl_ast_op_member,
isl_ast_op_address_of
};
enum isl_ast_expr_type {
isl_ast_expr_error = -1,
isl_ast_expr_op,
isl_ast_expr_id,
isl_ast_expr_int
};
enum isl_ast_node_type {
isl_ast_node_error = -1,
isl_ast_node_for = 1,
isl_ast_node_if,
isl_ast_node_block,
isl_ast_node_mark,
isl_ast_node_user
};
enum isl_ast_loop_type {
isl_ast_loop_error = -1,
isl_ast_loop_default = 0,
isl_ast_loop_atomic,
isl_ast_loop_unroll,
isl_ast_loop_separate
};
struct isl_ast_print_options;
typedef struct isl_ast_print_options isl_ast_print_options;
ISL_DECLARE_LIST(ast_expr)
ISL_DECLARE_LIST(ast_node)
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,56 @@
#ifndef ISL_BAND_H
#define ISL_BAND_H
#include <isl/printer.h>
#include <isl/list.h>
#include <isl/union_map_type.h>
#include <isl/vec.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct isl_band;
typedef struct isl_band isl_band;
ISL_DECLARE_LIST(band)
__isl_give isl_band *isl_band_copy(__isl_keep isl_band *band);
__isl_null isl_band *isl_band_free(__isl_take isl_band *band);
isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band);
int isl_band_has_children(__isl_keep isl_band *band);
__isl_give isl_band_list *isl_band_get_children(
__isl_keep isl_band *band);
__isl_give isl_union_map *isl_band_get_prefix_schedule(
__isl_keep isl_band *band);
__isl_give isl_union_map *isl_band_get_partial_schedule(
__isl_keep isl_band *band);
__isl_give isl_union_map *isl_band_get_suffix_schedule(
__isl_keep isl_band *band);
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);
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);
int isl_band_split(__isl_keep isl_band *band, int pos);
int isl_band_n_member(__isl_keep isl_band *band);
int isl_band_member_is_coincident(__isl_keep isl_band *band, int pos);
int isl_band_list_foreach_band(__isl_keep isl_band_list *list,
int (*fn)(__isl_keep isl_band *band, void *user), void *user);
__isl_give isl_printer *isl_printer_print_band(__isl_take isl_printer *p,
__isl_keep isl_band *band);
void isl_band_dump(__isl_keep isl_band *band);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,147 @@
/*
* Copyright 2008-2009 Katholieke Universiteit Leuven
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, K.U.Leuven, Departement
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
#ifndef ISL_CONSTRAINT_H
#define ISL_CONSTRAINT_H
#include <isl/local_space.h>
#include <isl/space.h>
#include <isl/aff_type.h>
#include <isl/set_type.h>
#include <isl/list.h>
#include <isl/val.h>
#include <isl/printer.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct isl_constraint;
typedef struct isl_constraint isl_constraint;
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);
struct isl_constraint *isl_constraint_cow(struct isl_constraint *c);
struct isl_constraint *isl_constraint_copy(struct isl_constraint *c);
__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);
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(
__isl_keep isl_basic_set *bset);
int isl_constraint_is_equal(struct isl_constraint *constraint1,
struct isl_constraint *constraint2);
isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset,
enum isl_dim_type type, unsigned pos,
isl_stat (*fn)(__isl_take isl_constraint *lower,
__isl_take isl_constraint *upper,
__isl_take isl_basic_set *bset, void *user), void *user);
__isl_give isl_basic_map *isl_basic_map_add_constraint(
__isl_take isl_basic_map *bmap, __isl_take isl_constraint *constraint);
__isl_give isl_basic_set *isl_basic_set_add_constraint(
__isl_take isl_basic_set *bset, __isl_take isl_constraint *constraint);
__isl_give isl_map *isl_map_add_constraint(__isl_take isl_map *map,
__isl_take isl_constraint *constraint);
__isl_give isl_set *isl_set_add_constraint(__isl_take isl_set *set,
__isl_take isl_constraint *constraint);
isl_bool isl_basic_map_has_defining_equality(
__isl_keep isl_basic_map *bmap, enum isl_dim_type type, int pos,
__isl_give isl_constraint **c);
isl_bool isl_basic_set_has_defining_equality(
struct isl_basic_set *bset, enum isl_dim_type type, int pos,
struct isl_constraint **constraint);
isl_bool isl_basic_set_has_defining_inequalities(
struct isl_basic_set *bset, enum isl_dim_type type, int pos,
struct isl_constraint **lower,
struct isl_constraint **upper);
__isl_give isl_space *isl_constraint_get_space(
__isl_keep isl_constraint *constraint);
__isl_give isl_local_space *isl_constraint_get_local_space(
__isl_keep isl_constraint *constraint);
int isl_constraint_dim(struct isl_constraint *constraint,
enum isl_dim_type type);
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,
enum isl_dim_type type, unsigned pos);
__isl_give isl_val *isl_constraint_get_constant_val(
__isl_keep isl_constraint *constraint);
__isl_give isl_val *isl_constraint_get_coefficient_val(
__isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos);
__isl_give isl_constraint *isl_constraint_set_constant_si(
__isl_take isl_constraint *constraint, int v);
__isl_give isl_constraint *isl_constraint_set_constant_val(
__isl_take isl_constraint *constraint, __isl_take isl_val *v);
__isl_give isl_constraint *isl_constraint_set_coefficient_si(
__isl_take isl_constraint *constraint,
enum isl_dim_type type, int pos, int v);
__isl_give isl_constraint *isl_constraint_set_coefficient_val(
__isl_take isl_constraint *constraint,
enum isl_dim_type type, int pos, __isl_take isl_val *v);
__isl_give isl_aff *isl_constraint_get_div(__isl_keep isl_constraint *constraint,
int pos);
struct isl_constraint *isl_constraint_negate(struct 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);
isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint,
enum isl_dim_type type, unsigned pos);
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(
__isl_take isl_constraint *constraint);
__isl_give isl_basic_set *isl_basic_set_from_constraint(
__isl_take isl_constraint *constraint);
__isl_give isl_aff *isl_constraint_get_bound(
__isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos);
__isl_give isl_aff *isl_constraint_get_aff(
__isl_keep isl_constraint *constraint);
__isl_give isl_constraint *isl_equality_from_aff(__isl_take isl_aff *aff);
__isl_give isl_constraint *isl_inequality_from_aff(__isl_take isl_aff *aff);
int isl_constraint_plain_cmp(__isl_keep isl_constraint *c1,
__isl_keep isl_constraint *c2);
int isl_constraint_cmp_last_non_zero(__isl_keep isl_constraint *c1,
__isl_keep isl_constraint *c2);
__isl_give isl_printer *isl_printer_print_constraint(__isl_take isl_printer *p,
__isl_keep isl_constraint *c);
void isl_constraint_dump(__isl_keep isl_constraint *c);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,258 @@
/*
* Copyright 2008-2009 Katholieke Universiteit Leuven
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, K.U.Leuven, Departement
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
#ifndef ISL_CTX_H
#define ISL_CTX_H
#include <stdio.h>
#include <stdlib.h>
#include <isl/arg.h>
#ifndef __isl_give
#define __isl_give
#endif
#ifndef __isl_take
#define __isl_take
#endif
#ifndef __isl_keep
#define __isl_keep
#endif
#ifndef __isl_null
#define __isl_null
#endif
#ifndef __isl_export
#define __isl_export
#endif
#ifndef __isl_overload
#define __isl_overload
#endif
#ifndef __isl_constructor
#define __isl_constructor
#endif
#ifndef __isl_subclass
#define __isl_subclass(super)
#endif
#if defined(__cplusplus)
extern "C" {
#endif
/* Nearly all isa functions require a struct isl_ctx allocated using
* isl_ctx_alloc. This ctx contains (or will contain) options that
* control the behavior of the library and some caches.
*
* An object allocated within a given ctx should never be used inside
* another ctx. Functions for moving objects from one ctx to another
* will be added as the need arises.
*
* A given context should only be used inside a single thread.
* A global context for synchronization between different threads
* as well as functions for moving a context to a different thread
* will be added as the need arises.
*
* If anything goes wrong (out of memory, failed assertion), then
* the library will currently simply abort. This will be made
* configurable in the future.
* Users of the library should expect functions that return
* a pointer to a structure, to return NULL, indicating failure.
* Any function accepting a pointer to a structure will treat
* a NULL argument as a failure, resulting in the function freeing
* the remaining structures (if any) and returning NULL itself
* (in case of pointer return type).
* The only exception is the isl_ctx argument, which should never be NULL.
*/
struct isl_stats {
long gbr_solved_lps;
};
enum isl_error {
isl_error_none = 0,
isl_error_abort,
isl_error_alloc,
isl_error_unknown,
isl_error_internal,
isl_error_invalid,
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;
isl_bool isl_bool_not(isl_bool b);
struct isl_ctx;
typedef struct isl_ctx isl_ctx;
/* Some helper macros */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define ISL_DEPRECATED __attribute__((__deprecated__))
#else
#define ISL_DEPRECATED
#endif
#define ISL_FL_INIT(l, f) (l) = (f) /* Specific flags location. */
#define ISL_FL_SET(l, f) ((l) |= (f))
#define ISL_FL_CLR(l, f) ((l) &= ~(f))
#define ISL_FL_ISSET(l, f) (!!((l) & (f)))
#define ISL_F_INIT(p, f) ISL_FL_INIT((p)->flags, f) /* Structure element flags. */
#define ISL_F_SET(p, f) ISL_FL_SET((p)->flags, f)
#define ISL_F_CLR(p, f) ISL_FL_CLR((p)->flags, f)
#define ISL_F_ISSET(p, f) ISL_FL_ISSET((p)->flags, f)
void *isl_malloc_or_die(isl_ctx *ctx, size_t size);
void *isl_calloc_or_die(isl_ctx *ctx, size_t nmemb, size_t size);
void *isl_realloc_or_die(isl_ctx *ctx, void *ptr, size_t size);
#define isl_alloc(ctx,type,size) ((type *)isl_malloc_or_die(ctx, size))
#define isl_calloc(ctx,type,size) ((type *)isl_calloc_or_die(ctx,\
1, size))
#define isl_realloc(ctx,ptr,type,size) ((type *)isl_realloc_or_die(ctx,\
ptr, size))
#define isl_alloc_type(ctx,type) isl_alloc(ctx,type,sizeof(type))
#define isl_calloc_type(ctx,type) isl_calloc(ctx,type,sizeof(type))
#define isl_realloc_type(ctx,ptr,type) isl_realloc(ctx,ptr,type,sizeof(type))
#define isl_alloc_array(ctx,type,n) isl_alloc(ctx,type,(n)*sizeof(type))
#define isl_calloc_array(ctx,type,n) ((type *)isl_calloc_or_die(ctx,\
n, sizeof(type)))
#define isl_realloc_array(ctx,ptr,type,n) \
isl_realloc(ctx,ptr,type,(n)*sizeof(type))
#define isl_die(ctx,errno,msg,code) \
do { \
isl_handle_error(ctx, errno, msg, __FILE__, __LINE__); \
code; \
} while (0)
void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg,
const char *file, int line);
#define isl_assert4(ctx,test,code,errno) \
do { \
if (test) \
break; \
isl_die(ctx, errno, "Assertion \"" #test "\" failed", code); \
} while (0)
#define isl_assert(ctx,test,code) \
isl_assert4(ctx,test,code,isl_error_unknown)
#define isl_min(a,b) ((a < b) ? (a) : (b))
/* struct isl_ctx functions */
struct isl_options *isl_ctx_options(isl_ctx *ctx);
isl_ctx *isl_ctx_alloc_with_options(struct isl_args *args,
__isl_take void *opt);
isl_ctx *isl_ctx_alloc(void);
void *isl_ctx_peek_options(isl_ctx *ctx, struct isl_args *args);
int isl_ctx_parse_options(isl_ctx *ctx, int argc, char **argv, unsigned flags);
void isl_ctx_ref(struct isl_ctx *ctx);
void isl_ctx_deref(struct isl_ctx *ctx);
void isl_ctx_free(isl_ctx *ctx);
void isl_ctx_abort(isl_ctx *ctx);
void isl_ctx_resume(isl_ctx *ctx);
int isl_ctx_aborted(isl_ctx *ctx);
void isl_ctx_set_max_operations(isl_ctx *ctx, unsigned long max_operations);
unsigned long isl_ctx_get_max_operations(isl_ctx *ctx);
void isl_ctx_reset_operations(isl_ctx *ctx);
#define ISL_ARG_CTX_DECL(prefix,st,args) \
st *isl_ctx_peek_ ## prefix(isl_ctx *ctx);
#define ISL_ARG_CTX_DEF(prefix,st,args) \
st *isl_ctx_peek_ ## prefix(isl_ctx *ctx) \
{ \
return (st *)isl_ctx_peek_options(ctx, &(args)); \
}
#define ISL_CTX_GET_INT_DEF(prefix,st,args,field) \
int prefix ## _get_ ## field(isl_ctx *ctx) \
{ \
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 options->field; \
}
#define ISL_CTX_SET_INT_DEF(prefix,st,args,field) \
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 isl_stat_error); \
options->field = val; \
return isl_stat_ok; \
}
#define ISL_CTX_GET_STR_DEF(prefix,st,args,field) \
const char *prefix ## _get_ ## field(isl_ctx *ctx) \
{ \
st *options; \
options = isl_ctx_peek_ ## prefix(ctx); \
if (!options) \
isl_die(ctx, isl_error_invalid, \
"isl_ctx does not reference " #prefix, \
return NULL); \
return options->field; \
}
#define ISL_CTX_SET_STR_DEF(prefix,st,args,field) \
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 isl_stat_error); \
if (!val) \
return isl_stat_error; \
free(options->field); \
options->field = strdup(val); \
if (!options->field) \
return isl_stat_error; \
return isl_stat_ok; \
}
#define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field) \
ISL_CTX_GET_INT_DEF(prefix,st,args,field)
#define ISL_CTX_SET_BOOL_DEF(prefix,st,args,field) \
ISL_CTX_SET_INT_DEF(prefix,st,args,field)
#define ISL_CTX_GET_CHOICE_DEF(prefix,st,args,field) \
ISL_CTX_GET_INT_DEF(prefix,st,args,field)
#define ISL_CTX_SET_CHOICE_DEF(prefix,st,args,field) \
ISL_CTX_SET_INT_DEF(prefix,st,args,field)
enum isl_error isl_ctx_last_error(isl_ctx *ctx);
void isl_ctx_reset_error(isl_ctx *ctx);
void isl_ctx_set_error(isl_ctx *ctx, enum isl_error error);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,45 @@
#ifndef ISL_DEPRECATED_AFF_INT_H
#define ISL_DEPRECATED_AFF_INT_H
#include <isl/deprecated/int.h>
#include <isl/aff_type.h>
#if defined(__cplusplus)
extern "C" {
#endif
int isl_aff_get_constant(__isl_keep isl_aff *aff, isl_int *v);
int isl_aff_get_coefficient(__isl_keep isl_aff *aff,
enum isl_dim_type type, int pos, isl_int *v);
isl_stat isl_aff_get_denominator(__isl_keep isl_aff *aff, isl_int *v);
__isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v);
__isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff,
enum isl_dim_type type, int pos, isl_int v);
__isl_give isl_aff *isl_aff_set_denominator(__isl_take isl_aff *aff, isl_int v);
__isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v);
__isl_give isl_aff *isl_aff_add_constant_num(__isl_take isl_aff *aff,
isl_int v);
__isl_give isl_aff *isl_aff_add_coefficient(__isl_take isl_aff *aff,
enum isl_dim_type type, int pos, isl_int v);
__isl_give isl_aff *isl_aff_mod(__isl_take isl_aff *aff, isl_int mod);
__isl_give isl_aff *isl_aff_scale(__isl_take isl_aff *aff, isl_int f);
__isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f);
__isl_give isl_pw_aff *isl_pw_aff_mod(__isl_take isl_pw_aff *pwaff,
isl_int mod);
__isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff,
isl_int f);
__isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff,
isl_int f);
__isl_give isl_multi_aff *isl_multi_aff_scale(__isl_take isl_multi_aff *maff,
isl_int f);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,17 @@
#ifndef ISL_DEPRECATED_AST_INT_H
#define ISL_DEPRECATED_AST_INT_H
#include <isl/deprecated/int.h>
#include <isl/ast.h>
#if defined(__cplusplus)
extern "C" {
#endif
int isl_ast_expr_get_int(__isl_keep isl_ast_expr *expr, isl_int *v);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
#ifndef ISL_DEPRECATED_CONSTRAINT_INT_H
#define ISL_DEPRECATED_CONSTRAINT_INT_H
#include <isl/deprecated/int.h>
#include <isl/constraint.h>
#if defined(__cplusplus)
extern "C" {
#endif
void isl_constraint_get_constant(__isl_keep isl_constraint *constraint,
isl_int *v);
void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint,
enum isl_dim_type type, int pos, isl_int *v);
__isl_give isl_constraint *isl_constraint_set_constant(
__isl_take isl_constraint *constraint, isl_int v);
__isl_give isl_constraint *isl_constraint_set_coefficient(
__isl_take isl_constraint *constraint,
enum isl_dim_type type, int pos, isl_int v);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,23 @@
#ifndef ISL_DEPRECATED_ILP_INT_H
#define ISL_DEPRECATED_ILP_INT_H
#include <isl/deprecated/int.h>
#include <isl/lp.h>
#include <isl/ilp.h>
#if defined(__cplusplus)
extern "C" {
#endif
enum isl_lp_result isl_basic_set_max(__isl_keep isl_basic_set *bset,
__isl_keep isl_aff *obj, isl_int *opt);
enum isl_lp_result isl_set_min(__isl_keep isl_set *set,
__isl_keep isl_aff *obj, isl_int *opt);
enum isl_lp_result isl_set_max(__isl_keep isl_set *set,
__isl_keep isl_aff *obj, isl_int *opt);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,136 @@
/*
* Copyright 2008-2009 Katholieke Universiteit Leuven
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, K.U.Leuven, Departement
* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
#ifndef ISL_DEPRECATED_INT_H
#define ISL_DEPRECATED_INT_H
#include <isl/hash.h>
#include <string.h>
#include <gmp.h>
#if defined(__cplusplus)
#include <iostream>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef mp_get_memory_functions
void mp_get_memory_functions(
void *(**alloc_func_ptr) (size_t),
void *(**realloc_func_ptr) (void *, size_t, size_t),
void (**free_func_ptr) (void *, size_t));
#endif
/* isl_int is the basic integer type. It currently always corresponds
* to a gmp mpz_t, but in the future, different types such as long long
* or cln::cl_I will be supported.
*/
typedef mpz_t isl_int;
#define isl_int_init(i) mpz_init(i)
#define isl_int_clear(i) mpz_clear(i)
#define isl_int_set(r,i) mpz_set(r,i)
#define isl_int_set_gmp(r,i) mpz_set(r,i)
#define isl_int_set_si(r,i) mpz_set_si(r,i)
#define isl_int_set_ui(r,i) mpz_set_ui(r,i)
#define isl_int_get_gmp(i,g) mpz_set(g,i)
#define isl_int_get_si(r) mpz_get_si(r)
#define isl_int_get_ui(r) mpz_get_ui(r)
#define isl_int_get_d(r) mpz_get_d(r)
#define isl_int_get_str(r) mpz_get_str(0, 10, r)
typedef void (*isl_int_print_gmp_free_t)(void *, size_t);
#define isl_int_free_str(s) \
do { \
isl_int_print_gmp_free_t gmp_free; \
mp_get_memory_functions(NULL, NULL, &gmp_free); \
(*gmp_free)(s, strlen(s) + 1); \
} while (0)
#define isl_int_abs(r,i) mpz_abs(r,i)
#define isl_int_neg(r,i) mpz_neg(r,i)
#define isl_int_swap(i,j) mpz_swap(i,j)
#define isl_int_swap_or_set(i,j) mpz_swap(i,j)
#define isl_int_add_ui(r,i,j) mpz_add_ui(r,i,j)
#define isl_int_sub_ui(r,i,j) mpz_sub_ui(r,i,j)
#define isl_int_add(r,i,j) mpz_add(r,i,j)
#define isl_int_sub(r,i,j) mpz_sub(r,i,j)
#define isl_int_mul(r,i,j) mpz_mul(r,i,j)
#define isl_int_mul_2exp(r,i,j) mpz_mul_2exp(r,i,j)
#define isl_int_mul_ui(r,i,j) mpz_mul_ui(r,i,j)
#define isl_int_pow_ui(r,i,j) mpz_pow_ui(r,i,j)
#define isl_int_addmul(r,i,j) mpz_addmul(r,i,j)
#define isl_int_submul(r,i,j) mpz_submul(r,i,j)
#define isl_int_gcd(r,i,j) mpz_gcd(r,i,j)
#define isl_int_lcm(r,i,j) mpz_lcm(r,i,j)
#define isl_int_divexact(r,i,j) mpz_divexact(r,i,j)
#define isl_int_divexact_ui(r,i,j) mpz_divexact_ui(r,i,j)
#define isl_int_tdiv_q(r,i,j) mpz_tdiv_q(r,i,j)
#define isl_int_cdiv_q(r,i,j) mpz_cdiv_q(r,i,j)
#define isl_int_fdiv_q(r,i,j) mpz_fdiv_q(r,i,j)
#define isl_int_fdiv_r(r,i,j) mpz_fdiv_r(r,i,j)
#define isl_int_fdiv_q_ui(r,i,j) mpz_fdiv_q_ui(r,i,j)
#define isl_int_read(r,s) mpz_set_str(r,s,10)
#define isl_int_print(out,i,width) \
do { \
char *s; \
s = mpz_get_str(0, 10, i); \
fprintf(out, "%*s", width, s); \
isl_int_free_str(s); \
} while (0)
#define isl_int_sgn(i) mpz_sgn(i)
#define isl_int_cmp(i,j) mpz_cmp(i,j)
#define isl_int_cmp_si(i,si) mpz_cmp_si(i,si)
#define isl_int_eq(i,j) (mpz_cmp(i,j) == 0)
#define isl_int_ne(i,j) (mpz_cmp(i,j) != 0)
#define isl_int_lt(i,j) (mpz_cmp(i,j) < 0)
#define isl_int_le(i,j) (mpz_cmp(i,j) <= 0)
#define isl_int_gt(i,j) (mpz_cmp(i,j) > 0)
#define isl_int_ge(i,j) (mpz_cmp(i,j) >= 0)
#define isl_int_abs_eq(i,j) (mpz_cmpabs(i,j) == 0)
#define isl_int_abs_ne(i,j) (mpz_cmpabs(i,j) != 0)
#define isl_int_abs_lt(i,j) (mpz_cmpabs(i,j) < 0)
#define isl_int_abs_gt(i,j) (mpz_cmpabs(i,j) > 0)
#define isl_int_abs_ge(i,j) (mpz_cmpabs(i,j) >= 0)
#define isl_int_is_zero(i) (isl_int_sgn(i) == 0)
#define isl_int_is_one(i) (isl_int_cmp_si(i,1) == 0)
#define isl_int_is_negone(i) (isl_int_cmp_si(i,-1) == 0)
#define isl_int_is_pos(i) (isl_int_sgn(i) > 0)
#define isl_int_is_neg(i) (isl_int_sgn(i) < 0)
#define isl_int_is_nonpos(i) (isl_int_sgn(i) <= 0)
#define isl_int_is_nonneg(i) (isl_int_sgn(i) >= 0)
#define isl_int_is_divisible_by(i,j) mpz_divisible_p(i,j)
uint32_t isl_gmp_hash(mpz_t v, uint32_t hash);
#define isl_int_hash(v,h) isl_gmp_hash(v,h)
#if defined(__cplusplus)
}
#endif
#if defined(__cplusplus)
extern "C" { typedef void (*isl_gmp_free_t)(void *, size_t); }
static inline std::ostream &operator<<(std::ostream &os, isl_int i)
{
char *s;
s = mpz_get_str(0, 10, i);
os << s;
isl_int_free_str(s);
return os;
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
#ifndef ISL_DEPRECATED_MAP_INT_H
#define ISL_DEPRECATED_MAP_INT_H
#include <isl/deprecated/int.h>
#include <isl/map_type.h>
#if defined(__cplusplus)
extern "C" {
#endif
isl_bool isl_basic_map_plain_is_fixed(__isl_keep isl_basic_map *bmap,
enum isl_dim_type type, unsigned pos, isl_int *val);
__isl_give isl_map *isl_map_fix(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, isl_int value);
isl_bool isl_map_plain_is_fixed(__isl_keep isl_map *map,
enum isl_dim_type type, unsigned pos, isl_int *val);
__isl_give isl_map *isl_map_fixed_power(__isl_take isl_map *map, isl_int exp);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,19 @@
#ifndef ISL_DEPRECATED_MAT_INT_H
#define ISL_DEPRECATED_MAT_INT_H
#include <isl/deprecated/int.h>
#include <isl/mat.h>
#if defined(__cplusplus)
extern "C" {
#endif
int isl_mat_get_element(__isl_keep isl_mat *mat, int row, int col, isl_int *v);
__isl_give isl_mat *isl_mat_set_element(__isl_take isl_mat *mat,
int row, int col, isl_int v);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,20 @@
#ifndef ISL_DEPRECATED_POINT_INT_H
#define ISL_DEPRECATED_POINT_INT_H
#include <isl/deprecated/int.h>
#include <isl/point.h>
#if defined(__cplusplus)
extern "C" {
#endif
int isl_point_get_coordinate(__isl_keep isl_point *pnt,
enum isl_dim_type type, int pos, isl_int *v);
__isl_give isl_point *isl_point_set_coordinate(__isl_take isl_point *pnt,
enum isl_dim_type type, int pos, isl_int v);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,32 @@
#ifndef ISL_DEPRECATED_POLYNOMIAL_INT_H
#define ISL_DEPRECATED_POLYNOMIAL_INT_H
#include <isl/deprecated/int.h>
#include <isl/polynomial.h>
#if defined(__cplusplus)
extern "C" {
#endif
__isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain(
__isl_take isl_space *space, const isl_int n, const isl_int d);
int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp,
isl_int *n, isl_int *d);
__isl_give isl_qpolynomial *isl_qpolynomial_scale(
__isl_take isl_qpolynomial *qp, isl_int v);
void isl_term_get_num(__isl_keep isl_term *term, isl_int *n);
void isl_term_get_den(__isl_keep isl_term *term, isl_int *d);
__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale(
__isl_take isl_qpolynomial_fold *fold, isl_int v);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fix_dim(
__isl_take isl_pw_qpolynomial_fold *pwf,
enum isl_dim_type type, unsigned n, isl_int v);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,27 @@
#ifndef ISL_DEPRECATED_SET_INT_H
#define ISL_DEPRECATED_SET_INT_H
#include <isl/deprecated/int.h>
#include <isl/set_type.h>
#if defined(__cplusplus)
extern "C" {
#endif
__isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset,
enum isl_dim_type type, unsigned pos, isl_int value);
__isl_give isl_set *isl_set_lower_bound(__isl_take isl_set *set,
enum isl_dim_type type, unsigned pos, isl_int value);
__isl_give isl_set *isl_set_upper_bound(__isl_take isl_set *set,
enum isl_dim_type type, unsigned pos, isl_int value);
__isl_give isl_set *isl_set_fix(__isl_take isl_set *set,
enum isl_dim_type type, unsigned pos, isl_int value);
isl_bool isl_set_plain_is_fixed(__isl_keep isl_set *set,
enum isl_dim_type type, unsigned pos, isl_int *val);
#if defined(__cplusplus)
}
#endif
#endif

View File

@@ -0,0 +1,18 @@
#ifndef ISL_DEPRECATED_UNION_MAP_INT_H
#define ISL_DEPRECATED_UNION_MAP_INT_H
#include <isl/deprecated/int.h>
#include <isl/union_map_type.h>
#if defined(__cplusplus)
extern "C" {
#endif
__isl_give isl_union_map *isl_union_map_fixed_power(
__isl_take isl_union_map *umap, isl_int exp);
#if defined(__cplusplus)
}
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More