Directly print OpenScop statement bodies when possible
[cloog.git] / include / cloog / options.h
blob223357905d2dce705933e0359a92cc52cefb5caa
2 /**-------------------------------------------------------------------**
3 ** CLooG **
4 **-------------------------------------------------------------------**
5 ** options.h **
6 **-------------------------------------------------------------------**
7 ** First version: april 19th 2003 **
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 ******************************************************************************/
37 #include <stdio.h>
39 #ifndef CLOOG_OPTIONS_H
40 #define CLOOG_OPTIONS_H
41 #if defined(__cplusplus)
42 extern "C"
44 #endif
47 /* Uncomment the following line if you want some information about
48 * maximum total allocated memory for code generation.
49 #define CLOOG_MEMORY
51 #define CLOOG_SCALARS
53 struct osl_scop;
55 struct cloogoptions;
56 typedef struct cloogoptions CloogOptions;
57 struct osl_scop;
59 struct cloogoptions
61 CloogState *state; /* State. */
62 /* OPTIONS FOR LOOP GENERATION */
63 int l ; /* Last level to optimize. */
64 int f ; /* First level to optimize. */
65 int stop ; /* Level to stop code generation. */
66 int strides ; /* 1 if user wants to handle non-unit strides (then loop
67 * increment can be something else than one), 0 otherwise.
69 int sh; /* 1 for computing simple hulls */
70 int first_unroll; /* The first dimension to unroll */
72 /* OPTIONS FOR PRETTY PRINTING */
73 int esp ; /* 1 if user wants to spread all equalities, i.e. when there
74 * is something like "i = 3*j + 1 ; A[i] = 0 ;" the generator
75 * will write "A[3*j + 1] = 0 ;", 0 otherwise.
77 int fsp ; /* The iteration level where equalities spreading can begin
78 * (it might happen that the user wants not to spread values
79 * of scattering iterators).
81 int otl ; /* 1 for eliminate loops running just one time and write them
82 * as an affectation of the iterator, 0 otherwise.
84 int block ; /* 1 to make one new block {...} per new dimension,
85 * 0 otherwise.
87 int compilable; /* 1 to generate a compilable code by using
88 * preprocessing, 0 otherwise.
90 int callable; /* 1 to generate callable code by using
91 * preprocessing, 0 otherwise.
93 int language; /* 1 to generate FORTRAN, 0 for C otherwise. */
95 int save_domains;/* Save unsimplified copy of domain. */
97 /* MISC OPTIONS */
98 char * name ; /* Name of the input file. */
99 float time ; /* Time spent for code generation in seconds. */
100 int openscop; /* 1 if the input file has OpenScop format, 0 otherwise. */
101 struct osl_scop *scop; /* Input OpenScop scop if any, NULL otherwise. */
102 #ifdef CLOOG_MEMORY
103 int memory ; /* Memory spent for code generation in kilobytes. */
104 #endif
105 int quiet; /* Don't print any informational messages. */
106 /* UNDOCUMENTED OPTIONS FOR THE AUTHOR ONLY */
107 int leaks ; /* 1 if I want to print the allocation statistics,
108 * 0 otherwise.
110 int backtrack; /* 1 to perform backtracking in
111 * Quillere's algorithm, 0 otherwise.
113 int override ; /* 1 if I want to bypass CLooG decisions on option correctness
114 * (generated code may be incorrect), 0 otherwise.
116 int structure ; /* 1 if I want to print the CloogProgram structure before the
117 * pretty printed code, 0 otherwise.
119 int noblocks ; /* 1 if I don't want to make statement blocks, 0 otherwise. */
120 int noscalars ; /* 1 if I don't want to use scalar dimensions, 0 otherwise. */
121 int nosimplify; /* 1 if I don't want to simplify polyhedra, 0 otherwise. */
125 /******************************************************************************
126 * Error reporting functions *
127 ******************************************************************************/
129 enum cloog_msg_type { CLOOG_ERROR, CLOOG_WARNING, CLOOG_INFO };
131 void cloog_msg(CloogOptions *options, enum cloog_msg_type type,
132 const char *msg, ...);
133 void cloog_die(const char *msg, ...);
136 /******************************************************************************
137 * Structure display function *
138 ******************************************************************************/
139 void cloog_options_print(FILE *, CloogOptions *) ;
142 /******************************************************************************
143 * Memory deallocation function *
144 ******************************************************************************/
145 void cloog_options_free(CloogOptions *) ;
148 /******************************************************************************
149 * Reading function *
150 ******************************************************************************/
151 void cloog_options_read(CloogState *state, int argc, char **argv,
152 FILE **input, FILE **output, CloogOptions **options);
155 /******************************************************************************
156 * Processing functions *
157 ******************************************************************************/
158 CloogOptions *cloog_options_malloc(CloogState *state);
159 void cloog_options_copy_from_osl_scop(struct osl_scop *, CloogOptions *);
162 #if defined(__cplusplus)
164 #endif
165 #endif /* define _H */