OSDN Git Service

* config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Do not allow
[pf3gnuchains/gcc-fork.git] / gcc / graphite-poly.h
1 /* Graphite polyhedral representation.
2    Copyright (C) 2009 Free Software Foundation, Inc.
3    Contributed by Sebastian Pop <sebastian.pop@amd.com> and
4    Tobias Grosser <grosser@fim.uni-passau.de>.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3.  If not see
20 <http://www.gnu.org/licenses/>.  */
21
22 #ifndef GCC_GRAPHITE_POLY_H
23 #define GCC_GRAPHITE_POLY_H
24
25 typedef struct poly_dr *poly_dr_p;
26 DEF_VEC_P(poly_dr_p);
27 DEF_VEC_ALLOC_P (poly_dr_p, heap);
28
29 typedef struct poly_bb *poly_bb_p;
30 DEF_VEC_P(poly_bb_p);
31 DEF_VEC_ALLOC_P (poly_bb_p, heap);
32
33 typedef struct scop *scop_p;
34 DEF_VEC_P(scop_p);
35 DEF_VEC_ALLOC_P (scop_p, heap);
36
37 typedef ppl_dimension_type graphite_dim_t;
38
39 static inline graphite_dim_t pbb_dim_iter_domain (const struct poly_bb *);
40 static inline graphite_dim_t pbb_nb_params (const struct poly_bb *);
41 static inline graphite_dim_t scop_nb_params (scop_p);
42
43 /* A data reference can write or read some memory or we
44    just know it may write some memory.  */
45 enum poly_dr_type
46 {
47   PDR_READ,
48   /* PDR_MAY_READs are represented using PDR_READS.  This does not
49      limit the expressiveness.  */
50   PDR_WRITE,
51   PDR_MAY_WRITE
52 };
53
54 struct poly_dr
55 {
56   /* An identifier for this PDR.  */
57   int id;
58
59   /* The number of data refs identical to this one in the PBB.  */
60   int nb_refs;
61
62   /* A pointer to compiler's data reference description.  */
63   void *compiler_dr;
64
65   /* A pointer to the PBB that contains this data reference.  */
66   poly_bb_p pbb;
67
68   enum poly_dr_type type;
69
70   /* The access polyhedron contains the polyhedral space this data
71      reference will access.
72
73      The polyhedron contains these dimensions:
74
75       - The alias set (a):
76       Every memory access is classified in at least one alias set.
77
78       - The subscripts (s_0, ..., s_n):
79       The memory is accessed using zero or more subscript dimensions.
80
81       - The iteration domain (variables and parameters)
82
83      Do not hardcode the dimensions.  Use the following accessor functions:
84      - pdr_alias_set_dim
85      - pdr_subscript_dim
86      - pdr_iterator_dim
87      - pdr_parameter_dim
88
89      Example:
90
91      | int A[1335][123];
92      | int *p = malloc ();
93      |
94      | k = ...
95      | for i
96      |   {
97      |     if (unknown_function ())
98      |       p = A;
99      |       ... = p[?][?];
100      |     for j
101      |       A[i][j+k] = m;
102      |   }
103
104      The data access A[i][j+k] in alias set "5" is described like this:
105
106      | i   j   k   a  s0  s1   1
107      | 0   0   0   1   0   0  -5     =  0
108      |-1   0   0   0   1   0   0     =  0
109      | 0  -1  -1   0   0   1   0     =  0
110      | 0   0   0   0   1   0   0     >= 0  # The last four lines describe the
111      | 0   0   0   0   0   1   0     >= 0  # array size.
112      | 0   0   0   0  -1   0 1335    >= 0
113      | 0   0   0   0   0  -1 123     >= 0
114
115      The pointer "*p" in alias set "5" and "7" is described as a union of
116      polyhedron:
117
118
119      | i   k   a  s0   1
120      | 0   0   1   0  -5   =  0
121      | 0   0   0   1   0   >= 0
122
123      "or"
124
125      | i   k   a  s0   1
126      | 0   0   1   0  -7   =  0
127      | 0   0   0   1   0   >= 0
128
129      "*p" accesses all of the object allocated with 'malloc'.
130
131      The scalar data access "m" is represented as an array with zero subscript
132      dimensions.
133
134      | i   j   k   a   1
135      | 0   0   0  -1   15  = 0 */
136   ppl_Pointset_Powerset_C_Polyhedron_t accesses;
137
138   /* The number of subscripts.  */
139   graphite_dim_t nb_subscripts;
140 };
141
142 #define PDR_ID(PDR) (PDR->id)
143 #define PDR_NB_REFS(PDR) (PDR->nb_refs)
144 #define PDR_CDR(PDR) (PDR->compiler_dr)
145 #define PDR_PBB(PDR) (PDR->pbb)
146 #define PDR_TYPE(PDR) (PDR->type)
147 #define PDR_ACCESSES(PDR) (PDR->accesses)
148 #define PDR_NB_SUBSCRIPTS(PDR) (PDR->nb_subscripts)
149
150 void new_poly_dr (poly_bb_p, ppl_Pointset_Powerset_C_Polyhedron_t,
151                   enum poly_dr_type, void *, graphite_dim_t);
152 void free_poly_dr (poly_dr_p);
153 void debug_pdr (poly_dr_p);
154 void print_pdr (FILE *, poly_dr_p);
155 static inline scop_p pdr_scop (poly_dr_p pdr);
156
157 /* The dimension of the PDR_ACCESSES polyhedron of PDR.  */
158
159 static inline ppl_dimension_type
160 pdr_dim (poly_dr_p pdr)
161 {
162   ppl_dimension_type dim;
163   ppl_Pointset_Powerset_C_Polyhedron_space_dimension (PDR_ACCESSES (pdr),
164                                                       &dim);
165   return dim;
166 }
167
168 /* The dimension of the iteration domain of the scop of PDR.  */
169
170 static inline ppl_dimension_type
171 pdr_dim_iter_domain (poly_dr_p pdr)
172 {
173   return pbb_dim_iter_domain (PDR_PBB (pdr));
174 }
175
176 /* The number of parameters of the scop of PDR.  */
177
178 static inline ppl_dimension_type
179 pdr_nb_params (poly_dr_p pdr)
180 {
181   return scop_nb_params (pdr_scop (pdr));
182 }
183
184 /* The dimension of the alias set in PDR.  */
185
186 static inline ppl_dimension_type
187 pdr_alias_set_dim (poly_dr_p pdr)
188 {
189   poly_bb_p pbb = PDR_PBB (pdr);
190
191   return pbb_dim_iter_domain (pbb) + pbb_nb_params (pbb);
192 }
193
194 /* The dimension in PDR containing subscript S.  */
195
196 static inline ppl_dimension_type
197 pdr_subscript_dim (poly_dr_p pdr, graphite_dim_t s)
198 {
199   poly_bb_p pbb = PDR_PBB (pdr);
200
201   return pbb_dim_iter_domain (pbb) + pbb_nb_params (pbb) + 1 + s;
202 }
203
204 /* The dimension in PDR containing the loop iterator ITER.  */
205
206 static inline ppl_dimension_type
207 pdr_iterator_dim (poly_dr_p pdr ATTRIBUTE_UNUSED, graphite_dim_t iter)
208 {
209   return iter;
210 }
211
212 /* The dimension in PDR containing parameter PARAM.  */
213
214 static inline ppl_dimension_type
215 pdr_parameter_dim (poly_dr_p pdr, graphite_dim_t param)
216 {
217   poly_bb_p pbb = PDR_PBB (pdr);
218
219   return pbb_dim_iter_domain (pbb) + param;
220 }
221
222 /* Returns true when PDR is a "read".  */
223
224 static inline bool
225 pdr_read_p (poly_dr_p pdr)
226 {
227   return PDR_TYPE (pdr) == PDR_READ;
228 }
229
230 /* Returns true when PDR is a "write".  */
231
232 static inline bool
233 pdr_write_p (poly_dr_p pdr)
234 {
235   return PDR_TYPE (pdr) == PDR_WRITE;
236 }
237
238 /* Returns true when PDR is a "may write".  */
239
240 static inline bool
241 pdr_may_write_p (poly_dr_p pdr)
242 {
243   return PDR_TYPE (pdr) == PDR_MAY_WRITE;
244 }
245
246 typedef struct poly_scattering *poly_scattering_p;
247
248 struct poly_scattering
249 {
250   /* The scattering function containing the transformations.  */
251   ppl_Polyhedron_t scattering;
252
253   /* The number of local variables.  */
254   int nb_local_variables;
255
256   /* The number of scattering dimensions.  */
257   int nb_scattering;
258 };
259
260 /* POLY_BB represents a blackbox in the polyhedral model.  */
261
262 struct poly_bb
263 {
264   void *black_box;
265
266   scop_p scop;
267
268   /* The iteration domain of this bb.
269      Example:
270
271      for (i = a - 7*b + 8; i <= 3*a + 13*b + 20; i++)
272        for (j = 2; j <= 2*i + 5; j++)
273          for (k = 0; k <= 5; k++)
274            S (i,j,k)
275
276      Loop iterators: i, j, k
277      Parameters: a, b
278
279      | i >=  a -  7b +  8
280      | i <= 3a + 13b + 20
281      | j >= 2
282      | j <= 2i + 5
283      | k >= 0
284      | k <= 5
285
286      The number of variables in the DOMAIN may change and is not
287      related to the number of loops in the original code.  */
288   ppl_Pointset_Powerset_C_Polyhedron_t domain;
289
290   /* The data references we access.  */
291   VEC (poly_dr_p, heap) *drs;
292
293   /* The original scattering.  */
294   poly_scattering_p original;
295
296   /* The transformed scattering.  */
297   poly_scattering_p transformed;
298
299   /* A copy of the transformed scattering.  */
300   poly_scattering_p saved;
301
302   /* True when the PDR duplicates have already been removed.  */
303   bool pdr_duplicates_removed;
304 };
305
306 #define PBB_BLACK_BOX(PBB) ((gimple_bb_p) PBB->black_box)
307 #define PBB_SCOP(PBB) (PBB->scop)
308 #define PBB_DOMAIN(PBB) (PBB->domain)
309 #define PBB_DRS(PBB) (PBB->drs)
310 #define PBB_ORIGINAL(PBB) (PBB->original)
311 #define PBB_ORIGINAL_SCATTERING(PBB) (PBB->original->scattering)
312 #define PBB_TRANSFORMED(PBB) (PBB->transformed)
313 #define PBB_TRANSFORMED_SCATTERING(PBB) (PBB->transformed->scattering)
314 #define PBB_SAVED(PBB) (PBB->saved)
315 #define PBB_NB_LOCAL_VARIABLES(PBB) (PBB->transformed->nb_local_variables)
316 #define PBB_NB_SCATTERING_TRANSFORM(PBB) (PBB->transformed->nb_scattering)
317 #define PBB_PDR_DUPLICATES_REMOVED(PBB) (PBB->pdr_duplicates_removed)
318
319 extern void new_poly_bb (scop_p, void *);
320 extern void free_poly_bb (poly_bb_p);
321 extern void debug_loop_vec (poly_bb_p);
322 extern void schedule_to_scattering (poly_bb_p, int);
323 extern void print_pbb_domain (FILE *, poly_bb_p);
324 extern void print_pbb (FILE *, poly_bb_p);
325 extern void print_scop_context (FILE *, scop_p);
326 extern void print_scop (FILE *, scop_p);
327 extern void debug_pbb_domain (poly_bb_p);
328 extern void debug_pbb (poly_bb_p);
329 extern void print_pdrs (FILE *, poly_bb_p);
330 extern void debug_pdrs (poly_bb_p);
331 extern void debug_scop_context (scop_p);
332 extern void debug_scop (scop_p);
333 extern void print_scop_params (FILE *, scop_p);
334 extern void debug_scop_params (scop_p);
335 extern void print_iteration_domain (FILE *, poly_bb_p);
336 extern void print_iteration_domains (FILE *, scop_p);
337 extern void debug_iteration_domain (poly_bb_p);
338 extern void debug_iteration_domains (scop_p);
339 extern bool scop_do_interchange (scop_p);
340 extern bool scop_do_strip_mine (scop_p);
341 extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, Value);
342 extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, Value);
343 extern void pbb_remove_duplicate_pdrs (poly_bb_p);
344
345 /* The index of the PBB.  */
346
347 static inline int
348 pbb_index (poly_bb_p pbb)
349 {
350   return GBB_BB (PBB_BLACK_BOX (pbb))->index;
351 }
352
353 /* The scop that contains the PDR.  */
354
355 static inline scop_p
356 pdr_scop (poly_dr_p pdr)
357 {
358   return PBB_SCOP (PDR_PBB (pdr));
359 }
360
361 /* Set black box of PBB to BLACKBOX.  */
362
363 static inline void
364 pbb_set_black_box (poly_bb_p pbb, void *black_box)
365 {
366   pbb->black_box = black_box;
367 }
368
369 /* The number of loops around PBB: the dimension of the iteration
370    domain.  */
371
372 static inline graphite_dim_t
373 pbb_dim_iter_domain (const struct poly_bb *pbb)
374 {
375   scop_p scop = PBB_SCOP (pbb);
376   ppl_dimension_type dim;
377
378   ppl_Pointset_Powerset_C_Polyhedron_space_dimension (PBB_DOMAIN (pbb), &dim);
379   return dim - scop_nb_params (scop);
380 }
381
382 /* The number of params defined in PBB.  */
383
384 static inline graphite_dim_t
385 pbb_nb_params (const struct poly_bb *pbb)
386 {
387   scop_p scop = PBB_SCOP (pbb);
388
389   return scop_nb_params (scop);
390 }
391
392 /* The number of scattering dimensions in the SCATTERING polyhedron
393    of a PBB for a given SCOP.  */
394
395 static inline graphite_dim_t
396 pbb_nb_scattering_orig (const struct poly_bb *pbb)
397 {
398   return 2 * pbb_dim_iter_domain (pbb) + 1;
399 }
400
401 /* The number of scattering dimensions in PBB.  */
402
403 static inline graphite_dim_t
404 pbb_nb_scattering_transform (const struct poly_bb *pbb)
405 {
406   return PBB_NB_SCATTERING_TRANSFORM (pbb);
407 }
408
409 /* The number of dynamic scattering dimensions in PBB.  */
410
411 static inline graphite_dim_t
412 pbb_nb_dynamic_scattering_transform (const struct poly_bb *pbb)
413 {
414   /* This function requires the 2d + 1 scattering format to be
415      invariant during all transformations.  */
416   gcc_assert (PBB_NB_SCATTERING_TRANSFORM (pbb) % 2);
417   return PBB_NB_SCATTERING_TRANSFORM (pbb) / 2;
418 }
419
420 /* Returns the number of local variables used in the transformed
421    scattering polyhedron of PBB.  */
422
423 static inline graphite_dim_t
424 pbb_nb_local_vars (const struct poly_bb *pbb)
425 {
426   /* For now we do not have any local variables, as we do not do strip
427      mining for example.  */
428   return PBB_NB_LOCAL_VARIABLES (pbb);
429 }
430
431 /* The dimension in the domain of PBB containing the iterator ITER.  */
432
433 static inline ppl_dimension_type
434 pbb_iterator_dim (poly_bb_p pbb ATTRIBUTE_UNUSED, graphite_dim_t iter)
435 {
436   return iter;
437 }
438
439 /* The dimension in the domain of PBB containing the iterator ITER.  */
440
441 static inline ppl_dimension_type
442 pbb_parameter_dim (poly_bb_p pbb, graphite_dim_t param)
443 {
444   return param
445     + pbb_dim_iter_domain (pbb);
446 }
447
448 /* The dimension in the original scattering polyhedron of PBB
449    containing the scattering iterator SCATTER.  */
450
451 static inline ppl_dimension_type
452 psco_scattering_dim (poly_bb_p pbb ATTRIBUTE_UNUSED, graphite_dim_t scatter)
453 {
454   gcc_assert (scatter < pbb_nb_scattering_orig (pbb));
455   return scatter;
456 }
457
458 /* The dimension in the transformed scattering polyhedron of PBB
459    containing the scattering iterator SCATTER.  */
460
461 static inline ppl_dimension_type
462 psct_scattering_dim (poly_bb_p pbb ATTRIBUTE_UNUSED, graphite_dim_t scatter)
463 {
464   gcc_assert (scatter <= pbb_nb_scattering_transform (pbb));
465   return scatter;
466 }
467
468 ppl_dimension_type psct_scattering_dim_for_loop_depth (poly_bb_p,
469                                                        graphite_dim_t);
470
471 /* The dimension in the transformed scattering polyhedron of PBB of
472    the local variable LV.  */
473
474 static inline ppl_dimension_type
475 psct_local_var_dim (poly_bb_p pbb, graphite_dim_t lv)
476 {
477   gcc_assert (lv <= pbb_nb_local_vars (pbb));
478   return lv + pbb_nb_scattering_transform (pbb);
479 }
480
481 /* The dimension in the original scattering polyhedron of PBB
482    containing the loop iterator ITER.  */
483
484 static inline ppl_dimension_type
485 psco_iterator_dim (poly_bb_p pbb, graphite_dim_t iter)
486 {
487   gcc_assert (iter < pbb_dim_iter_domain (pbb));
488   return iter + pbb_nb_scattering_orig (pbb);
489 }
490
491 /* The dimension in the transformed scattering polyhedron of PBB
492    containing the loop iterator ITER.  */
493
494 static inline ppl_dimension_type
495 psct_iterator_dim (poly_bb_p pbb, graphite_dim_t iter)
496 {
497   gcc_assert (iter < pbb_dim_iter_domain (pbb));
498   return iter
499     + pbb_nb_scattering_transform (pbb)
500     + pbb_nb_local_vars (pbb);
501 }
502
503 /* The dimension in the original scattering polyhedron of PBB
504    containing parameter PARAM.  */
505
506 static inline ppl_dimension_type
507 psco_parameter_dim (poly_bb_p pbb, graphite_dim_t param)
508 {
509   gcc_assert (param < pbb_nb_params (pbb));
510   return param
511     + pbb_nb_scattering_orig (pbb)
512     + pbb_dim_iter_domain (pbb);
513 }
514
515 /* The dimension in the transformed scattering polyhedron of PBB
516    containing parameter PARAM.  */
517
518 static inline ppl_dimension_type
519 psct_parameter_dim (poly_bb_p pbb, graphite_dim_t param)
520 {
521   gcc_assert (param < pbb_nb_params (pbb));
522   return param
523     + pbb_nb_scattering_transform (pbb)
524     + pbb_nb_local_vars (pbb)
525     + pbb_dim_iter_domain (pbb);
526 }
527
528 /* The scattering dimension of PBB corresponding to the dynamic level
529    LEVEL.  */
530
531 static inline ppl_dimension_type
532 psct_dynamic_dim (poly_bb_p pbb, graphite_dim_t level)
533 {
534   graphite_dim_t result;
535   result = 1 + 2 * level;
536
537   gcc_assert (result < pbb_nb_scattering_transform (pbb));
538   return result;
539 }
540
541 /* Adds to the transformed scattering polyhedron of PBB a new local
542    variable and returns its index.  */
543
544 static inline graphite_dim_t
545 psct_add_local_variable (poly_bb_p pbb)
546 {
547   graphite_dim_t nlv = pbb_nb_local_vars (pbb);
548   ppl_dimension_type lv_column = psct_local_var_dim (pbb, nlv);
549   ppl_insert_dimensions (PBB_TRANSFORMED_SCATTERING (pbb), lv_column, 1);
550   PBB_NB_LOCAL_VARIABLES (pbb) += 1;
551   return nlv;
552 }
553
554 /* Adds a dimension to the transformed scattering polyhedron of PBB at
555    INDEX.  */
556
557 static inline void
558 psct_add_scattering_dimension (poly_bb_p pbb, ppl_dimension_type index)
559 {
560   gcc_assert (index < pbb_nb_scattering_transform (pbb));
561
562   ppl_insert_dimensions (PBB_TRANSFORMED_SCATTERING (pbb), index, 1);
563   PBB_NB_SCATTERING_TRANSFORM (pbb) += 1;
564 }
565
566 /* A SCOP is a Static Control Part of the program, simple enough to be
567    represented in polyhedral form.  */
568 struct scop
569 {
570   /* A SCOP is defined as a SESE region.  */
571   void *region;
572
573   /* Number of parameters in SCoP.  */
574   graphite_dim_t nb_params;
575
576   /* All the basic blocks in this scop that contain memory references
577      and that will be represented as statements in the polyhedral
578      representation.  */
579   VEC (poly_bb_p, heap) *bbs;
580
581   /* Data dependence graph for this SCoP.  */
582   struct graph *dep_graph;
583
584   /* The context describes known restrictions concerning the parameters
585      and relations in between the parameters.
586
587   void f (int8_t a, uint_16_t b) {
588     c = 2 a + b;
589     ...
590   }
591
592   Here we can add these restrictions to the context:
593
594   -128 >= a >= 127
595      0 >= b >= 65,535
596      c = 2a + b  */
597   ppl_Pointset_Powerset_C_Polyhedron_t context;
598
599   /* A hashtable of the data dependence relations for the original
600      scattering.  */
601   htab_t original_pddrs;
602 };
603
604 #define SCOP_BBS(S) (S->bbs)
605 #define SCOP_REGION(S) ((sese) S->region)
606 #define SCOP_DEP_GRAPH(S) (S->dep_graph)
607 #define SCOP_CONTEXT(S) (S->context)
608 #define SCOP_ORIGINAL_PDDRS(S) (S->original_pddrs)
609
610 extern scop_p new_scop (void *);
611 extern void free_scop (scop_p);
612 extern void free_scops (VEC (scop_p, heap) *);
613 extern void print_generated_program (FILE *, scop_p);
614 extern void debug_generated_program (scop_p);
615 extern void print_scattering_function (FILE *, poly_bb_p);
616 extern void print_scattering_functions (FILE *, scop_p);
617 extern void debug_scattering_function (poly_bb_p);
618 extern void debug_scattering_functions (scop_p);
619 extern int scop_max_loop_depth (scop_p);
620 extern int unify_scattering_dimensions (scop_p);
621 extern bool apply_poly_transforms (scop_p);
622 extern bool graphite_legal_transform (scop_p);
623
624 /* Set the region of SCOP to REGION.  */
625
626 static inline void
627 scop_set_region (scop_p scop, void *region)
628 {
629   scop->region = region;
630 }
631
632 /* Returns the number of parameters for SCOP.  */
633
634 static inline graphite_dim_t
635 scop_nb_params (scop_p scop)
636 {
637   return scop->nb_params;
638 }
639
640 /* Set the number of params of SCOP to NB_PARAMS.  */
641
642 static inline void
643 scop_set_nb_params (scop_p scop, graphite_dim_t nb_params)
644 {
645   scop->nb_params = nb_params;
646 }
647
648 /* Allocates a new empty poly_scattering structure.  */
649
650 static inline poly_scattering_p
651 poly_scattering_new (void)
652 {
653   poly_scattering_p res = XNEW (struct poly_scattering);
654
655   res->scattering = NULL;
656   res->nb_local_variables = 0;
657   res->nb_scattering = 0;
658   return res;
659 }
660
661 /* Free a poly_scattering structure.  */
662
663 static inline void
664 poly_scattering_free (poly_scattering_p s)
665 {
666   ppl_delete_Polyhedron (s->scattering);
667   free (s);
668 }
669
670 /* Copies S and return a new scattering.  */
671
672 static inline poly_scattering_p
673 poly_scattering_copy (poly_scattering_p s)
674 {
675   poly_scattering_p res = poly_scattering_new ();
676
677   ppl_new_C_Polyhedron_from_C_Polyhedron (&(res->scattering), s->scattering);
678   res->nb_local_variables = s->nb_local_variables;
679   res->nb_scattering = s->nb_scattering;
680   return res;
681 }
682
683 /* Saves the transformed scattering of PBB.  */
684
685 static inline void
686 store_scattering_pbb (poly_bb_p pbb)
687 {
688   gcc_assert (PBB_TRANSFORMED (pbb));
689
690   if (PBB_SAVED (pbb))
691     poly_scattering_free (PBB_SAVED (pbb));
692
693   PBB_SAVED (pbb) = poly_scattering_copy (PBB_TRANSFORMED (pbb));
694 }
695
696 /* Saves the scattering for all the pbbs in the SCOP.  */
697
698 static inline void
699 store_scattering (scop_p scop)
700 {
701   int i;
702   poly_bb_p pbb;
703
704   for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
705     store_scattering_pbb (pbb);
706 }
707
708 /* Restores the scattering of PBB.  */
709
710 static inline void
711 restore_scattering_pbb (poly_bb_p pbb)
712 {
713   gcc_assert (PBB_SAVED (pbb));
714
715   poly_scattering_free (PBB_TRANSFORMED (pbb));
716   PBB_TRANSFORMED (pbb) = poly_scattering_copy (PBB_SAVED (pbb));
717 }
718
719 /* Restores the scattering for all the pbbs in the SCOP.  */
720
721 static inline void
722 restore_scattering (scop_p scop)
723 {
724   int i;
725   poly_bb_p pbb;
726
727   for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
728     restore_scattering_pbb (pbb);
729 }
730
731 #endif