PIPS
build-system.c
Go to the documentation of this file.
1 /*
2 
3  $Id: build-system.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 /*
28  * build-system.c
29  *
30  * here should be build equations and inequations to deal
31  * with the I/O in hpf programs.
32  *
33  * Fabien COELHO, Feb/Mar 94
34  */
35 
36 #include "defines-local.h"
37 #include "prettyprint.h"
38 #include "effects-generic.h"
39 #include "effects-simple.h"
40 #include "effects-convex.h"
41 
42 #define ALPHA_PREFIX "ALPHA"
43 #define LALPHA_PREFIX "LALPHA"
44 #define THETA_PREFIX "THETA"
45 #define PSI_PREFIX "PSI"
46 #define GAMMA_PREFIX "GAMMA"
47 #define DELTA_PREFIX "DELTA"
48 #define IOTA_PREFIX "IOTA"
49 #define SIGMA_PREFIX "SIGMA"
50 #define TMP_PREFIX "TMP"
51 
52 /* tags with a newgen look and feel */
53 #define is_entity_array 0
54 #define is_entity_template 1
55 #define is_entity_processors 2
56 
57 /* Variables
58  * + array dimensions (PHIs)
59  * + template dimensions
60  * + processor dimensions
61  * + cycles and offsets
62  * + local array dimensions
63  * + indexes and others coming thru the regions
64  *
65  * Inequations to be defined
66  * + array declaration
67  * + template declaration
68  * + processors arrangement declaration
69  * + local offsets within a block
70  * + local declarations
71  * - regions accessed by the statement
72  *
73  * Equations to be defined
74  * + alignement
75  * + distribution
76  * + local <-> global?
77  * + processor linearization?
78  *
79  * Remarks
80  * - offset to be computed
81  * - access functions are not needed (hidden by regions)
82  * - how to be sure that something can be done?
83  * - will newgen structures be necessary to build the systems?
84  * - will I have to remove some variables (indexes ?)
85  * - one equation to be added for replicated dimensions.
86  */
87 
88 /* variable names:
89  *
90  * ALPHA{1-7}: array dimensions,
91  * THETA{1-7}: template dimensions,
92  * PSI{1-7}: processor dimensions,
93  * SIGMA{1-7}: auxiliary variable,
94  * GAMMA{1-7}: cycles,
95  * DELTA{1-7}: local offsets,
96  * LALPHA{1-7}: local array dimensions, if specified...
97  *
98  * plus "PRIME" versions
99  */
100 
101 /* ------------------------------------------------------------------
102  *
103  * HPF CONSTRAINTS GENERATION
104  */
105 
107 entity e;
108 {
110 }
111 
112 /********************************************************* DUMMY VARIABLES */
113 
114 #define PRIME_LETTER_FOR_VARIABLES "p"
115 
116 /* define to build the _dummy and _prime of a variable.
117  */
118 #define GET_DUMMY_VARIABLE_ENTITY(MODULE, NAME, lname) \
119  entity get_ith_##lname##_dummy(int i) \
120  { \
121  return get_ith_dummy(MODULE, NAME, i); \
122  } \
123  entity get_ith_##lname##_prime(int i) \
124  { \
125  return get_ith_dummy(MODULE, NAME PRIME_LETTER_FOR_VARIABLES, i); \
126  }
127 
138 
139 /* shift dummy variables to prime variables.
140  * systeme s is modified.
141  */
142 GENERIC_LOCAL_FUNCTION(dummy_to_prime, entitymap)
143 
144 static void put_dummy_and_prime(gen1, gen2)
145 entity (*gen1)(), (*gen2)();
146 {
147  int i;
148  for(i=7; i>0; i--)
149  store_dummy_to_prime(gen1(i), gen2(i));
150 }
151 
152 #define STORE(name) \
153  put_dummy_and_prime(get_ith_##name##_dummy, get_ith_##name##_prime)
154 
156 {
157  init_dummy_to_prime();
158  STORE(array);
159  STORE(template);
160  STORE(processor);
161  STORE(block);
162  STORE(cycle);
163  STORE(local);
164  STORE(shift);
165  STORE(auxiliary);
166 }
167 
169 {
170  close_dummy_to_prime();
171 }
172 
174 Psysteme s;
175 {
176  return sc_rename_variables(s, (bool (*)())bound_dummy_to_prime_p,
177  (Variable(*)()) load_dummy_to_prime);
178 }
179 
180 /* already computed constraints
181  */
182 #ifndef Psysteme_undefined
183 #define Psysteme_undefined SC_UNDEFINED
184 #define Psysteme_undefined_p(sc) SC_UNDEFINED_P(sc)
185 #endif
186 /* ??? used with a temporary hack to differentiate array and templates */
187 GENERIC_LOCAL_MAPPING(declaration_constraints, Psysteme, entity)
188 GENERIC_LOCAL_MAPPING(hpf_align_constraints, Psysteme, entity)
189 GENERIC_LOCAL_MAPPING(hpf_distribute_constraints, Psysteme, entity)
190 GENERIC_LOCAL_MAPPING(new_declaration_constraints, Psysteme, entity)
191 
193 {
194  make_declaration_constraints_map();
195  make_hpf_align_constraints_map();
196  make_hpf_distribute_constraints_map();
197  make_new_declaration_constraints_map();
198 }
199 
201 {
202  free_declaration_constraints_map();
203  free_hpf_align_constraints_map();
204  free_hpf_distribute_constraints_map();
205  free_new_declaration_constraints_map();
206 }
207 
208 /* ------------------------------------------------------------------
209  *
210  * DECLARATION CONSTRAINTS GENERATION
211  */
212 
213 /* Psysteme compute_entity_to_constraints(ent, suffix, prefix)
214  * entity ent: variable the constraints of which are computed
215  * strings suffix and prefix: to be used in the dummy variables created
216  *
217  * computes the constraints due to the declarations.
218  *! usefull
219  */
221 entity ent;
222 string suffix, prefix;
223 {
225  int dim_number = 1;
226  Psysteme new_system = sc_new();
227 
228  pips_assert("variable", entity_variable_p(ent));
229 
230  /* system may be empty for scalars ???
231  */
232  pips_debug(5, "entity %s, [%s,%s]\n", entity_name(ent), prefix, suffix);
233 
234  MAP(DIMENSION, dim,
235  {
236  entity dummy = get_ith_dummy(prefix, suffix, dim_number);
237  int ilower;
238  int iupper;
240  (dimension_lower(dim), &ilower);
242  (dimension_upper(dim), &iupper);
243 
244  pips_assert("extent known", blower && bupper);
245 
246  /* now the dummy is to be used to generate two inequalities:
247  * -dummy + lower <= 0 and dummy - upper <= 0
248  */
250  (new_system,
252  dummy, VALUE_MONE,
253  TCST, int_to_value(ilower))));
255  (new_system,
257  dummy, VALUE_ONE,
258  TCST, int_to_value(-iupper))));
259  dim_number++;
260  },
261  dims);
262 
263  sc_creer_base(new_system);
264  return new_system;
265 }
266 
267 static Psysteme
269  entity e,
270  tag what)
271 {
272  string local_prefix = (what==is_entity_array? ALPHA_PREFIX:
274  what==is_entity_processors? PSI_PREFIX: "ERROR");
275 
277  (e, local_prefix, HPFC_PACKAGE);
278 }
279 
280 /* gives back the constraints due to the declarations.
281  * Uses a demand driven approach: computed systems are stored
282  * in the declaration_constraints mapping for later search.
283  */
284 Psysteme
286  entity e,
287  tag what)
288 {
289  Psysteme p = load_entity_declaration_constraints(e+what);
290  pips_assert("variable", entity_variable_p(e));
291 
292  if (Psysteme_undefined_p(p))
293  {
295  store_entity_declaration_constraints(e+what, p);
296  }
297 
298  DEBUG_SYST(9, concatenate("entity ", entity_name(e), NULL), p);
299 
300  return p;
301 }
302 
303 /* Psysteme hpfc_compute_align_constraints(e)
304  * entity e is an array
305  *
306  * compute the align equations:
307  *
308  * theta_i - a phi_j - b == 0
309  */
311 entity e;
312 {
313  align al = load_hpf_alignment(e);
314  entity template = align_template(al);
315  Psysteme new_system = sc_new();
316  int i;
317 
318  pips_assert("distributed array", array_distributed_p(e));
319 
320  for(i=1 ; i<=NumberOfDimension(template) ; i++)
321  {
322  entity theta = get_ith_template_dummy(i);
324 
325  if (a!=alignment_undefined)
326  {
327  int adim = alignment_arraydim(a),
329  Pvecteur
331  theta, VALUE_ONE,
333 
334  if (adim==0)
335  {
336  sc_add_egalite(new_system, contrainte_make(v));
337  }
338  else
339  {
340  entity phi = get_ith_array_dummy(adim);
341  int rate = HpfcExpressionToInt(alignment_rate(a));
342 
343  v = vect_make(v, phi, int_to_value(-rate), TCST, VALUE_ZERO);
344  sc_add_egalite(new_system, contrainte_make(v));
345  }
346  }
347  }
348 
349  sc_creer_base(new_system);
350  return(new_system);
351 }
352 
353 /* Psysteme hpfc_compute_unicity_constraints(e)
354  * entity e should be an array;
355  *
356  * equations for non aligned template dimensions are computed: ???
357  *
358  * theta_i - lower_template_i == 0
359  */
361 entity e;
362 {
363  align al = load_hpf_alignment(e);
364  entity template = align_template(al);
365  Psysteme new_system = sc_new();
366  int i;
367 
368  pips_assert("distributed array", array_distributed_p(e));
369 
370  for(i=1 ; i<=NumberOfDimension(template) ; i++)
371  {
372  alignment
374 
375  if (a==alignment_undefined)
376  {
377  entity
378  theta = get_ith_template_dummy(i);
379  int
380  low =
382  (dimension_lower(entity_ith_dimension(template, i)));
383 
385  (new_system,
387  theta, VALUE_ONE,
388  TCST, int_to_value(-low))));
389  }
390  }
391  sc_creer_base(new_system);
392  return(new_system);
393 }
394 
395 /* Psysteme hpfc_compute_distribute_constraints(e)
396  * entity e should be a template;
397  *
398  * the constraints due to the distribution are defined:
399  *
400  * theta_i - theta_i0 == Nj Pj gamma_j + Nj (psi_j - psi_j0) + delta_j
401  * delta_j >= 0
402  * delta_j < Nj
403  * ??? if block distribution: gamma_j == 0
404  * ??? not distributed template dimensions are skipped...
405  * ??? if cyclic(1) distribution: delta_j == 0
406  */
408 entity e;
409 {
410  Psysteme new_system = sc_new();
412  entity proc = distribute_processors(di);
413  list ld = distribute_distribution(di);
414  int j, i;
415 
416  pips_assert("template", entity_template_p(e));
417 
418  for(j=1 ; j<=NumberOfDimension(proc) ; j++)
419  {
421  d = FindDistributionOfProcessorDim(ld, j, &i);
422  entity
423  theta = get_ith_template_dummy(i),
424  psi = get_ith_processor_dummy(j),
425  gamma = get_ith_cycle_dummy(j),
426  delta = get_ith_block_dummy(j);
427  int
429  theta0 = HpfcExpressionToInt
431  psi0 = HpfcExpressionToInt
433  proc_size = SizeOfIthDimension(proc, j);
434  style st = distribution_style(d);
436 
437  /* -delta_j <= 0
438  */
439  sc_add_inegalite(new_system,
441 
442  /* delta_j - (N_j - 1) <= 0
443  */
444  sc_add_inegalite(new_system,
446  (Variable) delta, VALUE_ONE,
447  TCST, int_to_value(-param+1))));
448 
449  /* theta_i - Nj psi_j - Nj Pj gamma_j - delta_j + Nj psi_j0 - theta_i0
450  * == 0
451  */
453  (Variable) theta, VALUE_ONE,
454  (Variable) psi, int_to_value(-param),
455  (Variable) gamma, int_to_value(-(param*proc_size)),
456  (Variable) delta, VALUE_MONE,
457  TCST, int_to_value((param*psi0)-theta0));
458 
459  sc_add_egalite(new_system, contrainte_make(v));
460 
461  /* if block distributed
462  * gamma_j == 0
463  */
464  if (style_block_p(st))
465  sc_add_egalite(new_system,
467 
468  /* if cyclic(1) distributed
469  * delta_j == 0
470  */
471  if (style_cyclic_p(st) && (param==1))
472  sc_add_egalite(new_system,
474 
475  }
476  sc_creer_base(new_system);
477  return(new_system);
478 }
479 
481 {
482  Psysteme p = load_entity_hpf_align_constraints(e);
483 
484  pips_assert("distributed variable", array_distributed_p(e));
485 
486  if (Psysteme_undefined_p(p))
487  {
489  store_entity_hpf_align_constraints(e, p);
490  }
491 
492  return p;
493 }
494 
496 {
497  Psysteme p = load_entity_hpf_distribute_constraints(e);
498 
499  pips_assert("template", entity_template_p(e));
500 
501  if (Psysteme_undefined_p(p))
502  {
504  store_entity_hpf_distribute_constraints(e, p);
505  }
506 
507  return p;
508 }
509 
510 /* effect entity_to_region(stat, ent, act)
511  * statement stat; entity ent; tag act;
512  *
513  * gives the region of ent with action act in statement stat.
514  */
516  statement stat,
517  entity ent,
518  tag act)
519 {
521 
522  MAP(EFFECT, e,
523  if ((reference_variable(effect_any_reference(e))==ent) &&
524  ((int) action_tag(effect_action(e))==act)) return(e),
525  l);
526 
527  return(effect_undefined);
528 }
529 
530 /********************************************************* NEW DECLARATIONS */
531 
532 Psysteme
534  entity array)
535 {
536  int dim = NumberOfDimension(array);
537  Psysteme syst = sc_rn(NULL);
538 
539  pips_assert("distributed array", array_distributed_p(array));
540 
541  for (; dim>0; dim--)
542  {
543  entity lalpha = get_ith_local_dummy(dim),
544  alpha = get_ith_array_dummy(dim);
545 
546  switch (new_declaration_tag(array, dim))
547  {
548  case is_hpf_newdecl_none:
549  /* LALPHAi == ALPHAi
550  */
552  (syst,
554  alpha, VALUE_ONE,
555  lalpha, VALUE_MONE,
556  TCST, VALUE_ZERO)));
557  break;
559  {
560  /* LALPHAi = ALPHAi - ALPHAi_min + 1
561  */
562  int min = 314159;
563  int max = -314159;
564 
566 
568  (syst,
570  alpha, VALUE_ONE,
571  lalpha, VALUE_MONE,
572  TCST, int_to_value(1-min))));
573 
574  break;
575  }
576  case is_hpf_newdecl_beta:
577  {
578  /* (|a|==1) LALPHA_i == DELTA_j + 1
579  * generalized to:
580  * (|a|!=1) |a| * (LALPHA_i - 1) + IOTA_j == DELTA_j
581  * 0 <= IOTA_j < |a|
582  */
583  entity delta, template = array_to_template(array);
584  int tdim, pdim, a, b, n;
585 
586  get_alignment(array, dim, &tdim, &a, &b);
587  pips_assert("aligned dimension", a!=0 && tdim!=0);
588  get_distribution(template, tdim, &pdim, &n);
589 
590  delta = get_ith_block_dummy(pdim);
591 
592  if (abs(a)==1)
593  {
594  /* IOTA is not needed */
595  sc_add_egalite(syst,
597  delta, VALUE_ONE,
598  lalpha, VALUE_MONE,
599  TCST, VALUE_ONE)));
600  }
601  else
602  {
603  entity iota = get_ith_shift_dummy(pdim);
604  Pvecteur
605  v1 = vect_make(VECTEUR_NUL,
606  (Variable) lalpha, int_to_value(abs(a)),
607  (Variable) iota, VALUE_ONE,
608  (Variable) delta, VALUE_MONE,
609  TCST, int_to_value(-abs(a)));
610 
611  sc_add_egalite(syst, contrainte_make(v1));
612  sc_add_inegalite(syst,
614  VALUE_MONE)));
616  (syst,
618  (Variable) iota, VALUE_ONE,
619  TCST, int_to_value(-(abs(a)-1)))));
620  }
621 
622  break;
623  }
625  {
626  /* LALPHA_i == N* (GAMMA_j - GAMMA_0) + DELTA_j + 1
627  */
628  entity
629  gamma = entity_undefined,
630  delta = entity_undefined,
631  template = array_to_template(array),
632  processor = template_to_processors(template);
633  int gamma_0 = 0, tdim = -1, pdim = -1, a = 0, b = 0,
634  n, plow, pup, tlow, tup, alow, aup;
635 
636  get_alignment(array, dim, &tdim, &a, &b);
637  pips_assert("stride-1 aligned", abs(a)==1 && tdim!=0);
638 
639  get_distribution(template, tdim, &pdim, &n);
640  pips_assert("distributed dimension", pdim>0 && n>0);
641 
642  get_entity_dimensions(array, dim, &alow, &aup);
643  get_entity_dimensions(template, tdim, &tlow, &tup);
644  get_entity_dimensions(processor, pdim, &plow, &pup);
645 
646  delta = get_ith_block_dummy(pdim);
647  gamma = get_ith_cycle_dummy(pdim);
648 
649  gamma_0 = (a*alow + b - tlow) % (n * (pup - plow + 1));
650 
652  (syst,
654  (VECTEUR_NUL,
655  delta, VALUE_ONE,
656  gamma, int_to_value(n),
657  lalpha, VALUE_MONE,
658  TCST, int_to_value(1-(n*gamma_0)))));
659  break;
660  }
662  {
663  /* LALPHA_i = iceil(N,|a|) * (GAMMA_j - GAMMA_0) + SIGMA_j +1
664  * DELTA_j = |a|*SIGMA_j + IOTA_j
665  * 0 <= IOTA_j < |a|
666  */
667  entity sigma = entity_undefined,
668  iota = entity_undefined,
669  gamma = entity_undefined,
670  delta = entity_undefined,
671  template = array_to_template(array),
672  processor = template_to_processors(template);
673  int gamma_0 = 0, tdim = -1, pdim = -1, a = 0, b = 0,
674  n, icn, plow, pup, tlow, tup, alow, aup;
675 
676  get_alignment(array, dim, &tdim, &a, &b);
677  pips_assert("aligned dimension", tdim!=0);
678 
679  get_distribution(template, tdim, &pdim, &n);
680  pips_assert("distributed dimension", pdim>0 && n>0);
681 
682  get_entity_dimensions(array, dim, &alow, &aup);
683  get_entity_dimensions(template, tdim, &tlow, &tup);
684  get_entity_dimensions(processor, pdim, &plow, &pup);
685 
686  sigma = get_ith_auxiliary_dummy(pdim);
687  iota = get_ith_shift_dummy(pdim);
688  delta = get_ith_block_dummy(pdim);
689  gamma = get_ith_cycle_dummy(pdim);
690 
691  gamma_0 = (a*alow + b - tlow) % (n * (pup - plow + 1));
692  icn = iceil(n, abs(a));
693 
695  (syst,
698  sigma, VALUE_ONE,
699  gamma, int_to_value(icn),
700  lalpha, VALUE_MONE,
701  TCST, int_to_value(1-(icn*gamma_0)))));
702 
704  (syst,
707  delta, VALUE_ONE,
708  sigma, int_to_value(-abs(a)),
709  iota, VALUE_MONE,
710  TCST, VALUE_ZERO)));
711 
712  sc_add_inegalite(syst,
714  VALUE_MONE)));
716  (syst,
719  (Variable) iota, VALUE_ONE,
720  TCST, int_to_value(-(abs(a)-1)))));
721  break;
722  }
723  default:
724  pips_internal_error("unexpected new declaration tag");
725  }
726  }
727 
728  sc_creer_base(syst);
729  return syst;
730 }
731 
733 entity array;
734 {
735  Psysteme p = load_entity_new_declaration_constraints(array);
736 
737  pips_assert("distributed array", array_distributed_p(array));
738 
739  if (Psysteme_undefined_p(p))
740  {
742  store_entity_new_declaration_constraints(array, p);
743  }
744 
745  return p;
746 }
747 
748 /*********************************** REGION and ARRAY link: PHIi == ALPHAi */
749 
750 Psysteme
752  int n,
753  entity (*gen1)(int),
754  entity (*gen2)(int))
755 {
756  Psysteme s = sc_rn(NULL);
757 
758  for(; n>0; n--)
760  (vect_make(VECTEUR_NUL, gen1(n), VALUE_ONE,
761  gen2(n), VALUE_MONE, TCST, VALUE_ZERO)));
762 
763  sc_creer_base(s); return s;
764 }
765 
766 Psysteme
768  entity array)
769 {
770  int ndim = variable_entity_dimension(array);
771 
774 }
775 
776 /* Psysteme generate_system_for_variable(v)
777  * entity v;
778  *
779  * what: generates a system for DISTRIBUTED variable v.
780  * how: uses the declarations of v, t, p and align and distribute,
781  * and new declarations.
782  * input: entity (variable) v
783  * output: the built system, which is a new allocated system.
784  * side effects:
785  * - uses many functions that build and store systems...
786  * bugs or features:
787  */
788 Psysteme
790  entity v)
791 {
792  Psysteme result = sc_rn(NULL);
793  entity t, p;
794 
795  pips_assert("distributed array", array_distributed_p(v));
796 
799 
800  result = sc_append(result, entity_to_declaration_constraints(v, 0));
801  result = sc_append(result, entity_to_declaration_constraints(t, 1));
802  result = sc_append(result, entity_to_declaration_constraints(p, 2));
803  result = sc_append(result, entity_to_hpf_align_constraints(v));
804  result = sc_append(result, entity_to_hpf_distribute_constraints(t));
805  result = sc_append(result, entity_to_new_declaration(v));
806 
807  base_rm(sc_base(result)), sc_base(result) = NULL, sc_creer_base(result);
808 
809  return(result);
810 }
811 
812 /* that is all
813  */
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_MONE
#define VALUE_ONE
void hpfc_close_dummy_to_prime()
Definition: build-system.c:168
bool entity_hpfc_dummy_p(entity e)
Variables.
Definition: build-system.c:106
static Psysteme hpfc_compute_distribute_constraints(entity e)
Psysteme hpfc_compute_distribute_constraints(e) entity e should be a template;.
Definition: build-system.c:407
static Psysteme hpfc_compute_entity_to_declaration_constraints(entity e, tag what)
Definition: build-system.c:268
#define Psysteme_undefined_p(sc)
Definition: build-system.c:184
Psysteme entity_to_hpf_align_constraints(entity e)
Definition: build-system.c:480
#define is_entity_processors
Definition: build-system.c:55
Psysteme entity_to_declaration_constraints(entity e, tag what)
gives back the constraints due to the declarations.
Definition: build-system.c:285
void free_hpfc_current_mappings()
Definition: build-system.c:200
Psysteme generate_system_for_equal_variables(int n, entity(*gen1)(int), entity(*gen2)(int))
Definition: build-system.c:751
Psysteme hpfc_compute_entity_to_new_declaration(entity array)
Definition: build-system.c:533
Psysteme compute_entity_to_declaration_constraints(entity ent, string suffix, string prefix)
Psysteme compute_entity_to_constraints(ent, suffix, prefix) entity ent: variable the constraints of w...
Definition: build-system.c:220
#define GET_DUMMY_VARIABLE_ENTITY(MODULE, NAME, lname)
define to build the _dummy and _prime of a variable.
Definition: build-system.c:118
static Psysteme hpfc_compute_align_constraints(entity e)
Psysteme hpfc_compute_align_constraints(e) entity e is an array.
Definition: build-system.c:310
void make_hpfc_current_mappings()
??? used with a temporary hack to differentiate array and templates
Definition: build-system.c:192
#define DELTA_PREFIX
Definition: build-system.c:47
Psysteme entity_to_hpf_distribute_constraints(entity e)
Definition: build-system.c:495
Psysteme shift_system_to_prime_variables(Psysteme s)
Definition: build-system.c:173
#define STORE(name)
Definition: build-system.c:152
Psysteme hpfc_compute_unicity_constraints(entity e)
Psysteme hpfc_compute_unicity_constraints(e) entity e should be an array;.
Definition: build-system.c:360
Psysteme entity_to_new_declaration(entity array)
Definition: build-system.c:732
#define IOTA_PREFIX
Definition: build-system.c:48
#define ALPHA_PREFIX
Definition: build-system.c:42
void hpfc_init_dummy_to_prime()
Definition: build-system.c:155
#define SIGMA_PREFIX
Definition: build-system.c:49
#define LALPHA_PREFIX
Definition: build-system.c:43
#define PSI_PREFIX
Definition: build-system.c:45
#define GAMMA_PREFIX
Definition: build-system.c:46
#define is_entity_template
Definition: build-system.c:54
Psysteme generate_system_for_distributed_variable(entity v)
Psysteme generate_system_for_variable(v) entity v;.
Definition: build-system.c:789
static void put_dummy_and_prime(entity(*gen1)(), gen2)
shift dummy variables to prime variables.
Definition: build-system.c:144
effect entity_to_region(statement stat, entity ent, tag act)
effect entity_to_region(stat, ent, act) statement stat; entity ent; tag act;
Definition: build-system.c:515
#define TMP_PREFIX
Definition: build-system.c:50
#define THETA_PREFIX
Definition: build-system.c:44
Psysteme hpfc_unstutter_dummies(entity array)
Definition: build-system.c:767
#define is_entity_array
tags with a newgen look and feel
Definition: build-system.c:53
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
int dummy
A dummy file, to prevent empty libraries from breaking builds.
Definition: dummy.c:41
#define region
simulation of the type region
#define min(a, b)
#define max(a, b)
list load_statement_local_regions(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define PHI_PREFIX
#define effect_action(x)
Definition: effects.h:642
#define effect_undefined
Definition: effects.h:614
#define action_tag(x)
Definition: effects.h:310
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
#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 alignment_undefined
Definition: hpf.h:108
#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_arraydim(x)
Definition: hpf.h:134
#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_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 HPFC_PACKAGE
local definitions
Definition: hpfc-local.h:27
void get_entity_dimensions(entity e, int dim, int *plow, int *pup)
Definition: hpfc-util.c:651
void get_alignment(entity array, int dim, int *ptdim, int *pa, int *pb)
Definition: hpfc-util.c:606
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
Definition: hpfc-util.c:569
distribution FindDistributionOfProcessorDim(list ldi, int dim, int *tdim)
Definition: hpfc-util.c:421
void get_distribution(entity template, int dim, int *ppdim, int *pn)
Definition: hpfc-util.c:638
alignment FindAlignmentOfTemplateDim(list lal, int dim)
Definition: hpfc-util.c:389
tag new_declaration_tag(entity array, int dim)
Definition: declarations.c:229
void get_ith_dim_new_declaration(entity array, int i, int *pmin, int *pmax)
Definition: declarations.c:285
#define array_to_template(array)
#define DEBUG_SYST(D, W, S)
#define iceil(a, b)
integer ceiling function
#define template_to_processors(template)
entity get_ith_template_dummy(int)
entity get_ith_cycle_dummy(int)
bool entity_template_p(entity)
entity get_ith_region_dummy(int)
entity get_ith_array_dummy(int)
distribute load_hpf_distribution(entity)
entity get_ith_shift_dummy(int)
entity get_ith_block_dummy(int)
entity get_ith_processor_dummy(int)
entity get_ith_auxiliary_dummy(int)
align load_hpf_alignment(entity)
entity get_ith_local_dummy(int)
bool array_distributed_p(entity)
#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
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define GENERIC_LOCAL_MAPPING(name, result, type)
to allow mappings local to a file.
#define same_string_p(s1, s2)
int tag
TAG.
Definition: newgen_types.h:92
static const char * prefix
#define REGIONS_MODULE_NAME
Already defined.
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092
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 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
entity get_ith_dummy(string, string, int)
Returns a numbered entity the name of which is suffix + number, the module of which is prefix.
Definition: variable.c:1711
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
Definition: variable.c:1293
#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 entity_undefined
Definition: ri.h:2761
#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 entity_type(x)
Definition: ri.h:2792
Psysteme sc_rename_variables(Psysteme s, bool(*renamed_p)(), Variable(*new_variable)())
Psysteme sc_rename_variables(s, renamed_p, new_variable) Psysteme s; bool (*renamed_p)(Variable); Var...
Definition: sc.c:198
Psysteme sc_rn(Pbase b)
Psysteme sc_rn(Pbase b): build a Psysteme without constraints to define R^n, where n is b's dimension...
Definition: sc_alloc.c:336
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Definition: sc_alloc.c:389
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Definition: sc_alloc.c:406
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
static entity array
GENERIC_LOCAL_FUNCTION(directives, step_directives)
Copyright 2007, 2008, 2009 Alain Muller, Frederique Silber-Chaussumier.
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
Definition: replace.c:135
#define abs(v)
Definition: syntax-local.h:48
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
#define base_rm(b)
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_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...
Definition: alloc.c:165
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