declare isl_union_pw_multi_aff_gist
[isl.git] / isl_ast_graft_private.h
blob82b1c1ccaa048a8dd32b9532fcc71c241998f3c6
1 #ifndef ISL_AST_GRAFT_PRIVATE_H
2 #define ISL_AST_GRAFT_PRIVATE_H
4 #include <isl/ast.h>
5 #include <isl/set.h>
6 #include <isl/list.h>
7 #include <isl/printer.h>
9 struct isl_ast_graft;
10 typedef struct isl_ast_graft isl_ast_graft;
12 /* Representation of part of an AST ("node") with some additional polyhedral
13 * information about the tree.
15 * "guard" contains conditions that should still be enforced by
16 * some ancestor of the current tree. In particular, the already
17 * generated tree assumes that these conditions hold, but may not
18 * have enforced them itself.
19 * The guard should not contain any unknown divs as it will be used
20 * to generate an if condition.
22 * "enforced" expresses constraints that are already enforced by the for
23 * nodes in the current tree and that therefore do not need to be enforced
24 * by any ancestor.
25 * The constraints only involve outer loop iterators.
27 struct isl_ast_graft {
28 int ref;
30 isl_ast_node *node;
32 isl_set *guard;
33 isl_basic_set *enforced;
36 ISL_DECLARE_LIST(ast_graft)
38 #undef EL
39 #define EL isl_ast_graft
41 #include <isl_list_templ.h>
43 isl_ctx *isl_ast_graft_get_ctx(__isl_keep isl_ast_graft *graft);
45 __isl_give isl_ast_graft *isl_ast_graft_alloc(
46 __isl_take isl_ast_node *node, __isl_keep isl_ast_build *build);
47 __isl_give isl_ast_graft *isl_ast_graft_alloc_from_children(
48 __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard,
49 __isl_take isl_basic_set *enforced, __isl_keep isl_ast_build *build,
50 __isl_keep isl_ast_build *sub_build);
51 __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse(
52 __isl_take isl_ast_graft_list *children,
53 __isl_keep isl_ast_build *build);
54 __isl_give isl_ast_graft *isl_ast_graft_alloc_domain(
55 __isl_take isl_map *schedule, __isl_keep isl_ast_build *build);
56 void *isl_ast_graft_free(__isl_take isl_ast_graft *graft);
57 __isl_give isl_ast_graft_list *isl_ast_graft_list_sort_guard(
58 __isl_take isl_ast_graft_list *list);
60 __isl_give isl_ast_graft_list *isl_ast_graft_list_merge(
61 __isl_take isl_ast_graft_list *list1,
62 __isl_take isl_ast_graft_list *list2,
63 __isl_keep isl_ast_build *build);
65 __isl_give isl_ast_node *isl_ast_graft_get_node(
66 __isl_keep isl_ast_graft *graft);
67 __isl_give isl_basic_set *isl_ast_graft_get_enforced(
68 __isl_keep isl_ast_graft *graft);
69 __isl_give isl_set *isl_ast_graft_get_guard(__isl_keep isl_ast_graft *graft);
71 __isl_give isl_ast_graft *isl_ast_graft_insert_for(
72 __isl_take isl_ast_graft *graft, __isl_take isl_ast_node *node);
73 __isl_give isl_ast_graft *isl_ast_graft_add_guard(
74 __isl_take isl_ast_graft *graft,
75 __isl_take isl_set *guard, __isl_keep isl_ast_build *build);
76 __isl_give isl_ast_graft *isl_ast_graft_enforce(
77 __isl_take isl_ast_graft *graft, __isl_take isl_basic_set *enforced);
79 __isl_give isl_ast_graft_list *isl_ast_graft_list_unembed(
80 __isl_take isl_ast_graft_list *list, int product);
81 __isl_give isl_ast_graft_list *isl_ast_graft_list_preimage_multi_aff(
82 __isl_take isl_ast_graft_list *list, __isl_take isl_multi_aff *ma);
84 __isl_give isl_ast_node *isl_ast_node_from_graft_list(
85 __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build);
87 __isl_give isl_basic_set *isl_ast_graft_list_extract_shared_enforced(
88 __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build);
89 __isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard(
90 __isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build);
91 __isl_give isl_ast_graft_list *isl_ast_graft_list_gist_guards(
92 __isl_take isl_ast_graft_list *list, __isl_take isl_set *context);
94 __isl_give isl_printer *isl_printer_print_ast_graft(__isl_take isl_printer *p,
95 __isl_keep isl_ast_graft *graft);
97 #endif