move all stride information into separate CloogStride structure
[cloog.git] / include / cloog / loop.h
blob1d87e5b2609fe9bebe8e1fb1b3684f84b52388c4
2 /**-------------------------------------------------------------------**
3 ** CLooG **
4 **-------------------------------------------------------------------**
5 ** loop.h **
6 **-------------------------------------------------------------------**
7 ** First version: october 26th 2001 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
14 * *
15 * Copyright (C) 2001-2005 Cedric Bastoul *
16 * *
17 * This library is free software; you can redistribute it and/or *
18 * modify it under the terms of the GNU Lesser General Public *
19 * License as published by the Free Software Foundation; either *
20 * version 2.1 of the License, or (at your option) any later version. *
21 * *
22 * This library is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
25 * Lesser General Public License for more details. *
26 * *
27 * You should have received a copy of the GNU Lesser General Public *
28 * License along with this library; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
30 * Boston, MA 02110-1301 USA *
31 * *
32 * CLooG, the Chunky Loop Generator *
33 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 * *
35 ******************************************************************************/
38 #ifndef CLOOG_LOOP_H
39 #define CLOOG_LOOP_H
40 #if defined(__cplusplus)
41 extern "C"
43 #endif
45 /**
46 * CloogLoop structure:
47 * this structure contains all the informations of a loop generated or to be
48 * generated.
49 * - if the loop has not been processed yet (it is not a result of a call to
50 * cloog_loop_generate), the domain is the whole iteration domain of a given
51 * block, the stride is 1 (i.e. there is no stride), block is necessarily not
52 * NULL and inner is NULL.
53 * - if the loop comes as a result of a cloog_loop_generate call, the domain
54 * describes the constraints (guards and loop bounds) for only one dimension
55 * (the last one: outer dimensions being considered as parameters), the stride
56 * may differ from one (this means that on the considered dimension, a step of
57 * 'stride' must be considered between integral point, the first integral
58 * point to be considered being the lower bound of the loop), inner may differ
59 * from NULL, meaning that there are further dimensions and nesting levels in
60 * the loop.
62 struct cloogloop
64 CloogState *state; /**< State. */
65 CloogDomain * domain ; /**< The iteration domain. */
66 int otl; /**< Loop is executed at most once. */
67 CloogStride *stride; /**< If not NULL, stride information on iterator
68 * (filled only after loop generation).
70 CloogBlock * block ; /**< The included statement block, NULL if none.*/
71 void * usr; /**< User field, for library user convenience.
72 * This pointer is not freed when the
73 * CloogLoop structure is freed.
75 struct cloogloop * inner ; /**< Loops at the next level. */
76 struct cloogloop * next ; /**< Next loop at the same level. */
77 } ;
78 typedef struct cloogloop CloogLoop ;
81 /******************************************************************************
82 * Structure display function *
83 ******************************************************************************/
84 void cloog_loop_print_structure(FILE *, CloogLoop *, int) ;
85 void cloog_loop_print(FILE *, CloogLoop *) ;
88 /******************************************************************************
89 * Memory deallocation function *
90 ******************************************************************************/
91 void cloog_loop_free(CloogLoop *) ;
94 /******************************************************************************
95 * Reading functions *
96 ******************************************************************************/
97 CloogLoop *cloog_loop_from_domain(CloogState *state, CloogDomain *domain,
98 int number);
99 CloogLoop * cloog_loop_read(CloogState *state,
100 FILE * foo, int number, int nb_parameters);
103 /******************************************************************************
104 * Processing functions *
105 ******************************************************************************/
106 CloogLoop * cloog_loop_block(CloogLoop *loop, int *scaldims, int nb_scattdims);
107 CloogLoop * cloog_loop_malloc(CloogState *state);
108 CloogLoop *cloog_loop_generate(CloogLoop *loop, CloogDomain *context,
109 int level, int scalar, int *scaldims, int nb_scattdims,
110 CloogOptions *options);
111 CloogLoop *cloog_loop_simplify(CloogLoop *loop, CloogDomain *context, int level);
112 void cloog_loop_scatter(CloogLoop *, CloogScattering *);
115 #if defined(__cplusplus)
117 #endif
118 #endif /* define _H */