PIPS
comp_util.c
Go to the documentation of this file.
1 /*
2 
3  $Id: comp_util.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 /* comp_util.c
28  *
29  * useful routines for evaluation of the complexity of a program
30  *
31  * bool complexity_check(comp)
32  * void complexity_check_and_warn(function_name, comp)
33  * void good_complexity_assert(function_name, comp)
34  * void complexity_fprint(fd, comp, print_stats_p, print_local_names_p)
35  * char *complexity_sprint(comp, print_stats_p, print_local_names_p)
36  * void fprint_statement_complexity(module, stat, hash_statement_to_complexity)
37  * void prc(comp) (for dbx)
38  * void prp(pp) (for dbx)
39  * void prv(pv) (for dbx)
40  * void fprint_cost_table(fd)
41  * void init_cost_table();
42  * int intrinsic_cost(name, argstype)
43  * bool is_inferior_basic(basic1, basic2)
44  * basic simple_basic_dup(b)
45  * float constant_entity_to_float(e)
46  * void trace_on(va_alist)
47  * void trace_off()
48  * list entity_list_reverse(l)
49  * bool is_linear_unstructured(unstr)
50  * void add_formal_parameters_to_hash_table(mod, hash_complexity_params)
51  * void remove_formal_parameters_from_hash_table(mod, hash_complexity_params)
52  * hash_table fetch_callees_complexities(module_name)
53  * hash_table fetch_complexity_parameters(module_name)
54  */
55 /* Modif:
56  -- entity_local_name is replaced by module_local_name. LZ 230993
57  -- add of missing operators to intrinsic_cost_table. Molka Becher 08.03.2011
58 */
59 
60 /* To have strndup(): */
61 #include <stdio.h>
62 #include <string.h>
63 #include <stdlib.h> /* getenv */
64 #include <stdarg.h>
65 
66 #include "linear.h"
67 
68 #include "genC.h"
69 #include "database.h"
70 #include "ri.h"
71 #include "effects.h"
72 #include "complexity_ri.h"
73 #include "resources.h"
74 
75 #include "ri-util.h"
76 #include "prettyprint.h" // for debugging
77 #include "effects-util.h"
78 #include "pipsdbm.h"
79 #include "text-util.h" /* print_text */
80 #include "effects-generic.h"
81 #include "effects-simple.h"
82 #include "misc.h"
83 #include "constants.h" /* IMPLIED_DO_NAME is defined there */
84 #include "properties.h" /* get_string_property is defined there */
85 #include "matrice.h"
86 #include "polynome.h"
87 #include "complexity.h"
88 
89 /* for debugging */
90 #define INDENT_BLANKS " "
91 #define INDENT_VLINE "| "
92 #define INDENT_BACK "-"
93 #define INDENT_INTERVAL 2
94 ␌
95 /* return true if allright */
96 bool complexity_check(comp)
97 complexity comp;
98 {
99  if ( COMPLEXITY_UNDEFINED_P(comp) )
100  pips_internal_error("complexity undefined");
101 
102  if ( !complexity_zero_p(comp) ) {
103  return (polynome_check(complexity_polynome(comp)));
104  }
105  return (true);
106 }
107 
109 const char *s;
110 complexity comp;
111 {
112  if ( COMPLEXITY_UNDEFINED_P(comp) )
113  pips_internal_error("complexity undefined");
114 
115  if ( complexity_zero_p(comp) ) {
116  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
117  fprintf(stderr,"complexity ZERO for %s\n",s);
118  }
119  }
120  if (!complexity_check(comp))
121  user_warning(s,"Bad internal complexity representation!\n");
122 }
123 
124 void good_complexity_assert(_UNUSED_ string function, complexity comp)
125 {
126  if (!complexity_check(comp))
127  pips_internal_error("bad internal complexity representation");
128 }
129 
130 /* duplicates complexity comp */
132 complexity comp;
133 {
134  if ( COMPLEXITY_UNDEFINED_P(comp) )
135  pips_internal_error("complexity undefined");
136 
137  if ( complexity_zero_p(comp) )
138  return (make_zero_complexity());
139  else {
140  varcount vc = complexity_varcount(comp);
142  ifcount ic = complexity_ifcount(comp);
143 
145  varcount_guessed(vc),
146  varcount_bounded(vc),
147  varcount_unknown(vc));
149  rangecount_guessed(rc),
150  rangecount_bounded(rc),
151  rangecount_unknown(rc));
153  ifcount_computed(ic),
154  ifcount_halfhalf(ic));
155 
157  complexity compl = make_complexity(ppdup, newvc, newrc, newic);
158 
159  return(compl);
160  }
161 }
162 
163 /* remove complexity comp */
164 void complexity_rm(pcomp)
165 complexity *pcomp;
166 {
167  if ( COMPLEXITY_UNDEFINED_P(*pcomp) )
168  pips_internal_error("undefined complexity");
169 
170  if ( !complexity_zero_p(*pcomp) )
171  free_complexity(*pcomp);
172  *pcomp = make_zero_complexity();// complexity_undefined;
173 }
174 ␌
175 char *complexity_sprint(comp, print_stats_p, print_local_names_p)
176 complexity comp;
177 bool print_stats_p, print_local_names_p;
178 {
179 
180  char *s=NULL;
181 
182  if ( COMPLEXITY_UNDEFINED_P(comp) )
183  pips_internal_error("complexity undefined");
184  else {
185  varcount vc = complexity_varcount(comp);
187  ifcount ic = complexity_ifcount(comp);
188 
189  char * p = polynome_sprint(complexity_polynome(comp),
190  (print_local_names_p ? variable_local_name
191  : variable_name),
193 
194  if ( print_stats_p ) {
195  asprintf(&s,"[(var:%td/%td/%td/%td)"
196  " (rng:%td/%td/%td/%td)"
197  " (ifs:%td/%td/%td)] %s",
198  varcount_symbolic(vc),
199  varcount_guessed(vc),
200  varcount_bounded(vc),
201  varcount_unknown(vc),
203  rangecount_guessed(rc),
204  rangecount_bounded(rc),
205  rangecount_unknown(rc),
206  ifcount_profiled(ic),
207  ifcount_computed(ic),
208  ifcount_halfhalf(ic),p);
209  free(p);
210  }
211  else
212  s=p;
213  }
214  return s;
215 }
216 
217 void complexity_fprint(fd, comp, print_stats_p, print_local_names_p)
218 FILE *fd;
219 complexity comp;
220 bool print_stats_p, print_local_names_p;
221 {
222  char *s = complexity_sprint(comp, print_stats_p, print_local_names_p);
223 
224  fprintf(fd, "%s\n", s);
225  free(s);
226 }
227 
229 {
230  complexity_fprint(stderr, comp, false, true);
231 }
232 ␌
233 void prc(comp) /* for dbxtool: "print complexity" */
234 complexity comp;
235 {
236  complexity_fprint(stderr, comp, true, true);
237 }
238 
239 void prp(pp) /* for dbxtool: "print polynome" */
240 Ppolynome pp;
241 {
243  fprintf(stderr, "\n");
244 }
245 
246 void prv(pv) /* for dbxtool: "print vecteur (as a monome)" */
247 Pvecteur pv;
248 {
250  fprintf(stderr, "\n");
251 }
252 
253 void fprint_statement_complexity(module, stat, hash_statement_to_complexity)
254 entity module;
255 statement stat;
256 hash_table hash_statement_to_complexity;
257 {
258  text t = Text_Statement(module, 0, stat);
259  complexity comp;
260 
261  comp = ((complexity) hash_get(hash_statement_to_complexity,(char *)stat));
262  if (COMPLEXITY_UNDEFINED_P(comp))
263  pips_internal_error("undefined complexity");
264  else {
265  fprintf(stderr, "C -- ");
267  }
268  print_text(stderr, t);
269 }
270 ␌
271 /* The table intrinsic_cost_table[] gathers cost information
272  * of each intrinsic's cost; those costs are dynamically loaded
273  * from user files. It also returns the "minimum" type
274  * of the result of each intrinsic,
275  * specified by its basic_tag and number of memory bytes.
276  * ("bigger" and "minimum" refer to the order relation
277  * defined in the routine "is_inferior_basic"; the tag
278  * is_basic_overloaded is used as a don't care tag)
279  * (ex: SIN has a type of FLOAT even if its arg is an INT)
280  *
281  * Modif:
282  * -- LOOP_OVERHEAD and CALL_OVERHEAD are added, 280993 LZ
283  * -- LOOP_OVERHEAD is divided into two: INIT and BRAANCH 081093 LZ
284  */
285 
287 
324 
325  /* intrinsics for integer multiply add/sub */
328 
332 
341 
351 
364 
372 
393 
423 
458 
463 
466 
476 
477  { NULL, 0, ZERO_BYTE, EMPTY_COST },
478 };
479 
480 ␌
482 FILE *fd;
483 {
485  bool skip_one_line = false;
486 
487  fprintf(fd, "\nIntrinsic cost table:\n\n");
488  fprintf(fd, " Intrinsic name int float double complex dcomplex\n");
489  fprintf(fd, "------------------------------------------------------------------------\n");
490 
491  for(; p->name != NULL ;p++) {
492  if (1 ||(p->int_cost != 0) ||
493  (p->float_cost != 0) ||
494  (p->double_cost != 0) ||
495  (p->complex_cost != 0) ||
496  (p->dcomplex_cost != 0)) {
497  if (skip_one_line) {
498  fprintf(fd, "%25s|\n", "");
499  skip_one_line = false;
500  }
501  fprintf(fd, "%22.21s |%6td %6td %7td %8td %8td\n",
502  p->name, p->int_cost, p->float_cost,
504  }
505  else
506  skip_one_line = true;
507  }
508  fprintf(fd, "\n");
509 }
510 
511 /* Completes the intrinsic cost table with the costs read from the files
512  * specified in the "COMPLEXITY_COST_TABLE" string property
513  * See properties.rc and ~pips/Pips/pipsrc.csh for more information.
514  *
515  * L. ZHOU 13/03/91
516  *
517  * COST_DATA are names of five data files
518  */
520 {
521  char *token, *comma, *filename ;
522  float file_factor;
523 
524  char *cost_data = strdup(COST_DATA);
525  char *tmp=NULL;
526 
527  for(token = strtok(cost_data, " "); (token != NULL);token = strtok(NULL, " ")) {
528  comma = strchr(token, ',');
529 
530  if (comma == NULL) {
531  tmp=strdup(token);
532  file_factor = 1.0;
533  }
534  else {
535  int ii = comma - token;
536  tmp=strndup( token, ii);
537  sscanf(++comma, "%f", &file_factor);
538  }
539 
540 
541  filename = strdup(concatenate( COMPLEXITY_COST_TABLES "/", get_string_property("COMPLEXITY_COST_TABLE"), "/", tmp, NULL));
542 
543  debug(5,"init_cost_table","file_factor is %f\n", file_factor);
544  debug(1,"init_cost_table","cost file is %s\n",filename);
545 
546  load_cost_file(fopen_config(filename,NULL,"PIPS_COSTDIR"), file_factor);
547  free(tmp);
548  free(filename);
549  }
550 
551 }
552 
553 /*
554  * Load (some) intrinsics costs from file "fd",
555  * multiplying them by "file_factor".
556  */
557 void load_cost_file(fd, file_factor)
558 FILE *fd;
559 float file_factor;
560 {
561  char *line = (char*) malloc(199);
562  char *intrinsic_name = (char*) malloc(30);
564  struct intrinsic_cost_rec *p;
565  float scale_factor = 1.0;
566  bool recognized;
567 
568  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
569  fprintf(stderr, "\nReading cost file ");
570  if (file_factor != 1.0)
571  fprintf(stderr, "(x %.2f)", file_factor);
572  }
573 
574  while (fgets(line, 99, fd) != NULL) {
575  if (*line == '%')
576  sscanf(line+1, "%f", &scale_factor);
577  else if ((*line != '#') && (*line != '\n')) {
578  sscanf(line, "%s %d %d %d %d %d", intrinsic_name,
581  recognized = false;
582  for (p = intrinsic_cost_table; p->name != NULL; p++) {
583  if (same_string_p(p->name, intrinsic_name)) {
584  p->int_cost = (int)
585  (int_cost * scale_factor * file_factor + 0.5);
586  p->float_cost = (int)
587  (float_cost * scale_factor * file_factor + 0.5);
588  p->double_cost = (int)
589  (double_cost * scale_factor * file_factor + 0.5);
590  p->complex_cost = (int)
591  (complex_cost * scale_factor * file_factor + 0.5);
592  p->dcomplex_cost = (int)
593  (dcomplex_cost * scale_factor * file_factor + 0.5);
594  recognized = true;
595  break;
596  }
597  }
598  if (!recognized)
599  user_warning("load_cost_file",
600  "%s:unrecognized intrinsic\n",intrinsic_name);
601  }
602  }
603  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
604  fprintf(stderr, "\nScale factor is %f\n", scale_factor);
605  }
606  fclose(fd);
607 
608  free(intrinsic_name);
609  free(line);
610 }
611 ␌
612 /* Return the cost of the intrinsic named s, knowing that
613  * the "basic" type of its biggest argument is *pargsbasic.
614  * Update *pargsbasic if the intrinsic returns a number
615  * of bigger complexity.
616  */
617 int intrinsic_cost(s, pargsbasic)
618 const char *s;
619 basic *pargsbasic;
620 {
621  struct intrinsic_cost_rec *p;
622  basic b;
623 
624  for (p = intrinsic_cost_table; p->name != NULL; p++) {
625  if (same_string_p(p->name, s)) {
626 
627  /* Inserted by AP, oct 24th 1995 */
628  if (same_string_p(p->name, "LOG") || same_string_p(p->name, "LOG10")) {
629  user_warning("intrinsic_cost", "LOG or LOG10 functions used\n");
630  }
631 
632  b = make_basic(p->min_basic_result, (void *) p->min_nbytes_result);
633  if (is_inferior_basic(*pargsbasic, b)) {
634  free_basic(*pargsbasic);
635  *pargsbasic = simple_basic_dup(b);
636  }
637 
638  switch (basic_tag(*pargsbasic)) {
639  case is_basic_int:
640  return(p->int_cost);
641  case is_basic_float:
642  return (basic_float(*pargsbasic) <= FLOAT_NBYTES ?
643  p->float_cost : p->double_cost);
644  case is_basic_complex:
645  return (basic_complex(*pargsbasic) <= COMPLEX_NBYTES ?
646  p->complex_cost : p->dcomplex_cost);
647  case is_basic_string:
648  return (STRING_INTRINSICS_COST);
649  case is_basic_logical:
650  return (LOGICAL_INTRINSICS_COST);
651  default:
652  pips_internal_error("basic tag is %d", basic_tag(*pargsbasic));
653  }
654  }
655  }
656  /* To satisfy cproto . LZ 02 Feb. 93 */
657  return (STRING_INTRINSICS_COST);
658 }
659 ␌
660 
661 /* Return if possible the value of e in a float.
662  * it is supposed to be an int or a float.
663  */
665 entity e;
666 {
667  const char *cste = module_local_name(e);
668  basic b = entity_basic(e);
669  float f;
670 
671  if (basic_int_p(b) || basic_float_p(b)) {
672  sscanf(cste, "%f", &f);
673  return (f);
674  }
675  else {
676  user_warning("constant_entity_to_float",
677  "Basic tag:%d, not 4->9, (entity %s)\n",basic_tag(b),cste);
678  return (0.0);
679  }
680 }
681 
682 /* "trace on" */
683 static int call_level=0;
684 void trace_on(char * fmt, ...)
685 {
686  if (get_bool_property("COMPLEXITY_TRACE_CALLS")) {
687  va_list args;
688  char *indentstring = (char*) malloc(99);
689  bool b = (call_level >= 0);
690  int i,k=1;
691 
692  indentstring[0] = '\0';
693 
694  for (i=0; i< (b ? call_level : - call_level); i++) {
695  indentstring = strcat(indentstring,
696  strdup(b ? ( (k>0) ? INDENT_BLANKS
697  : INDENT_VLINE )
698  : INDENT_BACK));
699  k = ( k<INDENT_INTERVAL ? k+1 : 0 );
700  }
701 
702  fprintf(stderr, "%s>", indentstring);
703  va_start(args, fmt);
704  vfprintf(stderr, fmt, args);
705  fprintf(stderr, "\n");
706  va_end(args);
707 
708  free(indentstring);
709  call_level++;
710  }
711 }
712 
713 /* "trace off" */
714 void trace_off()
715 {
716  if (get_bool_property("COMPLEXITY_TRACE_CALLS")) {
717  char *indentstring = (char*) malloc(99);
718  bool b = (call_level >= 0);
719  int i,k=1;
720 
721  indentstring[0] = '\0';
722  call_level--;
723  for (i=0; i< (b ? call_level : - call_level); i++) {
724  indentstring = strcat(indentstring,
725  strdup(b ? ( (k>0) ? INDENT_BLANKS
726  : INDENT_VLINE )
727  : INDENT_BACK));
728  k = ( k<INDENT_INTERVAL ? k+1 : 0 );
729  }
730  fprintf(stderr, "%s<\n", indentstring);
731  free(indentstring);
732  }
733 }
734 ␌
735 /* return true if unstr is simply a linear
736  * string of controls
737  */
739 unstructured unstr;
740 {
742  control exit = unstructured_exit(unstr);
743 
744  while (current != exit) {
746 
747  if (succs == NIL)
748  pips_internal_error("control != exit one,it has no successor");
749  if (CDR(succs) != NIL)
750  return (false);
751  current = CONTROL(CAR(succs));
752  }
753 
754  return(true);
755 }
756 
758 list l;
759 {
760  entity e;
761 
762  if ((l == NIL) || (l->cdr == NIL))
763  return l;
764  e = ENTITY(CAR(l));
765  return (CONS(ENTITY, e, entity_list_reverse(l->cdr)));
766 }
767 
768 void add_formal_parameters_to_hash_table(mod, hash_complexity_params)
769 entity mod;
770 hash_table hash_complexity_params;
771 {
772  list decl;
773 
774  pips_assert("add_formal_parameters_to_hash_table",
775  entity_module_p(mod));
777 
778  MAPL(pe, {
779  entity param = ENTITY(CAR(pe));
781  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
782  fprintf(stderr,"\nstorage_formal %s\n",
783  entity_name(param));
784  }
785  hash_put(hash_complexity_params, (char *) strdup(module_local_name(param)),
787  }
788  }, decl);
789 }
790 
791 void remove_formal_parameters_from_hash_table(mod, hash_complexity_params)
792 entity mod;
793 hash_table hash_complexity_params;
794 {
795  list decl;
796 
797  pips_assert("remove_formal_parameters_from_hash_table",
798  entity_module_p(mod));
800 
801  MAPL(pe, {
802  entity param = ENTITY(CAR(pe));
804  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
805  fprintf(stderr,"storage_formal %s to be deleted\n",
806  entity_name(param));
807  }
808  hash_del(hash_complexity_params, (char *) module_local_name(param));
809  }, decl);
810 }
811 
813 {
814  /* Modified copies of the summary complexities are stored */
815  hash_table_clear(h);
816  hash_table_free(h);
817 
818  return hash_table_undefined;
819 }
820 
822 char *module_name;
823 {
824  hash_table hash_callees_comp = hash_table_make(hash_pointer, 0);
825  callees cl;
826  list callees_list;
827  complexity callee_comp;
828 
829  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
830  fprintf(stderr, "Fetching callees complexities ...\n");
831  }
832 
833  cl = (callees)db_get_memory_resource(DBR_CALLEES, module_name, true);
834  callees_list = callees_callees(cl);
835 
836  if ( callees_list == NIL ) {
837  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
838  fprintf(stderr, "Module %s has no callee! Done\n", module_name);
839  }
840  return(hash_callees_comp);
841  }
842 
843  MAPL(pc, {
844  string callee_name = STRING(CAR(pc));
845  entity callee = module_name_to_entity(callee_name);
846  type t = entity_type(callee);
847 
848  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
849  fprintf(stderr, "%s has callee %s!\n",module_name,callee_name);
850  }
851  pips_assert("call_to_complexity",
852  type_functional_p(t) || type_void_p(t));
853 
855  complexity new_comp;
856  callee_comp = (complexity)
857  db_get_memory_resource(DBR_SUMMARY_COMPLEXITY,
858  (char *) callee_name,
859  true);
860 
861  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
862  fprintf(stderr, "fetched complexity for callee %s",
863  callee_name);
864  fprintf(stderr, " of module %s:\n", module_name);
865  complexity_fprint(stderr, callee_comp,
868  }
869 
870  debug(5,"fetch_callees_complexities","callee_name %s\n",callee_name);
871 
872  /* translate the local name to current module name. LZ 5 Feb.93 */
873  /* i.e. SUB:M -> MAIN:M */
874  /* FI: this seems to be wrong in general because the
875  * formal parameter and actual argument are assumed to
876  * have the same name; see DemoStd/q and variables IM/IMM;
877  * 3 March 1994
878  */
879  new_comp = translate_complexity_from_local_to_current_name(callee_comp,
880  callee_name,module_name);
881 
882  hash_put(hash_callees_comp, (char *)callee, (char *)new_comp);
883  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
884  fprintf(stderr, "translated complexity for callee %s",
885  callee_name);
886  fprintf(stderr, " of module %s:\n", module_name);
887  complexity_fprint(stderr, new_comp,
890  }
891  }
892  }, callees_list );
893 
894  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
895  fprintf(stderr, "Fetching callees complexities ... done\n");
896  }
897 
898  return(hash_callees_comp);
899 }
900 
902 char *module_name;
903 {
904  hash_table hash_comp_params = hash_table_make(hash_pointer, 0);
905  char *parameters = strdup(get_string_property("COMPLEXITY_PARAMETERS"));
906  char *sep_chars = strdup(", ");
907  char *token = (char*) malloc(30);
908  entity e;
909 
911 
912  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
913  fprintf(stderr, "Fetching complexity parameters for module %s:\n",
914  module_name);
915  }
916 
917  token = strtok(parameters, sep_chars);
918 
919  while (token != NULL) {
922  token,
923  (char *) NULL),
924  entity_domain);
925  if (e != entity_undefined) {
926  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
927  fprintf(stderr, "{\t Defined entity %s }\n", entity_name(e));
928  }
929  hash_put(hash_comp_params,(char *)e,HASH_USER_VARIABLE);
930  }
931  else {
932  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
933  fprintf(stderr, "{\t Undefined token %s }\n", token);
934  }
935  }
936  token = strtok(NULL, sep_chars);
937  }
938 
939  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
940  fprintf(stderr, "Fetching complexity parameters: ...done.\n");
941  }
942 
943  return(hash_comp_params);
944 }
945 
946 void add_common_variables_to_hash_table(module, hash_complexity_params)
947 entity module;
948 hash_table hash_complexity_params;
949 {
950  const char* module_name = module_local_name(module);
951  list sefs_list = list_undefined;
952  list ce = list_undefined;
953 
954  pips_assert("add_common_variables_to_hash_table",
956 
957  sefs_list = effects_to_list( (effects)
958  db_get_memory_resource(DBR_SUMMARY_EFFECTS, module_name, true));
959 
960  ifdebug(5) {
961  debug(5, "add_common_variables_to_hash_table",
962  "Effect list for %s\n",
963  module_name);
964  print_effects(sefs_list);
965  }
966 
967  for(ce= sefs_list; !ENDP(ce); POP(ce)) {
968  effect obj = EFFECT(CAR(ce));
970  action ac = effect_action(obj);
972  entity e = reference_variable(r);
973  storage s = entity_storage(e);
974 
975  if ( !storage_formal_p(s) &&
976  action_read_p(ac) && approximation_exact_p(ap) ) {
977  debug(5,"add_common_variables_to_hash_table",
978  "%s added\n", module_local_name(e));
979  hash_put(hash_complexity_params, (char *) module_local_name(e),
981  }
982  }
983 }
984 
985 void remove_common_variables_from_hash_table(module, hash_complexity_params)
986 entity module;
987 hash_table hash_complexity_params;
988 {
989  const char* module_name = module_local_name(module);
990  list sefs_list;
991 
992  pips_assert("remove_common_variables_from_hash_table",
994 
995  sefs_list = effects_to_list( (effects)
996  db_get_memory_resource(DBR_SUMMARY_EFFECTS, module_name, true));
997 
998  MAPL(ce, {
999  effect obj = EFFECT(CAR(ce));
1001  action ac = effect_action(obj);
1003  entity e = reference_variable(r);
1004 
1005  if ( action_read_p(ac) && approximation_exact_p(ap) ) {
1006  if (get_bool_property("COMPLEXITY_INTERMEDIATES")) {
1007  fprintf(stderr, "%s deleted\n", module_local_name(e));
1008  }
1009  hash_del(hash_complexity_params, (char *) module_local_name(e));
1010  }
1011  }, sefs_list);
1012 }
1013 
1014 bool is_must_be_written_var(effects_list, var_name)
1015 list effects_list;
1016 char *var_name;
1017 {
1018  MAPL(ce, {
1019  effect eff = EFFECT(CAR(ce));
1020 
1021  if(eff == effect_undefined)
1022  pips_internal_error("unexpected effect undefined");
1023 
1024  if ( action_write_p(effect_action(eff))
1027  entity e = reference_variable(r);
1028 /*
1029  fprintf(stderr, "is_must_be_written_var for entity %s\n",
1030  module_local_name(e) );
1031 */
1032  if ( strcmp(module_local_name(e), var_name) == 0 ) {
1033  return (true);
1034  }
1035  }
1036 /*
1037  else {
1038  fprintf(stderr, "is_must_be_written_var for NOT entity %s\n",
1039  module_local_name(reference_variable(effect_any_reference(eff))) );
1040  }
1041 */
1042  },effects_list);
1043 
1044  return (false);
1045 }
1046 
1047 /*
1048  * This procedure is used to evaluate the complexity which has been postponed
1049  * to be evaluated by is_must_be_writteen.
1050  * LZ 26 Nov. 92
1051  */
1053 complexity comp;
1054 transformer precond;
1055 list effects_list;
1056 {
1057  complexity final_comp = complexity_dup(comp);
1058  Ppolynome pp = complexity_polynome(comp);
1060 
1061 
1062  fprintf(stderr, "Final evaluation\n");
1063 
1064  for ( ; !VECTEUR_NUL_P(pb); pb = pb->succ) {
1065  bool mustbewritten;
1066  char *var = variable_local_name(pb->var);
1067 
1068  fprintf(stderr, "Variable is %s\n", var);
1069 
1070  mustbewritten = is_must_be_written_var(effects_list, var);
1071 
1072  if ( mustbewritten ) {
1073  complexity compsubst;
1074  fprintf(stderr, "YES once\n");
1075  compsubst = evaluate_var_to_complexity((entity)pb->var,
1076  precond,
1077  effects_list, 1);
1078  complexity_fprint( stderr, compsubst, false, false);
1079 /*
1080 
1081  final_comp = complexity_var_subst(comp, pb->var, compsubst);
1082 */
1083  }
1084  comp = complexity_dup(final_comp);
1085  }
1086 
1087  complexity_fprint( stderr, final_comp, false, false);
1088 
1089  return ( final_comp );
1090 }
1091 
1092 /* translate_complexity_from_local_to_current_name(callee_comp,oldname,newname)
1093  * B:M -> A:M if A calls B
1094  * 5 Feb. 93 LZ
1095  *
1096  * This is not general enough to handle:
1097  * B:M -> A:N or B:M to A:N+1
1098  * FI, 3 March 1994
1099  */
1101 complexity callee_comp;
1102 string oldname,newname;
1103 {
1104  Ppolynome pp = complexity_polynome(callee_comp);
1106  Pbase pbcur = BASE_UNDEFINED;
1108  complexity old_comp = complexity_dup(callee_comp);
1109 
1110  if(BASE_NULLE_P(pb)) {
1111  /* constant complexity */
1112  comp = complexity_dup(callee_comp);
1113  return comp;
1114  }
1115 
1116  /* The basis associated to a polynomial includes the constant term! */
1117  if(base_dimension(pb)==1 && term_cst(pb)) {
1118  /* constant complexity */
1119  comp = complexity_dup(callee_comp);
1120  return comp;
1121  }
1122 
1123  for (pbcur=pb; pbcur != VECTEUR_NUL ; pbcur = pbcur->succ ) {
1124  Variable var = pbcur->var;
1125  char * stmp = strdup(variable_name(var));
1126 
1127  char *s = stmp;
1128  char *t = strchr(stmp,':');
1129 
1130  if ( t != NULL ) {
1131  int length = (int)(t - s);
1132  char *cur_name = (char *)malloc(100);
1133 
1134  (void) strncpy(cur_name,stmp,length);
1135  * (cur_name+length) = '\0';
1136 
1137  if ( 1 || strncmp(cur_name, oldname, length) == 0 ) {
1138  Variable newvar = name_to_variable(concatenate(strdup(newname),
1139  ":",strdup(t+1),NULL));
1140  if ( newvar != (Variable) chunk_undefined ) {
1141  complexity compsubst = make_single_var_complexity(1.0, newvar);
1142 
1143 /*
1144  polynome_chg_var(&pp, var, newvar);
1145 */
1146  comp = complexity_var_subst(old_comp, var, compsubst);
1147  old_comp = complexity_dup(comp);
1148  }
1149  else {
1150  comp = complexity_dup(old_comp);
1151  old_comp = complexity_dup(comp);
1152  }
1153  }
1154  }
1155  }
1156  return (comp);
1157 }
1158 
1160 {
1161  Ppolynome p = complexity_eval(c);
1162  bool monomial_p = is_single_monome(p);
1163 
1164  return monomial_p;
1165 }
1166 
1168 {
1169  Ppolynome p = complexity_eval(c);
1170  int degree = polynome_max_degree(p);
1171 
1172  return degree;
1173 }
rangecount make_rangecount(intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4)
varcount make_varcount(intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4)
void free_complexity(complexity p)
Definition: complexity_ri.c:21
ifcount make_ifcount(intptr_t a1, intptr_t a2, intptr_t a3)
Definition: complexity_ri.c:96
complexity make_complexity(Ppolynome a1, varcount a2, rangecount a3, ifcount a4)
Definition: complexity_ri.c:54
basic make_basic(enum basic_utype tag, void *val)
Definition: ri.c:155
void free_basic(basic p)
Definition: ri.c:107
static entity callee
Definition: alias_pairs.c:62
void const char const char const int
complexity evaluate_var_to_complexity(entity var, transformer precond, list effects_list __attribute__((__unused__)), int maximize)
complexity evaluate_var_to_complexity(entity var, transformer precond, list effects_list,...
Ppolynome complexity_polynome(complexity comp)
Because complexity is composed of two elements, we use this function to get the first element : polyn...
Definition: comp_math.c:506
complexity make_zero_complexity()
make a zero complexity "0.0000 * TCST" with null statistics
Definition: comp_math.c:238
complexity complexity_var_subst(complexity comp, Variable var, complexity compsubst)
complexity complexity_var_subst(comp, var, compsubst) replaces every occurrence of variable var in co...
Definition: comp_math.c:155
bool complexity_zero_p(complexity comp)
zero complexity check.
Definition: comp_math.c:244
complexity make_single_var_complexity(float f, Variable var)
make a complexity "f * var" with null statistics
Definition: comp_math.c:220
void complexity_rm(complexity *pcomp)
remove complexity comp
Definition: comp_util.c:164
void remove_formal_parameters_from_hash_table(entity mod, hash_table hash_complexity_params)
Definition: comp_util.c:791
void remove_common_variables_from_hash_table(entity module, hash_table hash_complexity_params)
Definition: comp_util.c:985
void good_complexity_assert(_UNUSED_ string function, complexity comp)
Definition: comp_util.c:124
#define INDENT_BACK
Definition: comp_util.c:92
void trace_on(char *fmt,...)
Definition: comp_util.c:684
hash_table free_callees_complexities(hash_table h)
Definition: comp_util.c:812
void complexity_fprint(FILE *fd, complexity comp, bool print_stats_p, bool print_local_names_p)
Definition: comp_util.c:217
void fprint_statement_complexity(entity module, statement stat, hash_table hash_statement_to_complexity)
Definition: comp_util.c:253
void prv(Pvecteur pv)
Definition: comp_util.c:246
void load_cost_file(FILE *fd, float file_factor)
Load (some) intrinsics costs from file "fd", multiplying them by "file_factor".
Definition: comp_util.c:557
bool is_must_be_written_var(list effects_list, char *var_name)
Definition: comp_util.c:1014
void add_common_variables_to_hash_table(entity module, hash_table hash_complexity_params)
Definition: comp_util.c:946
void complexity_check_and_warn(char *s, complexity comp) const
Definition: comp_util.c:108
bool complexity_check(complexity comp)
return true if allright
Definition: comp_util.c:96
float constant_entity_to_float(entity e)
Return if possible the value of e in a float.
Definition: comp_util.c:664
#define INDENT_VLINE
Definition: comp_util.c:91
list entity_list_reverse(list l)
Definition: comp_util.c:757
int complexity_degree(complexity c)
Definition: comp_util.c:1167
hash_table fetch_complexity_parameters(char *module_name)
Definition: comp_util.c:901
void trace_off()
"trace off"
Definition: comp_util.c:714
bool is_linear_unstructured(unstructured unstr)
return true if unstr is simply a linear string of controls
Definition: comp_util.c:738
void add_formal_parameters_to_hash_table(entity mod, hash_table hash_complexity_params)
Definition: comp_util.c:768
static int call_level
"trace on"
Definition: comp_util.c:683
void fprint_cost_table(FILE *fd)
Definition: comp_util.c:481
intrinsic_cost_record intrinsic_cost_table[]
The table intrinsic_cost_table[] gathers cost information of each intrinsic's cost; those costs are d...
Definition: comp_util.c:286
hash_table fetch_callees_complexities(char *module_name)
Definition: comp_util.c:821
int intrinsic_cost(char *s, basic *pargsbasic) const
Return the cost of the intrinsic named s, knowing that the "basic" type of its biggest argument is *p...
Definition: comp_util.c:617
void prc(complexity comp)
Definition: comp_util.c:233
#define INDENT_INTERVAL
Definition: comp_util.c:93
complexity translate_complexity_from_local_to_current_name(complexity callee_comp, string oldname, string newname)
translate_complexity_from_local_to_current_name(callee_comp,oldname,newname) B:M -> A:M if A calls B ...
Definition: comp_util.c:1100
void complexity_dump(complexity comp)
Definition: comp_util.c:228
complexity complexity_dup(complexity comp)
duplicates complexity comp
Definition: comp_util.c:131
char * complexity_sprint(complexity comp, bool print_stats_p, bool print_local_names_p)
Definition: comp_util.c:175
#define INDENT_BLANKS
comp_util.c
Definition: comp_util.c:90
void init_cost_table()
Completes the intrinsic cost table with the costs read from the files specified in the "COMPLEXITY_CO...
Definition: comp_util.c:519
bool complexity_is_monomial_p(complexity c)
Definition: comp_util.c:1159
complexity final_statement_to_complexity_evaluation(complexity comp, transformer precond, list effects_list)
Definition: comp_util.c:1052
void prp(Ppolynome pp)
Definition: comp_util.c:239
#define COST_DATA
defined complexity data file names here.
#define INT_NBYTES
#define STRING_INTRINSICS_COST
#define ZERO_BYTE
#define LOGICAL_INTRINSICS_COST
#define FLOAT_NBYTES
#define CALL_TWO_OVERHEAD
#define CALL_FIVE_OVERHEAD
#define LOOP_BRANCH_OVERHEAD
#define PRINT_LOCAL_NAMES
#define TYPE_CAST_COST
TYPE_CAST_COST added to handle cast case ; Molka Becher
#define FOUR_INDEX_NAME
#define HASH_COMMON_VARIABLE
#define ONE_INDEX_NAME
#define EMPTY_COST
#define MEMORY_READ_NAME
the above two lines are added for 6th cost file, overhead.
#define DOUBLE_NBYTES
#define HASH_USER_VARIABLE
#define CALL_ZERO_OVERHEAD
#define SIX_INDEX_NAME
#define LOOP_INIT_OVERHEAD
#define CALL_THREE_OVERHEAD
#define FIVE_INDEX_NAME
#define SEVEN_INDEX_NAME
#define THREE_INDEX_NAME
#define CONDITION_OVERHEAD
#define COMPLEXITY_UNDEFINED_P(c)
#define TWO_INDEX_NAME
#define HASH_FORMAL_PARAM
#define COMPLEX_NBYTES
#define CALL_ONE_OVERHEAD
#define CALL_SIX_OVERHEAD
#define DO_PRINT_STATS
defines for "complexity_fprint" calls
#define CALL_SEVEN_OVERHEAD
#define CALL_FOUR_OVERHEAD
char * variable_local_name(Variable)
Definition: polynome_ri.c:95
Variable name_to_variable(char *)
Definition: polynome_ri.c:172
int is_inferior_pvarval(Pvecteur *, Pvecteur *)
Definition: polynome_ri.c:149
#define ifcount_computed(x)
#define complexity_eval(x)
Definition: complexity_ri.h:92
#define rangecount_unknown(x)
#define varcount_guessed(x)
#define complexity_ifcount(x)
Definition: complexity_ri.h:98
#define ifcount_profiled(x)
#define complexity_varcount(x)
Definition: complexity_ri.h:94
#define complexity_rangecount(x)
Definition: complexity_ri.h:96
struct _newgen_struct_complexity_ * complexity
Definition: complexity_ri.h:30
#define rangecount_guessed(x)
#define varcount_symbolic(x)
#define varcount_unknown(x)
#define varcount_bounded(x)
#define rangecount_profiled(x)
#define ifcount_halfhalf(x)
#define rangecount_bounded(x)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
list effects_to_list(effects)
Definition: effects.c:209
#define approximation_exact_p(x)
Definition: effects.h:369
#define effect_action(x)
Definition: effects.h:642
#define effect_undefined
Definition: effects.h:614
#define action_write_p(x)
Definition: effects.h:314
#define action_read_p(x)
Definition: effects.h:311
#define effect_approximation(x)
Definition: effects.h:644
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
char * get_string_property(const char *)
FILE * fopen_config(const char *canonical_name, const char *cproperty, const char *cenv)
Definition: file.c:952
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define STRING(x)
Definition: genC.h:87
#define chunk_undefined
obsolete
Definition: genC.h:79
void * malloc(YYSIZE_T)
void free(void *)
#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
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
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
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
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
void hash_warn_on_redefinition(void)
these function set the variable should_i_warn_on_redefinition to the value true or false
Definition: hash.c:183
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
void * hash_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:439
void hash_table_clear(hash_table htp)
Clears all entries of a hash table HTP.
Definition: hash.c:305
void vect_fprint_as_monome(FILE *f, Pvecteur v, Pbase b, get_variable_name_t variable_name, char *mult_symbol)
void vect_fprint_as_monome(FILE * f, Pvecteur v, Pbase b, char * (*variable_name)(),...
Definition: io.c:201
#define _UNUSED_
Definition: misc-local.h:232
#define asprintf
Definition: misc-local.h:225
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_internal_error
Definition: misc-local.h:149
#define exit(code)
Definition: misc-local.h:54
#define user_warning(fn,...)
Definition: misc-local.h:262
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
#define LIST_DIRECTED_FORMAT_NAME
Definition: naming-local.h:97
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
@ hash_pointer
Definition: newgen_hash.h:32
#define hash_table_undefined
Value of an undefined hash_table.
Definition: newgen_hash.h:49
#define same_string_p(s1, s2)
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
static char * module
Definition: pips.c:74
Ppolynome polynome_dup(Ppolynome pp)
Ppolynome polynome_dup(Ppolynome pp) creates and returns a copy of pp.
Definition: pnome-alloc.c:211
bool polynome_check(Ppolynome pp)
bool polynome_check(Ppolynome pp) Return true if all's right.
Definition: pnome-error.c:131
int default_is_inferior_pvarval(Pvecteur *pvarval1, Pvecteur *pvarval2)
bool default_is_inferior_pvarval(Pvecteur * pvarval1, Pvecteur * pvarval2) return true if var1 is bef...
Definition: pnome-io.c:286
void polynome_fprint(FILE *fd, Ppolynome pp, char *(*variable_name)(Variable), int *is_inferior_var)
void polynome_fprint(FILE* fd, Ppolynome pp, char* (*variable_name)(), bool (*is_inferior_var)()) Out...
Definition: pnome-io.c:173
char * polynome_sprint(Ppolynome pp, char *(*variable_name)(Variable), int *is_inferior_var)
char polynome_sprint(Ppolynome pp, char (*variable_name)(), bool (*is_inferior_var)()) Outputs to fil...
Definition: pnome-io.c:197
Pbase polynome_used_var(Ppolynome pp, int *is_inferior_var)
Pbase polynome_used_var(Ppolynome pp, bool *is_inferior_var()) PRIVATE Returns, in a Pbase,...
Definition: pnome-reduc.c:204
int polynome_max_degree(Ppolynome pp)
int polynome_max_degree(Ppolynome pp) returns the degree of polynomial pp Let's hope there aren't too...
Definition: pnome-reduc.c:113
#define is_single_monome(pp)
#define print_effects(e)
Definition: print.c:334
text Text_Statement(entity, int, statement)
#define UNBOUNDED_DIMENSION_NAME
Definition: ri-util-local.h:74
#define BITWISE_OR_OPERATOR_NAME
#define NINT_CONVERSION_NAME
#define ATAN2_OPERATOR_NAME
#define MAX_OPERATOR_NAME
#define POWER_OPERATOR_NAME
#define LLE_OPERATOR_NAME
#define CABS_OPERATOR_NAME
#define POST_DECREMENT_OPERATOR_NAME
Definition: ri-util-local.h:98
#define CEXP_OPERATOR_NAME
#define IDNINT_CONVERSION_NAME
#define FLOAT_GENERIC_CONVERSION_NAME
#define BITWISE_XOR_OPERATOR_NAME
#define TANH_OPERATOR_NAME
#define COS_OPERATOR_NAME
#define DSIGN_OPERATOR_NAME
#define DOUBLE_MODULO_OPERATOR_NAME
#define READ_FUNCTION_NAME
#define C_AND_OPERATOR_NAME
#define GREATER_THAN_OPERATOR_NAME
#define ENDFILE_FUNCTION_NAME
#define SIGN_OPERATOR_NAME
#define DMIN1_OPERATOR_NAME
#define BITWISE_OR_UPDATE_OPERATOR_NAME
#define ABS_OPERATOR_NAME
#define DBLE_GENERIC_CONVERSION_NAME
#define DACOS_OPERATOR_NAME
#define COSH_OPERATOR_NAME
#define BUFFERIN_FUNCTION_NAME
#define DSQRT_OPERATOR_NAME
#define C_MODULO_OPERATOR_NAME
#define MINUS_OPERATOR_NAME
#define IDIM_OPERATOR_NAME
#define AINT_CONVERSION_NAME
#define LESS_THAN_OPERATOR_NAME
#define DNINT_CONVERSION_NAME
#define CLOG_OPERATOR_NAME
#define DINT_CONVERSION_NAME
#define IABS_OPERATOR_NAME
#define EQUIV_OPERATOR_NAME
#define DIVIDE_UPDATE_OPERATOR_NAME
#define MODULO_UPDATE_OPERATOR_NAME
#define POINT_TO_OPERATOR_NAME
Definition: ri-util-local.h:92
#define PLUS_OPERATOR_NAME
#define LOG10_OPERATOR_NAME
#define LENGTH_OPERATOR_NAME
#define DCOSH_OPERATOR_NAME
#define DIM_OPERATOR_NAME
#define SIN_OPERATOR_NAME
#define EQUAL_OPERATOR_NAME
#define DLOG10_OPERATOR_NAME
#define MAX0_OPERATOR_NAME
#define AMIN0_OPERATOR_NAME
#define RETURN_FUNCTION_NAME
#define DEREFERENCING_OPERATOR_NAME
Definition: ri-util-local.h:93
#define MIN0_OPERATOR_NAME
#define MAX1_OPERATOR_NAME
#define FIELD_OPERATOR_NAME
Definition: ri-util-local.h:91
#define NON_EQUIV_OPERATOR_NAME
#define C_NON_EQUAL_OPERATOR_NAME
#define LEFT_SHIFT_UPDATE_OPERATOR_NAME
#define IMS_OPERATOR_NAME
#define REAL_MODULO_OPERATOR_NAME
#define CONJG_OPERATOR_NAME
#define AMAX0_OPERATOR_NAME
#define REWIND_FUNCTION_NAME
#define DMAX1_OPERATOR_NAME
#define IFIX_GENERIC_CONVERSION_NAME
#define ACOS_OPERATOR_NAME
#define MULTIPLY_UPDATE_OPERATOR_NAME
#define OPEN_FUNCTION_NAME
#define END_FUNCTION_NAME
#define IMPLIED_DO_NAME
Definition: ri-util-local.h:75
#define LEFT_SHIFT_OPERATOR_NAME
#define CONDITIONAL_OPERATOR_NAME
#define ALOG10_OPERATOR_NAME
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define LLT_OPERATOR_NAME
#define C_RETURN_FUNCTION_NAME
#define BUFFEROUT_FUNCTION_NAME
#define CCOS_OPERATOR_NAME
#define DPROD_OPERATOR_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define MINUS_UPDATE_OPERATOR_NAME
#define ANINT_CONVERSION_NAME
#define C_NOT_OPERATOR_NAME
#define INT_TO_CHAR_CONVERSION_NAME
#define CONTINUE_FUNCTION_NAME
#define ADDRESS_OF_OPERATOR_NAME
#define CMPLX_GENERIC_CONVERSION_NAME
#define PRE_DECREMENT_OPERATOR_NAME
#define CHAR_TO_INT_CONVERSION_NAME
#define SQRT_OPERATOR_NAME
#define ATAN_OPERATOR_NAME
#define ISIGN_OPERATOR_NAME
#define INT_GENERIC_CONVERSION_NAME
generic conversion names.
#define LGE_OPERATOR_NAME
#define DIVIDE_OPERATOR_NAME
#define WRITE_FUNCTION_NAME
#define DABS_OPERATOR_NAME
#define CLOSE_FUNCTION_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define AMIN1_OPERATOR_NAME
#define DCOS_OPERATOR_NAME
#define BITWISE_XOR_UPDATE_OPERATOR_NAME
#define CONCATENATION_FUNCTION_NAME
#define EXP_OPERATOR_NAME
#define IMA_OPERATOR_NAME
Integer Multiply Add and Sub, FC 27/10/2005 for FI.
#define LOG_OPERATOR_NAME
#define RIGHT_SHIFT_UPDATE_OPERATOR_NAME
#define DSIN_OPERATOR_NAME
#define CSQRT_OPERATOR_NAME
#define BITWISE_NOT_OPERATOR_NAME
#define GREATER_OR_EQUAL_OPERATOR_NAME
#define TAN_OPERATOR_NAME
#define STOP_FUNCTION_NAME
#define PRE_INCREMENT_OPERATOR_NAME
Definition: ri-util-local.h:99
#define POST_INCREMENT_OPERATOR_NAME
Definition: ri-util-local.h:97
#define DSINH_OPERATOR_NAME
#define AIMAG_CONVERSION_NAME
#define PLUS_UPDATE_OPERATOR_NAME
#define INDEX_OPERATOR_NAME
#define FORMAT_FUNCTION_NAME
#define DATAN2_OPERATOR_NAME
#define DDIM_OPERATOR_NAME
#define SINH_OPERATOR_NAME
#define REAL_GENERIC_CONVERSION_NAME
#define ENDDO_FUNCTION_NAME
#define MULTIPLY_OPERATOR_NAME
#define DEXP_OPERATOR_NAME
#define BITWISE_AND_UPDATE_OPERATOR_NAME
#define DLOG_OPERATOR_NAME
#define LESS_OR_EQUAL_OPERATOR_NAME
#define BITWISE_AND_OPERATOR_NAME
#define CSIN_OPERATOR_NAME
#define SNGL_GENERIC_CONVERSION_NAME
#define DTANH_OPERATOR_NAME
#define RIGHT_SHIFT_OPERATOR_NAME
#define ASIN_OPERATOR_NAME
#define AMAX1_OPERATOR_NAME
#define DASIN_OPERATOR_NAME
#define IDINT_GENERIC_CONVERSION_NAME
#define NOT_OPERATOR_NAME
#define LGT_OPERATOR_NAME
#define MIN1_OPERATOR_NAME
#define OR_OPERATOR_NAME
#define NON_EQUAL_OPERATOR_NAME
#define DATAN_OPERATOR_NAME
#define DTAN_OPERATOR_NAME
#define ASSIGN_OPERATOR_NAME
Definition: ri-util-local.h:95
#define MODULO_OPERATOR_NAME
#define ALOG_OPERATOR_NAME
#define MIN_OPERATOR_NAME
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
bool entity_module_p(entity e)
Definition: entity.c:683
basic simple_basic_dup(basic)
Definition: type.c:2735
bool is_inferior_basic(basic, basic)
bool is_inferior_basic(basic1, basic2) return true if basic1 is less complex than basic2 ex: int is l...
Definition: type.c:2687
#define type_functional_p(x)
Definition: ri.h:2950
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_overloaded
Definition: ri.h:574
@ is_basic_int
Definition: ri.h:571
@ is_basic_logical
Definition: ri.h:573
@ is_basic_complex
Definition: ri.h:575
#define value_code_p(x)
Definition: ri.h:3065
struct _newgen_struct_callees_ * callees
Definition: ri.h:55
#define storage_formal_p(x)
Definition: ri.h:2522
#define basic_int_p(x)
Definition: ri.h:614
#define callees_callees(x)
Definition: ri.h:675
#define reference_variable(x)
Definition: ri.h:2326
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define basic_tag(x)
Definition: ri.h:613
#define entity_storage(x)
Definition: ri.h:2794
#define code_declarations(x)
Definition: ri.h:784
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
#define entity_undefined
Definition: ri.h:2761
#define type_void_p(x)
Definition: ri.h:2959
#define entity_name(x)
Definition: ri.h:2790
#define value_code(x)
Definition: ri.h:3067
#define control_successors(x)
Definition: ri.h:945
#define basic_float(x)
Definition: ri.h:619
#define unstructured_exit(x)
Definition: ri.h:3006
#define basic_complex(x)
Definition: ri.h:628
#define entity_type(x)
Definition: ri.h:2792
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define basic_float_p(x)
Definition: ri.h:617
#define entity_initial(x)
Definition: ri.h:2796
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
char * variable_name(Variable v)
polynome_ri.c
Definition: polynome_ri.c:73
static int line
FLEX_SCANNER.
Definition: scanner.c:852
#define ifdebug(n)
Definition: sg.c:47
static size_t current
Definition: string.c:115
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
Definition: strndup.c:26
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
Intrinsics costs defines.
Definition: replace.c:135
void print_text(FILE *fd, text t)
Definition: print.c:195
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_NUL_P(v)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define BASE_UNDEFINED
#define term_cst(varval)
#define base_dimension(b)
#define BASE_NULLE
MACROS SUR LES BASES.
#define BASE_NULLE_P(b)
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