OSDN Git Service

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