1 #ifndef ISL_AST_GRAFT_PRIVATE_H
2 #define ISL_AST_GRAFT_PRIVATE_H
7 #include <isl/printer.h>
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
25 * The constraints only involve outer loop iterators.
27 struct isl_ast_graft
{
33 isl_basic_set
*enforced
;
36 ISL_DECLARE_LIST(ast_graft
)
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_level(
48 __isl_take isl_ast_graft_list
*children
,
49 __isl_keep isl_ast_build
*build
, __isl_keep isl_ast_build
*sub_build
);
50 __isl_give isl_ast_graft_list
*isl_ast_graft_list_fuse(
51 __isl_take isl_ast_graft_list
*children
,
52 __isl_keep isl_ast_build
*build
);
53 __isl_give isl_ast_graft
*isl_ast_graft_alloc_domain(
54 __isl_take isl_map
*schedule
, __isl_keep isl_ast_build
*build
);
55 void *isl_ast_graft_free(__isl_take isl_ast_graft
*graft
);
56 __isl_give isl_ast_graft_list
*isl_ast_graft_list_sort_guard(
57 __isl_take isl_ast_graft_list
*list
);
59 __isl_give isl_ast_graft_list
*isl_ast_graft_list_merge(
60 __isl_take isl_ast_graft_list
*list1
,
61 __isl_take isl_ast_graft_list
*list2
,
62 __isl_keep isl_ast_build
*build
);
64 __isl_give isl_ast_node
*isl_ast_graft_get_node(
65 __isl_keep isl_ast_graft
*graft
);
66 __isl_give isl_basic_set
*isl_ast_graft_get_enforced(
67 __isl_keep isl_ast_graft
*graft
);
68 __isl_give isl_set
*isl_ast_graft_get_guard(__isl_keep isl_ast_graft
*graft
);
70 __isl_give isl_ast_graft
*isl_ast_graft_insert_for(
71 __isl_take isl_ast_graft
*graft
, __isl_take isl_ast_node
*node
);
72 __isl_give isl_ast_graft
*isl_ast_graft_add_guard(
73 __isl_take isl_ast_graft
*graft
,
74 __isl_take isl_set
*guard
, __isl_keep isl_ast_build
*build
);
75 __isl_give isl_ast_graft
*isl_ast_graft_enforce(
76 __isl_take isl_ast_graft
*graft
, __isl_take isl_basic_set
*enforced
);
78 __isl_give isl_ast_graft_list
*isl_ast_graft_list_unembed(
79 __isl_take isl_ast_graft_list
*list
, int product
);
80 __isl_give isl_ast_graft_list
*isl_ast_graft_list_preimage_multi_aff(
81 __isl_take isl_ast_graft_list
*list
, __isl_take isl_multi_aff
*ma
);
83 __isl_give isl_ast_node
*isl_ast_node_from_graft_list(
84 __isl_take isl_ast_graft_list
*list
, __isl_keep isl_ast_build
*build
);
86 __isl_give isl_printer
*isl_printer_print_ast_graft(__isl_take isl_printer
*p
,
87 __isl_keep isl_ast_graft
*graft
);