PIPS
SDG.c
Go to the documentation of this file.
1 #ifdef HAVE_CONFIG_H
2  #include "pips_config.h"
3 #endif
4 
5 
6 #include <stdio.h>
7 #include <ctype.h>
8 #include <string.h>
9 #include "boolean.h"
10 #include <stdbool.h>
11 
12 #include "genC.h"
13 #include "linear.h"
14 #include "ri.h"
15 #include "effects.h"
16 #include "database.h"
17 #include "misc.h"
18 #include "text.h"
19 #include "text-util.h"
20 #include "ri-util.h"
21 #include "prettyprint.h"
22 #include "effects-util.h"
23 #include "accel-util.h"
24 
25 #include "effects-generic.h"
26 #include "effects-simple.h"
27 
28 #include "pipsdbm.h"
29 #include "resources.h"
30 #include "control.h"
31 #include "conversion.h"
32 #include "properties.h"
33 #include "semantics.h"
34 #include "transformations.h"
35 
36 #include "effects-convex.h"
37 #include "genC.h"
38 
39 #include "complexity_ri.h"
40 
41 
42 #include "dg.h"
43 
44 /* Instantiation of the dependence graph: */
47 #include "graph.h"
48 #include "ricedg.h"
49 #include "chains.h"
50 #include "semantics.h"
51 #include "task_parallelization.h"
52 
54 static graph sdg;
55 
56 /* parameters of BDSC, to be recovered using pips properties */
60 
61 /* Global variables */
64 
65 
66 static
68 {
70 }
71 
72 static
74 {
75  set tmp = set_make(set_pointer);
77  return tmp;
78 }
79 
80 
81 struct cpv {
82  entity e;
83  bool rm;
84 };
85 
86 
87 static
89 {
91  if(set_belong_p(s,p->e)){
92  p->rm=true;
94  }
95  set_free(s);
96 }
97 static
99 {
100  return !has_entity_with_same_name(p->e,loop_locals(l));
101 }
102 
103 
105 {
106  set s = get_private_entities(stat);
107  list l =NIL;
108  SET_FOREACH(entity,e,s) {
109  struct cpv p = { .e=e, .rm=false };
113  0);
114  if(!p.rm)
115  l=CONS(ENTITY,e,l);
116  }
117  set_free(s);
118 
119  return l;
120 }
121 
122 
124 {
126 }
127 
128 
129 /* *************SDG: Sequence Dependence Graph ***************************/
130 
132 {
133  MAP(VERTEX, v, {
135  if (statement_equal_p(s, sv))
136  return v;
137  }, graph_vertices(g));
138  return vertex_undefined;
139 }
140 
142 {
144  switch(instruction_tag(inst))
145  {
146  case is_instruction_block :
147  {
148  MAPL( stmt_ptr,
149  {
150  statement local_stmt = STATEMENT(CAR( stmt_ptr ));
151  children_s = CONS( STATEMENT, local_stmt, children_s);
152  children_s = enclosed_statements_ast(local_stmt,children_s);
153  },
154  instruction_block( inst ) );
155  break;
156  }
157  case is_instruction_test :
158  {
159  test t = instruction_test(inst);
160  children_s = CONS( STATEMENT, test_true(t), children_s);
161  children_s = CONS( STATEMENT, test_false(t), children_s);
162  children_s = enclosed_statements_ast(test_true(t),children_s);
163  children_s = enclosed_statements_ast(test_false(t),children_s);
164  break;
165  }
166  case is_instruction_loop :
167  {
168  loop l = statement_loop(stmt);
169  statement body = loop_body(l);
170  children_s = CONS( STATEMENT, body, children_s);
171  children_s = enclosed_statements_ast(body,children_s);
172  break;
173  }
175  {
177  statement body = forloop_body(l);
178  children_s = CONS( STATEMENT, body, children_s);
179  children_s = enclosed_statements_ast(body,children_s);
180  break;
181  }
183  {
185  statement body = whileloop_body(l);
186  children_s = CONS( STATEMENT, body, children_s);
187  children_s = enclosed_statements_ast(body,children_s);
188  break;
189  }
190  case is_instruction_call:
191  //children_s = CONS( STATEMENT, stmt, children_s);
192  break;
193  default:
194  break;
195  }
196  return children_s;
197 }
198 
199 static bool same_level_p(statement s1, statement s2, bool found_p)
200 {
201 
202  if(statement_equal_p(s1, s2))
203  return true;
204  else {
206  switch(instruction_tag(inst)){
207  case is_instruction_block :{
208  MAPL( stmt_ptr,
209  {
210  statement local_stmt = STATEMENT(CAR( stmt_ptr ));
211  found_p = found_p || same_level_p(s1, local_stmt, found_p);
212  },
213  instruction_block(inst));
214  break;
215  }
216  case is_instruction_test :{
217  test t = instruction_test(inst);
218  found_p = found_p || same_level_p(s1, test_true(t), found_p);
219  return found_p || same_level_p(s1, test_false(t), found_p);
220  break;
221  }
222  case is_instruction_loop :{
223  loop l = statement_loop(s2);
224  statement body = loop_body(l);
225  return found_p || same_level_p(s1, body, found_p);
226  break;
227  }
228  case is_instruction_forloop :{
229  forloop l = statement_forloop(s2);
230  statement body = forloop_body(l);
231  return found_p || same_level_p(s1, body, found_p);
232  break;
233  }
236  statement body = whileloop_body(l);
237  return found_p || same_level_p(s1, body, found_p);
238  break;
239  }
240  default:
241  break;
242  }
243  }
244  return found_p;
245 }
247 {
248  statement enclosing_st = statement_undefined;
249  bool found_p;
250  list stmts = sequence_statements(seq);
251  FOREACH(STATEMENT, st, stmts){
252  found_p = same_level_p(child, st, false);
253  if(found_p){
254  enclosing_st = st;
255  return st;
256  }
257  }
258  return enclosing_st;
259 }
260 
261 /* for precision in dependences in arrays, we use array regions in this function*/
262 
264 {
265  bool dependence_b = false;
267  list private_ents1 = NIL, private_ents2 = NIL;
268  if(statement_loop_p(s1))
269  private_ents1 = loop_locals(statement_loop(s1));
270  private_ents1= gen_nconc(private_ents1,private_variables(s1));
271  if(statement_loop_p(s2))
272  private_ents2 = loop_locals(statement_loop(s2));
273  private_ents2= gen_nconc(private_ents2, private_variables(s2));
274  FOREACH(ENTITY,e,private_ents1){
275  FOREACH(REGION,reg,l_write_1){
276  if (same_entity_p(region_entity(reg),e))
277  gen_remove(&l_write_1, reg);
278  }
279  }
281  FOREACH(ENTITY,e,private_ents2){
282  FOREACH(REGION,reg,l_write_2){
283  if (same_entity_p(region_entity(reg),e))
284  gen_remove(&l_write_2, reg);
285  }
286  }
287  l_write_2 = convex_regions_transformer_compose(l_write_2, p_transformer);
289  FOREACH(ENTITY,e,private_ents2){
290  FOREACH(REGION,reg,l_read_2) {
291  if (same_entity_p(region_entity(reg),e))
292  gen_remove(&l_read_2, reg);
293  }
294  }
297  FOREACH(ENTITY,e,private_ents1){
298  FOREACH(REGION,reg,l_read_1){
299  if (same_entity_p(region_entity(reg),e))
300  gen_remove(&l_read_1, reg);
301  }
302  }
303  list dependence_rw = RegionsIntersection(regions_dup(l_read_1), regions_dup(l_write_2), r_w_combinable_p);
304  list dependence_wr = RegionsIntersection(regions_dup(l_write_1), regions_dup(l_read_2), w_r_combinable_p);
305  list dependence_ww = RegionsIntersection(regions_dup(l_write_1), regions_dup(l_write_2), w_w_combinable_p);
306  if(gen_length(dependence_rw)==0)
307  {
308  if(gen_length(dependence_wr)==0)
309  {
310  if(gen_length(dependence_ww)>0)
311  dependence_b=true;
312  }
313  else
314  dependence_b=true;
315  }
316  else
317  dependence_b = true;
318  return dependence_b;
319 }
320 
322 {
325  list stmts = sequence_statements(seq);
326  path pbegin;
327  path pend;
328  FOREACH(STATEMENT, st_g, stmts) {
329  {
330  list children_s = CONS(STATEMENT, st_g, NIL);
331  list ls = NIL;
332  children_s = enclosed_statements_ast(st_g,children_s);
333  vertex pre_g = statement_to_vertex(st_g, sdg);
334  FOREACH(STATEMENT, st, children_s){
335  vertex pre = statement_to_vertex(st, sdg);
336  FOREACH(SUCCESSOR, su, (vertex_successors(pre))) {
337  vertex s = successor_vertex(su);
338  statement child = vertex_to_statement(s);
339  statement enclosing_stmt = statement_undefined;
340  enclosing_stmt = in_same_sequence(child, seq);
341  if(statement_undefined_p(enclosing_stmt))
342  enclosing_stmt = in_same_sequence(st, seq);
343 
345  path_initialize(stmt, st,child, &pbegin, &pend);
346  //p_transformer = compute_path_transformer(stmt, pbegin, pend);
347  /*update the sdg for st(parent) using enclosing_stmt instead of
348  *the enclosed one child*/
349  if(!statement_equal_p(st_g, enclosing_stmt) && test_dependence_using_regions(st_g,enclosing_stmt)){
350  if(statement_ordering(st_g)<statement_ordering(enclosing_stmt)){
351  vertex new_v = statement_to_vertex(enclosing_stmt, sdg);
352  successor_vertex(su) = new_v;
353  if(gen_occurences(su, ls) == 0)
354  ls = CONS(SUCCESSOR, su, ls);
355  }
356  }
357  }
358  }
359  vertex_successors(pre_g) = ls;
360  }
361  }
362  }
363  return true;
364 }
365 
366 static bool statement_in_sequence_p(statement s, statement stmt, bool found_p)
367 {
369  switch(instruction_tag(inst))
370  {
371  case is_instruction_block :
372  {
373  MAPL( stmt_ptr,
374  {
375  statement local_stmt = STATEMENT(CAR( stmt_ptr ));
376  if(statement_equal_p(s, local_stmt))
377  return true;
378  else
379  found_p = found_p || statement_in_sequence_p(s, local_stmt, found_p);
380  },
381  instruction_block( inst ) );
382  break;
383  }
384  case is_instruction_test :
385  {
386  test t = instruction_test(inst);
387  found_p = found_p || statement_in_sequence_p(s, test_true(t), found_p);
388  return found_p || statement_in_sequence_p(s, test_false(t), found_p);
389  break;
390  }
391  case is_instruction_loop :
392  {
393  loop l = statement_loop(stmt);
394  statement body = loop_body(l);
395  return found_p || statement_in_sequence_p(s, body, found_p);
396  break;
397  }
399  {
401  statement body = forloop_body(l);
402  return found_p || statement_in_sequence_p(s, body, found_p);
403  break;
404  }
406  {
408  statement body = whileloop_body(l);
409  return found_p || statement_in_sequence_p(s, body, found_p);
410  break;
411  }
412  default:
413  break;
414  }
415  return found_p;
416 }
417 
418 
419 /* Second step to form a clustered DG (SDG), delete dependences between statement s1 and another statement S2
420  if s1 is not in a sequence and redondont dependences*/
421 static graph clean_sdg(statement module_stmt, graph tg)
422 {
423  list vertices = graph_vertices(tg);
424  statement s;
425  FOREACH(VERTEX, pre, vertices)
426  {
427  s = vertex_to_statement(pre);
428  bool found_p = statement_in_sequence_p(s, module_stmt, false);
429  if(!found_p)
430  {
432  vertex_successors(pre) = NIL;
433  }
434  else{
435  int count;
436  list ls = NIL, lv = NIL;
437  FOREACH(SUCCESSOR, su, (vertex_successors(pre))) {
438  vertex ssu = successor_vertex(su);
439  statement child = vertex_to_statement(ssu);
440  count = gen_occurences(child, ls);
441  if(count == 0 && statement_ordering(s)<statement_ordering(child))
442  {
443  ls = CONS(STATEMENT, child,ls);
444  if(gen_occurences(su, lv) == 0)
445  lv = CONS(SUCCESSOR,su,lv);
446  }
447  }
448  vertex_successors(pre) = lv;
449  }
450  }
451  return tg;
452 }
453 
454 
456 {
458  return clean_sdg(module_stmt, sdg);
459 }
460 
461 
462 
463 
464 
465 
466 /** \def dot_print_label_string( fd, str )
467  print the string str in file descriptor fd, removing all \n
468  */
469 #define dot_print_label_string( ftg, str ) \
470  fprintf(ftg," [fontsize=24,fontcolor=black, label=\""); \
471  while ( *str ) { \
472  char c = *str++; \
473  if ( c == '"' ) { /* some char must be escaped */ \
474  (void) putc( '\\', ftg); \
475  } \
476  (void) putc( c, ftg); \
477  }\
478  fprintf(ftg," \"]; \n");
479 
480 
481 static string prettyprint_dot_label(statement s, string label1 ) {
482  string label2="";
483  // saving comments
484  string i_comments = statement_comments(s);
485  // remove them
487  // Get the text without comments
488  text txt = Text_Statement(entity_undefined, 0, s);
489  // Restoring comments
490  statement_comments(s) = i_comments;
491  label2 = strdup (concatenate (label1, text_to_string(txt),"\\n", NULL));
492  free_text(txt);
493  return label2;
494  }
495 
496 /*
497  *return a dot graph for SDG, print only nodes that have at least one
498  *successor
499  */
501  string ver = "";
502  ver = prettyprint_dot_label(stmt,ver);
503  fprintf( ftg,"%d",(int)statement_ordering(stmt) );
504  if(strlen(ver)>1000)
505  ver = "too large statement label with ordering \\n";
508  if(an->cluster != -1)
509  {
510  ver = strdup (concatenate (ver, "cluster = ", NULL));ver = strdup (concatenate (ver, i2a(an->cluster),"\\n", NULL));
511  ver = strdup (concatenate (ver, "order = ", NULL)); ver = strdup (concatenate (ver, i2a(an->order_sched),"\\n", NULL));
512  ver = strdup (concatenate (ver, "time = ", NULL)); ver = strdup (concatenate (ver, i2a(an->task_time),"\\n", NULL));
513  }
514  }
515  dot_print_label_string( ftg, ver);
516  return;
517 }
518 
519 static int count = 0;
522  switch(instruction_tag(inst))
523  {
524  case is_instruction_block :
525  {
527  list stmts = sequence_statements(seq);
528  fprintf( ftg, "subgraph cluster%d { color = blue; \n ",count );
529  FOREACH(STATEMENT, s, stmts) {
530  list vertices = graph_vertices(tg);
531  annotation *anp = NULL;
532  FOREACH(VERTEX, pre, vertices) {
533  statement parent = vertex_to_statement(pre);
534  if(statement_equal_p(parent, s)){
536  anp = gen_array_item(annotations, (int)statement_ordering(parent));
537  print_sdg_task(ftg, annotations, parent);
538  FOREACH(SUCCESSOR, su, (vertex_successors(pre))) {
539  vertex s = successor_vertex(su);
540  statement child = vertex_to_statement(s);
541  print_sdg_task(ftg, annotations, child);
544  if(an->cluster!=-1)
545  {//FFT
546  double edge_c = (intptr_t)(gen_array_item(anp->edge_cost,statement_ordering(child)));
547  fprintf( ftg,"%d -> %d [style=filled,color=blue,fontsize=16,label=\"%ld\",color=black];\n", (int)statement_ordering(parent),(int)statement_ordering(child),(long)(edge_c));
548  }
549  }
550  else
551  fprintf( ftg,"%d -> %d [style=filled,color=blue,fontsize=16,color=black];\n", (int)statement_ordering(parent),(int)statement_ordering(child));
552  }
553  }
554  }
555  }
556  fprintf( ftg, "} \n " );
557  count ++;
558  stmts = sequence_statements(seq);
559  FOREACH(STATEMENT, s, stmts)
560  print_SDGs(s,tg, ftg, annotations);
561  break;
562  }
563  case is_instruction_test:
564  {
565  test t = instruction_test(inst);
566  print_SDGs(test_true(t),tg, ftg, annotations);
567  print_SDGs(test_false(t),tg, ftg, annotations);
568  break;
569  }
570  case is_instruction_loop :
571  {
572  loop l = statement_loop(stmt);
573  print_SDGs(loop_body(l),tg, ftg, annotations);
574  break;
575  }
577  {
579  print_SDGs(forloop_body(l),tg, ftg, annotations);
580  break;
581  }
583  {
586  break;
587  }
588  default:
589  break;
590  }
591  return;
592 }
594 {
595  //entity module;
596  statement module_stat;
597  string tg_name = NULL;
598  FILE *ftg;
599  //module = local_name_to_top_level_entity(module_name);
600  module_stat = (statement)db_get_memory_resource(DBR_CODE, module_name, true);
601  set_ordering_to_statement(module_stat);
603  set_current_module_statement(module_stat);
606  db_get_memory_resource(DBR_TRANSFORMERS, module_name, true));
607  /* The proper effect to detect the I/O operations: */
612  db_get_memory_resource(DBR_REGIONS, module_name, true));
617 
618  ddg = (graph) db_get_memory_resource (DBR_DG, module_name, true );
619  /*ddg contains the original dependences before clustering and scheduling, it
620  is saved to not make a side effect on the original dg when
621  constructing the SDG*/
622  sdg = copy_graph(ddg);
623  sdg = partitioning_sdg(module_stat);
625  "/",module_name,"/",module_name, "_sdg.dot", NULL));
626  ftg = safe_fopen(tg_name, "w");
627  fprintf( ftg, "digraph {\n compound=true;ratio=fill; node[fontsize=24,fontname=\"Courier\",labelloc=\"t\"];nodesep=.05;\n" );
628  print_SDGs(module_stat, sdg, ftg, gen_array_make(0));
629  fprintf( ftg, "\n}\n" );
630  safe_fclose(ftg, tg_name);
631  free(tg_name);
632 
634  DB_PUT_MEMORY_RESOURCE(DBR_SDG, module_name, (char*) sdg);
635 
647  return true;
648 }
649 
graph ddg
Definition: HBDSC.c:52
graph copy_graph(graph p)
GRAPH.
Definition: graph.c:20
void free_text(text p)
Definition: text.c:74
static statement in_same_sequence(statement child, sequence seq)
Definition: SDG.c:246
static transformer p_transformer
Definition: SDG.c:53
static void check_private_variables_call_walker(call c, struct cpv *p)
Definition: SDG.c:88
static bool check_private_variables_loop_walker(loop l, struct cpv *p)
Definition: SDG.c:98
static graph clean_sdg(statement module_stmt, graph tg)
Second step to form a clustered DG (SDG), delete dependences between statement s1 and another stateme...
Definition: SDG.c:421
static set get_private_entities(void *s)
Definition: SDG.c:73
int MEMORY_SIZE
Definition: SDG.c:58
static list enclosed_statements_ast(statement stmt, list children_s)
Definition: SDG.c:141
bool statement_equal_p(statement s1, statement s2)
Definition: SDG.c:123
void print_SDGs(statement stmt, graph tg, FILE *ftg, gen_array_t annotations)
Definition: SDG.c:520
vertex statement_to_vertex(statement s, graph g)
Definition: SDG.c:131
dg_vertex_label vertex_label
Definition: SDG.c:46
static graph sdg
Definition: SDG.c:54
static list private_variables(statement stat)
Definition: SDG.c:104
bool sequence_dependence_graph(char *module_name)
Definition: SDG.c:593
gen_array_t clusters
Definition: SDG.c:63
static bool statement_in_sequence_p(statement s, statement stmt, bool found_p)
Definition: SDG.c:366
string INSTRUMENTED_FILE
Definition: SDG.c:59
int NBCLUSTERS
parameters of BDSC, to be recovered using pips properties
Definition: SDG.c:57
static void print_sdg_task(FILE *ftg, gen_array_t annotations, statement stmt)
return a dot graph for SDG, print only nodes that have at least one successor
Definition: SDG.c:500
dg_arc_label arc_label
Instantiation of the dependence graph:
Definition: SDG.c:45
static bool sequence_dg(statement stmt)
Definition: SDG.c:321
static bool same_level_p(statement s1, statement s2, bool found_p)
Definition: SDG.c:199
static void get_private_entities_walker(loop l, set s)
Definition: SDG.c:67
static int count
Definition: SDG.c:519
graph partitioning_sdg(statement module_stmt)
Definition: SDG.c:455
#define dot_print_label_string(ftg, str)
print the string str in file descriptor fd, removing all
Definition: SDG.c:469
gen_array_t annotations
Global variables.
Definition: SDG.c:62
static bool test_dependence_using_regions(statement s1, statement s2)
for precision in dependences in arrays, we use array regions in this function
Definition: SDG.c:263
static string prettyprint_dot_label(statement s, string label1)
Definition: SDG.c:481
bool has_entity_with_same_name(entity, list)
inlining.c
Definition: inlining.c:256
size_t gen_array_nitems(const gen_array_t a)
Definition: array.c:131
gen_array_t gen_array_make(size_t size)
declarations...
Definition: array.c:40
void * gen_array_item(const gen_array_t a, size_t i)
Definition: array.c:143
transformer transformer_identity()
Allocate an identity transformer.
Definition: basic.c:110
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
#define region_entity(reg)
#define REGION
list RegionsIntersection(list l1, list l2, bool(*intersection_combinable_p)(effect, effect))
list RegionsIntersection(list l1,l2, bool (*intersection_combinable_p)(effect, effect)) input : outpu...
list regions_write_regions(list)
list regions_read_regions(list)
void set_methods_for_convex_effects(void)
methods.c
Definition: methods.c:235
list regions_dup(list)
void init_convex_rw_prettyprint(const char *)
list convex_regions_transformer_compose(list, transformer)
compose.c
void set_rw_effects(statement_effects)
bool w_r_combinable_p(effect, effect)
void reset_out_effects(void)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void set_out_effects(statement_effects)
void set_in_effects(statement_effects)
void reset_in_effects(void)
bool w_w_combinable_p(effect, effect)
void generic_effects_reset_all_methods(void)
bool r_w_combinable_p(effect, effect)
void reset_cumulated_rw_effects(void)
list load_statement_local_regions(statement)
void reset_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
Definition: genC.h:285
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
void free(void *)
#define successor_vertex(x)
Definition: graph.h:118
#define vertex_undefined
Definition: graph.h:128
struct _newgen_struct_graph_ * graph
Definition: graph.h:31
#define vertex_successors(x)
Definition: graph.h:154
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#define graph_vertices(x)
Definition: graph.h:82
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
Definition: genClib.c:3251
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
Definition: genClib.c:3373
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
Definition: genClib.c:2785
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
Definition: list.c:685
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#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 MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
int gen_occurences(const void *vo, const list l)
count occurences of vo in l
Definition: list.c:746
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
Definition: statement.c:1328
loop statement_loop(statement)
Get the loop of a statement.
Definition: statement.c:1374
whileloop statement_whileloop(statement)
Get the whileloop of a statement.
Definition: statement.c:1383
forloop statement_forloop(statement)
Get the forloop of a statement.
Definition: statement.c:1426
bool statement_loop_p(statement)
Definition: statement.c:349
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
Definition: statement.c:335
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
Definition: util.c:45
char * i2a(int)
I2A (Integer TO Ascii) yields a string for a given Integer.
Definition: string.c:121
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
Definition: newgen_set.h:78
void set_free(set)
Definition: set.c:332
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_pointer
Definition: newgen_set.h:44
set set_append_list(set, const list)
add list l items to set s, which is returned.
Definition: set.c:460
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
#define string_undefined
Definition: newgen_types.h:40
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
Definition: ordering.c:172
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
text Text_Statement(entity, int, statement)
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
bool same_entity_p(entity e1, entity e2)
predicates on entities
Definition: entity.c:1321
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
set get_referenced_entities(void *elem)
retrieves the set of entities used in elem beware that this entities may be formal parameters,...
Definition: entity.c:3063
#define loop_body(x)
Definition: ri.h:1644
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define statement_ordering(x)
Definition: ri.h:2454
#define test_false(x)
Definition: ri.h:2837
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
#define entity_undefined
Definition: ri.h:2761
@ is_instruction_whileloop
Definition: ri.h:1472
@ 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 test_true(x)
Definition: ri.h:2835
#define sequence_statements(x)
Definition: ri.h:2360
#define loop_locals(x)
Definition: ri.h:1650
#define whileloop_body(x)
Definition: ri.h:3162
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_comments(x)
Definition: ri.h:2456
#define instruction_test(x)
Definition: ri.h:1517
#define statement_undefined_p(x)
Definition: ri.h:2420
#define statement_number(x)
Definition: ri.h:2452
#define forloop_body(x)
Definition: ri.h:1372
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
Definition: mappings.c:624
void set_transformer_map(statement_mapping)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
void path_initialize(statement, statement, statement, path *, path *)
path_transformer.c
void reset_transformer_map(void)
s1
Definition: set.c:247
#define intptr_t
Definition: stdint.in.h:294
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: outlining.c:162
entity e
Definition: outlining.c:163
bool rm
Definition: outlining.c:164
Definition: statement.c:54
string text_to_string(text t)
SG: moved here from ricedg.
Definition: print.c:239
void free_value_mappings(void)
Normal call to free the mappings.
Definition: value.c:1212