Merge branch 'maint'
[isl.git] / isl_schedule_band.h
blobdcf16eb5d49c1eda7aed122e876f244ec2f2c139
1 #ifndef ISL_SCHEDULE_BAND_H
2 #define ISL_SCHEDULE_BAND_H
4 #include <isl/aff.h>
5 #include <isl/ast_type.h>
6 #include <isl/union_map.h>
8 /* Information about a band within a schedule.
10 * n is the number of scheduling dimensions within the band.
11 * coincident is an array of length n, indicating whether a scheduling dimension
12 * satisfies the coincidence constraints in the sense that
13 * the corresponding dependence distances are zero.
14 * permutable is set if the band is permutable.
15 * mupa is the partial schedule corresponding to this band. The dimension
16 * of mupa is equal to n.
17 * loop_type contains the loop AST generation types for the members
18 * in the band. It may be NULL, if all members are
19 * of type isl_ast_loop_default.
20 * isolate_loop_type contains the loop AST generation types for the members
21 * in the band for the isolated part. It may be NULL, if all members are
22 * of type isl_ast_loop_default.
23 * ast_build_options are the remaining AST build options associated
24 * to the band.
25 * anchored is set if the node depends on its position in the schedule tree.
26 * In particular, it is set if the AST build options include
27 * an isolate option.
29 struct isl_schedule_band {
30 int ref;
32 int n;
33 int *coincident;
34 int permutable;
36 isl_multi_union_pw_aff *mupa;
38 int anchored;
39 isl_union_set *ast_build_options;
40 enum isl_ast_loop_type *loop_type;
41 enum isl_ast_loop_type *isolate_loop_type;
43 typedef struct isl_schedule_band isl_schedule_band;
45 __isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff(
46 __isl_take isl_multi_union_pw_aff *mupa);
47 __isl_give isl_schedule_band *isl_schedule_band_copy(
48 __isl_keep isl_schedule_band *band);
49 __isl_null isl_schedule_band *isl_schedule_band_free(
50 __isl_take isl_schedule_band *band);
52 isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band);
54 isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1,
55 __isl_keep isl_schedule_band *band2);
57 int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band);
59 __isl_give isl_space *isl_schedule_band_get_space(
60 __isl_keep isl_schedule_band *band);
61 __isl_give isl_schedule_band *isl_schedule_band_intersect_domain(
62 __isl_take isl_schedule_band *band, __isl_take isl_union_set *domain);
63 __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule(
64 __isl_keep isl_schedule_band *band);
65 __isl_give isl_schedule_band *isl_schedule_band_set_partial_schedule(
66 __isl_take isl_schedule_band *band,
67 __isl_take isl_multi_union_pw_aff *schedule);
68 enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type(
69 __isl_keep isl_schedule_band *band, int pos);
70 __isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type(
71 __isl_take isl_schedule_band *band, int pos,
72 enum isl_ast_loop_type type);
73 enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type(
74 __isl_keep isl_schedule_band *band, int pos);
75 __isl_give isl_schedule_band *
76 isl_schedule_band_member_set_isolate_ast_loop_type(
77 __isl_take isl_schedule_band *band, int pos,
78 enum isl_ast_loop_type type);
79 __isl_give isl_union_set *isl_schedule_band_get_ast_build_options(
80 __isl_keep isl_schedule_band *band);
81 __isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options(
82 __isl_take isl_schedule_band *band, __isl_take isl_union_set *options);
83 __isl_give isl_set *isl_schedule_band_get_ast_isolate_option(
84 __isl_keep isl_schedule_band *band, int depth);
85 __isl_give isl_schedule_band *isl_schedule_band_replace_ast_build_option(
86 __isl_take isl_schedule_band *band, __isl_take isl_set *drop,
87 __isl_take isl_set *add);
89 int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band);
90 isl_bool isl_schedule_band_member_get_coincident(
91 __isl_keep isl_schedule_band *band, int pos);
92 __isl_give isl_schedule_band *isl_schedule_band_member_set_coincident(
93 __isl_take isl_schedule_band *band, int pos, int coincident);
94 isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *band);
95 __isl_give isl_schedule_band *isl_schedule_band_set_permutable(
96 __isl_take isl_schedule_band *band, int permutable);
98 __isl_give isl_schedule_band *isl_schedule_band_scale(
99 __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv);
100 __isl_give isl_schedule_band *isl_schedule_band_scale_down(
101 __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv);
102 __isl_give isl_schedule_band *isl_schedule_band_mod(
103 __isl_take isl_schedule_band *band, __isl_take isl_multi_val *mv);
104 __isl_give isl_schedule_band *isl_schedule_band_tile(
105 __isl_take isl_schedule_band *band, __isl_take isl_multi_val *sizes);
106 __isl_give isl_schedule_band *isl_schedule_band_point(
107 __isl_take isl_schedule_band *band, __isl_keep isl_schedule_band *tile,
108 __isl_take isl_multi_val *sizes);
109 __isl_give isl_schedule_band *isl_schedule_band_shift(
110 __isl_take isl_schedule_band *band,
111 __isl_take isl_multi_union_pw_aff *shift);
112 __isl_give isl_schedule_band *isl_schedule_band_drop(
113 __isl_take isl_schedule_band *band, int pos, int n);
114 __isl_give isl_schedule_band *isl_schedule_band_gist(
115 __isl_take isl_schedule_band *band, __isl_take isl_union_set *context);
117 __isl_give isl_schedule_band *isl_schedule_band_reset_user(
118 __isl_take isl_schedule_band *band);
119 __isl_give isl_schedule_band *isl_schedule_band_align_params(
120 __isl_take isl_schedule_band *band, __isl_take isl_space *space);
121 __isl_give isl_schedule_band *isl_schedule_band_pullback_union_pw_multi_aff(
122 __isl_take isl_schedule_band *band,
123 __isl_take isl_union_pw_multi_aff *upma);
125 #endif