7 #include <isl/union_map.h>
9 #if defined(__cplusplus)
14 ISL_ARG_DECL(pet_options
, struct pet_options
, pet_options_args
)
16 /* If autodetect is set, any valid scop is extracted.
17 * Otherwise, the scop needs to be delimited by pragmas.
19 int pet_options_set_autodetect(isl_ctx
*ctx
, int val
);
20 int pet_options_get_autodetect(isl_ctx
*ctx
);
22 #define PET_OVERFLOW_AVOID 0
23 #define PET_OVERFLOW_IGNORE 1
24 int pet_options_set_signed_overflow(isl_ctx
*ctx
, int val
);
25 int pet_options_get_signed_overflow(isl_ctx
*ctx
);
37 /* only compound assignments operators before assignment */
61 /* Index into the pet_expr->args array when pet_expr->type == pet_expr_unary
63 enum pet_un_arg_type
{
67 /* Indices into the pet_expr->args array when
68 * pet_expr->type == pet_expr_binary
70 enum pet_bin_arg_type
{
75 /* Indices into the pet_expr->args array when
76 * pet_expr->type == pet_expr_ternary
78 enum pet_ter_arg_type
{
84 /* d is valid when type == pet_expr_double
85 * acc is valid when type == pet_expr_access
86 * name is valid when type == pet_expr_call
87 * op is valid otherwise
89 * acc.access usually maps an iteration space to a data space.
90 * If the access has arguments, however, then the domain of the
91 * mapping is a wrapped mapping from the iteration space
92 * to a space of dimensionality equal to the number of arguments.
93 * Each dimension in this space corresponds to the value of the
94 * corresponding argument.
96 * If the data space is unnamed (and 1D), then it represents
97 * the set of integers. That is, the access represents a value that
98 * is equal to the index.
101 enum pet_expr_type type
;
104 struct pet_expr
**args
;
118 /* If the statement has arguments, i.e., n_arg != 0, then
119 * "domain" is a wrapped map, mapping the iteration domain
120 * to the values of the arguments for which this statement
122 * Otherwise, it is simply the iteration domain.
124 * If one of the arguments is an access expression that accesses
125 * more than one element for a given iteration, then the constraints
126 * on the value of this argument (encoded in "domain") should be satisfied
127 * for all of those accessed elements.
133 struct pet_expr
*body
;
136 struct pet_expr
**args
;
139 /* context holds constraints on the parameter that ensure that
140 * this array has a valid (i.e., non-negative) size
142 * extent holds constraints on the indices
144 * value_bounds holds constraints on the elements of the array
145 * and may be NULL if no such constraints were specified by the user
147 * element_size is the size in bytes of each array element
149 * live_out is set if the array appears in a live-out pragma
151 * if uniquely_defined is set then the array is written by a single access
152 * such that any element that is ever read
153 * is known to be assigned exactly once before the read
158 isl_set
*value_bounds
;
162 int uniquely_defined
;
165 /* The context describes the set of parameter values for which
166 * the scop can be executed.
167 * context_value describes assignments to the parameters (if any)
168 * outside of the scop.
172 isl_set
*context_value
;
175 struct pet_array
**arrays
;
178 struct pet_stmt
**stmts
;
181 /* Return a textual representation of the operator. */
182 const char *pet_op_str(enum pet_op_type op
);
183 int pet_op_is_inc_dec(enum pet_op_type op
);
185 /* Extract a pet_scop from a C source file.
186 * If function is not NULL, then the pet_scop is extracted from
187 * a function with that name.
189 struct pet_scop
*pet_scop_extract_from_C_source(isl_ctx
*ctx
,
190 const char *filename
, const char *function
);
192 /* Update all isl_sets and isl_maps such that they all have the same
193 * parameters in the same order.
195 struct pet_scop
*pet_scop_align_params(struct pet_scop
*scop
);
197 void pet_scop_dump(struct pet_scop
*scop
);
198 void *pet_scop_free(struct pet_scop
*scop
);
200 __isl_give isl_union_set
*pet_scop_collect_domains(struct pet_scop
*scop
);
201 /* Collect all read access relations. */
202 __isl_give isl_union_map
*pet_scop_collect_reads(struct pet_scop
*scop
);
203 /* Collect all write access relations. */
204 __isl_give isl_union_map
*pet_scop_collect_writes(struct pet_scop
*scop
);
205 __isl_give isl_union_map
*pet_scop_collect_schedule(struct pet_scop
*scop
);
207 #if defined(__cplusplus)