PIPS
message-utils.c
Go to the documentation of this file.
1 /*
2 
3  $Id: message-utils.c 23065 2016-03-02 09:05:50Z coelho $
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 /* Message Utilities
28  *
29  * Fabien Coelho, August 1993
30  */
31 
32 #include "defines-local.h"
33 #include "access_description.h"
34 
35 /* returns the index of an affine vector
36  */
38 Pvecteur v0;
39 {
40  Pvecteur v1 = vect_del_var(v0, TCST);
41 
42  vect_erase_var(&v1, DELTAV);
44  vect_erase_var(&v1, TSHIFTV);
45 
46  assert(vect_size(v1)==1);
47 
48  return v1;
49 }
50 
52 list l;
53 range r;
54 {
55  if (ENDP(l)) /* first time */
56  return CONS(LIST, CONS(RANGE, r, NIL), NIL);
57 
58  /* else */
59  MAPL(cc,
60  {
61  list lr = CONSP(CAR(cc));
62  assert(!ENDP(lr));
63  lr = gen_nconc(lr, CONS(RANGE, r, NIL));
64  },
65  l);
66 
67  return(l);
68 }
69 
70 /* ??? the complexity of this function could be greatly improved
71  */
73 list l;
74 {
75  list result = NIL;
76 
77  MAPL(cc,
78  {
79  list lr = CONSP(CAR(cc));
80  list lrp = NIL;
81  MAP(RANGE, r, lrp = gen_nconc(lrp, CONS(RANGE, r, NIL)), lr);
82  assert(gen_length(lrp)==gen_length(lr));
83  result = gen_nconc(result, CONS(LIST, lrp, NIL));
84  },
85  l);
86 
87  assert(gen_length(l)==gen_length(result));
88  return result;
89 }
90 
91 /* ??? the complexity of this function could be improved greatly...
92  */
94 list l;
95 {
96  list result = NIL;
97 
98  MAPL(cv,
99  {
100  Pvecteur v = (Pvecteur) PVECTOR(CAR(cv));
101  result = gen_nconc(result, CONS(PVECTOR, (VECTOR) vect_dup(v), NIL));
102  },
103  l);
104 
105  return result;
106 }
107 
108 /* caution, is initial list is destroyed.
109  */
111 list l;
112 int var, val;
113 {
114  list result = NIL;
115 
116  if (ENDP(l))
117  return CONS(PVECTOR, (VECTOR) vect_new((Variable) (intptr_t)var,
118  int_to_value(val)), NIL);
119 
120  if ((var==0) || (val==0))
121  return l;
122 
123  /* else */
124 
125  MAPL(cv,
126  {
127  Pvecteur v = (Pvecteur) PVECTOR(CAR(cv));
128  pips_debug(9, "size of vector %p is %d\n", v, vect_size(v));
129  vect_add_elem(&v, (Variable) (intptr_t) var, int_to_value(val));
130  result = gen_nconc(result, CONS(PVECTOR, (VECTOR) v, NIL));
131  },
132  l);
133 
134  gen_free_list(l);
135 
136  return result;
137 }
138 
139 /* range complementary_range(array, dim, r)
140  */
142 entity array;
143 int dim;
144 range r;
145 {
146  entity newarray = load_new_node(array);
147  dimension d = FindIthDimension(newarray, dim);
148  int rlo = HpfcExpressionToInt(range_lower(r)),
153 
154  assert(rin==1);
155 
156  if (dup==rup)
157  return(make_range(int_to_expression(dlo),
158  int_to_expression(rlo-1),
159  int_to_expression(1)));
160 
161  if (dlo==rlo)
162  return(make_range(int_to_expression(rup+1),
163  int_to_expression(dup),
164  int_to_expression(1)));
165 
166  pips_internal_error("well, there is a problem here around");
167 
168  return(range_undefined); /* just to avoid a gcc warning */
169 }
170 
171 /* list generate_message_from_3_lists(array, lcontent, lneighbour, ldomain)
172  */
173 list generate_message_from_3_lists(array, lcontent, lneighbour, ldomain)
174 entity array;
175 list lcontent, lneighbour, ldomain;
176 {
177  list lc = lcontent, ln = lneighbour, ld = ldomain, lm = NIL;
178  int len = gen_length(lcontent);
179 
180  assert(len==(int)gen_length(lneighbour) && len==(int)gen_length(ldomain));
181 
182  for ( ; lc!=NIL ; lc=CDR(lc), ln=CDR(ln), ld=CDR(ld))
183  {
184  lm = CONS(MESSAGE,
186  CONSP(CAR(lc)),
187  (Pvecteur)PVECTOR(CAR(ln)),
188  CONSP(CAR(ld))),
189  lm);
190  }
191 
192  return(lm);
193 }
194 
196 list lr;
197 {
198  return((ENDP(lr))?
199  (false):
200  (empty_range_p(RANGE(CAR(lr))) || empty_section_p(CDR(lr))));
201 }
202 
204 range r;
205 {
206  int lo, up;
207 
208  /* if we cannot decide, the range is supposed not to be empty
209  */
212  return false;
213  else
214  return lo>up;
215 }
216 
217 char *sprint_lrange(str, l)
218 string str;
219 list l;
220 {
221  string s = str;
222  bool firstrange = true;
223 
224  MAP(RANGE, r,
225  {
226  if (!firstrange)
227  {
228  sprintf(s, ", ");
229  s += strlen(s);
230  }
231  else
232  firstrange = false;
233 
234  sprint_range(s, r);
235  s += strlen(s);
236  },
237  l);
238 
239  return str;
240 }
241 
242 char *sprint_range(string str, range r)
243 {
244  int lo, up, in;
245  bool
249 
250  if (blo && bup && bin)
251  {
252  if (in==1)
253  {
254  if (lo==up)
255  sprintf(str, "%d", lo);
256  else
257  sprintf(str, "%d:%d", lo, up);
258  }
259  else
260  sprintf(str, "%d:%d:%d", lo, up, in);
261  }
262  else
263  sprintf(str, "X");
264 
265  return str+strlen(str);
266 }
267 
269 entity array;
270 list lr;
271 Pvecteur v;
272 {
273  list content = NIL, l = lr;
274  int i = 1;
275 
277 
278  for (; l; i++, POP(l))
279  {
280  int procdim = 0;
281  bool distributed_dim = ith_dim_distributed_p(array, i, &procdim);
282  Value vn = distributed_dim?
283  vect_coeff((Variable) (intptr_t)procdim, v): VALUE_ZERO;
284  int neighbour = VALUE_TO_INT(vn);
285  range r = RANGE(CAR(l));
286 
287  if (neighbour!=0)
288  {
289  entity newarray = load_new_node(array);
290  dimension nadim = FindIthDimension(newarray, i);
291  expression incr = range_increment(r);
292  int lom1 = HpfcExpressionToInt(dimension_lower(nadim))-1,
293  upp1 = HpfcExpressionToInt(dimension_upper(nadim))+1,
294  width = (HpfcExpressionToInt(range_upper(r)) -
296 
297  content =
298  gen_nconc(content,
299  CONS(RANGE,
300  (neighbour<0)?
302  int_to_expression(upp1+width),
303  incr):
304  make_range(int_to_expression(lom1-width),
305  int_to_expression(lom1),
306  incr),
307  NIL));
308  }
309  else
310  {
311  content = gen_nconc(content, CONS(RANGE, r, NIL)); /* shared! */
312  }
313  }
314 
315  return(content);
316 }
317 
319 list lr;
320 Pvecteur v;
321 {
322  list l = lr, domain = NIL;
323  int i = 1;
324 
325  for ( ; l!=NIL ; i++, l=CDR(l))
326  {
327  range r = RANGE(CAR(l));
328  Value vn = vect_coeff((Variable) (intptr_t)i, v);
329  int neighbour = VALUE_TO_INT(vn);
330 
331  if (neighbour==0)
332  domain = gen_nconc(domain, CONS(RANGE, r, NIL)); /* shared! */
333  else
334  {
335  int lo = HpfcExpressionToInt(range_lower(r)),
337 
338  domain =
339  gen_nconc(domain,
340  CONS(RANGE,
341  make_range(int_to_expression(lo+neighbour),
342  int_to_expression(up+neighbour),
343  range_increment(r)),
344  NIL));
345  }
346  }
347 
348  return(domain);
349 }
350 
352 message m;
353 list l;
354 {
355  MAP(MESSAGE, mp, if (message_larger_p(mp, m)) return true, l);
356  return(false);
357 }
358 
359 /* bool message_larger_p(m1, m2)
360  *
361  * true if m1>=m2... (caution, it is only a partial order)
362  */
363 bool message_larger_p(m1, m2)
364 message m1, m2;
365 {
366  if (message_array(m1)!=message_array(m2))
367  return(false);
368 
371  return(false);
372 
373  /*
374  * same array and same destination, let's look at the content and domain...
375  */
376 
379 }
380 
381 bool lrange_larger_p(lr1, lr2)
382 list lr1, lr2;
383 {
384  list l1 = lr1, l2 = lr2;
385 
386  assert(gen_length(lr1) == gen_length(lr2));
387 
388  for ( ; l1; POP(l1), POP(l2))
389  {
390  range r1 = RANGE(CAR(l1)), r2 = RANGE(CAR(l2));
391  int lo1, up1, in1, lo2, up2, in2;
392  bool
399  bcst = (blo1 && bup1 && bin1 && blo2 && bup2 && bin2);
400 
401  if (!bcst) /* can look for formal equality... */
402  {
403  return(expression_equal_p(range_lower(r1), range_lower(r2)) &&
406  }
407 
408  if (in1!=in2) return(false);
409 
410  /* ??? something more intelligent could be expected */
411  if ((in1!=1) && ((lo1!=lo2) || (up1!=up2)))
412  return(false);
413 
414  if ((in1==1) && ((lo1>lo2) || (up1<up2)))
415  return(false);
416  }
417 
418  pips_debug(7, "returning TRUE\n");
419 
420  return true;
421 }
422 
423 /****************************************************************** RANGES */
424 
425 list
427  entity array,
428  list lra)
429 {
431  entity template = align_template(a);
432  list la = align_alignment(a), lrt = NIL;
433  int i = 1;
434 
435  for (i=1 ; i<=NumberOfDimension(template) ; i++)
436  {
438  int arraydim = alignment_undefined_p(al)? -1: alignment_arraydim(al);
439 
440  if (arraydim==-1) /* scratched */
441  {
442  dimension d = FindIthDimension(template, i);
443  lrt = gen_nconc(lrt,
444  CONS(RANGE,
447  int_to_expression(1)), NIL));
448  }
449  else if (arraydim==0) /* replication */
450  {
452 
453  lrt = gen_nconc(lrt,
454  CONS(RANGE,
455  make_range(b, b, int_to_expression(1)),
456  NIL));
457  }
458  else
459  {
460  range rg = RANGE(gen_nth(arraydim-1, lra));
461 
463  {
464  /* non distributed dimension, so not used...
465  */
466  lrt = gen_nconc(lrt, CONS(RANGE,
470  NIL));
471  }
472  else
473  {
474  int
477  lb, ub, in;
478  expression tl, tu, ti;
479 
483  tl = int_to_expression(a*lb+b);
484  tu = int_to_expression(a*ub+b);
485  ti = int_to_expression(a*in);
486 
487  lrt = gen_nconc(lrt,
488  CONS(RANGE,
489  make_range(tl, tu, ti),
490  NIL));
491  }
492  }
493  }
494 
495  return(lrt);
496 }
497 
499 entity template;
500 list lrt;
501 {
502  distribute d = load_hpf_distribution(template);
503  entity proc = distribute_processors(d);
504  list ld = distribute_distribution(d), lrp = NIL;
505  int i = 1;
506 
507  for (i=1 ; i<=NumberOfDimension(proc) ; i++)
508  {
509  int tdim = 0;
510  distribution di = FindDistributionOfProcessorDim(ld, i, &tdim);
511  style s = distribution_style(di);
512  range rg = RANGE(gen_nth(tdim-1, lrt));
513  int p = 0,
517 
518  switch (style_tag(s))
519  {
520  case is_style_block:
521  {
522  expression
523  pl = int_to_expression(processor_number(template, tdim, tl, &p)),
524  pu = int_to_expression(processor_number(template, tdim, tu, &p));
525 
526  /* ??? another increment could be computed?
527  */
528  lrp = gen_nconc(lrp,
529  CONS(RANGE,
531  NIL));
532  break;
533  }
534  case is_style_cyclic:
535  {
536  dimension dp = FindIthDimension(proc, i);
537  int sz = dimension_size(dp);
538  expression
539  pl = int_to_expression(processor_number(template, tdim, tl, &p)),
540  pu = int_to_expression(processor_number(template, tdim, tu, &p));
541 
542  if (((tu-tl)>n*sz) || (pl>pu) || ((pl==pu) && ((tu-tl)>n)))
543  lrp = gen_nconc(lrp,
544  CONS(RANGE,
546  dimension_upper(dp),
547  int_to_expression(1)),
548  NIL));
549  else
550  lrp = gen_nconc(lrp,
551  CONS(RANGE,
552  make_range(pl, pu,
553  int_to_expression(1)),
554  NIL));
555 
556  break;
557  }
558  case is_style_none:
559  pips_internal_error("unexpected none style distribution");
560  break;
561  default:
562  pips_internal_error("unexpected style tag (%d)",
563  style_tag(s));
564  }
565  }
566  return(lrp);
567 }
568 
570 reference r;
571 list lkref, lvref;
572 {
574  int dim = 1;
575  list li = reference_indices(r), lk = lkref, lv = lvref, lra = NIL,
577 
578  pips_debug(7, "considering array %s\n", entity_name(array));
579 
580  for (; li; POP(li), POP(lk), POP(lv), POP(ldim), dim++)
581  {
582  access a = INT(CAR(lk));
583  Pvecteur v = (Pvecteur) PVECTOR(CAR(lv));
585 
586  pips_debug(8, "DIM=%d[%d]\n", dim, a);
587 
588  switch (access_tag(a))
589  {
590  case local_form_cst:
591  {
592  /* this dimension shouldn't be used,
593  * so I put there whatever I want...
594  * ??? mouais, the information is in the vector, I think.
595  */
596  lra = gen_nconc(lra,
597  CONS(RANGE,
601  NIL));
602 
603  break;
604  }
605  case aligned_constant:
606  case local_constant:
607  {
608  Value tc = vect_coeff(TCST, v);
609  expression arraycell = Value_to_expression(tc);
610 
611  lra = gen_nconc(lra,
612  CONS(RANGE,
613  make_range(arraycell, arraycell,
614  int_to_expression(1)),
615  NIL));
616  break;
617  }
618  case aligned_shift:
619  case local_shift:
620  {
621  range
622  /* ??? should check that it is ok */
624  ((entity) var_of(vect_del_var(v, TCST)));
625  expression
626  rl = range_lower(rg),
627  ru = range_upper(rg),
628  in = range_increment(rg),
632  int lb = -1, ub = -1, dt = VALUE_TO_INT(vdt);
633 
635  lb = HpfcExpressionToInt(rl),
636  al = int_to_expression(lb-dt);
637  else
639 
641  ub = HpfcExpressionToInt(ru),
642  au = int_to_expression(ub-dt);
643  else
645 
646  lra = gen_nconc(lra, CONS(RANGE, make_range(al, au, in), NIL));
647  break;
648  }
649  case aligned_affine:
650  case local_affine:
651  {
652  Pvecteur v2 = vect_del_var(v, TCST);
653  entity index = (entity) var_of(v2);
654  range rg = loop_index_to_range(index);
656  int rate = val_of(v2),
660  dt = VALUE_TO_INT(vdt);
661  expression
662  ai = int_to_expression(rate*in),
663  al = int_to_expression(rate*lb-dt),
664  au = int_to_expression(rate*ub-dt);
665 
666  lra = gen_nconc(lra, CONS(RANGE, make_range(al, au, ai), NIL));
667  break;
668  }
669  default:
670  pips_internal_error("unexpected but maybe legal access");
671  break;
672  }
673  }
674 
675  return(lra);
676 }
677 
678 /***************************************************************** GUARDS */
679 
681 statement stat;
682 entity proc;
683 list lr;
684 {
685  expression guard;
686 
687  return((make_guard_expression(proc, lr, &guard))?
690  make_test(guard,
691  stat,
693  (entity_empty_label()))))):
694  stat);
695 }
696 
697 /* bool make_guard_expression(proc, lr, pguard)
698  *
699  * compute the expression for the processors ranges lr guard.
700  * return true if not empty, false if empty.
701  */
702 bool make_guard_expression(proc, lrref, pguard)
703 entity proc;
704 list lrref;
705 expression *pguard;
706 {
707  int i, len = -1;
709  list lr = lrref, conjonction = NIL;
710 
711  for (i=1 ; i<=NumberOfDimension(proc) ; i++, lr=CDR(lr))
712  {
713  range rg = RANGE(CAR(lr));
714  expression
715  rloexpr = range_lower(rg),
716  rupexpr = range_upper(rg);
717  dimension d = FindIthDimension(proc, i);
718  int
721  sz = up-lo+1,
722  rlo = HpfcExpressionToInt(rloexpr),
723  rup = HpfcExpressionToInt(rupexpr);
724 
725  if (rlo>rup) /* empty match case */
726  {
727  (*pguard) = entity_to_expression(entity_intrinsic(".FALSE."));
728  return(true); /* ??? memory leak with the content of conjonction */
729  }
730 
731  if ((rlo==rup) && (sz!=1) && (rlo>=lo) && (rup<=up))
732  {
733  /* MYPOS(i, procnum).EQ.nn
734  */
735  conjonction =
737  eq_expression(make_mypos_expression(i, procnum), rloexpr),
738  conjonction);
739  }
740  else
741  {
742  if (rlo>lo)
743  {
744  /* MYPOS(i, procnum).GE.(rloexpr)
745  */
746  conjonction =
748  ge_expression(make_mypos_expression(i, procnum), rloexpr),
749  conjonction);
750  }
751 
752  if (rup<up)
753  {
754  /* MYPOS(i, procnum).LE.(rupexpr)
755  */
756  conjonction =
758  le_expression(make_mypos_expression(i, procnum), rupexpr),
759  conjonction);
760  }
761  }
762  }
763 
764  /* use of conjonction
765  */
766 
767  len = gen_length(conjonction);
768 
769  if (len==0) /* no guard */
770  {
771  (*pguard) = expression_undefined;
772  return(false);
773  }
774  else
775  {
776  (*pguard) = expression_list_to_conjonction(conjonction);
777  gen_free_list(conjonction);
778  return(true);
779  }
780 }
781 
783 int i;
785 {
790  NIL)))));
791 }
792 
793 statement loop_nest_guard(stat, r, lkref, lvref)
794 statement stat;
795 reference r;
796 list lkref, lvref;
797 {
798  entity
800  template = array_to_template(array),
801  proc = template_to_processors(template);
802  list
803  lra = array_access_to_array_ranges(r, lkref, lvref),
805  lrp = template_ranges_to_processors_ranges(template, lrt);
806  statement
807  result = generate_guarded_statement(stat, proc, lrp);
808 
809  gen_free_list(lra); /* ??? memory leak of some expressions */
810  gen_free_list(lrt);
811  gen_free_list(lrp);
812 
813  return(result);
814 }
815 
816 /* That is all
817  */
message make_message(entity a1, list a2, Pvecteur a3, list a4)
Definition: message.c:54
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
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
#define local_affine
#define aligned_shift
#define access
#define aligned_affine
#define local_form_cst
#define aligned_constant
#define access_tag(a)
#define local_constant
#define local_shift
bool hpfc_integer_constant_expression_p(expression e, int *pi)
#define VALUE_ZERO
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define VALUE_TO_INT(val)
#define value_ne(v1, v2)
int Value
@ INT
Definition: atomic.c:48
range loop_index_to_range(entity index)
#define LIST(x)
Definition: genC.h:93
#define CONSP(x)
Definition: genC.h:88
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
Definition: statement.c:597
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#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
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
Definition: list.c:710
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
statement make_continue_statement(entity)
Definition: statement.c:953
#define distribution_style(x)
Definition: hpf.h:210
#define alignment_constant(x)
Definition: hpf.h:140
#define align_template(x)
Definition: hpf.h:98
#define align_alignment(x)
Definition: hpf.h:96
#define distribute_distribution(x)
Definition: hpf.h:174
#define alignment_rate(x)
Definition: hpf.h:138
#define alignment_undefined_p(x)
Definition: hpf.h:109
#define style_tag(x)
Definition: hpf.h:258
#define alignment_arraydim(x)
Definition: hpf.h:134
#define distribute_processors(x)
Definition: hpf.h:176
#define distribution_parameter(x)
Definition: hpf.h:212
@ is_style_cyclic
Definition: hpf.h:239
@ is_style_block
Definition: hpf.h:238
@ is_style_none
Definition: hpf.h:237
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
Definition: hpfc-util.c:569
distribution FindDistributionOfProcessorDim(list ldi, int dim, int *tdim)
Definition: hpfc-util.c:421
bool ith_dim_distributed_p(entity array, int i, int *pprocdim)
whether a dimension is distributed or not.
Definition: hpfc-util.c:160
alignment FindAlignmentOfTemplateDim(list lal, int dim)
Definition: hpfc-util.c:389
int processor_number(entity template, int tdim, int tcell, int *pprocdim)
int processor_number(template, tdim, tcell, pprocdim)
Definition: hpfc-util.c:492
#define TEMPLATEV
Definition: defines-local.h:80
#define array_to_template(array)
#define TSHIFTV
Definition: defines-local.h:81
#define template_to_processors(template)
#define MYPOS
#define DELTAV
??? very beurk!
Definition: defines-local.h:79
#define VECTOR
Definition: defines-local.h:73
#define PVECTOR(v)
Definition: defines-local.h:72
entity hpfc_name_to_entity(const char *)
Definition: run-time.c:817
entity load_new_node(entity)
distribute load_hpf_distribution(entity)
align load_hpf_alignment(entity)
intptr_t load_hpf_number(entity)
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
bool empty_range_p(range r)
bool lrange_larger_p(list lr1, list lr2)
bool make_guard_expression(entity proc, list lrref, expression *pguard)
bool make_guard_expression(proc, lr, pguard)
list compute_receive_domain(list lr, Pvecteur v)
char * sprint_range(string str, range r)
list generate_message_from_3_lists(entity array, list lcontent, list lneighbour, list ldomain)
list generate_message_from_3_lists(array, lcontent, lneighbour, ldomain)
list add_elem_to_list_of_Pvecteur(list l, int var, int val)
caution, is initial list is destroyed.
list compute_receive_content(entity array, list lr, Pvecteur v)
range complementary_range(entity array, int dim, range r)
range complementary_range(array, dim, r)
list dup_list_of_ranges_list(list l)
??? the complexity of this function could be greatly improved
Definition: message-utils.c:72
expression make_mypos_expression(int i, expression exp)
Pvecteur the_index_of_vect(Pvecteur v0)
Message Utilities.
Definition: message-utils.c:37
list array_access_to_array_ranges(reference r, list lkref, list lvref)
bool larger_message_in_list(message m, list l)
bool empty_section_p(list lr)
bool message_larger_p(message m1, message m2)
bool message_larger_p(m1, m2)
char * sprint_lrange(string str, list l)
list template_ranges_to_processors_ranges(entity template, list lrt)
statement generate_guarded_statement(statement stat, entity proc, list lr)
list add_to_list_of_ranges_list(list l, range r)
Definition: message-utils.c:51
statement loop_nest_guard(statement stat, reference r, list lkref, list lvref)
list array_ranges_to_template_ranges(entity array, list lra)
list dup_list_of_Pvecteur(list l)
??? the complexity of this function could be improved greatly...
Definition: message-utils.c:93
#define message_array(x)
Definition: message.h:75
#define message_dom(x)
Definition: message.h:81
#define MESSAGE(x)
newgen_message_domain_defined
Definition: message.h:43
#define message_neighbour(x)
Definition: message.h:79
#define message_content(x)
Definition: message.h:77
#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_internal_error
Definition: misc-local.h:149
#define assert(ex)
Definition: newgen_assert.h:41
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
static int tc
Internal variables
Definition: reindexing.c:107
#define ge_expression(e1, e2)
#define le_expression(e1, e2)
#define eq_expression(e1, e2)
entity entity_empty_label(void)
Definition: entity.c:1105
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression reference_to_expression(reference r)
Definition: expression.c:196
bool expression_integer_constant_p(expression e)
Definition: expression.c:2417
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
Definition: expression.c:1347
expression expression_list_to_conjonction(list l)
Definition: expression.c:1937
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 Value_to_expression(Value v)
added interface for linear stuff.
Definition: expression.c:1251
dimension FindIthDimension(entity, int)
Definition: type.c:1180
int dimension_size(dimension)
this function computes the size of a dimension.
Definition: size.c:491
int NumberOfDimension(entity)
Definition: size.c:588
#define reference_variable(x)
Definition: ri.h:2326
#define range_upper(x)
Definition: ri.h:2290
#define range_undefined
Definition: ri.h:2263
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define range_increment(x)
Definition: ri.h:2292
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define expression_undefined
Definition: ri.h:1223
@ is_instruction_test
Definition: ri.h:1470
#define RANGE(x)
RANGE.
Definition: ri.h:2257
#define entity_name(x)
Definition: ri.h:2790
#define expression_normalized(x)
Definition: ri.h:1249
#define dimension_upper(x)
Definition: ri.h:982
#define reference_indices(x)
Definition: ri.h:2328
#define expression_undefined_p(x)
Definition: ri.h:1224
#define range_lower(x)
Definition: ri.h:2288
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
#define normalized_linear(x)
Definition: ri.h:1781
static entity array
#define intptr_t
Definition: stdint.in.h:294
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
A DOMAIN union describes the structure of a user type.
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define val_of(varval)
struct Svecteur * Pvecteur
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
#define var_of(varval)
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Definition: unaires.c:106
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72
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