isl_map_coalesce: avoid ignoring constraints redundant wrt implicit equalities
[isl.git] / isl_ast_private.h
blob8bff794c0c4857c0f21b7ed6db3e995f015a8d2b
1 #ifndef ISL_AST_PRIVATE_H
2 #define ISL_AST_PRIVATE_H
4 #include <isl/aff.h>
5 #include <isl/ast.h>
6 #include <isl/set.h>
7 #include <isl/map.h>
8 #include <isl/vec.h>
9 #include <isl/list.h>
10 #include <isl/stream.h>
12 #undef EL
13 #define EL isl_ast_expr
15 #include <isl_list_templ.h>
17 /* An expression is either an integer, an identifier or an operation
18 * with zero or more arguments.
20 struct isl_ast_expr {
21 int ref;
23 isl_ctx *ctx;
25 enum isl_ast_expr_type type;
27 union {
28 isl_val *v;
29 isl_id *id;
30 struct {
31 enum isl_ast_expr_op_type op;
32 isl_ast_expr_list *args;
33 } op;
34 } u;
37 __isl_give isl_ast_expr *isl_ast_expr_alloc_int_si(isl_ctx *ctx, int i);
38 __isl_give isl_ast_expr *isl_ast_expr_alloc_op(isl_ctx *ctx,
39 enum isl_ast_expr_op_type op, int n_arg);
40 __isl_give isl_ast_expr *isl_ast_expr_op_add_arg(__isl_take isl_ast_expr *expr,
41 __isl_take isl_ast_expr *arg);
42 __isl_give isl_ast_expr *isl_ast_expr_alloc_binary(
43 enum isl_ast_expr_op_type type,
44 __isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2);
46 __isl_give isl_ast_expr *isl_stream_read_ast_expr(__isl_keep isl_stream *s);
48 #undef EL
49 #define EL isl_ast_node
51 #include <isl_list_templ.h>
53 /* A node is either a block, an if, a for, a user node or a mark node.
54 * "else_node" is NULL if the if node does not have an else branch.
55 * "cond" and "inc" are NULL for degenerate for nodes.
56 * In case of a mark node, "mark" is the mark and "node" is the marked node.
58 struct isl_ast_node {
59 int ref;
61 isl_ctx *ctx;
62 enum isl_ast_node_type type;
64 union {
65 struct {
66 isl_ast_node_list *children;
67 } b;
68 struct {
69 isl_ast_expr *guard;
70 isl_ast_node *then;
71 isl_ast_node *else_node;
72 } i;
73 struct {
74 unsigned degenerate : 1;
75 isl_ast_expr *iterator;
76 isl_ast_expr *init;
77 isl_ast_expr *cond;
78 isl_ast_expr *inc;
79 isl_ast_node *body;
80 } f;
81 struct {
82 isl_ast_expr *expr;
83 } e;
84 struct {
85 isl_id *mark;
86 isl_ast_node *node;
87 } m;
88 } u;
90 isl_id *annotation;
93 __isl_give isl_ast_node *isl_ast_node_alloc_for(__isl_take isl_id *id);
94 __isl_give isl_ast_node *isl_ast_node_for_mark_degenerate(
95 __isl_take isl_ast_node *node);
96 __isl_give isl_ast_node *isl_ast_node_alloc_if(__isl_take isl_ast_expr *guard);
97 __isl_give isl_ast_node *isl_ast_node_alloc_block(
98 __isl_take isl_ast_node_list *list);
99 __isl_give isl_ast_node *isl_ast_node_alloc_mark(__isl_take isl_id *id,
100 __isl_take isl_ast_node *node);
101 __isl_give isl_ast_node *isl_ast_node_from_ast_node_list(
102 __isl_take isl_ast_node_list *list);
103 __isl_give isl_ast_node *isl_ast_node_for_set_init(
104 __isl_take isl_ast_node *node, __isl_take isl_ast_expr *init);
105 __isl_give isl_ast_node *isl_ast_node_for_set_cond(
106 __isl_take isl_ast_node *node, __isl_take isl_ast_expr *init);
107 __isl_give isl_ast_node *isl_ast_node_for_set_inc(
108 __isl_take isl_ast_node *node, __isl_take isl_ast_expr *init);
109 __isl_give isl_ast_node *isl_ast_node_for_set_body(
110 __isl_take isl_ast_node *node, __isl_take isl_ast_node *body);
111 __isl_give isl_ast_node *isl_ast_node_if_set_then(
112 __isl_take isl_ast_node *node, __isl_take isl_ast_node *child);
114 __isl_give isl_ast_node *isl_stream_read_ast_node(__isl_keep isl_stream *s);
116 struct isl_ast_print_options {
117 int ref;
118 isl_ctx *ctx;
120 __isl_give isl_printer *(*print_for)(__isl_take isl_printer *p,
121 __isl_take isl_ast_print_options *options,
122 __isl_keep isl_ast_node *node, void *user);
123 void *print_for_user;
124 __isl_give isl_printer *(*print_user)(__isl_take isl_printer *p,
125 __isl_take isl_ast_print_options *options,
126 __isl_keep isl_ast_node *node, void *user);
127 void *print_user_user;
130 __isl_give isl_printer *isl_ast_node_list_print(
131 __isl_keep isl_ast_node_list *list, __isl_take isl_printer *p,
132 __isl_keep isl_ast_print_options *options);
134 #endif