PIPS
mappings.c
Go to the documentation of this file.
1 /*
2 
3  $Id: mappings.c 23375 2017-05-11 08:58:06Z ancourt $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23  */
24 #ifdef HAVE_CONFIG_H
25 #include "pips_config.h"
26 #endif
27 /* package generic effects : Be'atrice Creusillet 5/97
28  *
29  * File: mappings.c
30  * ~~~~~~~~~~~~~~~~~
31  *
32  * This File contains the mappings necessary for the computation of effects.
33  *
34  */
35 #include <stdlib.h>
36 #include "genC.h"
37 #include "linear.h"
38 #include "ri.h"
39 #include "misc.h"
40 #include "effects.h"
41 #include "effects-generic.h"
42 
43 /* REFERENCES */
46 
47 /* READ AND WRITE EFFECTS */
48 GENERIC_GLOBAL_FUNCTION(proper_rw_pointer_effects, statement_effects)
50 GENERIC_GLOBAL_FUNCTION(rw_pointer_effects, statement_effects)
51 GENERIC_GLOBAL_FUNCTION(invariant_rw_pointer_effects, statement_effects)
53 GENERIC_GLOBAL_FUNCTION(invariant_rw_effects, statement_effects)
54 /* for external use - identical to rw_effects */
55 GENERIC_GLOBAL_FUNCTION(cumulated_rw_effects, statement_effects)
56 
57 /* PROPER RW EFFECTS associated to expressions
58  */
60 
61 
62 /* IN AND OUT EFFECTS */
64 GENERIC_GLOBAL_FUNCTION(cumulated_in_effects, statement_effects)
65 GENERIC_GLOBAL_FUNCTION(invariant_in_effects, statement_effects)
66 
68 
69 /* LIVE IN AND LIVE OUT PATHS */
73 
74 /* USEFULL VARIABLES EFFECTS */
75 GENERIC_GLOBAL_FUNCTION(useful_variables_effects, entity_effects)
76 
77 
78 /* APIs to get lists of effects instead of RI's effects */
79 
80 list
82 {
84  ifdebug(8) pips_assert("proper rw pointer effects loaded are consistent", effects_consistent_p(e));
86 }
87 
89 {
90  effects e = make_effects(l_eff);
91  ifdebug(8) pips_assert("proper rw pointer effects to store are consistent", effects_consistent_p(e));
93 }
94 
96 {
97  effects e = make_effects(l_eff);
98  ifdebug(8) pips_assert("proper rw pointer effects to update are consistent", effects_consistent_p(e));
100 }
101 
102 list
104 {
106  ifdebug(8) pips_assert("proper rw effects loaded are consistent", effects_consistent_p(e));
108 }
109 
111 {
112  effects e = make_effects(l_eff);
113  ifdebug(8) pips_assert("proper rw effects to store are consistent", effects_consistent_p(e));
115 }
116 
118 {
119  effects e = make_effects(l_eff);
120  ifdebug(8) pips_assert("proper rw effects to update are consistent", effects_consistent_p(e));
122 }
123 
124 
125 list
127 {
129  ifdebug(8) pips_assert("rw pointer effects loaded are consistent", effects_consistent_p(e));
131 }
132 
133 void
135 {
136  effects e = make_effects(l_eff);
137  ifdebug(8) pips_assert("rw pointer effects to store are consistent", effects_consistent_p(e));
139 }
140 
141 void
143 {
144  effects e = make_effects(l_eff);
145  ifdebug(8) pips_assert("rw pointer effects to update are consistent", effects_consistent_p(e));
147 }
148 
149 list
151 {
152  effects e = load_rw_effects(s);
153  ifdebug(8) pips_assert("rw effects loaded are consistent", effects_consistent_p(e));
155 }
156 
157 void
159 {
160  effects e = make_effects(l_eff);
161  ifdebug(8) pips_assert("rw effects to store are consistent", effects_consistent_p(e));
162  store_rw_effects(s, e);
163 }
164 
165 void
167 {
168  effects e = make_effects(l_eff);
169  ifdebug(8) pips_assert("rw effects to update are consistent", effects_consistent_p(e));
170  update_rw_effects(s, e);
171 }
172 
173 list
175 {
177  ifdebug(8) pips_assert("invariant rw pointer effects loaded are consistent", effects_consistent_p(e));
179 }
180 
181 void
183 {
184  effects e = make_effects(l_eff);
185  ifdebug(8) pips_assert("invariant rw pointer effects to store are consistent", effects_consistent_p(e));
187 }
188 
189 void
191 {
192  effects e = make_effects(l_eff);
193  ifdebug(8) pips_assert("invariant rw pointer effects to update are consistent", effects_consistent_p(e));
195 }
196 
197 list
199 {
201  ifdebug(8) pips_assert("invariant rw effects loaded are consistent", effects_consistent_p(e));
203 }
204 
205 void
207 {
208  effects e = make_effects(l_eff);
209  ifdebug(8) pips_assert("invariant rw effects to store are consistent", effects_consistent_p(e));
211 }
212 
213 void
215 {
216  effects e = make_effects(l_eff);
217  ifdebug(8) pips_assert("invariant rw effects to update are consistent", effects_consistent_p(e));
219 }
220 
221 list
223 {
225  ifdebug(8) pips_assert("cumulated rw effects loaded are consistent", effects_consistent_p(e));
227 }
228 
229 void
231 {
232  effects e = make_effects(l_eff);
233  ifdebug(8) pips_assert("cumulated rw effects to store are consistent", effects_consistent_p(e));
235 }
236 
237 void
239 {
240  effects e = make_effects(l_eff);
241  ifdebug(8) pips_assert("cumulated rw effects to update are consistent", effects_consistent_p(e));
243 }
244 
245 
246 /* IN AND OUT EFFECTS */
247 
248 list
250 {
251  return(effects_effects(load_in_effects(s)));
252 }
253 
254 void
256 {
257  (*effects_descriptor_normalize_func)(l_eff);
258  store_in_effects(s, make_effects(l_eff));
259 }
260 
261 void
263 {
264  update_in_effects(s, make_effects(l_eff));
265 }
266 
267 
268 list
270 {
272 }
273 
274 void
276 {
278 }
279 
280 void
282 {
284 }
285 
286 list
288 {
290 }
291 
292 void
294 {
296 }
297 
298 void
300 {
302 }
303 
304 
305 list
307 {
308  return(effects_effects(load_out_effects(s)));
309 }
310 
311 void
313 {
314  (*effects_descriptor_normalize_func)(l_eff);
315  store_out_effects(s, make_effects(l_eff));
316 }
317 
318 void
320 {
321  update_out_effects(s, make_effects(l_eff));
322 }
323 
324 list
326 {
328 }
329 
330 void
332 {
333  store_live_in_paths(s, make_effects(l_paths));
334 }
335 
336 void
338 {
339  update_live_out_paths(s, make_effects(l_paths));
340 }
341 
342 list
344 {
346 }
347 
348 void
350 {
351  store_live_out_paths(s, make_effects(l_paths));
352 }
353 
354 void
356 {
357  update_live_out_paths(s, make_effects(l_paths));
358 }
359 
360 list
362 {
364 }
365 
366 void
368 {
370 }
371 
372 void
374 {
376 }
377 
378 
379 
380 
381 /* BACKWARD COMPATIBILITY */
382 
384 {
385  return(load_rw_effects_list(s));
386 }
388 {
389  store_rw_effects_list(s, t);
390 }
392 {
394 }
395 
397 {
399 }
401 {
403 }
405 {
407 }
408 
410 {
411  return(load_proper_rw_effects_list(s));
412 }
414 {
416 }
417 
418 
420 {
421  return(load_in_effects_list(s));
422 }
424 {
425  store_in_effects_list(s, t);
426 }
427 
429 {
431 }
433 {
435 }
436 
438 {
440 }
441 
443 {
445 }
447 {
449 }
450 
452 {
453  return(load_out_effects_list(s));
454 }
456 {
458 }
459 
bool effects_consistent_p(effects p)
Definition: effects.c:541
effects make_effects(list a)
Definition: effects.c:568
bool live_out_regions(const char *)
void update_invariant_rw_pointer_effects(statement, effects)
void update_proper_rw_pointer_effects_list(statement, list)
void store_live_out_regions(statement, effects)
void update_rw_pointer_effects(statement, effects)
void store_proper_rw_effects(statement, effects)
effects load_out_effects(statement)
list load_statement_proper_regions(statement)
void update_statement_inv_in_regions(statement, list)
list load_invariant_rw_effects_list(statement)
void store_in_effects(statement, effects)
void store_invariant_rw_effects(statement, effects)
void update_statement_local_regions(statement, list)
void store_rw_pointer_effects(statement, effects)
void update_live_out_regions_list(statement, list)
void update_invariant_rw_effects(statement, effects)
void update_in_effects(statement, effects)
void store_invariant_rw_pointer_effects_list(statement, list)
list load_out_effects_list(statement)
void store_live_out_paths(statement, effects)
list load_live_out_paths_list(statement)
effects load_proper_rw_effects(statement)
list load_live_in_paths_list(statement)
void store_in_effects_list(statement, list)
void store_statement_cumulated_in_regions(statement, list)
void update_live_out_paths_list(statement, list)
list load_invariant_in_effects_list(statement)
effects load_invariant_in_effects(statement)
void store_proper_rw_effects_list(statement, list)
effects load_in_effects(statement)
effects load_live_out_regions(statement)
void store_cumulated_in_effects(statement, effects)
void update_invariant_rw_pointer_effects_list(statement, list)
effects load_invariant_rw_pointer_effects(statement)
void update_proper_rw_effects_list(statement, list)
void store_proper_rw_pointer_effects(statement, effects)
void store_rw_effects_list(statement, list)
void update_invariant_in_effects(statement, effects)
list load_statement_inv_regions(statement)
effects load_rw_pointer_effects(statement)
void update_cumulated_rw_effects_list(statement, list)
void store_statement_inv_regions(statement, list)
list load_proper_rw_effects_list(statement)
void store_rw_effects(statement, effects)
list load_rw_pointer_effects_list(statement)
effects load_cumulated_in_effects(statement)
void update_live_out_paths(statement, effects)
list load_invariant_rw_pointer_effects_list(statement)
void update_in_effects_list(statement, list)
void update_cumulated_rw_effects(statement, effects)
void store_invariant_in_effects_list(statement, list)
void update_rw_pointer_effects_list(statement, list)
void update_cummulated_in_effects_list(statement, list)
void store_live_out_regions_list(statement, list)
void update_proper_rw_effects(statement, effects)
void update_cumulated_in_effects(statement, effects)
void update_live_in_paths_list(statement, list)
list load_in_effects_list(statement)
void store_proper_rw_pointer_effects_list(statement, list)
void store_out_effects(statement, effects)
void store_statement_inv_in_regions(statement, list)
void update_rw_effects_list(statement, list)
void store_invariant_rw_pointer_effects(statement, effects)
list load_cumulated_in_effects_list(statement)
void store_cumulated_rw_effects_list(statement, list)
void update_invariant_rw_effects_list(statement, list)
void store_statement_local_regions(statement, list)
void update_statement_inv_regions(statement, list)
list load_rw_effects_list(statement)
list load_cumulated_rw_effects_list(statement)
effects load_cumulated_rw_effects(statement)
void update_rw_effects(statement, effects)
void store_statement_proper_regions(statement, list)
void store_cumulated_in_effects_list(statement, list)
effects load_rw_effects(statement)
void store_live_in_paths_list(statement, list)
void store_cumulated_rw_effects(statement, effects)
void update_out_effects(statement, effects)
void store_out_effects_list(statement, list)
void store_live_out_paths_list(statement, list)
effects load_live_out_paths(statement)
void store_live_in_paths(statement, effects)
effects load_proper_rw_pointer_effects(statement)
void update_live_out_regions(statement, effects)
void update_out_effects_list(statement, list)
void store_invariant_rw_effects_list(statement, list)
list load_statement_out_regions(statement)
list load_statement_cumulated_in_regions(statement)
void store_rw_pointer_effects_list(statement, list)
list load_statement_in_regions(statement)
void store_statement_out_regions(statement, list)
effects load_live_in_paths(statement)
list load_proper_rw_pointer_effects_list(statement)
effects load_invariant_rw_effects(statement)
void store_invariant_in_effects(statement, effects)
list load_statement_local_regions(statement)
list load_statement_inv_in_regions(statement)
void update_invariant_in_effects_list(statement, list)
list load_live_out_regions_list(statement)
void update_proper_rw_pointer_effects(statement, effects)
void store_statement_in_regions(statement, list)
bool proper_references(const string)
bool in_effects(const string)
bool out_effects(const string)
bool cumulated_references(const string)
interface.c
#define effects_effects(x)
Definition: effects.h:710
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define GENERIC_GLOBAL_FUNCTION(name, type)
return(s1)
#define ifdebug(n)
Definition: sg.c:47
The structure used to build lists in NewGen.
Definition: newgen_list.h:41