PIPS
declarations.c
Go to the documentation of this file.
1 /*
2 
3  $Id: declarations.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 /* HPFC module by Fabien COELHO
28  *
29  * new declarations compilation.
30  * normalization of HPF declarations.
31  */
32 
33 #include "defines-local.h"
34 
35 #include "effects-generic.h"
36 #include "effects-simple.h"
37 #include "effects-convex.h"
38 
39 bool expression_constant_p(expression); /* in static_controlize */
40 
41 /************************************************** HPF OBJECTS MANAGEMENT */
42 
43 /* DISTRIBUTED ARRAYS
44  */
45 
46 #define STATIC_LIST_OF_HPF_OBJECTS(name, set_name, pred_name)\
47 static list name = NIL;\
48 int number_of_##name(){return(gen_length(name));}\
49 list list_of_##name(){return(name);}\
50 bool pred_name(entity e){return(gen_in_list_p(e, name));}\
51 void set_name(entity e){ if (!gen_in_list_p(e, name)){\
52  name = CONS(ENTITY, e, name); normalize_hpf_object(e);}}
53 
56 
58 entity e;
59 {
60  bool
61  distributed =
62  (array_distributed_p(e) ||
65  in_common = entity_in_common_p(e);
66 
67  return(distributed && in_common);
68 }
69 
70 /* returns the list of entities that are 'local' to module
71  */
74 {
75  list l = NIL;
76 
77  MAP(ENTITY, e,
78  {
79  if (hpfc_main_entity(e)==module) l = CONS(ENTITY, e, l);
80  },
82 
83  return(l);
84 }
85 
86 /************************************************** TEMPLATES and PROCESSORS */
87 
90 
92 {
93  distributed_arrays = NIL,
94  templates = NIL,
95  processors = NIL;
96 }
97 
99 {
100  gen_free_list(distributed_arrays),
101  gen_free_list(templates),
102  gen_free_list(processors);
103 
105 }
106 
107 /**************************************************** HPF NUMBER MANAGEMENT */
108 
110 
111 static int
115 
116 static void init_currents()
117 {
121 }
122 
123 /* STANDARS STATIC MANAGEMENT
124  *
125  * functions: {init,get,set,reset,close}_hpf_number_status
126  */
127 
129 {
130  init_hpf_number();
131  init_currents();
132 }
133 
135 {
140 }
141 
143 {
145  init_currents();
146 }
147 
150 {
155 }
156 
158 {
160  init_currents();
161 }
162 
163 /* give to hpf objects listed in distributedarrays, templates and processors
164  * their number for the code generation...
165  */
167 {
168  pips_debug(7, "Here I am!\n");
169 
170  MAP(ENTITY, e,
171  {
172  if (!bound_hpf_number_p(e))
174  },
175  distributed_arrays);
176 
177  MAP(ENTITY, e,
178  {
179  if (!bound_hpf_number_p(e))
181  },
182  templates);
183 
184  MAP(ENTITY, e,
185  {
186  if (!bound_hpf_number_p(e))
188  },
189  processors);
190 }
191 
192 /* returns the hpf_number parameter as a string
193  * not really needed ???
194  * ??? never called
195  */
197 entity e;
198 {
199  storage
200  s = entity_storage(e);
201  bool
202  in_common = entity_in_common_p(e),
203  in_ram = storage_ram_p(s);
204  ram
205  r = (in_ram ? storage_ram(s) : ram_undefined);
206  const char* suffix = entity_local_name(e),
207  *prefix =
208  (in_ram ?
209  entity_local_name(in_common ? ram_section(r) : ram_function(r)) :
210  "DEFAULT");
211 
212  pips_assert("ram variable", entity_variable_p(e) && in_ram);
213 
215  (strdup(concatenate("n_", prefix, "_", suffix, NULL))));
216 
217 }
218 
219 /****************************************************** ALIGN and DISTRIBUTE */
220 
221 GENERIC_GLOBAL_FUNCTION(hpf_alignment, alignmap)
222 GENERIC_GLOBAL_FUNCTION(hpf_distribution, distributemap)
223 
224 /********************************************************** NEW DECLARATIONS */
225 
226 GENERIC_LOCAL_FUNCTION(new_declaration, newdeclmap)
227 
228 tag
230  entity array,
231  int dim)
232 {
233  tag t;
234 
235  pips_assert("valid dimension and distributed array",
236  dim>0 && dim<=7 && array_distributed_p(array));
237 
238  t = hpf_newdecl_tag
239  (HPF_NEWDECL(gen_nth(dim-1,
240  hpf_newdecls_dimensions(load_new_declaration(array)))));
241 
242  pips_debug(1, "%s[%d]: %d\n", entity_name(array), dim, t);
243 
244  return(t);
245 }
246 
247 static void
249  entity e)
250 {
251  type t = entity_type(e);
252  list l = NIL;
253  int ndim;
254 
255  pips_assert("variable", type_variable_p(t));
256 
258 
259  for(; ndim>0; ndim--)
261 
262  store_new_declaration(e, make_hpf_newdecls(l));
263 }
264 
265 static void
267 entity array;
268 int dim;
269 tag what;
270 {
271  hpf_newdecl n;
272 
273  pips_assert("valid dimension and distributed array",
274  dim>0 && dim<=7 && array_distributed_p(array));
275 
276  if (!bound_new_declaration_p(array))
278 
279  n = HPF_NEWDECL(gen_nth(dim-1,
280  hpf_newdecls_dimensions(load_new_declaration(array))));
281 
282  hpf_newdecl_tag(n) = what;
283 }
284 
285 void get_ith_dim_new_declaration(array, i, pmin, pmax)
286 entity array;
287 int i, *pmin, *pmax;
288 {
290 
291  pips_assert("distributed array",
293 
296 }
297 
298 /************************************* DATA STATUS INTERFACE FOR HPFC STATUS */
299 
301 {
302  init_new_declaration();
306 }
307 
309 {
310  /* ??? previsous data_status lost: memory leak
311  */
312  return(make_data_status(get_new_declaration(),
317  list_of_processors()));
318 }
319 
321 {
322  reset_new_declaration();
326 }
327 
329 data_status s;
330 {
331  set_new_declaration(data_status_newdeclmap(s));
334  distributed_arrays = data_status_arrays(s);
335  templates = data_status_templates(s);
336  processors = data_status_processors(s);
337 }
338 
340 {
341  close_new_declaration();
345 }
346 
347 
348 /********************************************************* Normalizations */
349 
350 /* NormalizeOneTemplateDistribution
351  */
352 static void NormalizeOneTemplateDistribution(d,templ,templdimp,procs,procsdimp)
353 distribution d;
354 entity templ,procs;
355 int *templdimp, *procsdimp;
356 {
358  (*templdimp)++;
359  else
360  {
361  int szoftempldim = SizeOfIthDimension(templ,(*templdimp)),
362  szofprocsdim = SizeOfIthDimension(procs,(*procsdimp));
363 
365  {
366  /* compute the missing value, in case of BLOCK distribution
367  */
368 
369  switch(style_tag(distribution_style(d)))
370  {
371  case is_style_block:
373  int_to_expression(iceil(szoftempldim, szofprocsdim));
374  break;
375  default:
376  pips_internal_error("undefined style tag");
377  break;
378  }
379  }
380  else
381  {
382  /* check the given value
383  */
384 
385  int paramvalue = HpfcExpressionToInt(distribution_parameter(d));
386 
387  switch(style_tag(distribution_style(d)))
388  {
389  case is_style_block:
390  {
391  int minvalue = iceil(szoftempldim, szofprocsdim);
392 
393  if (paramvalue<minvalue)
394  pips_user_error("block too small in %s distribution\n",
395  entity_name(templ));
396  break;
397  }
398  default:
399  break;
400  }
401  }
402 
403  (*templdimp)++;
404  (*procsdimp)++;
405  }
406 }
407 
409 entity t;
410 distribute d;
411 {
413  list /* of distribution */ ld = distribute_distribution(d);
414  int tdim = 1, pdim = 1;
415 
417 
418  MAP(DISTRIBUTION, di,
419  NormalizeOneTemplateDistribution(di, t, &tdim, p, &pdim), ld);
420 
421  if ((pdim-1)!=NumberOfDimension(p))
422  pips_user_error("%s not enough distributions\n", entity_name(t));
423 
424 }
425 
427 {
429 }
430 
432 entity v;
433 {
435 }
436 
438 {
440  ifdebug(8){print_hpf_dir();}
441 }
442 
443 /********************************************************* NEW DECLARATIONS */
444 
445 /* local macros...
446  */
447 #define normalized_dimension_p(dim) \
448  (HpfcExpressionToInt(dimension_lower(dim))==1)
449 
450 /* here the new size of the ith dimension of the given array is computed.
451  * because the declarations are static, there is a majoration of the space
452  * required on each processors to held his part of the distributed array.
453  */
454 static int
456  dimension dim,
457  int i,
458  entity array,
459  tag *newdeclp)
460 {
462  entity t = align_template(a);
466  int rate, param, pdim = 1, asize = 0;
467  style st;
468 
469  asize=dimension_size(dim);
470 
471  pips_debug(9, "dimension %d of array %s\n", i, entity_name(array));
472  ifdebug(9)
473  {
474  print_align(a);
475  print_distribute(d);
476  }
477 
478  /* default: the new declaration is the same as the old one.
479  */
480  (*newdeclp) = is_hpf_newdecl_none;
481 
482  /* looking for the matching alignment...
483  */
485 
486  /* no alignment => scratching of the dimension...
487  */
488  if (al==alignment_undefined)
489  {
490  if (!normalized_dimension_p(dim))
491  (*newdeclp) = is_hpf_newdecl_alpha;
492  return(asize);
493  }
494 
495  /* there is an alignment, but the rate is zero, so the whole
496  * dimension has to be declared on every processors, despite the
497  * fact that the dimension is mapped on only one element.
498  */
500  if (rate==0)
501  {
502  if (!normalized_dimension_p(dim))
503  (*newdeclp) = is_hpf_newdecl_alpha;
504  return asize;
505  }
506 
507  /* looking for the matching distribution...
508  * pdim is the corresponding dimension of processors p
509  */
512  &pdim);
513 
514  st=distribution_style(di);
515 
516  /* no style => scratching of the dimension...
517  */
518  if (style_none_p(st))
519  {
520  /* ???
521  * should delete the alignment which is not usefull...
522  */
523  /* alpha case
524  */
525  if (!normalized_dimension_p(dim))
526  (*newdeclp) = is_hpf_newdecl_alpha;
527  return asize;
528  }
529 
530  /* and now, let's look at the different cases.
531  *
532  * beta case
533  */
535 
536  if (style_block_p(st))
537  {
538  int
539  major = iceil(param, abs(rate)),
540  choice = min(asize, major);
541 
542  if (choice==asize)
543  {
544  if (normalized_dimension_p(dim))
545  (*newdeclp) = is_hpf_newdecl_none;
546  else
547  (*newdeclp) = is_hpf_newdecl_alpha;
548  }
549  else
550  (*newdeclp) = is_hpf_newdecl_beta;
551 
552  return choice;
553  }
554 
555  /* gamma case
556  *
557  * ??? what about rate==-1 ?
558  */
559  if (style_cyclic_p(st) && (rate==1))
560  {
561  int
562  psize = SizeOfIthDimension(distribute_processors(d), pdim),
563  major = param * iceil(asize+param-1, param*psize),
564  choice = min(asize, major);
565 
566  if (choice==asize)
567  {
568  if (normalized_dimension_p(dim))
569  (*newdeclp) = is_hpf_newdecl_none;
570  else
571  (*newdeclp) = is_hpf_newdecl_alpha;
572  }
573  else
574  (*newdeclp) = is_hpf_newdecl_gamma;
575 
576  return choice;
577  }
578 
579  /* delta case
580  */
581  if (style_cyclic_p(st))
582  {
583  int
584  absrate = abs(rate),
585  psize = SizeOfIthDimension(distribute_processors(d),pdim),
586  major = (iceil(param, absrate)*
587  iceil(absrate*(asize-1)+param, param*psize)),
588  choice = min(asize, major);
589 
590  if (choice==asize)
591  {
592  if (normalized_dimension_p(dim))
593  (*newdeclp) = is_hpf_newdecl_none;
594  else
595  (*newdeclp) = is_hpf_newdecl_alpha;
596  }
597  else
598  (*newdeclp) = is_hpf_newdecl_delta;
599 
600  return choice;
601  }
602 
603  /* alpha case, if nothing matches, what shouldn't be the case :
604  */
605  if (!normalized_dimension_p(dim))
606  (*newdeclp) = is_hpf_newdecl_alpha;
607  return asize;
608 }
609 
610 
611 /* for node this are reformated, and for host these variables are
612  * deleted.
613  */
614 static void
616  entity array)
617 {
618  entity newarray;
619  int ithdim = 1, newsz, p;
620  tag newdecl;
621  list ld = NIL;
622 
623  /* it may happen that no newarray is available,
624  * when a module with no distributed variables is considered...
625  */
626  if (!bound_new_node_p(array)) return;
627  newarray = load_new_node(array);
628  pips_assert("distributed array",
630 
631  pips_debug(6, "considering array %s, new %s\n",
632  entity_name(array), entity_name(newarray));
633 
634  /* compute the new size for every dimension on the array,
635  * then update the dimensions of the newarray. remember
636  * that the dimensions are shared between the old and new arrays.
637  */
638  MAP(DIMENSION, dim,
639  {
640  if (ith_dim_distributed_p(array, ithdim, &p))
641  {
642  newsz = ComputeNewSizeOfIthDimension(dim, ithdim, array, &newdecl);
643 
644  pips_debug(8, "dimension %d new size: %d\n", ithdim, newsz);
645 
646  ld = gen_nconc(ld,
647  CONS(DIMENSION,
649  int_to_expression(newsz),
650  NIL),
651  NIL));
652 
653  }
654  else
655  {
656  pips_debug(8, "dimension %d isn't touched\n", ithdim);
657 
658  newdecl = is_hpf_newdecl_none;
659  ld = gen_nconc(ld, CONS(DIMENSION, copy_dimension(dim), NIL));
660  }
661 
662  store_a_new_declaration(array, ithdim, newdecl);
663 
664  ithdim++;
665  },
667 
669 }
670 
671 /* this procedure generate the new declarations of every distributed arrays
672  * of the program, in order to minimize the amount of memory used.
673  * The new declarations have to be suitable for the new index computation
674  * which is to be done dynamically...
675  */
677 {
678  MAP(ENTITY, array,
679  {
680  if (!bound_new_declaration_p(array))
682  else
683  pips_debug(3, "skipping array %s\n", entity_name(array));
684  },
686 }
687 
688 /**************************************************************** OVERLAPS */
689 
690 GENERIC_GLOBAL_FUNCTION(overlap_status, overlapsmap)
691 
692 static void
694 {
695  type t = entity_type(e);
696  list o=NIL;
697  int n;
698 
699  pips_assert("variable", type_variable_p(t));
700 
702  for(; n>=1; n--) o = CONS(OVERLAP, make_overlap(0, 0), o);
703 
704  store_overlap_status(e, o);
705 
706  pips_assert("overlap stored", bound_overlap_status_p(e));
707 }
708 
709 /* set the overlap value for entity ent, on dimension dim,
710  * dans side side to width, which must be a positive integer.
711  * if necessary, the overlap is updates with the value width.
712  */
713 void set_overlap(ent, dim, side, width)
714 entity ent;
715 int dim, side, width;
716 {
717  overlap o;
718  int current;
719 
720  pips_assert("valid dimension", dim>0);
721 
722  pips_debug(10, "%s:(DIM=%d) %s%d\n",
723  entity_name(ent), dim, side?"+":"-", width);
724 
725  if (!bound_overlap_status_p(ent)) create_overlaps(ent);
726  o = OVERLAP(gen_nth(dim-1, load_overlap_status(ent)));
727 
728  if (side) /* upper */
729  {
730  current = overlap_upper(o);
731  if (current<width) overlap_upper(o)=width;
732  }
733  else /* lower */
734  {
735  current = overlap_lower(o);
736  if (current<width) overlap_lower(o)=width;
737  }
738 }
739 
740 /* returns the overlap for a given entity, dimension and side,
741  * to be used in the declaration modifications
742  */
743 int get_overlap(ent, dim, side)
744 entity ent;
745 int dim, side;
746 {
747  overlap o;
748 
749  pips_assert("valid dimension", dim>0);
750  pips_debug(10, "%s (DIM=%d) %s\n", entity_name(ent), dim, side?"+":"-");
751 
752  if (!bound_overlap_status_p(ent)) create_overlaps(ent);
753  pips_assert("overlap ok", bound_overlap_status_p(ent));
754 
755  o = OVERLAP(gen_nth(dim-1, load_overlap_status(ent)));
756  return(side ? overlap_upper(o) : overlap_lower(o));
757 }
758 
759 /* redefines the bound given the overlap which is to be included
760  */
761 static void overlap_redefine_expression(pexpr, ov)
762 expression *pexpr;
763 int ov;
764 {
765  expression
766  copy = *pexpr;
767 
768  if (expression_constant_p(*pexpr))
769  {
770  *pexpr = int_to_expression(HpfcExpressionToInt(*pexpr)+ov);
771  free_expression(copy); /* this avoid a memory leak */
772  }
773  else
776  *pexpr,
777  int_to_expression(ov));
778 }
779 
781 list l;
782 {
783  entity ent;
784  int ndim, i, lower_overlap, upper_overlap;
785  dimension the_dim;
786 
787  MAP(ENTITY, oldent,
788  {
789  ent = load_new_node(oldent);
790  ndim = variable_entity_dimension(ent);
791 
792  pips_assert("variable", type_variable_p(entity_type(ent)));
793 
795  {
796  /* arguments are passed the declarations from outside
797  */
798  for (i=1 ; i<=ndim ; i++)
799  {
800  if (ith_dim_overlapable_p(oldent, i))
801  {
802  the_dim = entity_ith_dimension(ent, i);
803  dimension_lower(the_dim) = /* ??? memory leak */
804  hpfc_array_bound(ent, false, i);
805  dimension_upper(the_dim) =
806  hpfc_array_bound(ent, true, i);
807  }
808  }
809  }
810  else
811  {
812  for (i=1 ; i<=ndim ; i++)
813  {
814  the_dim = entity_ith_dimension(ent, i);
815  lower_overlap = get_overlap(oldent, i, 0);
816  upper_overlap = get_overlap(oldent, i, 1);
817 
818  pips_debug(8, "%s(DIM=%d): -%d, +%d\n",
819  entity_name(ent), i, lower_overlap, upper_overlap);
820 
821  if (lower_overlap!=0)
823  -lower_overlap);
824 
825  if (upper_overlap!=0)
827  upper_overlap);
828  }
829  }
830  },
831  l);
832 }
833 
834 void
836 {
839  gen_free_list(l);
840 }
841 
842 static void
844  entity u /* distributed variable in the caller */,
845  entity v /* formal parameter in the callee */)
846 {
847  int ndim = NumberOfDimension(v);
848 
849  pips_assert("conformance", ndim==NumberOfDimension(u));
850 
851  pips_debug(7, "%s from %s\n", entity_name(u), entity_name(v));
852 
853  for(; ndim>0; ndim--)
854  {
855  set_overlap(u, ndim, 0, get_overlap(v, ndim, 0));
856  set_overlap(u, ndim, 1, get_overlap(v, ndim, 1));
857  }
858 }
859 
860 /* the overlaps of the actual parameters are updated according
861  * to the formal requirements.
862  */
863 void
865  entity fun, /* the function */
866  list /* of expression */ le /* call arguments in the initial code */)
867 {
868  int len = gen_length(le), i;
869  for (i=1; i<=len; i++, POP(le))
870  {
871  entity v = find_ith_parameter(fun, i);
872  if (array_distributed_p(v))
873  {
874  expression e = EXPRESSION(CAR(le));
875  entity u = expression_to_entity(e), nu;
876  pips_assert("bounded to a new var", bound_new_node_p(u));
877  nu = load_new_node(u);
878  pips_debug(5, "call to %s, %s (%s) -> %s\n",
879  entity_name(fun), entity_name(u),
880  entity_name(nu), entity_name(v));
881  update_overlaps_of(u, v);
882  }
883 
884  }
885 }
886 
887 /* That is all
888  */
hpf_newdecl make_hpf_newdecl(enum hpf_newdecl_utype tag, void *val)
Definition: hpf_private.c:542
numbers_status make_numbers_status(entity_int a1, intptr_t a2, intptr_t a3, intptr_t a4)
Definition: hpf_private.c:698
hpf_newdecls make_hpf_newdecls(list a)
Definition: hpf_private.c:599
overlap make_overlap(intptr_t a1, intptr_t a2)
Definition: hpf_private.c:740
data_status make_data_status(newdeclmap a1, alignmap a2, distributemap a3, list a4, list a5, list a6)
Definition: hpf_private.c:109
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
dimension copy_dimension(dimension p)
DIMENSION.
Definition: ri.c:529
void free_expression(expression p)
Definition: ri.c:853
expression MakeCharacterConstantExpression(string s)
END_EOLE.
Definition: constant.c:573
void print_align(align a)
this is a set of functions to help hpfc debugging
Definition: debug-util.c:38
void print_distribute(distribute d)
Definition: debug-util.c:87
void print_hpf_dir(void)
Definition: debug-util.c:121
#define min(a, b)
#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
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
#define style_none_p(x)
Definition: hpf.h:259
#define alignment_templatedim(x)
Definition: hpf.h:136
#define alignment_undefined
Definition: hpf.h:108
#define DISTRIBUTION(x)
DISTRIBUTION.
Definition: hpf.h:180
#define distribution_style(x)
Definition: hpf.h:210
#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 style_tag(x)
Definition: hpf.h:258
#define distribute_processors(x)
Definition: hpf.h:176
#define distribution_parameter(x)
Definition: hpf.h:212
#define style_block_p(x)
Definition: hpf.h:262
#define style_cyclic_p(x)
Definition: hpf.h:265
@ is_style_block
Definition: hpf.h:238
#define distribution_undefined
Definition: hpf.h:186
#define hpf_newdecls_dimensions(x)
Definition: hpf_private.h:739
#define hpf_newdecl_tag(x)
Definition: hpf_private.h:692
#define data_status_templates(x)
Definition: hpf_private.h:297
#define numbers_status_arrays(x)
Definition: hpf_private.h:818
#define numbers_status_processors(x)
Definition: hpf_private.h:822
#define OVERLAP(x)
OVERLAP.
Definition: hpf_private.h:826
#define data_status_alignmap(x)
Definition: hpf_private.h:291
#define numbers_status_templates(x)
Definition: hpf_private.h:820
#define data_status_processors(x)
Definition: hpf_private.h:299
#define overlap_lower(x)
Definition: hpf_private.h:856
#define data_status_distributemap(x)
Definition: hpf_private.h:293
#define numbers_status_numbermap(x)
Definition: hpf_private.h:816
#define HPF_NEWDECL(x)
HPF_NEWDECL.
Definition: hpf_private.h:644
#define overlap_upper(x)
Definition: hpf_private.h:858
#define data_status_newdeclmap(x)
Definition: hpf_private.h:289
@ is_hpf_newdecl_none
Definition: hpf_private.h:665
@ is_hpf_newdecl_delta
Definition: hpf_private.h:669
@ is_hpf_newdecl_alpha
Definition: hpf_private.h:666
@ is_hpf_newdecl_beta
Definition: hpf_private.h:667
@ is_hpf_newdecl_gamma
Definition: hpf_private.h:668
#define data_status_arrays(x)
Definition: hpf_private.h:295
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
Definition: hpfc-util.c:569
bool ith_dim_distributed_p(entity array, int i, int *pprocdim)
whether a dimension is distributed or not.
Definition: hpfc-util.c:160
alignment FindAlignmentOfDim(list lal, int dim)
Definition: hpfc-util.c:377
distribution FindDistributionOfDim(list ldi, int dim, int *pdim)
Definition: hpfc-util.c:401
bool ith_dim_overlapable_p(entity array, int i)
Definition: hpfc-util.c:178
void normalize_hpf_object(entity v)
Definition: declarations.c:431
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
void reset_hpf_number_status()
Definition: declarations.c:142
void GiveToHpfObjectsTheirNumber()
give to hpf objects listed in distributedarrays, templates and processors their number for the code g...
Definition: declarations.c:166
static int ComputeNewSizeOfIthDimension(dimension dim, int i, entity array, tag *newdeclp)
here the new size of the ith dimension of the given array is computed.
Definition: declarations.c:455
static void init_currents()
Definition: declarations.c:116
#define normalized_dimension_p(dim)
local macros...
Definition: declarations.c:447
void set_hpf_number_status(numbers_status s)
Definition: declarations.c:148
static void NewDeclarationOfDistributedArray(entity array)
for node this are reformated, and for host these variables are deleted.
Definition: declarations.c:615
void close_hpf_number_status()
Definition: declarations.c:157
static void create_new_declaration(entity e)
Definition: declarations.c:248
tag new_declaration_tag(entity array, int dim)
Definition: declarations.c:229
void reset_data_status()
Definition: declarations.c:320
static void declaration_with_overlaps(list l)
Definition: declarations.c:780
int get_overlap(entity ent, int dim, int side)
returns the overlap for a given entity, dimension and side, to be used in the declaration modificatio...
Definition: declarations.c:743
void get_ith_dim_new_declaration(entity array, int i, int *pmin, int *pmax)
Definition: declarations.c:285
numbers_status get_hpf_number_status()
Definition: declarations.c:134
static int current_template_index
Definition: declarations.c:113
static int current_array_index
Definition: declarations.c:112
list list_of_distributed_arrays_for_module(entity module)
returns the list of entities that are 'local' to module
Definition: declarations.c:72
void normalize_align(_UNUSED_ entity e, align a)
Definition: declarations.c:426
static void overlap_redefine_expression(expression *pexpr, int ov)
redefines the bound given the overlap which is to be included
Definition: declarations.c:761
expression entity_hpf_number(entity e)
returns the hpf_number parameter as a string not really needed ??? ??? never called
Definition: declarations.c:196
void NormalizeHpfDeclarations()
Definition: declarations.c:437
void normalize_distribute(entity t, distribute d)
Definition: declarations.c:408
static void store_a_new_declaration(entity array, int dim, tag what)
Definition: declarations.c:266
void reset_hpf_object_lists()
Definition: declarations.c:91
static int current_processors_index
Definition: declarations.c:114
void init_hpf_number_status()
STANDARS STATIC MANAGEMENT.
Definition: declarations.c:128
static void create_overlaps(entity e)
Definition: declarations.c:693
void declaration_with_overlaps_for_module(entity module)
Definition: declarations.c:835
void NewDeclarationsOfDistributedArrays()
this procedure generate the new declarations of every distributed arrays of the program,...
Definition: declarations.c:676
#define STATIC_LIST_OF_HPF_OBJECTS(name, set_name, pred_name)
in static_controlize
Definition: declarations.c:46
void close_data_status()
Definition: declarations.c:339
static void NormalizeOneTemplateDistribution(distribution d, entity templ, int *templdimp, entity procs, int *procsdimp)
NormalizeOneTemplateDistribution.
Definition: declarations.c:352
void set_overlap(entity ent, int dim, int side, int width)
set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a posi...
Definition: declarations.c:713
data_status get_data_status()
Definition: declarations.c:308
void set_data_status(data_status s)
Definition: declarations.c:328
void free_hpf_object_lists()
Definition: declarations.c:98
void init_data_status()
Definition: declarations.c:300
void update_overlaps_in_caller(entity fun, list le)
the overlaps of the actual parameters are updated according to the formal requirements.
Definition: declarations.c:864
static void update_overlaps_of(entity u, entity v)
Definition: declarations.c:843
#define iceil(a, b)
integer ceiling function
void init_hpf_alignment(void)
entity load_old_node(entity)
bool declaration_delayed_p(entity)
entity load_new_node(entity)
void init_hpf_distribution(void)
void reset_hpf_alignment(void)
void reset_hpf_distribution(void)
bool entity_template_p(entity)
void set_template(entity)
list load_overlap_status(entity)
list list_of_processors(void)
bool bound_hpf_number_p(entity)
expression hpfc_array_bound(entity, bool, int)
Definition: run-time.c:516
entity hpfc_main_entity(entity)
returns the entity to which e is attached, that is first a common, then a function....
Definition: run-time.c:462
list list_of_templates(void)
distribute load_hpf_distribution(entity)
void close_hpf_distribution(void)
alignmap get_hpf_alignment(void)
void reset_hpf_number(void)
distributemap get_hpf_distribution(void)
void set_hpf_distribution(distributemap)
bool bound_new_node_p(entity)
void store_hpf_number(entity, intptr_t)
bool entity_processor_p(entity)
void store_overlap_status(entity, list)
align load_hpf_alignment(entity)
bool bound_overlap_status_p(entity)
void close_hpf_number(void)
void set_hpf_number(entity_int)
void close_hpf_alignment(void)
void set_hpf_alignment(alignmap)
list list_of_distributed_arrays(void)
void set_array_as_distributed(entity)
void init_hpf_number(void)
entity load_old_host(entity)
bool array_distributed_p(entity)
void set_processor(entity)
entity_int get_hpf_number(void)
#define _UNUSED_
Definition: misc-local.h:232
#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 pips_user_error
Definition: misc-local.h:147
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define GENERIC_GLOBAL_FUNCTION(name, type)
int tag
TAG.
Definition: newgen_types.h:92
#define UU
Definition: newgen_types.h:98
void normalize_first_expressions_of(void *obj)
Definition: normalize.c:694
static char * module
Definition: pips.c:74
static const char * prefix
#define PLUS_OPERATOR_NAME
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
entity FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
Definition: entity.c:1586
bool entity_in_common_p(entity e)
Definition: entity.c:1082
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
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
dimension entity_ith_dimension(entity, int)
Another semantics would be: is this reference r to e a kill for e? In general, this cannot be answere...
Definition: variable.c:1228
int dimension_size(dimension)
this function computes the size of a dimension.
Definition: size.c:491
int SizeOfIthDimension(entity, int)
this function returns the size of the ith dimension of a variable e.
Definition: size.c:453
int NumberOfDimension(entity)
Definition: size.c:588
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
Definition: variable.c:1293
entity find_ith_parameter(entity, int)
Definition: util.c:93
#define storage_formal_p(x)
Definition: ri.h:2522
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define ram_undefined
Definition: ri.h:2221
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
#define storage_ram_p(x)
Definition: ri.h:2519
#define ram_section(x)
Definition: ri.h:2249
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define expression_undefined
Definition: ri.h:1223
#define entity_name(x)
Definition: ri.h:2790
#define dimension_upper(x)
Definition: ri.h:982
#define variable_dimensions(x)
Definition: ri.h:3122
#define storage_ram(x)
Definition: ri.h:2521
#define ram_function(x)
Definition: ri.h:2247
#define entity_type(x)
Definition: ri.h:2792
#define type_variable_p(x)
Definition: ri.h:2947
char * strdup()
#define ifdebug(n)
Definition: sg.c:47
static entity array
GENERIC_LOCAL_FUNCTION(directives, step_directives)
Copyright 2007, 2008, 2009 Alain Muller, Frederique Silber-Chaussumier.
static size_t current
Definition: string.c:115
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: replace.c:135
#define abs(v)
Definition: syntax-local.h:48
static Panel_item choice
Definition: xv_schoose2.c:54