scop.c: expr_propagate_params: use pet_expr_map_access
[pet.git] / scop.h
blob23ce5d43543113e5d88a6c7769747bda61d09819
1 #ifndef PET_SCOP_H
2 #define PET_SCOP_H
4 #include <pet.h>
6 #include <isl/aff.h>
7 #include <isl/id.h>
9 #if defined(__cplusplus)
10 extern "C" {
11 #endif
13 /* Do we want to skip the rest of the current loop iteration (pet_skip_now)
14 * or subsequent loop iterations (pet_skip_later)?
16 enum pet_skip { pet_skip_now = 0, pet_skip_later = 1 };
18 const char *pet_type_str(enum pet_expr_type type);
19 enum pet_expr_type pet_str_type(const char *str);
21 enum pet_op_type pet_str_op(const char *str);
23 struct pet_expr *pet_expr_from_index_and_depth(
24 __isl_take isl_multi_pw_aff *index, int depth);
25 struct pet_expr *pet_expr_from_access_and_index(__isl_take isl_map *access,
26 __isl_take isl_multi_pw_aff *index);
27 struct pet_expr *pet_expr_kill_from_access_and_index(__isl_take isl_map *access,
28 __isl_take isl_multi_pw_aff *index);
29 struct pet_expr *pet_expr_new_unary(isl_ctx *ctx, enum pet_op_type op,
30 struct pet_expr *arg);
31 struct pet_expr *pet_expr_new_binary(isl_ctx *ctx, enum pet_op_type op,
32 struct pet_expr *lhs, struct pet_expr *rhs);
33 struct pet_expr *pet_expr_new_ternary(isl_ctx *ctx, struct pet_expr *cond,
34 struct pet_expr *lhs, struct pet_expr *rhs);
35 struct pet_expr *pet_expr_new_call(isl_ctx *ctx, const char *name,
36 unsigned n_arg);
37 struct pet_expr *pet_expr_new_cast(isl_ctx *ctx, const char *type_name,
38 struct pet_expr *arg);
39 struct pet_expr *pet_expr_new_double(isl_ctx *ctx, double d, const char *s);
40 struct pet_expr *pet_expr_new_int(__isl_take isl_val *v);
41 void pet_expr_dump(struct pet_expr *expr);
43 int pet_expr_is_affine(struct pet_expr *expr);
44 __isl_give isl_id *pet_expr_access_get_id(struct pet_expr *expr);
45 struct pet_expr *pet_expr_access_align_params(struct pet_expr *expr);
46 int pet_expr_is_scalar_access(struct pet_expr *expr);
47 int pet_expr_is_equal(struct pet_expr *expr1, struct pet_expr *expr2);
48 struct pet_expr *pet_expr_restrict(struct pet_expr *expr,
49 __isl_take isl_set *cond);
51 struct pet_stmt *pet_stmt_from_pet_expr(isl_ctx *ctx, int line,
52 __isl_take isl_id *label, int id, struct pet_expr *expr);
53 void pet_stmt_dump(struct pet_stmt *stmt);
54 void *pet_stmt_free(struct pet_stmt *stmt);
56 int pet_stmt_is_assume(struct pet_stmt *stmt);
58 struct pet_type *pet_type_alloc(isl_ctx *ctx, const char *name,
59 const char *definition);
60 struct pet_type *pet_type_free(struct pet_type *type);
62 void pet_array_dump(struct pet_array *array);
63 struct pet_array *pet_array_free(struct pet_array *array);
65 void *pet_implication_free(struct pet_implication *implication);
67 struct pet_stmt *pet_stmt_prefix(struct pet_stmt *stmt, int pos);
69 struct pet_scop *pet_scop_from_pet_stmt(isl_ctx *ctx, struct pet_stmt *stmt);
70 struct pet_scop *pet_scop_alloc(isl_ctx *ctx);
71 struct pet_scop *pet_scop_empty(isl_ctx *ctx);
72 struct pet_scop *pet_scop_add_seq(isl_ctx *ctx, struct pet_scop *scop1,
73 struct pet_scop *scop2);
74 struct pet_scop *pet_scop_add_par(isl_ctx *ctx, struct pet_scop *scop1,
75 struct pet_scop *scop2);
77 int pet_scop_is_equal(struct pet_scop *scop1, struct pet_scop *scop2);
79 struct pet_scop *pet_scop_prefix(struct pet_scop *scop, int pos);
80 struct pet_scop *pet_scop_embed(struct pet_scop *scop, __isl_take isl_set *dom,
81 __isl_take isl_aff *sched, __isl_take isl_aff *iv_map,
82 __isl_take isl_id *id);
83 struct pet_scop *pet_scop_restrict(struct pet_scop *scop,
84 __isl_take isl_set *cond);
85 struct pet_scop *pet_scop_restrict_context(struct pet_scop *scop,
86 __isl_take isl_set *context);
87 struct pet_scop *pet_scop_reset_context(struct pet_scop *scop);
88 struct pet_expr *pet_expr_filter(struct pet_expr *expr,
89 __isl_take isl_multi_pw_aff *test, int satisfied);
90 struct pet_scop *pet_scop_filter(struct pet_scop *scop,
91 __isl_take isl_multi_pw_aff *test, int satisfied);
92 struct pet_scop *pet_scop_merge_filters(struct pet_scop *scop);
93 struct pet_scop *pet_scop_add_implication(struct pet_scop *scop,
94 __isl_take isl_map *map, int satisfied);
96 struct pet_scop *pet_scop_detect_parameter_accesses(struct pet_scop *scop);
98 struct pet_scop *pet_scop_gist(struct pet_scop *scop,
99 __isl_keep isl_union_map *value_bounds);
101 struct pet_scop *pet_scop_add_ref_ids(struct pet_scop *scop);
102 struct pet_scop *pet_scop_anonymize(struct pet_scop *scop);
104 int pet_expr_foreach_access_expr(struct pet_expr *expr,
105 int (*fn)(struct pet_expr *expr, void *user), void *user);
106 struct pet_expr *pet_expr_map_access(struct pet_expr *expr,
107 struct pet_expr *(*fn)(struct pet_expr *expr, void *user),
108 void *user);
110 int pet_scop_writes(struct pet_scop *scop, __isl_keep isl_id *id);
112 int pet_scop_has_skip(struct pet_scop *scop, enum pet_skip type);
113 int pet_scop_has_affine_skip(struct pet_scop *scop, enum pet_skip type);
114 int pet_scop_has_universal_skip(struct pet_scop *scop, enum pet_skip type);
115 int pet_scop_has_var_skip(struct pet_scop *scop, enum pet_skip type);
116 struct pet_scop *pet_scop_set_skip(struct pet_scop *scop,
117 enum pet_skip type, __isl_take isl_multi_pw_aff *skip);
118 __isl_give isl_multi_pw_aff *pet_scop_get_skip(struct pet_scop *scop,
119 enum pet_skip type);
120 __isl_give isl_set *pet_scop_get_affine_skip_domain(struct pet_scop *scop,
121 enum pet_skip type);
122 __isl_give isl_id *pet_scop_get_skip_id(struct pet_scop *scop,
123 enum pet_skip type);
124 struct pet_expr *pet_scop_get_skip_expr(struct pet_scop *scop,
125 enum pet_skip type);
126 void pet_scop_reset_skip(struct pet_scop *scop, enum pet_skip type);
128 struct pet_scop *pet_scop_add_array(struct pet_scop *scop,
129 struct pet_array *array);
131 struct pet_scop *pet_scop_update_start_end(struct pet_scop *scop,
132 unsigned start, unsigned end);
133 struct pet_scop *pet_scop_set_input_file(struct pet_scop *scop, FILE *input);
135 #if defined(__cplusplus)
137 #endif
139 #endif