PIPS
compile_regions.c
Go to the documentation of this file.
1 /* Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier
2 
3 This file is part of STEP.
4 
5 The program is distributed under the terms of the GNU General Public
6 License.
7 */
8 
9 #ifdef HAVE_CONFIG_H
10  #include "pips_config.h"
11 #endif
12 
13 #include "defines-local.h"
14 #include "prettyprint.h"
15 
16 /*
17  Voir si n'existe pas dans Libs/effect
18 */
19 static bool combinable_regions_p(region r1, region r2)
20 {
21  bool same_var, same_act;
22 
24  return(true);
25 
26  same_var = (region_entity(r1) == region_entity(r2));
27  same_act = action_equal_p(region_action(r1), region_action(r2));
28 
29  return(same_var && same_act);
30 }
31 
32 static bool region_interlaced_p(list send_regions, region r)
33 {
34  bool interlaced = false;
35  pips_debug(1, "begin send_regions = %p, r = %p\n", send_regions, r);
36 
37  if(region_write_p(r))
38  {
39  bool first = true;
40 
41  FOREACH(REGION, reg, send_regions)
42  {
43  if(combinable_regions_p(reg, r))
44  {
45  assert(first);
46  interlaced = step_interlaced_p(reg);
47  first = false;
48  }
49  }
50  }
51  pips_debug(1, "end\n");
52  return interlaced;
53 }
54 
55 static bool reduction_p(set reductions_l[STEP_UNDEF_REDUCE], entity e)
56 {
57  bool is_reduction = false;
58  int op;
59 
60  pips_debug(1, "begin\n");
61 
62  for(op=0; !is_reduction && op<STEP_UNDEF_REDUCE; op++)
63  is_reduction = set_belong_p(reductions_l[op], e);
64 
65  pips_debug(1, "end\n");
66  return is_reduction;
67 }
68 
69 
70 static bool comm_partial_p(list send_regions, region r)
71 {
72  bool partial_p = true;
73  pips_debug(1, "begin\n");
74  if(region_write_p(r))
75  {
76  bool first = true;
77 
78  FOREACH(REGION, reg, send_regions)
79  {
80  if(combinable_regions_p(reg, r))
81  {
82  assert(first);
83  partial_p = step_partial_p(reg);
84  first = false;
85  }
86  }
87  }
88  pips_debug(1, "end partial_p = %d\n", partial_p);
89  return partial_p;
90 }
91 
92 /*
93  genere un statement de la forme :
94  array_region(bound_name,dim,index) = expr_bound
95 */
96 static statement bound_to_statement(entity mpi_module, list expr_bound, entity array_region, string bound_name, int dim, list index)
97 {
98  pips_debug(1, "begin array_region = %p\n", array_region);
99 
100  pips_assert("expression", !ENDP(expr_bound));
101  statement s;
103  list dims = CONS(EXPRESSION, step_symbolic_expression(bound_name, mpi_module),
105 
106  bool is_fortran = fortran_module_p(get_current_module_entity());
107  if (!is_fortran)
108  {
109  list l = NIL;
110  FOREACH(EXPRESSION, e, dims)
111  {
113  e,
114  int_to_expression(1)),
115  l);
116  }
117  dims = l;
118  }
119 
120  expression expr = reference_to_expression(make_reference(array_region, dims));
121 
122  if ( gen_length(expr_bound) != 1 )
123  {
124  if(strncmp(bound_name, STEP_INDEX_SLICE_LOW_NAME, strlen(bound_name)) == 0)
126  else if (strncmp(bound_name, STEP_INDEX_SLICE_UP_NAME, strlen(bound_name)) == 0)
128  else
129  pips_internal_error("unexpected bound name %s", bound_name);
130  s = make_assign_statement(expr, call_to_expression(make_call(op, expr_bound)));
131  }
132  else
133  s = make_assign_statement(expr, EXPRESSION(CAR(expr_bound)));
134 
135  pips_debug(1, "end\n");
136  return s;
137 }
138 
140 {
141  Psysteme sys = region_system(reg);
142  Pcontrainte c;
143  list expression_l = NIL;
144 
145  entity comparator;
148  else
150 
151  for(c = equality?sc_egalites(sys):sc_inegalites(sys); !CONTRAINTE_UNDEFINED_P(c); c = c->succ)
152  {
153  int coef_phi = 0;
155  {
157  coef_phi = VALUE_TO_INT(vect_coeff((Variable)phi,c->vecteur));
158  if(coef_phi != 0)
159  break;
160  }
161  if(coef_phi == 0)
162  {
163  expression expr = MakeBinaryCall(comparator,
165  int_to_expression(0));
166  expression_l = CONS(EXPRESSION, expr, expression_l);
167  }
168  }
169  return expression_l;
170 }
171 
172 /*
173  si equality=true :
174 
175  recherche la premiere contrainte d'egalite portant sur la variable
176  PHI du systeme de contraintes sys et transforme cette contrainte en
177  2 expressions, l'une traduisant le contrainte d'inferiorite (ajouter
178  a expr_l), l'autre traduisant la contrainte de superiorite (ajoutée
179  a expr_u)
180 
181  retourne true si une contrainte d'egalite a ete trouve, false sinon.
182 
183  si equality=false :
184  traduit l'ensemble des contraintes d'inegalite portant sur la variable PHI.
185 
186  Les expressions traduisant une contrainte d'inferiorie (de
187  superiorite) sont ajoutes à la liste expr_l (expr_u)
188 
189 */
190 /*
191  Voir make_contrainte_expression
192 */
193 
194 static bool contraintes_to_expression(bool equality, entity phi, Psysteme sys, list *expr_l, list *expr_u)
195 {
196  Pcontrainte c;
197  bool found_equality=false;
198 
199  pips_debug(1, "begin\n");
200  for(c = equality?sc_egalites(sys):sc_inegalites(sys); !found_equality && !CONTRAINTE_UNDEFINED_P(c); c = c->succ)
201  {
202  int coef_phi=VALUE_TO_INT(vect_coeff((Variable)phi,c->vecteur));
203  if(coef_phi != 0)
204  {
205  expression expr;
206  Pvecteur coord,v = vect_del_var(c->vecteur, (Variable)phi);
207  bool up_bound = (coef_phi > 0);
208  bool low_bound = !up_bound;
209 
210  //construction des expressions d'affectation
211  if(VECTEUR_NUL_P(v))
212  expr = int_to_expression(0);
213  else
214  {
215  if (coef_phi > 0) //contrainte de type : coef_phi*phi <= "vecteur"
216  {
217  for (coord = v; coord!=NULL; coord=coord->succ)
218  val_of(coord) = -val_of(coord);
219  coef_phi = -coef_phi;
220  }
221 
222  expr = make_vecteur_expression(v);
223  if (coef_phi != -1)
224  expr = make_op_exp("/", expr, int_to_expression(-coef_phi));
225  }
226 
227  if (equality || low_bound)
228  *expr_l = CONS(EXPRESSION,copy_expression(expr), *expr_l);
229  if (equality || up_bound)
230  *expr_u = CONS(EXPRESSION,copy_expression(expr), *expr_u);
231 
232  free_expression(expr);
233  found_equality = equality;
234  }
235  }
236  pips_debug(1, "end\n");
237  return found_equality;
238 }
239 
240 /*
241  Generation of
242 
243  // compute_region_statement
244  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_LOW-1] = MAX(STEP_i_LOW, 0);
245  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_UP-1] = MIN(STEP_i_UP, 99999);
246 
247  or
248 
249  if( phi_free_contrainte_1 && ... && phi_free_contrainte_n ) ) {
250  // compute_region_statement
251  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_LOW-1] = MAX(STEP_i_LOW, 0);
252  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_UP-1] = MIN(STEP_i_UP, 99999);
253  }
254  else {
255  // empty_region_statement
256  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_LOW-1] = 99999;
257  STEP_RR_a[IDX-1][1-1][STEP_INDEX_SLICE_UP-1] = 0;
258  }
259 
260 */
261 
262 
263 static void compute_region(entity mpi_module, region reg, entity array_region, bool loop_p, statement *compute_regions_stmt)
264 {
265  pips_debug(1, "begin array_region = %p\n", array_region);
266  Psysteme sys = region_system(reg);
268 
269  if(ENDP(bounds_array))
270  {
271  pips_debug(0,"Current array : %s\n", entity_name(region_entity(reg)));
272  pips_assert("defined array bounds", 0);
273  }
274 
275  list index_slice = NIL;
276  if (loop_p)
277  {
278  entity workchunk_id = step_local_slice_index(mpi_module);
279  index_slice = CONS(EXPRESSION, entity_to_expression(workchunk_id), index_slice);
280  }
281 
282  statement empty_region_stmt = statement_undefined;
283  list phi_free_contraints = NIL;
284  phi_free_contraints = gen_nconc(phi_free_contraints_to_expressions(true, reg), phi_free_contraints);
285  phi_free_contraints = gen_nconc(phi_free_contraints_to_expressions(false, reg), phi_free_contraints);
286  if (!ENDP(phi_free_contraints))
287  empty_region_stmt = make_empty_block_statement();
288 
289  statement compute_region_stmt = make_empty_block_statement();
290  int dim = 0;
291 
292  // on parcourt dans l'ordre des indices (PHI1, PHI2, ...) chaque PHIi correspond a une dimension dim
293 
295  {
296  list expr_l = NIL;
297  list expr_u = NIL;
299  dimension bounds_d = DIMENSION(gen_nth(dim, bounds_array)); // gen_nth numerote les element a partir de 0 et ...
300  dim++; // ... les tableaux de region numerote les dimensions a partir de 1
301 
302  // on determine les listes d'expression expr_l (et expr_u) correspondant aux
303  // contraites low (et up) portant sur la variable PHI courante
304  // ex: L <= PHI1 + 1 et PHI1 -1 <= U
305  // expr_l contient l'expression (L-1) et expr_u contient l'expression (U+1)
306 
307  // pips_assert("empty list", ENDP(expr_l) && ENDP(expr_u));
308  // recherche et transformation des contraintes d'equalites portant sur phi
309  contraintes_to_expression(true, phi, sys, &expr_l, &expr_u);
310  // recherche et transformation des contraintes d'inequalites portant sur phi
311  contraintes_to_expression(false, phi, sys, &expr_l, &expr_u);
312 
313  // ajout contraintes liees aux bornes d'indexation du tableau pour la dimension courante
314  if(ENDP(expr_l))
315  expr_l = CONS(EXPRESSION, copy_expression(dimension_lower(bounds_d)), expr_l);
316  if(ENDP(expr_u))
317  expr_u = CONS(EXPRESSION, copy_expression(dimension_upper(bounds_d)), expr_u);
318 
319  /*
320  generation des statements : array_region(bound_name, dim, index_slice) = expr_bound
321  */
322  statement b1 = bound_to_statement(mpi_module, expr_l, array_region, STEP_INDEX_SLICE_LOW_NAME, dim, index_slice);
323  statement b2 = bound_to_statement(mpi_module, expr_u, array_region, STEP_INDEX_SLICE_UP_NAME, dim, index_slice);
324 
325  ifdebug(2)
326  {
327  pips_debug(2, "b1\n");
329  pips_debug(2, "b2\n");
331  }
332  insert_statement(compute_region_stmt, b1, false);
333  insert_statement(compute_region_stmt, b2, false);
334 
335  if (!ENDP(phi_free_contraints))
336  {
337  expr_l = CONS(EXPRESSION, copy_expression(dimension_upper(bounds_d)), NIL);
338  expr_u = CONS(EXPRESSION, copy_expression(dimension_lower(bounds_d)), NIL);
339 
340  b1 = bound_to_statement(mpi_module, expr_l, array_region, STEP_INDEX_SLICE_LOW_NAME, dim, index_slice);
341  b2 = bound_to_statement(mpi_module, expr_u, array_region, STEP_INDEX_SLICE_UP_NAME, dim, index_slice);
342 
343  insert_statement(empty_region_stmt, b1, false);
344  insert_statement(empty_region_stmt, b2, false);
345  }
346 
347  }
348 
349  if (!ENDP(phi_free_contraints))
350  {
352  expression cond_expr = expression_list_to_binary_operator_call(phi_free_contraints, and_op);
353 
354  insert_statement(*compute_regions_stmt,
356  make_test(cond_expr,
357  compute_region_stmt,
358  empty_region_stmt))),
359  false);
360  string comment_str = strdup(" Inverted bounds correspond to empty regions\n Used when work concerns specific data ex: print A[5]\n In this case, only concerned process sends non empty regions\n");
361  put_a_comment_on_a_statement(empty_region_stmt, comment_str);
362  }
363  else
364  insert_statement(*compute_regions_stmt, compute_region_stmt, false);
365 
366  pips_debug(1, "end\n");
367 }
368 
369 static bool region_reduction_p(set reductions_l[STEP_UNDEF_REDUCE], region reg)
370 {
371  entity array = region_entity(reg);
372 
373  return region_write_p(reg) && reduction_p(reductions_l, array);
374 }
375 
376 static void generate_call_set_regionarray(entity mpi_module, region reg, entity array_region, bool loop_p, bool is_reduction, bool is_interlaced, statement *set_regions_stmt)
377 {
378  pips_debug(1, "begin\n");
379 
380  entity array = region_entity(reg);
381 
382  expression expr_nb_workchunk = loop_p?entity_to_expression(get_entity_step_commsize(mpi_module)):int_to_expression(1);
383  statement set_stmt = region_read_p(reg)?
384  build_call_STEP_set_recvregions(array, expr_nb_workchunk, array_region):
385  build_call_STEP_set_sendregions(array, expr_nb_workchunk, array_region, is_interlaced, is_reduction);
386  insert_statement(*set_regions_stmt, set_stmt, false);
387 
388  pips_debug(1, "end\n");
389 }
390 
391 /* pourquoi flush et non pas alltoall ? */
392 static void generate_call_stepalltoall(entity mpi_module, region reg, bool is_reduction, bool is_interlaced, bool is_partial, statement *stepalltoall_stmt)
393 {
394  entity array = region_entity(reg);
395 
396  if(!is_reduction)
397  {
398  statement comm_stmt = build_call_STEP_AllToAll(mpi_module, array, is_partial, is_interlaced);
399  insert_statement(*stepalltoall_stmt, comm_stmt, false);
400  }
401 }
402 
403 static void region_to_statement(entity mpi_module, region reg, bool loop_p, bool is_reduction, bool is_interlaced, bool is_partial, statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
404 {
405  pips_debug(1,"begin mpi_module = %s, region = %p\n", entity_name(mpi_module), reg);
406 
407  entity array = region_entity(reg);
408  pips_debug(2, "array = %s\n", entity_name(array));
409 
410  /*
411  Elimination of redundancies
412  */
414 
415  /*
416  Add region description in comments
417  */
418  string str_eff = text_to_string(text_rw_array_regions(CONS(REGION, reg, NIL)));
419  statement comment_stmt = make_plain_continue_statement();
420  put_a_comment_on_a_statement(comment_stmt, str_eff);
421 
422  insert_statement(*compute_regions_stmt, comment_stmt, false);
423 
424 
425  /*
426  Create STEP_RR and STEP_SR array entities
427  */
429 
430  /* bug bug bug si on inverse les instr expr_nb_region et region_array_name alors bug. POURQUOI??*/
431 
432  string region_array_name = region_read_p(reg)?STEP_RR_NAME(array):STEP_SR_NAME(array);
433  pips_debug(2, "region_array_name = %s\n", region_array_name);
434 
435  entity region_array = step_local_regionArray(mpi_module, array, region_array_name, expr_nb_region);
436  pips_debug(2, "region_array = %p\n", region_array);
437 
438  /*
439  Compute regions
440  */
441  compute_region(mpi_module, reg, region_array, loop_p, compute_regions_stmt);
442 
443  /*
444  Set regions
445  */
446 
447  generate_call_set_regionarray(mpi_module, reg, region_array, loop_p, is_reduction, is_interlaced, set_regionarray_stmt);
448 
449  /*
450  stepalltoall_stmt
451 
452  Pour les régions SEND ET (?) RECV
453  */
454 
455  generate_call_stepalltoall(mpi_module, reg, is_reduction, is_interlaced, is_partial, stepalltoall_stmt);
456 
457  pips_debug(1, "end\n");
458 }
459 
460 static void transform_regions_to_statement(entity mpi_module, list regions_l, bool loop_p, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE],
461  statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
462 {
463  pips_debug(1, "begin regions_l = %p, pure_send_l = %p\n", regions_l, send_as_comm_l);
464 
465  *compute_regions_stmt = make_empty_block_statement();
466  *set_regionarray_stmt = make_empty_block_statement();
467  *stepalltoall_stmt = make_empty_block_statement();
468 
469  FOREACH(REGION, reg, regions_l)
470  {
471  bool is_reduction = region_reduction_p(reductions_l, reg);
472  bool is_interlaced = region_interlaced_p(send_as_comm_l, reg);
473  bool is_partial = comm_partial_p(send_as_comm_l, reg);
474 
475  region_to_statement(mpi_module, reg, loop_p, is_reduction, is_interlaced, is_partial, compute_regions_stmt, set_regionarray_stmt, stepalltoall_stmt);
476  }
477 
478  pips_debug(1, "end\n");
479 }
480 
481 static void add_workchunk_loop(entity mpi_module, bool loop_p, loop loop_stmt, statement *compute_regions_stmt)
482 {
483  pips_debug(1, "begin\n");
484  /*
485  ajout de la boucle parcourant les workchunks
486  suppression du test !entity_undefined_p(index) : redondant avec loop_p?
487  */
488  if( loop_p &&
489  !ENDP(statement_block(*compute_regions_stmt)))
490  {
491  generate_call_get_workchunk_loopbounds(mpi_module, loop_stmt, compute_regions_stmt);
492 
493  generate_loop_workchunk(mpi_module, compute_regions_stmt);
494  }
495  pips_debug(1, "end\n");
496 }
497 
498 void compile_regions(entity new_module, list regions_l, bool loop_p, loop loop_stmt, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE], statement mpi_begin_stmt, statement mpi_end_stmt)
499 {
500  statement compute_regions_stmt, set_regions_stmt, flush_regions_stmt;
501 
502  pips_debug(1, "begin regions_l = %p\n", regions_l);
503 
504  transform_regions_to_statement(new_module, regions_l, loop_p, send_as_comm_l, reductions_l,
505  &compute_regions_stmt, &set_regions_stmt, &flush_regions_stmt);
506 
507  add_workchunk_loop(new_module, loop_p, loop_stmt, &compute_regions_stmt);
508  generate_call_flush(&flush_regions_stmt);
509 
510  if(!ENDP(statement_block(compute_regions_stmt)))
511  {
512  string comment;
513  statement comment_stmt = make_plain_continue_statement();
514  insert_statement(mpi_begin_stmt, comment_stmt, false);
515  insert_statement(mpi_begin_stmt, compute_regions_stmt, false);
516  insert_statement(mpi_begin_stmt, set_regions_stmt, false);
517 
518  if (list_undefined_p(send_as_comm_l))
519  {
520  comment = strdup("\nRECV REGIONS");
521  insert_statement(mpi_begin_stmt, flush_regions_stmt, false);
522  }
523  else
524  {
525  comment = strdup("\nSEND REGIONS");
526  insert_statement(mpi_end_stmt, flush_regions_stmt, false);
527  }
528  put_a_comment_on_a_statement(comment_stmt, comment);
529  }
530  else
531  {
532  free_statement(compute_regions_stmt);
533  free_statement(set_regions_stmt);
534  free_statement(flush_regions_stmt);
535  }
536 
537 }
538 
call make_call(entity a1, list a2)
Definition: ri.c:269
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
test make_test(expression a1, statement a2, statement a3)
Definition: ri.c:2607
void free_expression(expression p)
Definition: ri.c:853
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
void free_statement(statement p)
Definition: ri.c:2189
#define STEP_MAX_NB_LOOPSLICES_NAME
Definition: STEP_name.h:34
#define STEP_INDEX_SLICE_LOW_NAME
Definition: STEP_name.h:26
#define STEP_INDEX_SLICE_UP_NAME
Definition: STEP_name.h:27
#define STEP_SR_NAME(array)
Definition: STEP_name.h:11
#define STEP_RR_NAME(array)
Definition: STEP_name.h:12
bool step_interlaced_p(region reg)
Definition: analyse.c:167
bool step_partial_p(region reg)
Definition: analyse.c:173
#define VALUE_TO_INT(val)
statement build_call_STEP_set_recvregions(entity user_array, expression expr_nb_workchunk, entity regions_array)
Definition: compile_RT.c:736
expression step_symbolic_expression(string name, entity module)
Definition: compile_RT.c:353
void generate_call_flush(statement *stepalltoall_stmt)
Definition: compile_RT.c:85
entity step_local_regionArray(entity module, entity array, string region_array_name, expression expr_nb_region)
Definition: compile_RT.c:428
entity get_entity_step_commsize(entity module)
Que signifie local?
Definition: compile_RT.c:519
void generate_call_get_workchunk_loopbounds(entity mpi_module, loop loop_stmt, statement *compute_regions_stmt)
Definition: compile_RT.c:119
statement build_call_STEP_set_sendregions(entity user_array, expression expr_nb_workchunk, entity regions_array, bool is_interlaced, bool is_reduction)
Definition: compile_RT.c:701
entity step_local_slice_index(entity module)
Definition: compile_RT.c:486
statement build_call_STEP_AllToAll(entity module, entity array, bool is_partial, bool is_interlaced)
Definition: compile_RT.c:640
void generate_loop_workchunk(entity mpi_module, statement *compute_regions_stmt)
Definition: compile_RT.c:101
static void region_to_statement(entity mpi_module, region reg, bool loop_p, bool is_reduction, bool is_interlaced, bool is_partial, statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
static bool combinable_regions_p(region r1, region r2)
Copyright 2007-2012 Alain Muller, Frederique Silber-Chaussumier.
static statement bound_to_statement(entity mpi_module, list expr_bound, entity array_region, string bound_name, int dim, list index)
static bool contraintes_to_expression(bool equality, entity phi, Psysteme sys, list *expr_l, list *expr_u)
void compile_regions(entity new_module, list regions_l, bool loop_p, loop loop_stmt, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE], statement mpi_begin_stmt, statement mpi_end_stmt)
static list phi_free_contraints_to_expressions(bool equality, region reg)
static bool comm_partial_p(list send_regions, region r)
static void generate_call_stepalltoall(entity mpi_module, region reg, bool is_reduction, bool is_interlaced, bool is_partial, statement *stepalltoall_stmt)
pourquoi flush et non pas alltoall ?
static void generate_call_set_regionarray(entity mpi_module, region reg, entity array_region, bool loop_p, bool is_reduction, bool is_interlaced, statement *set_regions_stmt)
static bool reduction_p(set reductions_l[STEP_UNDEF_REDUCE], entity e)
static void transform_regions_to_statement(entity mpi_module, list regions_l, bool loop_p, list send_as_comm_l, set reductions_l[STEP_UNDEF_REDUCE], statement *compute_regions_stmt, statement *set_regionarray_stmt, statement *stepalltoall_stmt)
static bool region_interlaced_p(list send_regions, region r)
static void add_workchunk_loop(entity mpi_module, bool loop_p, loop loop_stmt, statement *compute_regions_stmt)
static bool region_reduction_p(set reductions_l[STEP_UNDEF_REDUCE], region reg)
static void compute_region(entity mpi_module, region reg, entity array_region, bool loop_p, statement *compute_regions_stmt)
#define CONTRAINTE_UNDEFINED_P(c)
#define region_write_p(reg)
#define region_action(reg)
#define region_entity(reg)
#define region_system(reg)
#define region_read_p(reg)
useful region macros
#define region_undefined_p(reg)
#define REGION
#define region
simulation of the type region
text text_rw_array_regions(list)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
bool action_equal_p(action, action)
Definition: effects.c:1023
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
Definition: freia_spoc.c:52
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
Definition: statement.c:625
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define list_undefined_p(c)
Return if a list is undefined.
Definition: newgen_list.h:75
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
Definition: list.c:710
list gen_full_copy_list(list l)
Copy a list structure with element copy.
Definition: list.c:535
list statement_block(statement)
Get the list of block statements of a statement sequence.
Definition: statement.c:1338
statement make_assign_statement(expression, expression)
Definition: statement.c:583
void put_a_comment_on_a_statement(statement, string)
Similar to try_to_put_a_comment_on_a_statement() but insert a CONTINUE to put the comment on it if th...
Definition: statement.c:1863
void insert_statement(statement, statement, bool)
This is the normal entry point.
Definition: statement.c:2570
statement make_plain_continue_statement(void)
Make a simple continue statement to be used as a NOP or ";" in C.
Definition: statement.c:964
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_internal_error
Definition: misc-local.h:149
#define assert(ex)
Definition: newgen_assert.h:41
bool set_belong_p(const set, const void *)
Definition: set.c:194
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
#define MAX_OPERATOR_NAME
#define C_LESS_OR_EQUAL_OPERATOR_NAME
#define C_AND_OPERATOR_NAME
#define EQUAL_OPERATOR_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define MINUS_C_OPERATOR_NAME
#define LESS_OR_EQUAL_OPERATOR_NAME
#define C_EQUAL_OPERATOR_NAME
#define MIN_OPERATOR_NAME
bool c_module_p(entity m)
Test if a module "m" is written in C.
Definition: entity.c:2777
bool fortran_module_p(entity m)
Test if a module is in Fortran.
Definition: entity.c:2799
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
Definition: expression.c:1650
expression reference_to_expression(reference r)
Definition: expression.c:196
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
expression expression_list_to_binary_operator_call(list l, entity op)
Definition: expression.c:1917
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
Definition: expression.c:2012
expression call_to_expression(call c)
Build an expression that call a function or procedure.
Definition: expression.c:309
#define syntax_reference(x)
Definition: ri.h:2730
#define reference_variable(x)
Definition: ri.h:2326
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
@ is_instruction_test
Definition: ri.h:1470
#define entity_name(x)
Definition: ri.h:2790
#define dimension_upper(x)
Definition: ri.h:982
#define reference_indices(x)
Definition: ri.h:2328
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
#define expression_syntax(x)
Definition: ri.h:1247
#define statement_undefined
Definition: ri.h:2419
Psysteme sc_safe_elim_redund(Psysteme ps)
Same as above, but the basis is preserved and sc_empty is returned is the system is not feasible.
Value b2
Definition: sc_gram.c:105
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
char * strdup()
#define ifdebug(n)
Definition: sg.c:47
static entity array
#define STEP_UNDEF_REDUCE
Definition: step_common.h:95
Pvecteur vecteur
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
struct Svecteur * succ
Definition: vecteur-local.h:92
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
string text_to_string(text t)
SG: moved here from ricedg.
Definition: print.c:239
#define val_of(varval)
#define VECTEUR_NUL_P(v)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Definition: unaires.c:206
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228