graphite.h revision 1.4.2.3 1 1.4.2.2 christos /* Graphite polyhedral representation.
2 1.4.2.3 martin Copyright (C) 2009-2017 Free Software Foundation, Inc.
3 1.4.2.2 christos Contributed by Sebastian Pop <sebastian.pop (at) amd.com> and
4 1.4.2.2 christos Tobias Grosser <grosser (at) fim.uni-passau.de>.
5 1.4.2.2 christos
6 1.4.2.2 christos This file is part of GCC.
7 1.4.2.2 christos
8 1.4.2.2 christos GCC is free software; you can redistribute it and/or modify
9 1.4.2.2 christos it under the terms of the GNU General Public License as published by
10 1.4.2.2 christos the Free Software Foundation; either version 3, or (at your option)
11 1.4.2.2 christos any later version.
12 1.4.2.2 christos
13 1.4.2.2 christos GCC is distributed in the hope that it will be useful,
14 1.4.2.2 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
15 1.4.2.2 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 1.4.2.2 christos GNU General Public License for more details.
17 1.4.2.2 christos
18 1.4.2.2 christos You should have received a copy of the GNU General Public License
19 1.4.2.2 christos along with GCC; see the file COPYING3. If not see
20 1.4.2.2 christos <http://www.gnu.org/licenses/>. */
21 1.4.2.2 christos
22 1.4.2.2 christos #ifndef GCC_GRAPHITE_POLY_H
23 1.4.2.2 christos #define GCC_GRAPHITE_POLY_H
24 1.4.2.2 christos
25 1.4.2.2 christos #include "sese.h"
26 1.4.2.2 christos #include <isl/options.h>
27 1.4.2.2 christos #include <isl/ctx.h>
28 1.4.2.3 martin #include <isl/val.h>
29 1.4.2.2 christos #include <isl/set.h>
30 1.4.2.2 christos #include <isl/union_set.h>
31 1.4.2.2 christos #include <isl/map.h>
32 1.4.2.2 christos #include <isl/union_map.h>
33 1.4.2.2 christos #include <isl/aff.h>
34 1.4.2.2 christos #include <isl/constraint.h>
35 1.4.2.2 christos #include <isl/flow.h>
36 1.4.2.2 christos #include <isl/ilp.h>
37 1.4.2.2 christos #include <isl/schedule.h>
38 1.4.2.2 christos #include <isl/ast_build.h>
39 1.4.2.2 christos #include <isl/schedule_node.h>
40 1.4.2.2 christos #include <isl/id.h>
41 1.4.2.2 christos #include <isl/space.h>
42 1.4.2.2 christos
43 1.4.2.2 christos typedef struct poly_dr *poly_dr_p;
44 1.4.2.2 christos
45 1.4.2.2 christos typedef struct poly_bb *poly_bb_p;
46 1.4.2.2 christos
47 1.4.2.2 christos typedef struct scop *scop_p;
48 1.4.2.2 christos
49 1.4.2.2 christos typedef unsigned graphite_dim_t;
50 1.4.2.2 christos
51 1.4.2.2 christos static inline graphite_dim_t scop_nb_params (scop_p);
52 1.4.2.2 christos
53 1.4.2.2 christos /* A data reference can write or read some memory or we
54 1.4.2.2 christos just know it may write some memory. */
55 1.4.2.2 christos enum poly_dr_type
56 1.4.2.2 christos {
57 1.4.2.2 christos PDR_READ,
58 1.4.2.2 christos /* PDR_MAY_READs are represented using PDR_READS. This does not
59 1.4.2.2 christos limit the expressiveness. */
60 1.4.2.2 christos PDR_WRITE,
61 1.4.2.2 christos PDR_MAY_WRITE
62 1.4.2.2 christos };
63 1.4.2.2 christos
64 1.4.2.2 christos struct poly_dr
65 1.4.2.2 christos {
66 1.4.2.2 christos /* An identifier for this PDR. */
67 1.4.2.2 christos int id;
68 1.4.2.2 christos
69 1.4.2.2 christos /* The number of data refs identical to this one in the PBB. */
70 1.4.2.2 christos int nb_refs;
71 1.4.2.2 christos
72 1.4.2.2 christos /* A pointer to the gimple stmt containing this reference. */
73 1.4.2.2 christos gimple *stmt;
74 1.4.2.2 christos
75 1.4.2.2 christos /* A pointer to the PBB that contains this data reference. */
76 1.4.2.2 christos poly_bb_p pbb;
77 1.4.2.2 christos
78 1.4.2.2 christos enum poly_dr_type type;
79 1.4.2.2 christos
80 1.4.2.2 christos /* The access polyhedron contains the polyhedral space this data
81 1.4.2.2 christos reference will access.
82 1.4.2.2 christos
83 1.4.2.2 christos The polyhedron contains these dimensions:
84 1.4.2.2 christos
85 1.4.2.2 christos - The alias set (a):
86 1.4.2.2 christos Every memory access is classified in at least one alias set.
87 1.4.2.2 christos
88 1.4.2.2 christos - The subscripts (s_0, ..., s_n):
89 1.4.2.2 christos The memory is accessed using zero or more subscript dimensions.
90 1.4.2.2 christos
91 1.4.2.2 christos - The iteration domain (variables and parameters)
92 1.4.2.2 christos
93 1.4.2.2 christos Do not hardcode the dimensions. Use the following accessor functions:
94 1.4.2.2 christos - pdr_alias_set_dim
95 1.4.2.2 christos - pdr_subscript_dim
96 1.4.2.2 christos - pdr_iterator_dim
97 1.4.2.2 christos - pdr_parameter_dim
98 1.4.2.2 christos
99 1.4.2.2 christos Example:
100 1.4.2.2 christos
101 1.4.2.2 christos | int A[1335][123];
102 1.4.2.2 christos | int *p = malloc ();
103 1.4.2.2 christos |
104 1.4.2.2 christos | k = ...
105 1.4.2.2 christos | for i
106 1.4.2.2 christos | {
107 1.4.2.2 christos | if (unknown_function ())
108 1.4.2.2 christos | p = A;
109 1.4.2.2 christos | ... = p[?][?];
110 1.4.2.2 christos | for j
111 1.4.2.2 christos | A[i][j+k] = m;
112 1.4.2.2 christos | }
113 1.4.2.2 christos
114 1.4.2.2 christos The data access A[i][j+k] in alias set "5" is described like this:
115 1.4.2.2 christos
116 1.4.2.2 christos | i j k a s0 s1 1
117 1.4.2.2 christos | 0 0 0 1 0 0 -5 = 0
118 1.4.2.2 christos |-1 0 0 0 1 0 0 = 0
119 1.4.2.2 christos | 0 -1 -1 0 0 1 0 = 0
120 1.4.2.2 christos | 0 0 0 0 1 0 0 >= 0 # The last four lines describe the
121 1.4.2.2 christos | 0 0 0 0 0 1 0 >= 0 # array size.
122 1.4.2.2 christos | 0 0 0 0 -1 0 1335 >= 0
123 1.4.2.2 christos | 0 0 0 0 0 -1 123 >= 0
124 1.4.2.2 christos
125 1.4.2.2 christos The pointer "*p" in alias set "5" and "7" is described as a union of
126 1.4.2.2 christos polyhedron:
127 1.4.2.2 christos
128 1.4.2.2 christos
129 1.4.2.2 christos | i k a s0 1
130 1.4.2.2 christos | 0 0 1 0 -5 = 0
131 1.4.2.2 christos | 0 0 0 1 0 >= 0
132 1.4.2.2 christos
133 1.4.2.2 christos "or"
134 1.4.2.2 christos
135 1.4.2.2 christos | i k a s0 1
136 1.4.2.2 christos | 0 0 1 0 -7 = 0
137 1.4.2.2 christos | 0 0 0 1 0 >= 0
138 1.4.2.2 christos
139 1.4.2.2 christos "*p" accesses all of the object allocated with 'malloc'.
140 1.4.2.2 christos
141 1.4.2.2 christos The scalar data access "m" is represented as an array with zero subscript
142 1.4.2.2 christos dimensions.
143 1.4.2.2 christos
144 1.4.2.2 christos | i j k a 1
145 1.4.2.2 christos | 0 0 0 -1 15 = 0
146 1.4.2.2 christos
147 1.4.2.2 christos The difference between the graphite internal format for access data and
148 1.4.2.2 christos the OpenSop format is in the order of columns.
149 1.4.2.2 christos Instead of having:
150 1.4.2.2 christos
151 1.4.2.2 christos | i j k a s0 s1 1
152 1.4.2.2 christos | 0 0 0 1 0 0 -5 = 0
153 1.4.2.2 christos |-1 0 0 0 1 0 0 = 0
154 1.4.2.2 christos | 0 -1 -1 0 0 1 0 = 0
155 1.4.2.2 christos | 0 0 0 0 1 0 0 >= 0 # The last four lines describe the
156 1.4.2.2 christos | 0 0 0 0 0 1 0 >= 0 # array size.
157 1.4.2.2 christos | 0 0 0 0 -1 0 1335 >= 0
158 1.4.2.2 christos | 0 0 0 0 0 -1 123 >= 0
159 1.4.2.2 christos
160 1.4.2.2 christos In OpenScop we have:
161 1.4.2.2 christos
162 1.4.2.2 christos | a s0 s1 i j k 1
163 1.4.2.2 christos | 1 0 0 0 0 0 -5 = 0
164 1.4.2.2 christos | 0 1 0 -1 0 0 0 = 0
165 1.4.2.2 christos | 0 0 1 0 -1 -1 0 = 0
166 1.4.2.2 christos | 0 1 0 0 0 0 0 >= 0 # The last four lines describe the
167 1.4.2.2 christos | 0 0 1 0 0 0 0 >= 0 # array size.
168 1.4.2.2 christos | 0 -1 0 0 0 0 1335 >= 0
169 1.4.2.2 christos | 0 0 -1 0 0 0 123 >= 0
170 1.4.2.2 christos
171 1.4.2.2 christos The OpenScop access function is printed as follows:
172 1.4.2.2 christos
173 1.4.2.2 christos | 1 # The number of disjunct components in a union of access functions.
174 1.4.2.2 christos | R C O I L P # Described bellow.
175 1.4.2.2 christos | a s0 s1 i j k 1
176 1.4.2.2 christos | 1 0 0 0 0 0 -5 = 0
177 1.4.2.2 christos | 0 1 0 -1 0 0 0 = 0
178 1.4.2.2 christos | 0 0 1 0 -1 -1 0 = 0
179 1.4.2.2 christos | 0 1 0 0 0 0 0 >= 0 # The last four lines describe the
180 1.4.2.2 christos | 0 0 1 0 0 0 0 >= 0 # array size.
181 1.4.2.2 christos | 0 -1 0 0 0 0 1335 >= 0
182 1.4.2.2 christos | 0 0 -1 0 0 0 123 >= 0
183 1.4.2.2 christos
184 1.4.2.2 christos Where:
185 1.4.2.2 christos - R: Number of rows.
186 1.4.2.2 christos - C: Number of columns.
187 1.4.2.2 christos - O: Number of output dimensions = alias set + number of subscripts.
188 1.4.2.2 christos - I: Number of input dimensions (iterators).
189 1.4.2.2 christos - L: Number of local (existentially quantified) dimensions.
190 1.4.2.2 christos - P: Number of parameters.
191 1.4.2.2 christos
192 1.4.2.2 christos In the example, the vector "R C O I L P" is "7 7 3 2 0 1". */
193 1.4.2.2 christos isl_map *accesses;
194 1.4.2.2 christos isl_set *subscript_sizes;
195 1.4.2.2 christos };
196 1.4.2.2 christos
197 1.4.2.2 christos #define PDR_ID(PDR) (PDR->id)
198 1.4.2.2 christos #define PDR_NB_REFS(PDR) (PDR->nb_refs)
199 1.4.2.2 christos #define PDR_PBB(PDR) (PDR->pbb)
200 1.4.2.2 christos #define PDR_TYPE(PDR) (PDR->type)
201 1.4.2.2 christos #define PDR_ACCESSES(PDR) (NULL)
202 1.4.2.2 christos
203 1.4.2.2 christos void new_poly_dr (poly_bb_p, gimple *, enum poly_dr_type,
204 1.4.2.2 christos isl_map *, isl_set *);
205 1.4.2.2 christos void debug_pdr (poly_dr_p);
206 1.4.2.2 christos void print_pdr (FILE *, poly_dr_p);
207 1.4.2.2 christos
208 1.4.2.2 christos static inline bool
209 1.4.2.2 christos pdr_read_p (poly_dr_p pdr)
210 1.4.2.2 christos {
211 1.4.2.2 christos return PDR_TYPE (pdr) == PDR_READ;
212 1.4.2.2 christos }
213 1.4.2.2 christos
214 1.4.2.2 christos /* Returns true when PDR is a "write". */
215 1.4.2.2 christos
216 1.4.2.2 christos static inline bool
217 1.4.2.2 christos pdr_write_p (poly_dr_p pdr)
218 1.4.2.2 christos {
219 1.4.2.2 christos return PDR_TYPE (pdr) == PDR_WRITE;
220 1.4.2.2 christos }
221 1.4.2.2 christos
222 1.4.2.2 christos /* Returns true when PDR is a "may write". */
223 1.4.2.2 christos
224 1.4.2.2 christos static inline bool
225 1.4.2.2 christos pdr_may_write_p (poly_dr_p pdr)
226 1.4.2.2 christos {
227 1.4.2.2 christos return PDR_TYPE (pdr) == PDR_MAY_WRITE;
228 1.4.2.2 christos }
229 1.4.2.2 christos
230 1.4.2.2 christos /* POLY_BB represents a blackbox in the polyhedral model. */
231 1.4.2.2 christos
232 1.4.2.2 christos struct poly_bb
233 1.4.2.2 christos {
234 1.4.2.2 christos /* Pointer to a basic block or a statement in the compiler. */
235 1.4.2.2 christos gimple_poly_bb_p black_box;
236 1.4.2.2 christos
237 1.4.2.2 christos /* Pointer to the SCOP containing this PBB. */
238 1.4.2.2 christos scop_p scop;
239 1.4.2.2 christos
240 1.4.2.2 christos /* The iteration domain of this bb. The layout of this polyhedron
241 1.4.2.2 christos is I|G with I the iteration domain, G the context parameters.
242 1.4.2.2 christos
243 1.4.2.2 christos Example:
244 1.4.2.2 christos
245 1.4.2.2 christos for (i = a - 7*b + 8; i <= 3*a + 13*b + 20; i++)
246 1.4.2.2 christos for (j = 2; j <= 2*i + 5; j++)
247 1.4.2.2 christos for (k = 0; k <= 5; k++)
248 1.4.2.2 christos S (i,j,k)
249 1.4.2.2 christos
250 1.4.2.2 christos Loop iterators: i, j, k
251 1.4.2.2 christos Parameters: a, b
252 1.4.2.2 christos
253 1.4.2.2 christos | i >= a - 7b + 8
254 1.4.2.2 christos | i <= 3a + 13b + 20
255 1.4.2.2 christos | j >= 2
256 1.4.2.2 christos | j <= 2i + 5
257 1.4.2.2 christos | k >= 0
258 1.4.2.2 christos | k <= 5
259 1.4.2.2 christos
260 1.4.2.2 christos The number of variables in the DOMAIN may change and is not
261 1.4.2.2 christos related to the number of loops in the original code. */
262 1.4.2.2 christos isl_set *domain;
263 1.4.2.2 christos isl_set *iterators;
264 1.4.2.2 christos
265 1.4.2.2 christos /* The data references we access. */
266 1.4.2.2 christos vec<poly_dr_p> drs;
267 1.4.2.2 christos
268 1.4.2.2 christos /* The last basic block generated for this pbb. */
269 1.4.2.2 christos basic_block new_bb;
270 1.4.2.2 christos };
271 1.4.2.2 christos
272 1.4.2.2 christos #define PBB_BLACK_BOX(PBB) ((gimple_poly_bb_p) PBB->black_box)
273 1.4.2.2 christos #define PBB_SCOP(PBB) (PBB->scop)
274 1.4.2.2 christos #define PBB_DRS(PBB) (PBB->drs)
275 1.4.2.2 christos
276 1.4.2.2 christos extern poly_bb_p new_poly_bb (scop_p, gimple_poly_bb_p);
277 1.4.2.2 christos extern void print_pbb_domain (FILE *, poly_bb_p);
278 1.4.2.2 christos extern void print_pbb (FILE *, poly_bb_p);
279 1.4.2.2 christos extern void print_scop_context (FILE *, scop_p);
280 1.4.2.2 christos extern void print_scop (FILE *, scop_p);
281 1.4.2.2 christos extern void debug_pbb_domain (poly_bb_p);
282 1.4.2.2 christos extern void debug_pbb (poly_bb_p);
283 1.4.2.2 christos extern void print_pdrs (FILE *, poly_bb_p);
284 1.4.2.2 christos extern void debug_pdrs (poly_bb_p);
285 1.4.2.2 christos extern void debug_scop_context (scop_p);
286 1.4.2.2 christos extern void debug_scop (scop_p);
287 1.4.2.2 christos extern void print_scop_params (FILE *, scop_p);
288 1.4.2.2 christos extern void debug_scop_params (scop_p);
289 1.4.2.2 christos extern void print_iteration_domain (FILE *, poly_bb_p);
290 1.4.2.2 christos extern void print_iteration_domains (FILE *, scop_p);
291 1.4.2.2 christos extern void debug_iteration_domain (poly_bb_p);
292 1.4.2.2 christos extern void debug_iteration_domains (scop_p);
293 1.4.2.2 christos extern void print_isl_set (FILE *, isl_set *);
294 1.4.2.2 christos extern void print_isl_map (FILE *, isl_map *);
295 1.4.2.2 christos extern void print_isl_union_map (FILE *, isl_union_map *);
296 1.4.2.2 christos extern void print_isl_aff (FILE *, isl_aff *);
297 1.4.2.2 christos extern void print_isl_constraint (FILE *, isl_constraint *);
298 1.4.2.2 christos extern void print_isl_schedule (FILE *, isl_schedule *);
299 1.4.2.2 christos extern void debug_isl_schedule (isl_schedule *);
300 1.4.2.2 christos extern void print_isl_ast (FILE *, isl_ast_node *);
301 1.4.2.2 christos extern void debug_isl_ast (isl_ast_node *);
302 1.4.2.2 christos extern void debug_isl_set (isl_set *);
303 1.4.2.2 christos extern void debug_isl_map (isl_map *);
304 1.4.2.2 christos extern void debug_isl_union_map (isl_union_map *);
305 1.4.2.2 christos extern void debug_isl_aff (isl_aff *);
306 1.4.2.2 christos extern void debug_isl_constraint (isl_constraint *);
307 1.4.2.2 christos extern void debug_gmp_value (mpz_t);
308 1.4.2.2 christos extern void debug_scop_pbb (scop_p scop, int i);
309 1.4.2.2 christos extern void print_schedule_ast (FILE *, __isl_keep isl_schedule *, scop_p);
310 1.4.2.2 christos extern void debug_schedule_ast (__isl_keep isl_schedule *, scop_p);
311 1.4.2.2 christos
312 1.4.2.2 christos /* The basic block of the PBB. */
313 1.4.2.2 christos
314 1.4.2.2 christos static inline basic_block
315 1.4.2.2 christos pbb_bb (poly_bb_p pbb)
316 1.4.2.2 christos {
317 1.4.2.2 christos return GBB_BB (PBB_BLACK_BOX (pbb));
318 1.4.2.2 christos }
319 1.4.2.2 christos
320 1.4.2.2 christos static inline int
321 1.4.2.2 christos pbb_index (poly_bb_p pbb)
322 1.4.2.2 christos {
323 1.4.2.2 christos return pbb_bb (pbb)->index;
324 1.4.2.2 christos }
325 1.4.2.2 christos
326 1.4.2.2 christos /* The loop of the PBB. */
327 1.4.2.2 christos
328 1.4.2.2 christos static inline loop_p
329 1.4.2.2 christos pbb_loop (poly_bb_p pbb)
330 1.4.2.2 christos {
331 1.4.2.2 christos return gbb_loop (PBB_BLACK_BOX (pbb));
332 1.4.2.2 christos }
333 1.4.2.2 christos
334 1.4.2.2 christos /* The scop that contains the PDR. */
335 1.4.2.2 christos
336 1.4.2.2 christos static inline scop_p
337 1.4.2.2 christos pdr_scop (poly_dr_p pdr)
338 1.4.2.2 christos {
339 1.4.2.2 christos return PBB_SCOP (PDR_PBB (pdr));
340 1.4.2.2 christos }
341 1.4.2.2 christos
342 1.4.2.2 christos /* Set black box of PBB to BLACKBOX. */
343 1.4.2.2 christos
344 1.4.2.2 christos static inline void
345 1.4.2.2 christos pbb_set_black_box (poly_bb_p pbb, gimple_poly_bb_p black_box)
346 1.4.2.2 christos {
347 1.4.2.2 christos pbb->black_box = black_box;
348 1.4.2.2 christos }
349 1.4.2.2 christos
350 1.4.2.2 christos /* A helper structure to keep track of data references, polyhedral BBs, and
351 1.4.2.2 christos alias sets. */
352 1.4.2.2 christos
353 1.4.2.2 christos struct dr_info
354 1.4.2.2 christos {
355 1.4.2.2 christos enum {
356 1.4.2.2 christos invalid_alias_set = -1
357 1.4.2.2 christos };
358 1.4.2.2 christos /* The data reference. */
359 1.4.2.2 christos data_reference_p dr;
360 1.4.2.2 christos
361 1.4.2.2 christos /* The polyhedral BB containing this DR. */
362 1.4.2.2 christos poly_bb_p pbb;
363 1.4.2.2 christos
364 1.4.2.2 christos /* ALIAS_SET is the SCC number assigned by a graph_dfs of the alias graph.
365 1.4.2.2 christos -1 is an invalid alias set. */
366 1.4.2.2 christos int alias_set;
367 1.4.2.2 christos
368 1.4.2.2 christos /* Construct a DR_INFO from a data reference DR, an ALIAS_SET, and a PBB. */
369 1.4.2.2 christos dr_info (data_reference_p dr, poly_bb_p pbb,
370 1.4.2.2 christos int alias_set = invalid_alias_set)
371 1.4.2.2 christos : dr (dr), pbb (pbb), alias_set (alias_set) {}
372 1.4.2.2 christos };
373 1.4.2.2 christos
374 1.4.2.2 christos /* A SCOP is a Static Control Part of the program, simple enough to be
375 1.4.2.2 christos represented in polyhedral form. */
376 1.4.2.2 christos struct scop
377 1.4.2.2 christos {
378 1.4.2.2 christos /* A SCOP is defined as a SESE region. */
379 1.4.2.2 christos sese_info_p scop_info;
380 1.4.2.2 christos
381 1.4.2.2 christos /* Number of parameters in SCoP. */
382 1.4.2.2 christos graphite_dim_t nb_params;
383 1.4.2.2 christos
384 1.4.2.2 christos /* All the basic blocks in this scop that contain memory references
385 1.4.2.2 christos and that will be represented as statements in the polyhedral
386 1.4.2.2 christos representation. */
387 1.4.2.2 christos vec<poly_bb_p> pbbs;
388 1.4.2.2 christos
389 1.4.2.2 christos /* All the data references in this scop. */
390 1.4.2.2 christos vec<dr_info> drs;
391 1.4.2.2 christos
392 1.4.2.2 christos /* The context describes known restrictions concerning the parameters
393 1.4.2.2 christos and relations in between the parameters.
394 1.4.2.2 christos
395 1.4.2.2 christos void f (int8_t a, uint_16_t b) {
396 1.4.2.2 christos c = 2 a + b;
397 1.4.2.2 christos ...
398 1.4.2.2 christos }
399 1.4.2.2 christos
400 1.4.2.2 christos Here we can add these restrictions to the context:
401 1.4.2.2 christos
402 1.4.2.2 christos -128 >= a >= 127
403 1.4.2.2 christos 0 >= b >= 65,535
404 1.4.2.2 christos c = 2a + b */
405 1.4.2.2 christos isl_set *param_context;
406 1.4.2.2 christos
407 1.4.2.2 christos /* The context used internally by isl. */
408 1.4.2.2 christos isl_ctx *isl_context;
409 1.4.2.2 christos
410 1.4.2.2 christos /* SCoP original schedule. */
411 1.4.2.2 christos isl_schedule *original_schedule;
412 1.4.2.2 christos
413 1.4.2.2 christos /* SCoP transformed schedule. */
414 1.4.2.2 christos isl_schedule *transformed_schedule;
415 1.4.2.2 christos
416 1.4.2.2 christos /* The data dependence relation among the data references in this scop. */
417 1.4.2.2 christos isl_union_map *dependence;
418 1.4.2.2 christos };
419 1.4.2.2 christos
420 1.4.2.2 christos extern scop_p new_scop (edge, edge);
421 1.4.2.2 christos extern void free_scop (scop_p);
422 1.4.2.2 christos extern gimple_poly_bb_p new_gimple_poly_bb (basic_block, vec<data_reference_p>,
423 1.4.2.2 christos vec<scalar_use>, vec<tree>);
424 1.4.2.2 christos extern bool apply_poly_transforms (scop_p);
425 1.4.2.2 christos
426 1.4.2.2 christos /* Set the region of SCOP to REGION. */
427 1.4.2.2 christos
428 1.4.2.2 christos static inline void
429 1.4.2.2 christos scop_set_region (scop_p scop, sese_info_p region)
430 1.4.2.2 christos {
431 1.4.2.2 christos scop->scop_info = region;
432 1.4.2.2 christos }
433 1.4.2.2 christos
434 1.4.2.2 christos /* Returns the number of parameters for SCOP. */
435 1.4.2.2 christos
436 1.4.2.2 christos static inline graphite_dim_t
437 1.4.2.2 christos scop_nb_params (scop_p scop)
438 1.4.2.2 christos {
439 1.4.2.2 christos return scop->nb_params;
440 1.4.2.2 christos }
441 1.4.2.2 christos
442 1.4.2.2 christos /* Set the number of params of SCOP to NB_PARAMS. */
443 1.4.2.2 christos
444 1.4.2.2 christos static inline void
445 1.4.2.2 christos scop_set_nb_params (scop_p scop, graphite_dim_t nb_params)
446 1.4.2.2 christos {
447 1.4.2.2 christos scop->nb_params = nb_params;
448 1.4.2.2 christos }
449 1.4.2.2 christos
450 1.4.2.2 christos extern void scop_get_dependences (scop_p scop);
451 1.4.2.2 christos
452 1.4.2.2 christos bool
453 1.4.2.2 christos carries_deps (__isl_keep isl_union_map *schedule,
454 1.4.2.2 christos __isl_keep isl_union_map *deps,
455 1.4.2.2 christos int depth);
456 1.4.2.2 christos
457 1.4.2.2 christos extern bool build_poly_scop (scop_p);
458 1.4.2.2 christos extern bool graphite_regenerate_ast_isl (scop_p);
459 1.4.2.2 christos extern void build_scops (vec<scop_p> *);
460 1.4.2.2 christos extern void dot_all_sese (FILE *, vec<sese_l> &);
461 1.4.2.2 christos extern void dot_sese (sese_l &);
462 1.4.2.2 christos extern void dot_cfg ();
463 1.4.2.2 christos
464 1.4.2.2 christos #endif
465