3 #if defined(__cplusplus)
15 enum clast_expr_type type
;
19 struct clast_expr expr
;
23 /* Represents the term
24 * val * var (if var != NULL)
26 * val (if var == NULL)
29 struct clast_expr expr
;
31 struct clast_expr
*var
;
34 #define CLAST_PARALLEL_NOT 0
35 #define CLAST_PARALLEL_OMP 1
36 #define CLAST_PARALLEL_MPI 2
37 #define CLAST_PARALLEL_VEC 4
39 enum clast_red_type
{ clast_red_sum
, clast_red_min
, clast_red_max
};
40 struct clast_reduction
{
41 struct clast_expr expr
;
42 enum clast_red_type type
;
44 struct clast_expr
* elts
[1];
47 enum clast_bin_type
{ clast_bin_fdiv
, clast_bin_cdiv
,
48 clast_bin_div
, clast_bin_mod
};
50 struct clast_expr expr
;
51 enum clast_bin_type type
;
52 struct clast_expr
* LHS
;
57 struct clast_stmt_op
{
58 void (*free
)(struct clast_stmt
*);
61 #define CLAST_STMT_IS_A(stmt, type) ((stmt)->op == &(type))
63 extern const struct clast_stmt_op stmt_root
;
64 extern const struct clast_stmt_op stmt_ass
;
65 extern const struct clast_stmt_op stmt_user
;
66 extern const struct clast_stmt_op stmt_block
;
67 extern const struct clast_stmt_op stmt_for
;
68 extern const struct clast_stmt_op stmt_guard
;
71 const struct clast_stmt_op
*op
;
72 struct clast_stmt
*next
;
76 struct clast_stmt stmt
;
77 CloogNames
* names
; /**< Names of iterators and parameters. */
80 struct clast_assignment
{
81 struct clast_stmt stmt
;
83 struct clast_expr
* RHS
;
87 struct clast_stmt stmt
;
88 struct clast_stmt
* body
;
91 struct clast_user_stmt
{
92 struct clast_stmt stmt
;
94 CloogStatement
* statement
;
95 struct clast_stmt
* substitutions
;
99 struct clast_stmt stmt
;
100 CloogDomain
* domain
;
101 const char * iterator
;
102 struct clast_expr
* LB
;
103 struct clast_expr
* UB
;
105 struct clast_stmt
* body
;
107 /* Comma separated list of loop private variables for OpenMP parallelization */
109 /* Comma separated list of reduction variable/operators for OpenMP parallelization */
110 char *reduction_vars
;
111 /* Enable execution time reporting for this loop */
112 /* Variable name to accumulate execution time this loop */
116 struct clast_equation
{
117 struct clast_expr
* LHS
;
118 struct clast_expr
* RHS
;
123 struct clast_stmt stmt
;
124 struct clast_stmt
* then
;
126 struct clast_equation eq
[1];
130 struct clast_stmt
*cloog_clast_create_from_input(CloogInput
*input
,
131 CloogOptions
*options
);
132 struct clast_stmt
*cloog_clast_create(CloogProgram
*program
,
133 CloogOptions
*options
);
134 void cloog_clast_free(struct clast_stmt
*s
);
136 struct clast_name
*new_clast_name(const char *name
);
137 struct clast_term
*new_clast_term(cloog_int_t c
, struct clast_expr
*v
);
138 struct clast_binary
*new_clast_binary(enum clast_bin_type t
,
139 struct clast_expr
*lhs
, cloog_int_t rhs
);
140 struct clast_reduction
*new_clast_reduction(enum clast_red_type t
, int n
);
141 struct clast_root
*new_clast_root(CloogNames
*names
);
142 struct clast_assignment
*new_clast_assignment(const char *lhs
,
143 struct clast_expr
*rhs
);
144 struct clast_user_stmt
*new_clast_user_stmt(CloogDomain
*domain
,
145 CloogStatement
*stmt
, struct clast_stmt
*subs
);
146 struct clast_block
*new_clast_block(void);
147 struct clast_for
*new_clast_for(CloogDomain
*domain
, const char *it
,
148 struct clast_expr
*LB
, struct clast_expr
*UB
,
149 CloogStride
*stride
);
150 struct clast_guard
*new_clast_guard(int n
);
152 void free_clast_name(struct clast_name
*t
);
153 void free_clast_term(struct clast_term
*t
);
154 void free_clast_binary(struct clast_binary
*b
);
155 void free_clast_reduction(struct clast_reduction
*r
);
156 void free_clast_expr(struct clast_expr
*e
);
157 void free_clast_stmt(struct clast_stmt
*s
);
159 int clast_expr_equal(struct clast_expr
*e1
, struct clast_expr
*e2
);
161 struct clast_expr
*clast_bound_from_constraint(CloogConstraint
*constraint
,
162 int level
, CloogNames
*names
);
164 typedef enum filterType
{exact
, subset
} ClastFilterType
;
166 typedef struct clastFilter
{
168 const int *stmts_filter
;
170 ClastFilterType filter_type
;
173 void clast_filter(struct clast_stmt
*node
, ClastFilter filter
,
174 struct clast_for
***loops
, int *nloops
, int **stmts
, int *nstmts
);
176 #if defined(__cplusplus)
179 #endif /* define _H */