PIPS
utils.c
Go to the documentation of this file.
1 /*
2 
3  $Id: utils.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /* Name : utils.c
28  * Package : static_controlize.c
29  * Author : Arnauld LESERVOT
30  * Date : 27/04/93
31  * Modified :
32  * Documents: "Implementation du Data Flow Graph dans Pips"
33  * Comments :
34  */
35 
36 /* Ansi includes */
37 #include <stdlib.h>
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <string.h>
41 
42 /* Newgen includes */
43 #include "genC.h"
44 #include "boolean.h"
45 
46 /* C3 includes */
47 #include "boolean.h"
48 #include "arithmetique.h"
49 #include "vecteur.h"
50 #include "contrainte.h"
51 #include "ray_dte.h"
52 #include "sommet.h"
53 #include "sg.h"
54 #include "sc.h"
55 #include "polyedre.h"
56 #include "matrix.h"
57 
58 /* Pips includes */
59 #include "ri.h"
60 /* Types arc_label and vertex_label must be defined although they are
61  not used */
62 typedef void * arc_label;
63 typedef void * vertex_label;
64 #include "graph.h"
65 #include "paf_ri.h"
66 #include "database.h"
67 #include "parser_private.h"
68 #include "ri-util.h"
69 #include "workspace-util.h"
70 #include "prettyprint.h"
71 #include "constants.h"
72 #include "misc.h"
73 #include "text.h"
74 #include "text-util.h"
75 #include "paf-util.h"
76 #include "effects-generic.h"
77 #include "alias-classes.h"
78 #include "static_controlize.h"
79 
80 /* Global variables */
81 /* extern list Gscalar_written_forward; */
83 
84 
85 extern list assigned_var;
86 #define entity_assigned_by_array_p(ent) (gen_find_eq(ent, assigned_var) != chunk_undefined)
87 /*
88 extern list Genclosing_loops;
89 extern list Genclosing_tests;
90 extern hash_table Gforward_substitute_table; */
91 
92 
93 /*=======================================================================*/
94 /* list stco_same_loops( in_map, in_s, in_s2 ) AL 25/10/93
95  * Input : A static_control mapping on statements and 2 statements.
96  * Output : A list of loops common to in_s and in_s2.
97  */
98 list stco_same_loops( in_map, in_s, in_s2 )
99 statement_mapping in_map;
100 statement in_s, in_s2;
101 {
102  list l, l2, ret_l = NIL;
103  static_control sc, sc2;
104 
105  pips_debug(7,"begin\n");
106  sc = (static_control) GET_STATEMENT_MAPPING( in_map, in_s );
107  sc2= (static_control) GET_STATEMENT_MAPPING( in_map, in_s2 );
108  l = static_control_loops( sc );
109  l2 = static_control_loops( sc2 );
110  for(; !ENDP(l); POP(l)) {
111  list l3 = l2;
112  loop lo = LOOP(CAR( l ));
113  int in = statement_ordering(loop_body( lo ));
114  for(; !ENDP(l3); POP(l3) ) {
115  loop ll = LOOP(CAR( l3 ));
116  int in2 = statement_ordering(loop_body( ll ));
117  if( in == in2 ) ADD_ELEMENT_TO_LIST(ret_l, LOOP, ll);
118  }
119  }
120  pips_debug(7, "end \n");
121 
122  return( ret_l );
123 }
124 
125 /*=================================================================*/
126 /* int stco_renumber_code( (statement) in_st, (int) in_ct ) AL 25/10/93
127  * Input : A statement in_st and a begin count number in_ct.
128  * Output : Renumber statement_number in an textual order and return
129  * the last number attributed.
130 
131  * I've removed many renumbering since it is done by a deeper call to
132  * stco_renumber_code() and renumbering sequences kill an assert in
133  * the prettyprinter...
134 
135  */
136 int
138  int in_ct)
139 {
140  int count;
141  instruction inst;
142 
143  pips_debug(7, "begin\n");
144  count = in_ct;
145  inst = statement_instruction( in_st );
146 
147  /* Renumber all the statement but the sequence: */
149  statement_number(in_st) = count++;
150 
151  switch(instruction_tag(inst)) {
152  case is_instruction_block : {
153  MAPL( stmt_ptr, {
154  statement st = STATEMENT(CAR( stmt_ptr ));
155  /*
156  statement_number( st ) = count++;
157  */
158  count = stco_renumber_code( st, count );
159  }, instruction_block( inst ) );
160  break;
161  }
162  case is_instruction_test : {
163  test t = instruction_test(inst);
164  statement tt, tf;
165 
166  tt = test_true( t );
167  tf = test_false( t );
168  /*
169  statement_number( tt ) = count++;
170  statement_number( tf ) = count++;
171  */
172  count = stco_renumber_code( tt, count );
173  count = stco_renumber_code( tf, count );
174  break;
175  }
176  case is_instruction_loop : {
177  statement lb = loop_body( instruction_loop( inst ) );
178  /*
179  statement_number( lb ) = count++;
180  */
181  count = stco_renumber_code( lb, count );
182  break;
183  }
185  {
186  break;
187  }
189  {
190  break;
191  }
192  case is_instruction_call : {
193  break;
194  }
195  case is_instruction_goto : {
196  statement gs = instruction_goto( inst );
197  /*
198  statement_number( gs ) = count++;
199  */
200  count = stco_renumber_code( gs, count );
201  break;
202  }
204  {
205  break;
206  }
208  list blocs = NIL;
210 
212  blocs = gen_nreverse( blocs ) ;
213  MAPL( ctl_ptr, {
215  CONTROL(CAR( ctl_ptr )));
216  /*
217  statement_number( stmt ) = count++;
218  */
220  }, blocs);
221  gen_free_list(blocs);
222  break;
223  }
224  default : pips_internal_error("Ill. instruction tag");
225  }
226 
227  pips_debug(7, "return count : %d\n", count);
228  return( count );
229 }
230 
231 /*=================================================================*/
232 /* expression sc_opposite_exp_of_conjunction(expression exp, (list) *ell)
233  * AL 08/19/93 Input : exp a conjunction of linear expressions Output :
234  * simplified value of NOT( exp )
235  */
238 list *ell;
239 {
240  expression ret_exp;
241 
242  pips_debug(9, "begin\n");
243  if ( (exp == expression_undefined) ||
245  ret_exp = expression_undefined;
246  }
247  else if (splc_positive_relation_p(exp, ell)) {
248  expression exp1, exp2;
249  exp1 = EXPRESSION(CAR( call_arguments(
251  exp2 = MakeBinaryCall( ENTITY_GE,
253  int_to_expression(-1), exp1 ),
254  int_to_expression(0) );
255  ret_exp = exp2;
256  }
257  else if(ENTITY_AND_P(call_function(
259  list args = NIL;
260  expression r_exp, l_exp;
261 
263  l_exp = EXPRESSION(CAR( args ));
264  r_exp = EXPRESSION(CAR(CDR( args )));
265  ret_exp = MakeBinaryCall( ENTITY_OR,
266  sc_opposite_exp_of_conjunction(l_exp, ell),
267  sc_opposite_exp_of_conjunction(r_exp, ell));
268 
269  }
270  else ret_exp = expression_undefined;
271 
272  pips_debug(9, "end\n");
273  return( ret_exp );
274 }
275 
276 
277 /*=================================================================*/
278 /* bool splc_positive_relation_p((expression) exp, list *ell) AL 04/93
279  * Returns true if exp is an affine form of structural parameters and of
280  * loop-counters.
281  */
284 list *ell;
285 {
287  call c;
288  list args;
289 
290  pips_debug(7, "exp : %s\n",
292  if (syntax_tag(s) != is_syntax_call) return( false );
293  c = syntax_call( s );
294  if (!ENTITY_GREATER_OR_EQUAL_P(call_function( c ))) return( false );
295  args = call_arguments( c );
296  return(splc_linear_expression_p(EXPRESSION(CAR(args)), ell) &&
298 }
299 
300 /*=================================================================*/
301 /* list ndf_normalized_test( (expression) exp, (list) *ell) AL 04/93
302  * Returns a list of positive linear forms from an input expression which
303  * is a logical combinaison of affine forms of structural parameters and
304  * of loop counters.
305  */
307 {
308  list args, ret_list = NIL;
309  entity fun;
310  expression arg1, arg2, exp2, exp3;
311 
312  pips_debug(7, "doing\n");
313  if ( (exp == expression_undefined) ||
315  return NIL;
316  }
317  pips_debug(7, "input exp : %s\n",
319 
322  if(ENDP(args)) return NIL;
323 
324  if (splc_positive_relation_p(exp, ell)) {
325  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp );
326  return( ret_list );
327  }
328  if (ENTITY_NOT_P( fun )) {
329  arg1 = EXPRESSION(CAR(args));
330  if (splc_positive_relation_p(arg1, ell)) {
331  exp3 = EXPRESSION(CAR( call_arguments(
332  syntax_call(expression_syntax( arg1 )))));
333  exp2 = MakeBinaryCall( ENTITY_GE,
335  int_to_expression(-1),
336  exp3 ),
337  int_to_expression(0) );
338  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp2 );
339  return( ret_list );
340  }
341  else {
343 
344  MAPL( exp_ptr, {
345  exp3 = EXPRESSION(CAR( exp_ptr ));
346  if (exp2 == expression_undefined)
347  exp2 = sc_opposite_exp_of_conjunction(exp3, ell);
348  else
349  exp2 = MakeBinaryCall(ENTITY_AND,
351  copy_expression( exp2 ) );
352  }, ndf_normalized_test(arg1, ell));
353  ret_list = ndf_normalized_test(exp2, ell);
354  return( ret_list );
355  }
356  }
357 
358  arg1 = EXPRESSION(CAR(args));
359  arg2 = EXPRESSION(CAR(CDR(args)));
360 
361  /* Redon FND propagation : see document. */
362  if (ENTITY_OR_P( fun )) {
363  expression exp3;
364 
365  MAPL( exp_ptr, {
366  exp3 = EXPRESSION(CAR( exp_ptr ));
367  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp3 );
368  }, ndf_normalized_test(arg1, ell));
369  MAPL( exp_ptr, {
370  exp3 = EXPRESSION(CAR( exp_ptr ));
371  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp3 );
372  }, ndf_normalized_test(arg2, ell));
373  return( ret_list );
374  }
375 
376  /*
377  %%%%%%%%%%%%%
378  */
379 
380  /* We propagate an Exclusive Normal Disjunctive Form */
381  /* if (ENTITY_OR_P( fun )) {
382  * list not_l1, not_l2, l1, l2;
383  *
384  *l1 = ndf_normalized_test(arg1, ell);
385  *l2 = ndf_normalized_test( arg2, ell);
386  *not_l1 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg1), ell );
387  *not_l2 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg2), ell );
388  *
389  * MAPL( exp_ptr, {
390  * expression S1 = EXPRESSION(CAR( exp_ptr ));
391  *MAPL( exp_ptr2, {
392  *expression T1 = EXPRESSION(CAR( exp_ptr ));
393  *ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
394  *MakeBinaryCall( ENTITY_AND, S1, T1 ) );
395  *}, l2);
396  *}, not_l1 );
397  *
398  *MAPL( exp_ptr, {
399  *expression S1 = EXPRESSION(CAR( exp_ptr ));
400  * MAPL( exp_ptr2, {
401  * expression T1 = EXPRESSION(CAR( exp_ptr ));
402  * ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
403  * MakeBinaryCall( ENTITY_AND, S1, T1 ) );
404  * }, l2);
405  * }, l1 );
406  *
407  * MAPL( exp_ptr, {
408  * expression S1 = EXPRESSION(CAR( exp_ptr ));
409  * MAPL( exp_ptr2, {
410  * expression T1 = EXPRESSION(CAR( exp_ptr ));
411  * ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
412  * MakeBinaryCall( ENTITY_AND, S1, T1 ) );
413  * }, not_l2);
414  * }, l1 );
415  *
416  * return( ret_list );
417  *}
418  */
419  else if (ENTITY_AND_P( fun )) {
420  expression exp4, exp5, exp6;
421  list l1, l2;
422 
423  l1 = ndf_normalized_test(arg1, ell);
424  l2 = ndf_normalized_test(arg2, ell);
425  MAPL( exp_ptr, {
426  exp4 = EXPRESSION(CAR( exp_ptr ));
427  MAPL( ep, {
428  exp5 = EXPRESSION(CAR( ep ));
429  exp6 = MakeBinaryCall( ENTITY_AND,
430  exp4, exp5 );
431  ADD_ELEMENT_TO_LIST(ret_list, EXPRESSION, exp6);
432  }, l2 );
433  }, l1 );
434  return( ret_list );
435  }
436  else return NIL;
437 }
438 
439 
440 /*=================================================================*/
441 /* expression normalize_test_leaves((expression) exp, (list) *ell) AL 04/93
442  * If exp is linear in structurals and loop-counters, it returns the same
443  * expression with linear positive forms
444  */
447 list *ell;
448 {
450  entity fun = call_function(syntax_call( s ));
451  list args = call_arguments(syntax_call( s ));
452  list new_args = NIL;
454  expression e, ne, arg1, arg2, arg3, arg4;
455 
456  if (exp == expression_undefined || args == NIL) return( exp );
457  pips_debug(7, "exp : %s\n",
459  if (syntax_tag( s ) != is_syntax_call) return( ret_exp );
460 
461  if (ENTITY_NOT_P( fun )) {
462  expression exp1 =
463  normalize_test_leaves(EXPRESSION(CAR(args)), ell);
464 
465  /* We return expression_undefined if we can not normalize */
466  if (exp1 == expression_undefined) return(expression_undefined);
467 
468  ret_exp = MakeUnaryCall(ENTITY_NOT, exp1 );
469  pips_debug(7, "returning : %s\n",
470  expression_to_string( ret_exp ) );
471  return( ret_exp );
472  }
473 
474  arg1 = EXPRESSION(CAR(args));
475  arg2 = EXPRESSION(CAR(CDR(args)));
476  arg3 = copy_expression( arg1 );
477  arg4 = copy_expression( arg2 );
478  if (ENTITY_EQUIV_P( fun )) {
479  ret_exp1 = MakeBinaryCall( ENTITY_OR,
480  MakeUnaryCall( ENTITY_NOT, arg1),
481  arg2 );
482  ret_exp2 = MakeBinaryCall( ENTITY_OR,
483  MakeUnaryCall( ENTITY_NOT, arg4),
484  arg3 ) ;
485  exp = MakeBinaryCall( ENTITY_AND, ret_exp1, ret_exp2 );
486  }
487  else if (ENTITY_NON_EQUIV_P( fun )) {
489  MakeUnaryCall( ENTITY_NOT, arg2),
490  arg1 );
492  MakeUnaryCall( ENTITY_NOT, arg3),
493  arg4 ) ;
494  exp = MakeBinaryCall( ENTITY_OR, ret_exp1, ret_exp2);
495  }
496 
497  s = expression_syntax( exp );
498  fun = call_function(syntax_call( s ));
499  args = call_arguments(syntax_call( s ));
500  arg1 = EXPRESSION(CAR(args));
501  arg2 = EXPRESSION(CAR(CDR(args)));
502  arg3 = copy_expression( arg1 );
503  arg4 = copy_expression( arg2 );
505  MAPL( exp_ptr, {
506  e = EXPRESSION(CAR( exp_ptr ));
507  ne = normalize_test_leaves(e, ell);
508  if (ne == expression_undefined) return(ne);
510  copy_expression( ne ));
511  }, args);
512  call_arguments(syntax_call( s )) = new_args;
513  ret_exp = copy_expression( exp );
514  pips_debug(7, "returning : %s\n",
515  expression_to_string( ret_exp ) );
516  return( ret_exp );
517  }
518  else if ( ENTITY_RELATIONAL_OPERATOR_P( fun ) &&
519  (!splc_linear_expression_p(arg1, ell) ||
520  !splc_linear_expression_p(arg2, ell)) ) {
521 
522  pips_debug(7, "returning : %s\n",
523  "expression_undefined" );
524  return( expression_undefined );
525  }
526  if (ENTITY_LESS_THAN_P( fun )) {
527  ret_exp = MakeBinaryCall( ENTITY_GE,
529  make_op_exp(
531  arg2, arg1 ),
532  int_to_expression(1) ),
533  int_to_expression(0) );
534  }
535  else if (ENTITY_LESS_OR_EQUAL_P( fun )) {
536  ret_exp = MakeBinaryCall( ENTITY_GE,
538  arg2, arg1 ),
539  int_to_expression(0) );
540  }
541  else if (ENTITY_GREATER_THAN_P( fun )) {
542  ret_exp = MakeBinaryCall( ENTITY_GE,
544  make_op_exp(
546  arg1, arg2 ),
547  int_to_expression(1) ),
548  int_to_expression(0) );
549  }
550  else if (ENTITY_GREATER_OR_EQUAL_P( fun )) {
551  ret_exp = MakeBinaryCall( (entity) ENTITY_GE,
553  arg1, arg2 ),
554  int_to_expression(0) );
555  }
556  else if (ENTITY_EQUAL_P( fun )) {
557  ret_exp1 = MakeBinaryCall( ENTITY_GE,
559  arg1, arg2 ),
560  int_to_expression(0) );
561  ret_exp2 = MakeBinaryCall( ENTITY_GE,
563  arg4, arg3 ),
564  int_to_expression(0) ) ;
565  ret_exp = MakeBinaryCall( ENTITY_AND, ret_exp1, ret_exp2);
566  }
567  else if (ENTITY_NON_EQUAL_P( fun )) {
568  ret_exp1 = MakeBinaryCall( ENTITY_GE,
571  arg1, arg2 ),
572  int_to_expression(1) ),
573  int_to_expression(0) );
574  ret_exp2 = MakeBinaryCall( ENTITY_GE,
577  arg4, arg3 ),
578  int_to_expression(1) ),
579  int_to_expression(0) );
580  ret_exp = MakeBinaryCall( ENTITY_OR, ret_exp1, ret_exp2);
581  }
582  else ret_exp = expression_undefined;
583 
584  pips_debug(7, "returning : %s\n",
585  ((ret_exp == expression_undefined)?"expression_undefined":\
586  expression_to_string( ret_exp )) );
587  return( ret_exp );
588 }
589 
590 
591 /*=================================================================*/
592 /* expression sc_conditional( (expression) exp, (list) *ell ) AL 04/93 If
593  * exp is linear in structurals and loop-counters, it returns the same
594  * expression with a normal disjunctive form.
595  */
597 {
598  expression e, ret_exp = expression_undefined;
600  list ndf_list;
601 
602  pips_debug(7, "exp : %s\n",
604 
605  if ( syntax_tag(s) != is_syntax_call ) return( ret_exp );
606  e = normalize_test_leaves(exp, ell);
607  ndf_list = ndf_normalized_test(e, ell);
608  if (ndf_list != NIL) {
609  ret_exp = EXPRESSION(CAR( ndf_list ));
610  ndf_list = CDR( ndf_list );
611  MAPL( exp_ptr,{
612  e = EXPRESSION(CAR( exp_ptr ));
613  ret_exp = MakeBinaryCall( ENTITY_OR,
614  copy_expression( ret_exp ), e );
615  }, ndf_list );
616  }
617 
618  pips_debug(7, "returning : %s\n",
619  ((ret_exp == expression_undefined)?"expression_undefined":
620  expression_to_string( ret_exp )) );
621  return( ret_exp );
622 }
623 
624 
625 
626 /*=================================================================*/
627 /* list loops_to_indices((loop) l ) AL 04/93
628  * Returns indices of the loop -list l.
629  */
631 {
632  list rl = NIL;
633  loop lo;
634 
635  pips_debug(7, "doing\n");
636  if (l == NIL) return(NIL);
637  MAPL( loop_ptr, {
638  lo = LOOP(CAR( loop_ptr ));
639  ADD_ELEMENT_TO_LIST( rl, ENTITY, loop_index( lo ) );
640  }, l);
641  return rl;
642 }
643 
644 /*=================================================================*/
645 /* bool splc_linear_expression_p((expression) exp) AL 04/93
646  * Returns true if exp is linear in structural parameters and loop counters.
647  */
649 {
650  Pvecteur vect;
651  bool ONLY_SPLC;
652 
653  pips_debug(7, "exp : %s\n", expression_to_string(exp));
654 
656  ONLY_SPLC = false;
657  else
658  {
660  ONLY_SPLC = true;
661 
662  for(; !VECTEUR_NUL_P(vect) && ONLY_SPLC ; vect = vect->succ)
663  {
664  entity var = (entity) vect->var;
665  bool assigned_by_array = entity_assigned_by_array_p(var);
666  if( ! term_cst(vect) )
667  if(!(ENTITY_SP_P(var) || (gen_find_eq(var,loops_to_indices(*ell)) != chunk_undefined)) || assigned_by_array == true)
668  ONLY_SPLC = false;
669  }
670  }
672  pips_debug(7, " result : %s\n", (ONLY_SPLC?"TRUE":"FALSE") );
673  return(ONLY_SPLC);
674 }
675 
676 
677 /*=================================================================*/
678 /* bool splc_linear_expression_list_p((list) l) AL 04/93
679  * Returns true if all expressions exp are structural parameters
680  * and loop counters linear functions.
681  */
683 {
684  bool bo = true;
685  expression exp;
686 
687  pips_debug( 7, "doing \n");
688  MAPL( exp_ptr, {
689  exp = EXPRESSION(CAR( exp_ptr ));
690  bo = bo && splc_linear_expression_p(exp, ell);
691  }, l );
692  return( bo );
693 }
694 
695 /*=================================================================*/
696 /* bool splc_linear_access_to_arrays_p((list) l, (list) *ell) AL 04/93
697  * Returns true if all expressions exp are structural parameters and loop
698  * counters linear functions.
699  */
701 {
702  bool bo, ret_bo = true;
703  expression exp;
704  syntax s;
705  tag t;
706 
707  pips_debug(7, "doing\n");
708  if (l == NIL) return(true);
709  MAPL( exp_ptr, {
710  exp = EXPRESSION(CAR( exp_ptr ));
711  s = expression_syntax( exp );
712  t = syntax_tag( s );
713  if (t == is_syntax_call)
714  bo =
716  ell);
717  else if (t == is_syntax_reference)
718  bo =
720  ell);
721  else bo = false;
722  ret_bo = ret_bo && bo;
723  }, l );
724 
725  return( ret_bo );
726 }
727 
728 /*=================================================================*/
729 /* char* print_structurals( (list) l ) AL 04/93
730  * Prints structural parameters.
731  */
733 {
734  return(strdup( words_to_string(words_entity_list( l )) ));
735 }
736 
737 /*=================================================================*/
738 /* list sc_list_of_exp_dup( (list) l ) AL 04/93
739  * Duplicates a list of expressions.
740  */
742 {
743  list ret_list = NIL;
744 
745  pips_debug(9, "begin\n");
746  for(; !ENDP( l ); POP( l ) ) {
747  expression exp;
748 
749  exp = EXPRESSION(CAR( l ));
751  }
752 
753  pips_debug(9, "end\n");
754  return( ret_list );
755 }
756 
757 /*=================================================================*/
758 /* list sc_list_of_entity_dup( (list) l ) AL 04/93
759  * Duplicates a list of entities.
760  */
762 {
763  list rl = NIL;
764 
765  pips_debug( 7, "doing\n");
766  if ( l == NIL ) return( NIL );
767  MAPL( ent_ptr, {
768  entity ent = ENTITY(CAR( ent_ptr ));
769  ADD_ELEMENT_TO_LIST( rl, ENTITY, ent );
770  }, l );
771  return( rl );
772 }
773 
774 /*=================================================================*/
775 /* list sc_list_of_loop_dup( (list) l ) AL 04/93
776  * Duplicates a list of loops. See Newgen gen_copy_seq()?
777  */
779 {
780  list rl = NIL;
781 
782  pips_debug( 7, "doing\n");
783  if ( l == NIL ) return(NIL);
784  MAPL( loop_ptr, {
785  loop lo = LOOP(CAR( loop_ptr ));
786  ADD_ELEMENT_TO_LIST( rl, LOOP, lo );
787  }, l );
788  return( rl );
789 }
790 
791 /*=================================================================*/
792 /* list sc_loop_dup( (list) l ) AL 04/93
793  * Duplicates a loop with sharing of the loop_body and sharing of the
794  * loop locals.
795  */
797 {
798  loop new_loop;
799 
800  pips_debug( 7, "doing\n");
801  new_loop = make_loop(loop_index(l), copy_range(loop_range(l)),
803  loop_locals(l));
804 
805  return(new_loop);
806 }
807 
808 /*=================================================================*/
809 /* list make_undefined_list( ) AL 04/93
810  * Duplicates a list of 2 undefined statements.
811  *
812  * FI: this is no longer possible. List elements must be
813  * defined. Maybe empty/nop statements could be used instead?
814  */
816 {
817  list the_list = NIL;
818 
819  pips_debug(7, "doing\n");
820  /*
821  ADD_ELEMENT_TO_LIST( the_list, STATEMENT, statement_undefined);
822  ADD_ELEMENT_TO_LIST( the_list, STATEMENT, statement_undefined);
823  */
824  ADD_ELEMENT_TO_LIST( the_list, STATEMENT,
826  ADD_ELEMENT_TO_LIST( the_list, STATEMENT,
828  return the_list;
829 }
830 
831 
832 /*=================================================================*/
833 /* int in_forward_defined( (entity) ent ) AL 30/08/93
834  * Returns the number of entities ent in the list Gscalar_written_forward.
835  */
837 {
838  cons *pc;
839  int ret_int = 0;
840 
841  pips_debug(9, "doing \n");
842  for (pc = *swfl; pc != NIL; pc = pc->cdr ) {
843  if ((void *) ent == CAR(pc).p)
844  ret_int++;
845  }
846 
847  pips_debug(9, "returns : %d\n", ret_int);
848  return( ret_int );
849 }
850 
851 /*=================================================================*/
852 /* bool in_forward_defined_p( (entity) ent ) AL 04/93
853  * Returns true if ent is in global variable Gscalar_written_forward.
854  */
856 {
857  entity ch;
858 
859  pips_debug(7, "doing \n");
860  ch = (entity) gen_find_eq(ent, *swfl );
861  pips_debug(9, "scalar written_forward = %s\n",
862  print_structurals(*swfl) );
863  return( ch != entity_undefined );
864 }
865 
866 /*=================================================================*/
867 /* void verify_structural_parameters( (list) l ) AL 04/93
868  * Updates the global variable Gstructure_parameters.
869  * 'l' is a list of entities, which are structural-parameters candidates.
870  * An entity will be a structural parameter if it is a candidate and if it
871  * is not written forward.
872  */
874 {
875  pips_debug(7,"doing\n");
876  MAPL( el_ptr,
877  {
878  entity ent = ENTITY(CAR( el_ptr ));
879  if ( gen_find_eq( ent, *swfl )
880  == chunk_undefined )
882  ENTITY,
883  ent );
884  },
885  the_list);
886  pips_debug(7, "list of structurals : %s\n",
888 }
889 
890 /*=================================================================*/
891 /* list sc_entity_to_formal_integer_parameters((entity) f)
892  * This is a strict copy of entity_to_formal_integer_parameters
893  * from semantics/interprocedural.c . This function is copied
894  * here to keep locality of local functions to each pass.
895  *
896  * FI: Well, but it was modified to handle all integer scalar variables
897  * and a bug was added because a COMMON has a RAM storage (OK, this could
898  * be discussed). I add a test on type_variable_p()
899  */
901 entity f;
902 {
903  list formals_or_ram_integer = NIL;
904  list decl = NIL;
905 
906  pips_assert("sc_entity_to_formal_integer_parameters",entity_module_p(f));
907 
909  MAPL(ce, {entity e = ENTITY(CAR(ce));
910  storage sto = entity_storage(e);
911  type t = entity_type(e);
912 
913  if( type_variable_p(t)
914  && (storage_formal_p(sto) || storage_ram_p(sto))
916  formals_or_ram_integer = CONS(ENTITY, e,
917  formals_or_ram_integer);},
918  decl);
919 
920  return formals_or_ram_integer;
921 }
922 
923 /*=================================================================*/
924 /* bool sp_linear_expression_p( (expression) exp)
925  * Returns true if the expression is a linear combinaison of
926  * structural parameters.
927  */
929 {
930  Pvecteur vect;
931  bool ONLY_SP;
932 
933  pips_debug(7, "exp : %s\n", expression_to_string(exp));
934 
936  ONLY_SP = false;
937  else
938  {
940  ONLY_SP = true;
941 
942  for(; !VECTEUR_NUL_P(vect) && ONLY_SP ; vect = vect->succ)
943  {
944  entity var = (entity) vect->var;
945 
946  if( ! term_cst(vect) )
947  if( ! (ENTITY_SP_P(var)) )
948  ONLY_SP = false;
949  }
950  }
952  pips_debug(7,
953  " result : %s\n", (ONLY_SP?"TRUE":"FALSE") );
954  return(ONLY_SP);
955 }
956 
957 /*=================================================================*/
958 /* bool splc_feautrier_expression_p( (expression) exp )
959  * Returns true if exp quasi affine form in structural parameters
960  * and in surrounding loop-counters.
961  */
963 {
964  bool b = false;
966 
967  pips_debug(7, "exp : %s \n",
968  ((exp == expression_undefined)?"expression_undefined":
970 
971  if (splc_linear_expression_p(exp, ell)) return( true );
972  if ( syntax_tag( s ) == is_syntax_call ) {
973  call c;
974  list args;
975  expression exp1, exp2;
976 
977  c = syntax_call( s );
978  if (ENTITY_DIVIDE_P(call_function( c ))) {
979  args = call_arguments( c );
980  exp1 = EXPRESSION(CAR( args ));
981  exp2 = EXPRESSION(CAR( CDR(args) ));
982  b = splc_feautrier_expression_p(exp1, ell)
983  && expression_constant_p( exp2 );
984  }
985  }
986  pips_debug(7, "returning : %s\n",
987  (b?"TRUE":"FALSE") );
988  return( b );
989 }
990 
991 /*=================================================================*/
992 /* bool sp_feautrier_expression_p( (expression) exp)
993  * Returns true if exp quasi affine form.
994  */
996 {
997  bool b = false;
999 
1000  pips_debug(7, "exp : %s \n",
1001  ((exp == expression_undefined)?"expression_undefined":
1002  expression_to_string( exp ) ));
1003 
1004  if (sp_linear_expression_p( exp )) return( true );
1005  if ( syntax_tag( s ) == is_syntax_call ) {
1006  call c;
1007  list args;
1008  expression exp1, exp2;
1009 
1010  c = syntax_call( s );
1011  if (ENTITY_DIVIDE_P(call_function( c ))) {
1012  args = call_arguments( c );
1013  exp1 = EXPRESSION(CAR( args ));
1014  exp2 = EXPRESSION(CAR( CDR(args) ));
1015  b = sp_feautrier_expression_p( exp1 )
1016  && expression_constant_p( exp2 );
1017  }
1018  }
1019  pips_debug(7, "returning : %s\n",
1020  (b?"TRUE":"FALSE") );
1021  return( b );
1022 }
1023 
1024 /*=================================================================*/
1025 /* entity sp_feautrier_scalar_assign_call( (call) c )
1026  * Returns the left-hand-side entity if it is an assignement of
1027  * a linear combinaison of structural parameters.
1028  */
1030 {
1031  entity ent, ret_ent = entity_undefined;
1032  expression rhs;
1033 
1034  pips_debug(7, "doing\n");
1035  if ((ent = scalar_assign_call(c)) != entity_undefined) {
1036  rhs = EXPRESSION(CAR(CDR(call_arguments(c))));
1037  if (sp_feautrier_expression_p( rhs )) ret_ent = ent;
1038  }
1039  pips_debug(7,
1040  "returning : %s \n",
1041  ((ret_ent == entity_undefined)?"entity_undefined":
1042  entity_name( ret_ent )) );
1043  return( ret_ent );
1044 }
1045 
1046 
1047 /*=================================================================*/
1048 /* bool get_sp_of_call_p( (call) c, fst) AL 04/93 Updates the global
1049  * variables Gstructure_parameters and Gforward_substitute_table according
1050  * to the type of call. Returns true if the call has to be modified
1051  * (redefinition of a structural parameter), false in all the other cases.
1052  *
1053  * AP, sep 95 : Gforward_substitute_table is no longer a global variable,
1054  * we pass it as an argument.
1055  */
1056 bool get_sp_of_call_p( c, fst, swfl)
1057 call c;
1058 hash_table fst; /* forward substitute table */
1059 list *swfl;
1060 {
1061  entity lhs_ent, ent;
1062  bool ret_bool = false;
1063 
1064  pips_debug(7, "begin\n");
1065  /*FI: not too sure about the false parameter... */
1066  pips_debug(9, "input call : %s \n",
1067  words_to_string(Words_Regular_Call(c, false )));
1068  pips_debug(9, "struct param. before : %s \n",
1070 
1071  if (ENTITY_READ_P( call_function(c) )) {
1072  list the_arg = call_arguments( c );
1073 
1074  MAPL( exp_ptr,
1075  {
1076  expression exp = EXPRESSION(CAR( exp_ptr ));
1078  if ((ent != entity_undefined) && !in_forward_defined_p(ent, swfl))
1080  },
1081  the_arg);
1082  }
1083 
1084  if ( ((lhs_ent = sp_feautrier_scalar_assign_call(c)) != entity_undefined)
1085  && (in_forward_defined(lhs_ent, swfl) <= 1) ) {
1086 
1087  expression nsp_exp;
1088  entity nsp_ent;
1089 
1090  if ( !ENTITY_SP_P( lhs_ent ) ) {
1092  }
1093  else {
1094  nsp_ent = make_nsp_entity();
1095  nsp_exp = make_entity_expression( nsp_ent, NIL );
1096  hash_put(fst, (char*) lhs_ent, (char*) nsp_exp );
1098  ret_bool = true;
1099  }
1100  }
1101 
1102  pips_debug(9, "struct param. after : %s \n",
1104  pips_debug(9, "call has to be modified : %s \n",
1105  ((ret_bool == true)?"TRUE":"FALSE") );
1106  pips_debug(7, "end\n");
1107  return( ret_bool );
1108 }
1109 
1110 ␌
1111 /* rewriting of forward_substitute_in_exp, in_loop,...
1112  *
1113  * FI: what was the initial semantics? Substitute the left hand sides
1114  * only?
1115  *
1116  * see transformations/induction_substitution.c
1117  *
1118  * It's a simple case because the loop indices cannot be written
1119  * within the loop bounds
1120 */
1121 
1123 {
1124  syntax s = expression_syntax(e);
1125  if(syntax_reference_p(s)) {
1127  expression ne = hash_get(fst, (void *) v);
1128 
1129  if(!expression_undefined_p(ne)) {
1130  /* FI: let's take care of memory leaks later...
1131  *
1132  * The hash_table could contain syntax objects...
1133  */
1135  }
1136  }
1137 }
1138 
1140 {
1141  /* Would it be better to loop over with HASH_MAP or to check every
1142  reference? */
1145  NULL);
1146 }
1147 
1149 {
1150  /* Would it be better to loop over with HASH_MAP or to check every
1151  reference? */
1152  gen_context_multi_recurse(*pe, fst,
1154  NULL);
1155 }
1156 
1158 {
1159  pips_assert("call c is consistent_p\n", call_consistent_p(*pc));
1160 
1161  /* Would it be better to loop over with HASH_MAP or to check every
1162  reference? */
1163  gen_context_multi_recurse(*pc, fst,
1165  NULL);
1166 }
1167 ␌
1168 
1169 /* bool normalizable_loop_p(loop l)
1170  * Returns true if "l" has a constant step.
1171  */
1173 {
1174  pips_debug(7, "doing\n");
1176 }
1177 
1178 ␌
1179 /* Code retrieved from revision 14476,
1180  transformations/loop_normalize.c */
1181 
1182 /* Code to be retrieved: I suppose you need a constant increment? */
1184 {
1185  bool ok = false;
1186  entity i = loop_index(l);
1187  range r = loop_range(l);
1188 
1190 
1191  return ok;
1192 }
1193 
1194 /* State if an expression OR part of that expression corresponds to one
1195  of the entity of the list l.
1196  This function was specifically designed in order to find if an expression
1197  is using one of the variable/entity listed in l.
1198  The function considers that the list only contains scalar variables.
1199 */
1201  if (l == NIL)
1202  return false;
1204  switch (syntax_tag(s)) {
1205  // If the expression is an array we go look among the indices by calling
1206  // the function on these indices
1207  case is_syntax_reference :
1208  {
1210  if (reference_indices(ref) != NIL) {
1212  if(is_expression_in_list(e, l))
1213  return true;
1214  }
1215  }
1216  else {
1217  entity ent = reference_variable(ref);
1218  if (gen_find_eq(ent, l) != chunk_undefined)
1219  return true;
1220  }
1221  }
1222  break;
1223  // Same principle, we go look among the arguments of the call
1224  case is_syntax_call :
1225  {
1226  call c = syntax_call(s);
1228  if(is_expression_in_list(e, l))
1229  return true;
1230  }
1231  }
1232  break;
1233  case is_syntax_cast :
1234  {
1235  cast ca = syntax_cast(s);
1237  if (gen_find_eq(ent, l) != chunk_undefined) {
1238  return true;
1239  }
1240  }
1241  break;
1242  // We call the function on every component of the range object
1243  case is_syntax_range :
1244  {
1245  range ra = syntax_range(s);
1247  }
1248  break;
1249  case is_syntax_subscript :
1250  {
1251  subscript sub = syntax_subscript(s);
1252  bool isinArray = is_expression_in_list(subscript_array(sub), l);
1253  if (isinArray)
1254  return true;
1256  if (is_expression_in_list(e, l)) {
1257  return true;
1258  }
1259  }
1260  }
1261  break;
1262  case is_syntax_application :
1263  {
1265  bool isinFunction = is_expression_in_list(application_function(app), l);
1266  if (isinFunction)
1267  return true;
1269  if (is_expression_in_list(e, l)) {
1270  return true;
1271  }
1272  }
1273  }
1274  break;
1275  case is_syntax_va_arg :
1276  {
1277  list sil = syntax_va_arg(s);
1278  FOREACH(sizeofexpression, soe, sil) {
1280  return true;
1281  }
1282  }
1283  break;
1285  {
1288  return true;
1289  }
1290  break;
1291  default :
1292  return false;
1293  }
1294  return false;
1295  }
1296 
1297 /* Allows the static_controlize phase to keep and update a list containing
1298  all the variables of the program assigned directly or indirectly by an array
1299 */
1301  // we only compute assignments
1302  if (!assignment_statement_p(s)) {
1303  return false;
1304  }
1306  // May not be necessary
1307  if (!instruction_call_p(inst)) {
1308  return false;
1309  }
1310  // Being an assignment, logically this call has only two arguments
1311  call c = instruction_call(inst);
1312  list args = call_arguments(c);
1313  // Left member of the assignment
1314  expression left = gen_car(args);
1315  entity eleft = expression_to_entity(left);
1316  // Right member of the assignment
1317  expression right = gen_car(CDR(args));
1318  // If the assigned variable is not in the list
1319  if (gen_find_eq(eleft, *l) == chunk_undefined) {
1320  // Test if the assignment is static control
1322  syntax s = expression_syntax(left);
1323  // We look for the right member in the list in order to know if the variable read has not been assigned by an array
1324  bool isRightArrayAccess = is_expression_in_list(right, *l);
1325  // If the left member is a scalar and if the right member is not static control or if it is a variable previously assigned
1326  // by an array, then we add the left member to the list
1327  if ((syntax_reference_p(s) && reference_indices(syntax_reference(s)) == NIL) && (entity_undefined_p(e) || isRightArrayAccess == true)) {
1328  *l = gen_cons(eleft, *l);
1329  }
1330  }
1331  return true;
1332 }
range copy_range(range p)
RANGE.
Definition: ri.c:2005
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
bool call_consistent_p(call p)
Definition: ri.c:242
static int count
Definition: SDG.c:519
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
bool normalizable_and_linear_loop_p(entity, range)
#define chunk_undefined
obsolete
Definition: genC.h:79
void control_map_get_blocs(control c, list *l)
Build recursively the list of all controls reachable from a control of an unstructured.
Definition: control.c:75
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
Definition: genClib.c:3373
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#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
list gen_cons(const void *item, const list next)
Definition: list.c:888
#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
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
void * gen_car(list l)
Definition: list.c:364
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
statement make_continue_statement(entity)
Definition: statement.c:953
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
Definition: icfg-local.h:50
#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
entity scalar_assign_call(call c)
entity scalar_assign_call((call) c) Detects if the call is an assignement and if the value assigned i...
entity expression_int_scalar(expression exp)
================================================================
entity make_nsp_entity()
entity make_nsp_entity() Makes a new NSP (for New Structural Parameter) .
#define GET_STATEMENT_MAPPING(map, stat)
Definition: newgen-local.h:49
int tag
TAG.
Definition: newgen_types.h:92
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
dfg_arc_label arc_label
Name : utils.c Package : paf-util Author : Alexis Platonoff Date : july 1993.
Definition: utils.c:88
dfg_vertex_label vertex_label
Definition: utils.c:89
#define static_control_loops(x)
Definition: paf_ri.h:757
struct _newgen_struct_static_control_ * static_control
Definition: paf_ri.h:184
void unnormalize_expression(void *st)
void unnormalize_expression(expression exp): puts all the normalized field of expressions in "st" to ...
Definition: normalize.c:452
string expression_to_string(expression e)
Definition: expression.c:77
list Words_Regular_Call(call obj, bool is_a_subroutine)
Definition: misc.c:1081
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
#define ENTITY_OR_P(e)
#define ENTITY_DIVIDE_P(e)
#define ENTITY_RELATIONAL_OPERATOR_P(e)
#define ENTITY_AND_P(e)
#define ENTITY_NON_EQUAL_P(e)
#define ENTITY_EQUAL_P(e)
#define MINUS_OPERATOR_NAME
#define ENTITY_LESS_THAN_P(e)
#define NORMALIZE_EXPRESSION(e)
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define ENTITY_NOT_P(e)
#define is_instruction_block
soft block->sequence transition
#define ENTITY_GREATER_THAN_P(e)
#define ENTITY_NON_EQUIV_P(e)
#define ENTITY_READ_P(e)
#define instruction_block(i)
#define ENTITY_LESS_OR_EQUAL_P(e)
#define ENTITY_GREATER_OR_EQUAL_P(e)
#define ENTITY_EQUIV_P(e)
code entity_code(entity e)
Definition: entity.c:1098
entity entity_empty_label(void)
Definition: entity.c:1105
bool entity_module_p(entity e)
Definition: entity.c:683
expression make_entity_expression(entity e, cons *inds)
Definition: expression.c:176
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
Definition: expression.c:2012
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
bool expression_equal_integer_p(expression exp, int i)
================================================================
Definition: expression.c:1977
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
Definition: variable.c:1130
#define loop_body(x)
Definition: ri.h:1644
#define syntax_reference_p(x)
Definition: ri.h:2728
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
#define LOOP(x)
LOOP.
Definition: ri.h:1606
#define loop_execution(x)
Definition: ri.h:1648
#define storage_formal_p(x)
Definition: ri.h:2522
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_tag(x)
Definition: ri.h:2727
#define call_function(x)
Definition: ri.h:709
#define reference_variable(x)
Definition: ri.h:2326
#define range_upper(x)
Definition: ri.h:2290
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define instruction_loop(x)
Definition: ri.h:1520
#define statement_ordering(x)
Definition: ri.h:2454
#define sizeofexpression_expression(x)
Definition: ri.h:2409
#define syntax_cast(x)
Definition: ri.h:2739
#define instruction_goto(x)
Definition: ri.h:1526
#define syntax_application(x)
Definition: ri.h:2748
#define test_false(x)
Definition: ri.h:2837
#define syntax_va_arg(x)
Definition: ri.h:2751
#define entity_storage(x)
Definition: ri.h:2794
#define code_declarations(x)
Definition: ri.h:784
#define syntax_range(x)
Definition: ri.h:2733
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_application
Definition: ri.h:2697
@ is_syntax_cast
Definition: ri.h:2694
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_va_arg
Definition: ri.h:2698
@ is_syntax_reference
Definition: ri.h:2691
@ is_syntax_sizeofexpression
Definition: ri.h:2695
@ is_syntax_subscript
Definition: ri.h:2696
#define range_increment(x)
Definition: ri.h:2292
#define storage_ram_p(x)
Definition: ri.h:2519
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define cast_expression(x)
Definition: ri.h:747
#define application_arguments(x)
Definition: ri.h:510
#define subscript_indices(x)
Definition: ri.h:2563
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define expression_undefined
Definition: ri.h:1223
@ is_instruction_goto
Definition: ri.h:1473
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_whileloop
Definition: ri.h:1472
@ is_instruction_expression
Definition: ri.h:1478
@ is_instruction_test
Definition: ri.h:1470
@ is_instruction_call
Definition: ri.h:1474
@ is_instruction_forloop
Definition: ri.h:1477
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511
#define entity_name(x)
Definition: ri.h:2790
#define normalized_tag(x)
Definition: ri.h:1778
#define expression_normalized(x)
Definition: ri.h:1249
#define test_true(x)
Definition: ri.h:2835
#define reference_indices(x)
Definition: ri.h:2328
#define syntax_sizeofexpression(x)
Definition: ri.h:2742
#define syntax_call(x)
Definition: ri.h:2736
#define loop_label(x)
Definition: ri.h:1646
#define instruction_call_p(x)
Definition: ri.h:1527
#define loop_locals(x)
Definition: ri.h:1650
#define expression_undefined_p(x)
Definition: ri.h:1224
#define subscript_array(x)
Definition: ri.h:2561
#define application_function(x)
Definition: ri.h:508
#define range_lower(x)
Definition: ri.h:2288
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_call(x)
Definition: ri.h:1529
#define syntax_subscript(x)
Definition: ri.h:2745
#define loop_range(x)
Definition: ri.h:1642
#define call_arguments(x)
Definition: ri.h:711
#define control_statement(x)
Definition: ri.h:941
#define instruction_test(x)
Definition: ri.h:1517
#define entity_type(x)
Definition: ri.h:2792
#define statement_number(x)
Definition: ri.h:2452
#define normalized_linear(x)
Definition: ri.h:1781
#define expression_syntax(x)
Definition: ri.h:1247
#define type_variable_p(x)
Definition: ri.h:2947
#define instruction_unstructured(x)
Definition: ri.h:1532
#define loop_index(x)
Definition: ri.h:1640
@ is_normalized_complex
Definition: ri.h:1761
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
char * strdup()
static bool ok
#define ENTITY_OR
#define ENTITY_AND
#define ENTITY_SP_P(ent)
#define ENTITY_GE
#define ENTITY_NOT
#define ENTITY_STRICT_LOGICAL_OPERATOR_P(e)
list words_entity_list(list obj)
================================================================
Definition: prettyprint.c:265
static void substitute_variable_by_expression(expression e, hash_table fst)
rewriting of forward_substitute_in_exp, in_loop,...
Definition: utils.c:1122
bool is_expression_in_list(expression exp, list l)
State if an expression OR part of that expression corresponds to one of the entity of the list l.
Definition: utils.c:1200
int stco_renumber_code(statement in_st, int in_ct)
================================================================
Definition: utils.c:137
bool splc_linear_expression_list_p(list l, list *ell)
================================================================
Definition: utils.c:682
string print_structurals(list l)
================================================================
Definition: utils.c:732
int in_forward_defined(entity ent, list *swfl)
================================================================
Definition: utils.c:836
list sc_list_of_loop_dup(list l)
================================================================
Definition: utils.c:778
bool get_sp_of_call_p(call c, hash_table fst, list *swfl)
================================================================
Definition: utils.c:1056
list make_undefined_list()
================================================================
Definition: utils.c:815
void forward_substitute_in_exp(expression *pe, hash_table fst)
Definition: utils.c:1148
list assigned_var
=================================================================
bool sp_feautrier_expression_p(expression exp)
================================================================
Definition: utils.c:995
#define entity_assigned_by_array_p(ent)
Definition: utils.c:86
void forward_substitute_in_anyloop(void *pl, hash_table fst)
Definition: utils.c:1139
void verify_structural_parameters(list the_list, list *swfl)
================================================================
Definition: utils.c:873
bool splc_linear_expression_p(expression exp, list *ell)
================================================================
Definition: utils.c:648
bool splc_feautrier_expression_p(expression exp, list *ell)
================================================================
Definition: utils.c:962
bool splc_linear_access_to_arrays_p(list l, list *ell)
================================================================
Definition: utils.c:700
void forward_substitute_in_call(call *pc, hash_table fst)
Definition: utils.c:1157
bool normalizable_loop_p(loop l)
bool normalizable_loop_p(loop l) Returns true if "l" has a constant step.
Definition: utils.c:1172
bool splc_positive_relation_p(expression exp, list *ell)
================================================================
Definition: utils.c:282
list sc_list_of_exp_dup(list l)
================================================================
Definition: utils.c:741
list loops_to_indices(list l)
================================================================
Definition: utils.c:630
entity sp_feautrier_scalar_assign_call(call c)
================================================================
Definition: utils.c:1029
bool get_reference_assignments(statement s, list *l)
Allows the static_controlize phase to keep and update a list containing all the variables of the prog...
Definition: utils.c:1300
bool sp_linear_expression_p(expression exp)
================================================================
Definition: utils.c:928
list stco_same_loops(statement_mapping in_map, statement in_s, statement in_s2)
======================================================================
Definition: utils.c:98
expression sc_opposite_exp_of_conjunction(expression exp, list *ell)
================================================================
Definition: utils.c:236
expression sc_conditional(expression exp, list *ell)
================================================================
Definition: utils.c:596
bool in_forward_defined_p(entity ent, list *swfl)
================================================================
Definition: utils.c:855
list sc_list_of_entity_dup(list l)
================================================================
Definition: utils.c:761
list Gstructure_parameters
Global variables
loop sc_loop_dup(loop l)
================================================================
Definition: utils.c:796
bool normalizable_loop_p_retrieved(loop l)
Code retrieved from revision 14476, transformations/loop_normalize.c.
Definition: utils.c:1183
list sc_entity_to_formal_integer_parameters(entity f)
================================================================
Definition: utils.c:900
expression normalize_test_leaves(expression exp, list *ell)
================================================================
Definition: utils.c:445
list ndf_normalized_test(expression exp, list *ell)
================================================================
Definition: utils.c:306
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
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
Definition: statement.c:54
string words_to_string(cons *lw)
Definition: print.c:211
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207
struct Svecteur * Pvecteur
#define VECTEUR_NUL_P(v)
#define term_cst(varval)