2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: october 26th 2001 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
17 * This is free software; you can redistribute it and/or modify it under the *
18 * terms of the GNU General Public License as published by the Free Software *
19 * Foundation; either version 2 of the License, or (at your option) any later *
22 * This software is distributed in the hope that it will be useful, but *
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27 * You should have received a copy of the GNU General Public License along *
28 * with software; if not, write to the Free Software Foundation, Inc., *
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
31 * CLooG, the Chunky Loop Generator *
32 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 ******************************************************************************/
39 #if defined(__cplusplus)
45 * CloogLoop structure:
46 * this structure contains all the informations of a loop generated or to be
48 * - if the loop has not been processed yet (it is not a result of a call to
49 * cloog_loop_generate), the domain is the whole iteration domain of a given
50 * block, the stride is 1 (i.e. there is no stride), block is necessarily not
51 * NULL and inner is NULL.
52 * - if the loop comes as a result of a cloog_loop_generate call, the domain
53 * describes the constraints (guards and loop bounds) for only one dimension
54 * (the last one: outer dimensions being considered as parameters), the stride
55 * may differ from one (this means that on the considered dimension, a step of
56 * 'stride' must be considered between integral point, the first integral
57 * point to be considered being the lower bound of the loop), inner may differ
58 * from NULL, meaning that there are further dimensions and nesting levels in
62 { CloogDomain
* _domain
; /**< The iteration domain. */
63 Value _stride
; /**< The stride for the corresponding iterator
64 * (filled only after loop generation).
66 CloogBlock
* _block
; /**< The included statement block, NULL if none.*/
67 void * _usr
; /**< User field, for library user convenience.
68 * This pointer is not freed when the
69 * CloogLoop structure is freed.
71 struct cloogloop
* inner
; /**< Loops at the next level. */
72 struct cloogloop
* next
; /**< Next loop at the same level. */
74 typedef struct cloogloop CloogLoop
;
77 static inline CloogDomain
*cloog_loop_domain (CloogLoop
*l
)
82 static inline void cloog_loop_set_domain (CloogLoop
*l
, CloogDomain
*d
)
87 static inline Value
cloog_loop_stride (CloogLoop
*l
)
92 static inline void cloog_loop_set_stride (CloogLoop
*l
, Value v
)
94 value_assign (l
->_stride
, v
);
97 static inline void cloog_loop_clear_stride (CloogLoop
*l
)
99 value_clear_c (l
->_stride
);
102 static inline void cloog_loop_init_stride (CloogLoop
*l
)
104 value_init_c (l
->_stride
);
107 static inline void cloog_loop_set_si_stride (CloogLoop
*l
, int i
)
109 value_set_si (l
->_stride
, i
);
112 static inline CloogBlock
*cloog_loop_block (CloogLoop
*l
)
117 static inline void cloog_loop_set_block (CloogLoop
*l
, CloogBlock
*b
)
122 static inline void *cloog_loop_usr (CloogLoop
*l
)
127 static inline void cloog_loop_set_usr (CloogLoop
*l
, void *u
)
133 /******************************************************************************
134 * Structure display function *
135 ******************************************************************************/
136 void cloog_loop_print_structure(FILE *, CloogLoop
*, int) ;
137 void cloog_loop_print(FILE *, CloogLoop
*) ;
140 /******************************************************************************
141 * Memory deallocation function *
142 ******************************************************************************/
143 void cloog_loop_free(CloogLoop
*) ;
146 /******************************************************************************
147 * Reading functions *
148 ******************************************************************************/
149 CloogLoop
* cloog_loop_read(FILE *, int, int) ;
152 /******************************************************************************
153 * Processing functions *
154 ******************************************************************************/
155 CloogLoop
* cloog_loop_malloc(void);
156 CloogLoop
* cloog_loop_generate(CloogLoop
*, CloogDomain
*, int, int,
157 int *, int, int, CloogOptions
*) ;
158 CloogLoop
* cloog_loop_simplify(CloogLoop
*, CloogDomain
*, int, int) ;
159 void cloog_loop_scatter(CloogLoop
*, CloogDomain
*) ;
162 #if defined(__cplusplus)
165 #endif /* define _H */