8 #if defined(__cplusplus)
12 /* Do we want to skip the rest of the current loop iteration (pet_skip_now)
13 * or subsequent loop iterations (pet_skip_later)?
15 enum pet_skip
{ pet_skip_now
= 0, pet_skip_later
= 1 };
17 const char *pet_type_str(enum pet_expr_type type
);
18 enum pet_expr_type
pet_str_type(const char *str
);
20 enum pet_op_type
pet_str_op(const char *str
);
22 struct pet_expr
*pet_expr_from_access(__isl_take isl_map
*access
);
23 struct pet_expr
*pet_expr_kill_from_access(__isl_take isl_map
*access
);
24 struct pet_expr
*pet_expr_new_unary(isl_ctx
*ctx
, enum pet_op_type op
,
25 struct pet_expr
*arg
);
26 struct pet_expr
*pet_expr_new_binary(isl_ctx
*ctx
, enum pet_op_type op
,
27 struct pet_expr
*lhs
, struct pet_expr
*rhs
);
28 struct pet_expr
*pet_expr_new_ternary(isl_ctx
*ctx
, struct pet_expr
*cond
,
29 struct pet_expr
*lhs
, struct pet_expr
*rhs
);
30 struct pet_expr
*pet_expr_new_call(isl_ctx
*ctx
, const char *name
,
32 struct pet_expr
*pet_expr_new_cast(isl_ctx
*ctx
, const char *type_name
,
33 struct pet_expr
*arg
);
34 struct pet_expr
*pet_expr_new_double(isl_ctx
*ctx
, double d
, const char *s
);
35 void pet_expr_dump(struct pet_expr
*expr
);
36 void *pet_expr_free(struct pet_expr
*expr
);
38 int pet_expr_is_affine(struct pet_expr
*expr
);
39 int pet_expr_is_equal(struct pet_expr
*expr1
, struct pet_expr
*expr2
);
40 struct pet_expr
*pet_expr_restrict(struct pet_expr
*expr
,
41 __isl_take isl_set
*cond
);
43 struct pet_stmt
*pet_stmt_from_pet_expr(isl_ctx
*ctx
, int line
,
44 __isl_take isl_id
*label
, int id
, struct pet_expr
*expr
);
45 void pet_stmt_dump(struct pet_stmt
*stmt
);
46 void *pet_stmt_free(struct pet_stmt
*stmt
);
48 void pet_array_dump(struct pet_array
*array
);
49 struct pet_array
*pet_array_free(struct pet_array
*array
);
51 struct pet_stmt
*pet_stmt_prefix(struct pet_stmt
*stmt
, int pos
);
53 struct pet_scop
*pet_scop_from_pet_stmt(isl_ctx
*ctx
, struct pet_stmt
*stmt
);
54 struct pet_scop
*pet_scop_alloc(isl_ctx
*ctx
);
55 struct pet_scop
*pet_scop_empty(isl_ctx
*ctx
);
56 struct pet_scop
*pet_scop_add_seq(isl_ctx
*ctx
, struct pet_scop
*scop1
,
57 struct pet_scop
*scop2
);
58 struct pet_scop
*pet_scop_add_par(isl_ctx
*ctx
, struct pet_scop
*scop1
,
59 struct pet_scop
*scop2
);
61 int pet_scop_is_equal(struct pet_scop
*scop1
, struct pet_scop
*scop2
);
63 struct pet_scop
*pet_scop_prefix(struct pet_scop
*scop
, int pos
);
64 struct pet_scop
*pet_scop_embed(struct pet_scop
*scop
, __isl_take isl_set
*dom
,
65 __isl_take isl_map
*sched
, __isl_take isl_map
*iv_map
,
66 __isl_take isl_id
*id
);
67 struct pet_scop
*pet_scop_restrict(struct pet_scop
*scop
,
68 __isl_take isl_set
*cond
);
69 struct pet_scop
*pet_scop_restrict_context(struct pet_scop
*scop
,
70 __isl_take isl_set
*context
);
71 struct pet_scop
*pet_scop_reset_context(struct pet_scop
*scop
);
72 struct pet_expr
*pet_expr_filter(struct pet_expr
*expr
,
73 __isl_take isl_map
*test
, int satisfied
);
74 struct pet_scop
*pet_scop_filter(struct pet_scop
*scop
,
75 __isl_take isl_map
*test
, int satisfied
);
76 struct pet_scop
*pet_scop_merge_filters(struct pet_scop
*scop
);
78 struct pet_scop
*pet_scop_detect_parameter_accesses(struct pet_scop
*scop
);
80 struct pet_scop
*pet_scop_gist(struct pet_scop
*scop
,
81 __isl_keep isl_union_map
*value_bounds
);
83 struct pet_scop
*pet_scop_anonymize(struct pet_scop
*scop
);
85 struct pet_expr
*pet_expr_foreach_access(struct pet_expr
*expr
,
86 __isl_give isl_map
*(*fn
)(__isl_take isl_map
*access
, void *user
),
89 int pet_scop_writes(struct pet_scop
*scop
, __isl_keep isl_id
*id
);
91 int pet_scop_has_skip(struct pet_scop
*scop
, enum pet_skip type
);
92 int pet_scop_has_affine_skip(struct pet_scop
*scop
, enum pet_skip type
);
93 int pet_scop_has_universal_skip(struct pet_scop
*scop
, enum pet_skip type
);
94 int pet_scop_has_var_skip(struct pet_scop
*scop
, enum pet_skip type
);
95 struct pet_scop
*pet_scop_set_skip(struct pet_scop
*scop
,
96 enum pet_skip type
, __isl_take isl_set
*skip
);
97 __isl_give isl_set
*pet_scop_get_skip(struct pet_scop
*scop
,
99 __isl_give isl_map
*pet_scop_get_skip_map(struct pet_scop
*scop
,
101 struct pet_expr
*pet_scop_get_skip_expr(struct pet_scop
*scop
,
103 void pet_scop_reset_skip(struct pet_scop
*scop
, enum pet_skip type
);
105 struct pet_scop
*pet_scop_add_array(struct pet_scop
*scop
,
106 struct pet_array
*array
);
108 struct pet_scop
*pet_scop_update_start_end(struct pet_scop
*scop
,
109 unsigned start
, unsigned end
);
111 #if defined(__cplusplus)