PIPS
reindexing.c
Go to the documentation of this file.
1 /*
2 
3  $Id: reindexing.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 /* Name : reindexing.c
29  * Package : reindexing
30  * Author : Alexis Platonoff & Antoine Cloue
31  * Date : april 1994
32  * Historic :
33  * - 19 jan 95 : remove my_make_rational_exp() and my_vect_var_subst(), AP
34  * - 20 apr 95 : modification of get_time_ent(), AP
35  * - 21 apr 95 : remove the functions dealing with "cell" in cell.c, AP
36  *
37  * Documents: SOON
38  * Comments : This file contains the functions for the transformation of a
39  * program to a single assignment form. The main function is reindexing().
40  */
41 
42 /* Ansi includes */
43 #include <stdio.h>
44 #include <stdlib.h>
45 #include <string.h>
46 
47 /* Newgen includes */
48 #include "genC.h"
49 
50 /* C3 includes */
51 #include "boolean.h"
52 #include "arithmetique.h"
53 #include "vecteur.h"
54 #include "contrainte.h"
55 #include "ray_dte.h"
56 #include "sommet.h"
57 #include "sg.h"
58 #include "sc.h"
59 #include "polyedre.h"
60 #include "union.h"
61 #include "matrice.h"
62 #include "matrix.h"
63 #include "sparse_sc.h"
64 
65 /* Pips includes */
66 #include "boolean.h"
67 #include "ri.h"
68 #include "constants.h"
69 #include "control.h"
70 #include "ri-util.h"
71 #include "misc.h"
72 #include "complexity_ri.h"
73 #include "database.h"
74 #include "graph.h"
75 #include "dg.h"
76 #include "paf_ri.h"
77 #include "parser_private.h"
78 #include "property.h"
79 #include "reduction.h"
80 #include "text.h"
81 #include "text-util.h"
82 #include "tiling.h"
83 #include "text-util.h"
84 #include "pipsdbm.h"
85 #include "resources.h"
86 #include "static_controlize.h"
87 #include "paf-util.h"
88 #include "pips.h"
89 #include "array_dfg.h"
90 #include "prgm_mapping.h"
91 #include "conversion.h"
92 #include "scheduling.h"
93 #include "reindexing.h"
94 
95 /* Macro functions */
96 
97 #define STRING_BDT "t"
98 #define STRING_PLC "p"
99 #define STRING_TAU "q"
100 #define STRING_FLAG "flag"
101 
102 #define MAKE_STATEMENT(ins) (make_statement(entity_empty_label(),STATEMENT_NUMBER_UNDEFINED,STATEMENT_ORDERING_UNDEFINED,string_undefined,ins))
103 
104 /* Internal variables */
105 
106 /* Global variables */
107 static int tc;
110 hash_table ht_ab; /* Array bounds */
112 
113 /* Local defines */
116 
117 /* We define a set of constant in order to a more generic function for the
118  * insert of the declarations of the new created variables.
119  */
120 #define INTEGER_DEC 0
121 #define REAL_DEC 1
122 #define COMPLEX_DEC 2
123 #define LOGICAL_DEC 3
124 #define DOUBLE_DEC 4
125 #define CHARACTER_DEC 5
126 
127 #define INTEGER_DECL " INTEGER"
128 #define REAL_DECL " REAL"
129 #define COMPLEX_DECL " COMPLEX"
130 #define LOGICAL_DECL " LOGICAL"
131 #define DOUBLE_DECL " DOUBLE"
132 #define CHARACTER_DECL " CHARACTER"
133 #define COLON ":"
134 #define NEWLINE "\n *"
135 #define ENDLINE "\n"
136 #define LINE_LENGHT 68
137 #define MARGIN_LENGHT 7
138 
139 #define IS_MIN 0
140 #define IS_MAX 1
141 
142 
143 #define DOUBLE_PRECISION_SIZE 8
144 
145 
146 /*===================================================================*/
147 /* entity get_time_ent(typ, count)
148  *
149  * Returns the entity that represents the global time variable "t_count"
150  * for the program. If it does not exist yet, we create it.
151  * AC 94/05/30
152  *
153  * AP 95/04/20: entities must have in their full name the current module
154  * name instead of RE_MODULE_NAME. */
155 
157 char *typ;
158 int st, count;
159 {
160  char name[32], *full_name;
161  entity new_coeff;
162 
163  if (!strncmp(typ, STRING_BDT, 1))
164  sprintf(name, "%s%d%s%d", STAT_SYM, st, typ, count);
165  else
166  sprintf(name, "%s%d%s%d", STAT_SYM, st - BASE_NODE_NUMBER, typ, count);
167 
168  /* full_name = strdup(concatenate(RE_MODULE_NAME, MODULE_SEP_STRING,
169  name, NULL));
170  */
172  MODULE_SEP_STRING, name, NULL));
173 
175 
176  /* We create it, if it does not exist yet */
177  if (new_coeff == entity_undefined) {
178  if (!strncmp(typ, STRING_BDT, 1))
179  new_coeff = create_new_entity(st, STRING_BDT, count);
180  else
181  new_coeff = create_new_entity(st - BASE_NODE_NUMBER,
182  STRING_TAU, count);
183  }
184 
185  return(new_coeff);
186 }
187 
188 
189 /*=========================================================================*/
190 /* void build_contraction_matrices(mH, mQ, mQ_inv, mC, l)
191  *
192  * From the matrix of Hermite mH, build the matrix mQ containing the
193  * periods of the different schedule dimension.
194  *
195  * AC 94/03/31 */
196 
197 void build_contraction_matrices(s, ps, mH, c, mQ, mQ_inv, mC, ln, lom,
198  indx, cnst)
199 int s, *c;
200 Pmatrix mH, *mQ, *mQ_inv, *mC;
201 list *ln, *lom;
202 Pbase indx, cnst;
203 Psysteme ps;
204 {
205  int i, le = ps->nb_eq;
206  Value ppc = VALUE_ONE;
207  entity ent;
208  Psysteme sc = sc_new();
209  Pcontrainte cont;
210 
211  *ln = NIL;
212  *lom = NIL;
213  matrix_identity(*mQ, 0);
214  matrix_identity(*mQ_inv, 0);
215 
216  if (get_debug_level() > 5)
217  fprintf(stderr,"\nBuild_contraction matrice :");
218 
219  for (i = 1; i <= le; i++)
220  ppc = ppcm(ppc, value_abs(MATRIX_ELEM(mH, i, i)));
221 
222  for (i = 1; i <= MATRIX_NB_LINES(*mQ); i++) {
223  if (i <= le) {
224  Value p = value_div(ppc,MATRIX_ELEM(mH, i, i)), x;
225  MATRIX_ELEM(*mQ,i,i) = value_abs(p);
226  ent = get_time_ent(s, STRING_TAU, (*c));
227  (*c)++;
228  ADD_ELEMENT_TO_LIST(*ln, ENTITY, ent);
229 
230  x = value_abs(MATRIX_ELEM(mH,i,i));
232  }
233  else
234  value_product(MATRIX_ELEM(*mQ,i,i), ppc);
235  }
236 
237  MATRIX_DENOMINATOR(*mQ) = ppc;
238 
239  sc = matrix_to_system(*mQ, indx);
240 
241  cont = sc->egalites;
242 
243  while (ps->egalites != NULL) {
244  cont->vecteur = vect_substract(cont->vecteur, (ps->egalites)->vecteur);
245  cont = cont->succ;
246  ps->egalites = (ps->egalites)->succ;
247  ps->nb_eq--;
248  }
249 
250  /* build the matrix mC */
251  matrix_nulle(*mC);
252 
253  my_constraints_with_sym_cst_to_matrices(sc->egalites, indx, cnst, *mQ, *mC);
254 
255  MATRIX_DENOMINATOR(*mQ) = ppc;
256  MATRIX_DENOMINATOR(*mC) = ppc;
257 
258  matrix_general_inversion(*mQ, *mQ_inv);
259 
260  if (get_debug_level() > 5)
261  fprintf(stderr,"\nBuild_contraction_matrice fin\n");
262 }
263 
264 
265 /*========================================================================*/
266 /* build_list_of_min()
267  *
268  * From the list of psystem "lsys", take each inequality (that is an
269  * expression of a possible lower bound), and create as many systems as
270  * necessary to raise the undetermination on the domain. This is done
271  * until the counter is equal to 0 meaning that all "t" variables have
272  * been treated.
273  *
274  * AC 94/05/05 */
275 
277 Psyslist lsys;
278 list lnew;
279 Psysteme ps;
280 {
281  Psysteme sc_aux, ps_aux2;
282  Pcontrainte cont, cont2;
283  Pvecteur vect, vectp, vect2;
284  Value val, val2;
285  Psyslist lsys_aux = NULL, lsys_aux2 = NULL;
286  Variable var;
287 
288  if (get_debug_level() > 5)
289  fprintf(stderr, "\nBuild list of min begin \n");
290 
291  if (lsys != NULL) {
292  /* get the system corresponding to the current variable */
293  sc_aux = lsys->psys;
294  var = (Variable)ENTITY(CAR(lnew));
295 
296  if (get_debug_level() > 5) {
297  fprintf(stderr, "\nSysteme en cours d'etude:");
298  fprint_psysteme(stderr, sc_aux);
299  fprintf(stderr, "\nVariable relative : ");
300  fprint_entity_list(stderr,CONS(ENTITY, (entity)var, NIL));
301  fprintf(stderr,"\nSysteme en p a ajouter: ");
302  fprint_psysteme(stderr,ps);
303  }
304 
305  if (sc_aux->nb_ineq == 1) {
306  /* there is already an unique minimum */
307  vectp = vect_del_var(vect_dup((sc_aux->inegalites)->vecteur), var);
308 
309  /* add inequalities on the max */
310  cont = sc_aux->egalites;
311  while (sc_aux->egalites != NULL) {
312  cont = sc_aux->egalites;
313  sc_aux->egalites = (sc_aux->egalites)->succ;
314  cont->succ = NULL;
315  sc_add_inegalite(sc_aux, cont);
316  }
317  sc_aux = sc_append(sc_aux, ps);
318 
319  /* put the value of the min in the equality */
320  sc_add_egalite_at_end(sc_aux, contrainte_make(vectp));
321  sc_aux = my_clean_ps(sc_aux);
322 
323  /* search on the next t variable */
324  lsys_aux2 = build_list_of_min(lsys->succ, lnew->cdr, sc_aux);
325 
326  if (lsys_aux2 != NULL)
327  lsys_aux = add_sclist_to_sclist(lsys_aux, lsys_aux2);
328  else
329  lsys_aux = add_sc_to_sclist(sc_aux, lsys_aux);
330  }
331  else {
332  for (cont = sc_aux->inegalites; cont != NULL; cont = cont->succ) {
333  /* for each possible minimum build new system */
334  ps_aux2 = sc_dup(sc_aux);
335  vect = vect_dup(cont->vecteur);
336  val = vect_coeff(var, vect);
337  vectp = vect_del_var(vect_dup(cont->vecteur), var);
338 
339  /* include new value of the min in the system */
340  for (cont2 = ps_aux2->inegalites; cont2 != NULL; cont2 = cont2->succ) {
341  vect2 = cont2->vecteur;
342  val2 = vect_coeff(var, vect2);
343  vect2 = vect_del_var(vect2, var);
344  vect2 = vect_multiply(vect2, value_abs(val));
345  vect2 = vect_add(vect_multiply(vect_dup(vectp), val2), vect2);
346  cont2->vecteur = vect2;
347  }
348  /* put the inequality on the current minimum */
349  sc_add_inegalite(ps_aux2, contrainte_make(vect));
350 
351  /* add inequalities on the max */
352  cont2 = ps_aux2->egalites;
353  while (ps_aux2->egalites != NULL) {
354  cont2 = ps_aux2->egalites;
355  cont2->succ = NULL;
356  sc_add_inegalite(ps_aux2, cont2);
357  ps_aux2->egalites = (ps_aux2->egalites)->succ;
358  }
359 
360  ps_aux2 = sc_append(ps_aux2, sc_dup(ps));
361 
362  /* put the minimum value that is the l in "t = omega*to + l" */
363  /* in the equality part of the system. Problem if val != 1 */
364  sc_add_egalite_at_end(ps_aux2, contrainte_make(vectp));
365 
366  sc_normalize(ps_aux2);
367 
368  /* get the next dimension */
369  lsys_aux2 = build_list_of_min(lsys->succ, lnew->cdr, ps_aux2);
370 
371  if (lsys_aux2 != NULL)
372  lsys_aux = add_sclist_to_sclist(lsys_aux, lsys_aux2);
373  else
374  lsys_aux = add_sc_to_sclist(ps_aux2, lsys_aux);
375  }
376  }
377  }
378 
379  if (get_debug_level() > 5) {
380  fprintf(stderr, "\n Liste de systeme build part min : ");
381  sl_fprint(stderr, lsys, entity_local_name);
382  }
383 
384  return(lsys_aux);
385 }
386 
387 
388 /*========================================================================*/
389 /* list dataflows_on_reference(cls, crhs, pred, lm)
390  *
391  * Selects in the list of successors cls the one that correspond to the
392  * domain pred on which we are working and for the current rhs. The list
393  * lm will contain the corresponding list of statement of the choosen
394  * dataflow.
395  *
396  * AC 94/04/06 */
397 
398 list dataflows_on_reference(cls, crhs, pred, lm)
399 list cls, *lm;
400 reference crhs;
401 predicate pred;
402 {
403  Psysteme psd = sc_dup(predicate_to_system(pred)), sys_pred;
404  list ldata, ldat, lpred, ld;
405  int stat_pred;
406  vertex vert_pred;
407 
408  ldat = NIL;
409  *lm = NIL;
410  ldata = NIL; ld = NIL;
411 
412  if (get_debug_level() > 6) {
413  fprintf(stderr, "\nDataflow on reference %s debut:",
415  fprintf(stderr, "\nDomain noeud:");
416  fprint_psysteme(stderr, psd);
417  }
418 
419  for (lpred = cls; lpred != NIL; POP(lpred)) {
420  successor suc = SUCCESSOR(CAR(lpred));
421  vert_pred = successor_vertex(suc);
422  stat_pred = vertex_int_stmt(vert_pred);
423 
424  if (get_debug_level() > 6)
425  fprintf(stderr,"\nSuccesseur en cours : %d\n",stat_pred);
426 
428 
429  for (ld = ldata; ld != NIL; POP(ld)) {
430  dataflow d = DATAFLOW(CAR(ld));
432  if (get_debug_level() > 6) {
433  fprintf(stderr, "\nDomain arc:");
434  fprint_psysteme(stderr, sys_pred);
435  }
436  sys_pred = sc_append(sys_pred, psd);
437  sc_normalize(sys_pred);
438 
439  if (reference_equal_p(crhs, dataflow_reference(d))) {
440  if (SC_RN_P(sys_pred) ||
442  if (get_debug_level() > 6) {
443  fprintf(stderr, "\nDomain inter donc faisabilite:");
444  fprint_psysteme(stderr, sys_pred);
445  }
446  ADD_ELEMENT_TO_LIST(ldat, DATAFLOW, d);
447  ADD_ELEMENT_TO_LIST(*lm, INT, stat_pred);
448  }
449  }
450  }
451  }
452 
453  if (get_debug_level() > 6)
454  fprintf(stderr, "\nDataflow on ref fin\n");
455 
456  return(ldat);
457 }
458 
459 
460 /*=======================================================================*/
461 /* instruction build_local_time_test(t, l)
462  *
463  * Builds the insruction corresponding to:
464  * IF t_local > ub THEN t_local = -1 ENDIF
465  *
466  * t = entity of the local time;
467  * l = list of the ub (expression);
468  *
469  * AC 94/06/14 */
470 
472 entity t;
473 list l;
474 {
475  expression upper = EXPRESSION(CAR(l)), exp;
476  instruction ins;
477  call ca;
478  list lexp;
479  statement stat;
480 
481  /* build the expression t-local = -1 */
486  stat = MAKE_STATEMENT(ins);
487 
488  /* make the test expression */
493 
496 
497  return(ins);
498 }
499 
500 /*=======================================================================*/
501 /* expression build_global_time_test_with_exp(tg, exp)
502  *
503  * Builds the expression:
504  * tg == exp
505  *
506  * AC 94/06/15
507  */
508 
510 entity tg;
512 {
513  list lexp;
514  call ca;
515 
519 
522 }
523 
524 /*=======================================================================*/
525 /* instruction build_flag_assign(f, val) :
526  *
527  * build the instruction: flag = val.
528  *
529  * AC 94/06/14 */
530 
532 entity f;
533 bool val;
534 {
535  call ca;
536  list lexp;
537  expression e;
538 
539  if(val)
540  e = int_to_expression(1);
541  else
542  e = int_to_expression(0);
543 
547 
549 }
550 
551 
552 /*=======================================================================*/
553 /* instruction build_flag_test(f, t)
554  *
555  * Builds the instruction:
556  * IF flag == 1 THEN t = t + 1 ENDIF
557  *
558  * AC 94/06/14
559  */
560 
562  entity f, t;
563 {
564  call ca;
565  list lexp;
566  instruction ins;
567  statement stat;
568  expression exp;
569 
570  ins = make_increment_instruction(t, 1);
571  stat = MAKE_STATEMENT(ins);
572 
577 
579  make_test(exp, stat, make_empty_statement())));
580 }
581 
582 /*=======================================================================*/
583 /* instruction make_init_time(en, ex) : build the instruction: en = ex
584  *
585  * AC 94/06/15
586  */
587 
589  entity en;
590  expression ex;
591 {
592  call ca;
593  list lexp = NIL;
594 
598 
600 }
601 
602 
603 /*======================================================================*/
604 /* instruction make_increment_instruction(t, i): returns the instruction:
605  * t = t + i
606  *
607  * AC 94/06/09
608  */
609 
611  entity t;
612  int i;
613 {
614  call ca;
615  expression exp1;
616  list lexp;
617 
623 
627 
629 }
630 
631 
632 /*=======================================================================*/
633 /* int get_number_of_ins(e): gives back the number of the node.
634  *
635  * AC 94/07/28
636  */
637 
639 entity e;
640 {
641  int n = 0;
642  char *c;
643 
644  c = (char*) malloc(32);
645 
646  c = strcpy(c, (entity_local_name(e)+4));
647  n = atoi(c) + BASE_NODE_NUMBER;
648 
649  if (get_debug_level() > 5)
650  fprintf(stderr,"\nNumero de l'instruction de %s = %d",
651  entity_local_name(e), n);
652 
653  free(c);
654 
655  return(n);
656 }
657 
658 
659 /*=======================================================================*/
660 /* void reindexing((char*) mod_name):
661  *
662  */
663 
664 bool reindexing(mod_name)
665 char* mod_name;
666 {
667  extern int tc;
668 
669  graph the_dfg;
670  bdt the_bdt;
671  plc the_plc;
672  entity ent;
673  static_control stco;
674  statement mod_stat, new_mod_stat;
675  int nb_nodes;
676  list l;
678 
679  /* Initialize debugging functions */
680  debug_on("REINDEXING_DEBUG_LEVEL");
681  if (get_debug_level() > 0)
682  user_log("\n\n *** COMPUTE REINDEXING for %s\n", mod_name);
683 
684  /* We get the required data: module entity, code, static_control, */
685  /* dataflow graph. */
686  ent = local_name_to_top_level_entity( mod_name );
687 
688  if (ent != get_current_module_entity())
689  {
692  }
693 
694  /* mod_stat = copy_statement((statement) db_get_memory_resource(DBR_CODE, mod_name,
695  true));*/
696  mod_stat = (statement) db_get_memory_resource(DBR_CODE, mod_name, false);
697  STS = (statement_mapping)db_get_memory_resource(DBR_STATIC_CONTROL,
698  mod_name, false);
701 
703 
704  if (stco == static_control_undefined)
705  pips_internal_error("This is an undefined static control !");
706 
707  if (!static_control_yes(stco))
708  pips_internal_error("This is not a static control program !");
709 
710 
711  /* The DFG, the BDT and the PLC */
712  the_dfg = (graph)db_get_memory_resource(DBR_ADFG, mod_name, true);
713  the_bdt = (bdt)db_get_memory_resource(DBR_BDT, mod_name, true);
714  the_plc = (plc)db_get_memory_resource(DBR_PLC, mod_name, true);
715 
716  if (get_debug_level() > 0)
717  {
718  fprint_dfg(stderr, the_dfg);
719  fprint_bdt(stderr, the_bdt);
720  fprint_plc(stderr, the_plc);
721  }
722 
723  /* First we count the number of nodes to initialize the hash tables */
724  nb_nodes = 0;
725  for(l = graph_vertices(the_dfg); !ENDP(l); POP(l))
726  nb_nodes++;
730 
731  /* The temporary variables counter */
732  tc = 0;
733 
734  new_mod_stat = re_do_it(the_dfg, the_bdt, the_plc);
735 
736  /* Remove the old code: */
738  /* And replace it by the new one: */
740  new_mod_stat,
741  NIL));
742  DB_PUT_MEMORY_RESOURCE(DBR_REINDEXED_CODE, strdup(mod_name),
743  (char*) mod_stat);
746  db_get_memory_resource(DBR_CODE,
747  mod_name, true) );
749 
750  DB_PUT_MEMORY_RESOURCE(DBR_CODE, strdup(mod_name), (char*) mod_stat);
752 
753  /* print the values of the delay */
754  if (get_debug_level() > 0)
755  fprint_delay(stderr, the_dfg, delay_table);
756 
757  if(get_debug_level() > 0)
758  user_log("\n\n *** REINDEXING done\n");
759 
762 
765 
766  debug_off();
767 
768  return(true);
769 }
void user_log(const char *format,...)
Definition: message.c:234
call make_call(entity a1, list a2)
Definition: ri.c:269
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
test make_test(expression a1, statement a2, statement a3)
Definition: ri.c:2607
void free_instruction(instruction p)
Definition: ri.c:1118
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
string db_get_current_module_name(void)
Also used to check whether set...
Definition: database.c:1059
static int count
Definition: SDG.c:519
void fprint_dfg(FILE *fp, graph obj)
===========================================================================
static hash_table STS
The "STS" global variable is the hash table that maps the static_control on the statements.
Definition: adg_read_paf.c:155
#define VALUE_TO_INT(val)
int Value
#define value_product(v, w)
#define VALUE_ONE
#define value_abs(val)
#define value_div(v1, v2)
Value ppcm(Value, Value)
ppcm.c
Definition: ppcm.c:42
static list lexp
@ INT
Definition: atomic.c:48
Psysteme predicate_to_system(predicate p)
=================================================================
Definition: bdt_utils.c:298
statement re_do_it(graph the_dfg, bdt the_bdt, plc the_plc)
======================================================================
Definition: cell.c:3038
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
void * malloc(YYSIZE_T)
void free(void *)
#define successor_vertex(x)
Definition: graph.h:118
#define successor_arc_label(x)
Definition: graph.h:116
struct _newgen_struct_graph_ * graph
Definition: graph.h:31
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#define graph_vertices(x)
Definition: graph.h:82
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
#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
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
#define full_name(dir, name)
Definition: compile.c:414
void fprint_entity_list(FILE *fp, list l)
void fprint_entity_list(FILE *fp,list l): prints a list of entities on file fp.
Definition: entity.c:3188
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
Definition: icfg-local.h:50
static statement mod_stat
We want to keep track of the current statement inside the recurse.
Definition: impact_check.c:41
Psyslist add_sc_to_sclist(Psysteme sc, Psyslist lsys)
=================================================================
Definition: makebdt.c:1985
#define MATRIX_NB_LINES(matrix)
Definition: matrix-local.h:87
#define MATRIX_DENOMINATOR(matrix)
int MATRIX_DENONIMATOR(matrix): acces au denominateur global d'une matrice matrix
Definition: matrix-local.h:86
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrix-local.h:80
void matrix_general_inversion(Pmatrix a, Pmatrix inv_a)
void matrix_general_inversion(Pmatrix a; Pmatrix inv_a) calcul de l'inversion du matrice general.
Definition: inversion.c:216
void matrix_nulle(Pmatrix Z)
void matrix_nulle(Pmatrix Z): Initialisation de la matrice Z a la valeur matrice nulle
Definition: matrix.c:293
void matrix_identity(Pmatrix, int)
void matrix_identity(Pmatrix ID, int level) Construction d'une sous-matrice identity dans ID(level+1....
Definition: sub-matrix.c:322
#define debug_on(env)
Definition: misc-local.h:157
#define pips_internal_error
Definition: misc-local.h:149
#define debug_off()
Definition: misc-local.h:160
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
Definition: debug.c:67
#define MODULE_SEP_STRING
Definition: naming-local.h:30
hash_table statement_mapping
these macros are obsolete! newgen functions (->) should be used instead
Definition: newgen-local.h:42
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
@ hash_int
Definition: newgen_hash.h:32
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
#define BASE_NODE_NUMBER
int vertex_int_stmt(vertex)
===========================================================================
Definition: utils.c:866
void reset_current_stco_map(void)
========================================================================
Definition: utils.c:2423
static_control get_stco_from_current_map(statement)
========================================================================
Definition: utils.c:2429
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
Definition: print.c:302
void set_current_stco_map(statement_mapping)
========================================================================
Definition: utils.c:2408
void fprint_bdt(FILE *, bdt)
===========================================================================
Definition: print.c:352
#define DATAFLOW(x)
DATAFLOW.
Definition: paf_ri.h:308
struct _newgen_struct_bdt_ * bdt
Definition: paf_ri.h:72
#define dfg_arc_label_dataflows(x)
Definition: paf_ri.h:378
#define static_control_params(x)
Definition: paf_ri.h:755
#define static_control_yes(x)
Definition: paf_ri.h:753
#define static_control_undefined
Definition: paf_ri.h:727
#define dataflow_governing_pred(x)
Definition: paf_ri.h:344
struct _newgen_struct_plc_ * plc
Definition: paf_ri.h:144
#define dataflow_reference(x)
Definition: paf_ri.h:340
void fprint_plc(FILE *fp, plc obj)
========================================================================
Definition: print.c:85
graph the_dfg
The placement function.
Definition: prgm_mapping.c:99
int nb_nodes
The timing function.
Definition: prgm_mapping.c:101
bdt the_bdt
The data flow graph.
Definition: prgm_mapping.c:100
#define STAT_SYM
void fprint_delay(FILE *fp, graph g, hash_table t)
======================================================================
Definition: delay.c:221
int get_number_of_ins(entity e)
======================================================================
Definition: reindexing.c:638
static int tc
Internal variables
Definition: reindexing.c:107
dfg_arc_label arc_label
Definition: reindexing.c:115
bool reindexing(char *mod_name)
======================================================================
Definition: reindexing.c:664
hash_table h_node
Definition: reindexing.c:108
void build_contraction_matrices(int s, Psysteme ps, Pmatrix mH, int *c, Pmatrix *mQ, Pmatrix *mQ_inv, Pmatrix *mC, list *ln, list *lom, Pbase indx, Pbase cnst)
========================================================================
Definition: reindexing.c:197
hash_table ht_ab
Definition: reindexing.c:110
#define STRING_TAU
Definition: reindexing.c:99
instruction build_flag_test(entity f, entity t)
======================================================================
Definition: reindexing.c:561
Psyslist build_list_of_min(Psyslist lsys, list lnew, Psysteme ps)
=======================================================================
Definition: reindexing.c:276
dfg_vertex_label vertex_label
Local defines.
Definition: reindexing.c:114
instruction build_local_time_test(entity t, list l)
======================================================================
Definition: reindexing.c:471
list lparams
Array bounds.
Definition: reindexing.c:111
#define MAKE_STATEMENT(ins)
Definition: reindexing.c:102
list dataflows_on_reference(list cls, reference crhs, predicate pred, list *lm)
=======================================================================
Definition: reindexing.c:398
hash_table delay_table
Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic :
Definition: reindexing.c:109
expression build_global_time_test_with_exp(entity tg, expression exp)
======================================================================
Definition: reindexing.c:509
instruction make_init_time(entity en, expression ex)
======================================================================
Definition: reindexing.c:588
entity get_time_ent(int st, char *typ, int count)
==================================================================
Definition: reindexing.c:156
instruction make_increment_instruction(entity t, int i)
=====================================================================
Definition: reindexing.c:610
instruction build_flag_assign(entity f, bool val)
======================================================================
Definition: reindexing.c:531
#define STRING_BDT
Name : reindexing.c Package : reindexing Author : Alexis Platonoff & Antoine Cloue Date : april 1994 ...
Definition: reindexing.c:97
entity create_new_entity(int st, char *typ, int nb)
========================================================================
Psysteme my_clean_ps(Psysteme ps)
=======================================================================
Psyslist add_sclist_to_sclist(Psyslist l1, Psyslist l2)
=======================================================================
Psysteme matrix_to_system(Pmatrix A, Pbase b)
==================================================================
Psysteme sc_add_egalite_at_end(Psysteme ps, Pcontrainte co)
=======================================================================
void my_constraints_with_sym_cst_to_matrices(Pcontrainte pc, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=====================================================================
#define GREATER_THAN_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define EQUAL_OPERATOR_NAME
#define ASSIGN_OPERATOR_NAME
Definition: ri-util-local.h:95
#define make_empty_statement
An alias for make_empty_block_statement.
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 local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression make_entity_expression(entity e, cons *inds)
Definition: expression.c:176
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
bool reference_equal_p(reference r1, reference r2)
Definition: expression.c:1500
#define normalized_undefined
Definition: ri.h:1745
#define reference_variable(x)
Definition: ri.h:2326
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
@ is_syntax_call
Definition: ri.h:2693
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_undefined
Definition: ri.h:2761
@ is_instruction_test
Definition: ri.h:1470
@ is_instruction_call
Definition: ri.h:1474
#define statement_instruction(x)
Definition: ri.h:2458
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
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_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
void sl_fprint(in_fi, in_sl, char *(*in_fu)())
Definition: sc_list.c:447
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
Definition: scalaires.c:123
static char * x
Definition: split_file.c:159
package matrice
Definition: matrix-local.h:63
Pvecteur vecteur
struct Scontrainte * succ
Warning! Do not modify this file that is automatically generated!
Definition: union-local.h:3
Pcontrainte inegalites
Definition: sc-local.h:71
Pcontrainte egalites
Definition: sc-local.h:70
int nb_ineq
Definition: sc-local.h:73
int nb_eq
Definition: sc-local.h:72
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
struct cons * cdr
The pointer to the next element.
Definition: newgen_list.h:43
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207
#define NO_OFL_CTRL
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_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_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...
Definition: binaires.c:75
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