PIPS
adg_graph.c File Reference
#include "local.h"
+ Include dependency graph for adg_graph.c:

Go to the source code of this file.

Macros

#define GRAPH_IS_DFG
 Name : adg_graph.c Package : array_dfg Author : Arnauld LESERVOT Date : 93/06/27 Modified : Documents: Platonoff's thesis and Leservot's thesis "Dataflow Analysis of Array and Scalar References" P. More...
 

Functions

graph adg_pure_dfg (graph in_gr)
 ====================================================================== More...
 
graph adg_pure_dfg2 (graph in_gr)
 ====================================================================== More...
 
void adg_print_graph (FILE *fd, statement mod_stat, graph mod_graph)
 ====================================================================== More...
 
int adg_number_to_ordering (int in_nb)
 ====================================================================== More...
 
vertex adg_number_to_vertex (graph in_dfg, int in_nb)
 ====================================================================== More...
 
statement adg_vertex_to_statement (vertex in_ver)
 ====================================================================== More...
 
int adg_vertex_to_ordering (vertex in_ver)
 ====================================================================== More...
 
bool integer_in_list_p (int i, list l)
 =========================================================================== More...
 
void adg_reorder_statement_number (graph in_dfg)
 ====================================================================== More...
 
vertex adg_same_dfg_vertex_number (list in_l, int in_i)
 ====================================================================== More...
 
void adg_update_dfg (quast in_sou, reference in_ref, vertex in_dest, Ppath in_pa, Psysteme in_context, Psysteme in_test, graph in_gr, list *in_lp)
 ====================================================================== More...
 
list adg_get_exec_domain (static_control stco)
 ====================================================================== More...
 
list adg_same_order_in_dvl (list l, vertex ver)
 ====================================================================== More...
 
graph adg_dup_disjunctive_nodes (graph g, statement_mapping stco_map)
 ====================================================================== More...
 
list adg_write_reference_list (vertex ver, effect reff)
 ====================================================================== More...
 
bool in_effect_list_p (list l, effect eff)
 ====================================================================== More...
 
list read_reference_list (vertex ver, list ent_l1, list ent_l2)
 ====================================================================== More...
 
graph adg_only_call_WR_dependence (graph g)
 ====================================================================== More...
 
static effect effect_dup (effect eff)
 effect effect_dup(effect eff) input : an effect. More...
 
conflict conflict_dup (conflict conf)
 ====================================================================== More...
 
dg_arc_label dg_arc_label_dup (dg_arc_label dg_al)
 ====================================================================== More...
 
dg_vertex_label dg_vertex_label_dup (dg_vertex_label dg_vl)
 ====================================================================== More...
 
vertex dg_vertex_dup (vertex ver)
 ====================================================================== More...
 
list adg_list_same_order_in_dg (list in_l, vertex in_v)
 ====================================================================== More...
 
vertex adg_same_order_in_dg (list l, vertex v)
 ====================================================================== More...
 
graph adg_reverse_graph (graph g)
 ====================================================================== More...
 

Variables

int Gcount_re
 External variables. More...
 
hash_table Gvertex_number_to_statement
 Global variables. More...
 
hash_table Gstco_map
 

Macro Definition Documentation

◆ GRAPH_IS_DFG

#define GRAPH_IS_DFG

Name : adg_graph.c Package : array_dfg Author : Arnauld LESERVOT Date : 93/06/27 Modified : Documents: Platonoff's thesis and Leservot's thesis "Dataflow Analysis of Array and Scalar References" P.

FEAUTRIER Comments :

Definition at line 37 of file adg_graph.c.

Function Documentation

◆ adg_dup_disjunctive_nodes()

graph adg_dup_disjunctive_nodes ( graph  g,
statement_mapping  stco_map 
)

======================================================================

graph adg_dup_disjunctive_nodes( graph g, statement_mapping stco_map) Input : A dependence graph or a partial one. AL 20/07/93 A static_control mapping on each statement. Output: A graph whose nodes controlled by a disjunctive predicate are duplicated. Labels associated to vertex are dfg_vertex_label whose predicate are set to one of the disjunctive part of the englobing tests. Successors arc-labels are initial dg_arc_label PRIVATE to this pass !!

Do the associated vertices successors exist ?

Does vertex associated to ver exist in the new ver_list ?

Build the new successors list

ssociate a duplicated successor list to each new vertex

Definition at line 581 of file adg_graph.c.

584 {
585  list l = NULL, ver_list = NIL;
586 
587  debug(7, "adg_dup_disjunctive_nodes", "begin \n");
588  l = graph_vertices( g );
589  for(; !ENDP( l ); POP(l)) {
590  vertex ver = NULL;
591  list new_ver_l = NULL, succ_list = NULL;
592  list new_succ_list = NIL;
593  int in;
594  dfg_vertex_label dvl = NULL;
595 
596  ver = VERTEX(CAR( l ));
598  succ_list = vertex_successors( ver );
599 
600  /* Do the associated vertices successors exist ? */
601  for(; !ENDP(succ_list); POP( succ_list )) {
602  successor succ = SUCCESSOR(CAR( succ_list ));
603  vertex v = successor_vertex( succ );
604  list prl = NIL;
605  static_control stco = NULL;
606  statement st = NULL;
607  int in2 = (int) NULL;
608 
609 
610  if( adg_list_same_order_in_dg( ver_list, v ) != NIL ) continue;
611 
612  st = vertex_to_statement( v );
613  in2 = statement_ordering( st );
614  stco = (static_control) GET_STATEMENT_MAPPING( stco_map, st );
616 
617  if (prl == NIL) {
619  ADD_ELEMENT_TO_LIST( ver_list, VERTEX, make_vertex( dvl, NIL ) );
620  continue;
621  }
622  for(; !ENDP(prl); POP(prl)) {
623  predicate pred = PREDICATE(CAR( prl ));
624  if (pred != predicate_undefined) {
625  Psysteme ps = predicate_system( pred );
626  ps->base = NULL; sc_creer_base( ps );
627  }
628  dvl = make_dfg_vertex_label(in2, pred, sccflags_undefined);
629  ADD_ELEMENT_TO_LIST( ver_list, VERTEX, make_vertex( dvl, NIL));
630  }
631 
632  }
633 
634 
635  /* Does vertex associated to ver exist in the new ver_list ?*/
636  if( adg_list_same_order_in_dg( ver_list, ver ) == NIL ) {
637  list prl = NIL;
638  static_control stco = NULL;
639 
640  stco = (static_control) GET_STATEMENT_MAPPING(stco_map,
641  vertex_to_statement( ver ));
643  if (prl == NIL) {
645  ADD_ELEMENT_TO_LIST( ver_list, VERTEX, make_vertex( dvl, NIL ) );
646  }
647  else for(; !ENDP(prl); POP(prl)) {
648  predicate pred = PREDICATE(CAR( prl ));
649  if (pred != predicate_undefined) {
650  Psysteme ps = predicate_system( pred );
651  ps->base = NULL; sc_creer_base( ps );
652  }
653  dvl = make_dfg_vertex_label(in, pred, sccflags_undefined);
654  ADD_ELEMENT_TO_LIST( ver_list, VERTEX, make_vertex( dvl, NIL));
655  }
656  }
657 
658  /* Build the new successors list */
659  succ_list = vertex_successors( ver );
660  for(; !ENDP(succ_list); POP(succ_list)) {
661  successor succ = SUCCESSOR(CAR( succ_list ));
662  vertex v = successor_vertex( succ );
663  dfg_arc_label dal = successor_arc_label( succ );
664  list sl = adg_list_same_order_in_dg( ver_list, v );
665 
666  for(; !ENDP(sl); POP(sl))
667  { ADD_ELEMENT_TO_LIST( new_succ_list, SUCCESSOR,
668  make_successor( copy_dfg_arc_label( dal ), VERTEX(CAR(sl)) ) ); }
669  }
670 
671  /*Associate a duplicated successor list to each new vertex */
672  new_ver_l = adg_list_same_order_in_dg( ver_list, ver );
673  for(; !ENDP(new_ver_l); POP(new_ver_l))
674  { vertex_successors( VERTEX(CAR( new_ver_l )) ) = new_succ_list;}
675  }
676 
677  debug(7, "adg_dup_disjunctive_nodes", "end \n");
678  return( make_graph( ver_list ) );
679 }
graph make_graph(list a)
Definition: graph.c:56
successor make_successor(arc_label a1, vertex a2)
Definition: graph.c:98
vertex make_vertex(vertex_label a1, list a2)
Definition: graph.c:140
dfg_arc_label copy_dfg_arc_label(dfg_arc_label p)
DFG_ARC_LABEL.
Definition: paf_ri.c:186
dfg_vertex_label make_dfg_vertex_label(intptr_t a1, predicate a2, sccflags a3)
Definition: paf_ri.c:264
list adg_list_same_order_in_dg(list in_l, vertex in_v)
======================================================================
Definition: adg_graph.c:992
list adg_get_disjunctions(list exp_l)
======================================================================
void const char const char const int
#define sccflags_undefined
Definition: dg.h:247
#define successor_vertex(x)
Definition: graph.h:118
#define successor_arc_label(x)
Definition: graph.h:116
#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
#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 CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
Definition: icfg-local.h:50
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
Definition: util.c:45
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
#define GET_STATEMENT_MAPPING(map, stat)
Definition: newgen-local.h:49
struct _newgen_struct_static_control_ * static_control
Definition: paf_ri.h:184
#define static_control_tests(x)
Definition: paf_ri.h:759
#define PREDICATE(x)
PREDICATE.
Definition: ri.h:2040
#define statement_ordering(x)
Definition: ri.h:2454
#define predicate_undefined
Definition: ri.h:2046
#define predicate_system(x)
Definition: ri.h:2069
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
Pbase base
Definition: sc-local.h:75
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References ADD_ELEMENT_TO_LIST, adg_get_disjunctions(), adg_list_same_order_in_dg(), Ssysteme::base, CAR, copy_dfg_arc_label(), debug(), ENDP, GET_STATEMENT_MAPPING, graph_vertices, int, make_dfg_vertex_label(), make_graph(), make_successor(), make_vertex(), NIL, POP, PREDICATE, predicate_system, predicate_undefined, sc_creer_base(), sccflags_undefined, statement_ordering, static_control_tests, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_successors, and vertex_to_statement().

Referenced by array_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_get_exec_domain()

list adg_get_exec_domain ( static_control  stco)

======================================================================

list adg_get_exec_domain( static_control stco ) AL 21/07/93 Input : A static_control stco. Output: A list of predicates corresponding to the conditions on enclosing loops combined with enclosing tests. PRIVATE to this pass !!

Get existing predicate for the exec_domain

Definition at line 515 of file adg_graph.c.

517 {
518  predicate loop_pred = NULL;
519  list test_pred_l = NULL, prl = NIL;
520 
521  debug(9, "adg_get_exec_domain", "begin\n");
522 
523  /* Get existing predicate for the exec_domain */
524  test_pred_l = adg_get_disjunctions( static_control_tests(stco) );
526  if( loop_pred != predicate_undefined ) {
527  list prov_list = NIL;
528  ADD_ELEMENT_TO_LIST( prov_list, PREDICATE, loop_pred);
529  prl = adg_make_disjunctions(test_pred_l, prov_list);
530  }
531  else prl = test_pred_l;
532  if( prl == NIL ) ADD_ELEMENT_TO_LIST( prl, PREDICATE, make_predicate(SC_RN));
533 
534  if(get_debug_level() >= 9) adg_fprint_predicate_list(stderr, prl);
535  debug(9, "adg_get_exec_domain", "end\n");
536  return( prl );
537 }
predicate make_predicate(Psysteme a1)
Definition: ri.c:1820
list adg_make_disjunctions(list ps_l1, list ps_l2)
======================================================================
predicate adg_get_predicate_of_loops(list loops)
======================================================================
Definition: adg_predicate.c:55
void adg_fprint_predicate_list(FILE *fp, list sc_l)
===========================================================================
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
Definition: debug.c:67
#define static_control_loops(x)
Definition: paf_ri.h:757

References ADD_ELEMENT_TO_LIST, adg_fprint_predicate_list(), adg_get_disjunctions(), adg_get_predicate_of_loops(), adg_make_disjunctions(), debug(), get_debug_level(), make_predicate(), NIL, PREDICATE, predicate_undefined, static_control_loops, and static_control_tests.

+ Here is the call graph for this function:

◆ adg_list_same_order_in_dg()

list adg_list_same_order_in_dg ( list  in_l,
vertex  in_v 
)

======================================================================

list adg_list_same_order_in_dg( (list) in_l, (vertex) in_v ) AL 27/10/93 Input : A list of vertices of a dg and a vertex of this type. Output : All the vertices which associated ordering has same ordering as the one linked to in_v. PRIVATE use !

Definition at line 992 of file adg_graph.c.

995 {
996  vertex ver = NULL;
997  int in;
998  statement s = NULL;
999  list ret_l = NIL;
1000 
1001  debug(9, "adg_list_same_order_in_dg", "begin\n");
1002  in = statement_ordering( vertex_to_statement( in_v ) );
1003  for(;!ENDP(in_l); POP(in_l)) {
1004  ver = VERTEX(CAR( in_l ));
1005  s = vertex_to_statement( ver );
1006  if ( statement_ordering(s) == in ) ADD_ELEMENT_TO_LIST( ret_l, VERTEX, ver );
1007  }
1008  debug(9, "adg_list_same_order_in_dg", "end \n");
1009 
1010  return ret_l;
1011 }

References ADD_ELEMENT_TO_LIST, CAR, debug(), ENDP, NIL, POP, statement_ordering, VERTEX, and vertex_to_statement().

Referenced by adg_dup_disjunctive_nodes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_number_to_ordering()

int adg_number_to_ordering ( int  in_nb)

======================================================================

int adg_number_to_ordering( (int) in_nb ) AL 21/10/93 Input : Number of a vertex. Output : The ordering of Statement associated to this vertex. PRIVATE to this pass !!

Definition at line 227 of file adg_graph.c.

229 { return (int) hash_get( Gvertex_number_to_statement, (char *) in_nb ); }
hash_table Gvertex_number_to_statement
Global variables.
Definition: adg_graph.c:42
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

References Gvertex_number_to_statement, and hash_get().

Referenced by adg_dataflowgraph(), and adg_number_to_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_number_to_vertex()

vertex adg_number_to_vertex ( graph  in_dfg,
int  in_nb 
)

======================================================================

vertex adg_number_to_vertex( (graph) in_dfg, (int) in_nb ) AL 21/10/93 Input : A graph and a number of a vertex. Output : A vertex which statement number is equal to in_nb. PRIVATE to this pass !!

Definition at line 239 of file adg_graph.c.

242 {
243  vertex ret_ver = vertex_undefined;
244  list gl = graph_vertices( in_dfg );
245 
246  debug(9, "adg_number_to_vertex", "begin\n");
247  for(; !ENDP(gl); POP(gl)) {
248  vertex ver = VERTEX(CAR( gl ));
250  if ((dvl != dfg_vertex_label_undefined) &&
251  (dfg_vertex_label_statement(dvl) == in_nb))
252  ret_ver = ver;
253  }
254  debug(9, "adg_number_to_vertex", "end\n");
255  return ret_ver;
256 }
#define vertex_undefined
Definition: graph.h:128
#define vertex_vertex_label(x)
Definition: graph.h:152
#define dfg_vertex_label_undefined
Definition: paf_ri.h:388
struct _newgen_struct_dfg_vertex_label_ * dfg_vertex_label
Definition: paf_ri.h:112
#define dfg_vertex_label_statement(x)
Definition: paf_ri.h:413

References CAR, debug(), dfg_vertex_label_statement, dfg_vertex_label_undefined, ENDP, graph_vertices, POP, VERTEX, vertex_undefined, and vertex_vertex_label.

Referenced by adg_dataflowgraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_only_call_WR_dependence()

graph adg_only_call_WR_dependence ( graph  g)

======================================================================

graph adg_only_call_WR_dependence( (graph) g ) AL 06/07/93 Returns a graph from a dependence graph with only Write-Read conflicts and assignements statements.

We only keep call statement

Definition at line 784 of file adg_graph.c.

786 {
787  list l, new_vertices = NIL;
788 
789  debug(7, "adg_only_call_WR_dependence", "begin \n");
790 
791  l = graph_vertices( g );
792  for(; !ENDP(l); POP(l)) {
793  list succ_list = NULL;
794  list new_succ_list = NIL;
795  vertex ver, new_ver = NULL;
796  dfg_vertex_label dgvl = NULL;
797 
798  ver = VERTEX(CAR( l ));
799  /* We only keep call statement */
802  vertex_vertex_label( ver )))) ) continue;
803 
804  succ_list = vertex_successors( ver );
805  if (adg_same_order_in_dg(new_vertices,ver)==vertex_undefined){
806  dgvl = vertex_vertex_label( ver );
807  new_ver = make_vertex( dgvl,(list) NIL );
808  }
809  for(;!ENDP( succ_list ); POP( succ_list )) {
810  successor s = NULL, new_succ = NULL;
811  list conflist = NIL;
812  list new_conflist = NIL;
813  dg_arc_label dgal = NULL, vl = NULL;
814  vertex succ_ver = NULL, new_succver = NULL;
815 
816  s = SUCCESSOR(CAR( succ_list ));
817  succ_ver = successor_vertex( s );
819 
820  for(;!ENDP( conflist ); POP( conflist )) {
821  conflict conf = NULL;
822  effect eff1 = NULL;
823  effect eff2 = NULL;
824 
825  conf = CONFLICT(CAR( conflist ));
826  eff1 = (effect) conflict_source( conf );
827  eff2 = (effect) conflict_sink( conf );
829  ADD_ELEMENT_TO_LIST( new_conflist,CONFLICT, conflict_dup( conf ) );
830  }
831 
832  if (new_conflist != NIL) {
833  new_succver = adg_same_order_in_dg( new_vertices, succ_ver );
834  if (new_succver == vertex_undefined) {
835  vl = (dg_arc_label) vertex_vertex_label(succ_ver);
836  new_succver = make_vertex((dfg_arc_label) vl, (list) NIL);
837  }
838  dgal = make_dg_arc_label( new_conflist );
839  new_succ = make_successor( (dfg_arc_label) dgal, new_succver );
840  ADD_ELEMENT_TO_LIST( new_succ_list, SUCCESSOR, new_succ );
841  }
842  }
843  if (new_succ_list != NIL ) vertex_successors( new_ver ) = (list) new_succ_list;
844 
845  ADD_ELEMENT_TO_LIST( new_vertices, VERTEX, new_ver );
846  }
847 
848  debug(7, "adg_only_call_WR_dependence", "end \n" );
849  return( make_graph( new_vertices ) );
850 }
dg_arc_label make_dg_arc_label(list a)
Definition: dg.c:138
vertex adg_same_order_in_dg(list l, vertex v)
======================================================================
Definition: adg_graph.c:1021
conflict conflict_dup(conflict conf)
======================================================================
Definition: adg_graph.c:891
struct _newgen_struct_effect_ * effect
Definition: dg.h:21
struct _newgen_struct_dg_arc_label_ * dg_arc_label
Definition: dg.h:60
#define conflict_sink(x)
Definition: dg.h:167
#define CONFLICT(x)
CONFLICT.
Definition: dg.h:134
#define dg_arc_label_conflicts(x)
Definition: dg.h:201
#define conflict_source(x)
Definition: dg.h:165
#define effect_action(x)
Definition: effects.h:642
#define action_write_p(x)
Definition: effects.h:314
#define action_read_p(x)
Definition: effects.h:311
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
struct cons * list
Definition: newgen_types.h:106
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
Definition: ordering.c:111

References action_read_p, action_write_p, ADD_ELEMENT_TO_LIST, adg_same_order_in_dg(), assignment_statement_p(), CAR, CONFLICT, conflict_dup(), conflict_sink, conflict_source, debug(), dfg_vertex_label_statement, dg_arc_label_conflicts, effect_action, ENDP, graph_vertices, make_dg_arc_label(), make_graph(), make_successor(), make_vertex(), NIL, ordering_to_statement(), POP, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_successors, vertex_undefined, and vertex_vertex_label.

Referenced by array_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_print_graph()

void adg_print_graph ( FILE *  fd,
statement  mod_stat,
graph  mod_graph 
)

======================================================================

void adg_print_graph() Prints a dg graph with vertex labels as they are, Do not try to translate vertex label to a statement number.

Definition at line 172 of file adg_graph.c.

176 {
177  cons *pv1 = NULL, *ps = NULL, *pc = NULL;
178  Ptsg gs = NULL;
179 
180  fprintf(fd, "\n ************************ Dependence graph ************************\n");
181 
182  for (pv1 = graph_vertices(mod_graph); !ENDP(pv1); pv1 = CDR(pv1)) {
183  vertex v1 = VERTEX(CAR(pv1));
185 
186  for (ps = vertex_successors(v1); !ENDP(ps); ps = CDR(ps)) {
187  successor su = SUCCESSOR(CAR(ps));
188  vertex v2 = successor_vertex(su);
189  int dvl2 = dg_vertex_label_statement(
192  fprintf(fd, "\t%02d --> %02d with conflicts\n", dvl1, dvl2);
193 
194  for (pc = dg_arc_label_conflicts(dal); !ENDP(pc); pc = CDR(pc)) {
195  conflict c = CONFLICT(CAR(pc));
196 
197  fprintf(fd, "\t\tfrom ");
199 
200  fprintf(fd, " to ");
202 
203  if(conflict_cone(c) != cone_undefined){
204  fprintf(fd, " at levels ");
205  MAPL(pl, {
206  fprintf(fd, " %d", INT(CAR(pl)));
207  }, cone_levels(conflict_cone(c)));
208 
209  fprintf(fd, "\n");
211  if (!SG_UNDEFINED_P(gs)) sg_fprint(fd,gs,entity_local_name);
212 
213  }
214  fprintf(fd, "\n");
215  }
216  }
217  }
218  fprintf(fd, "\n******************** End of Dependence graph ********************\n");
219 }
@ INT
Definition: atomic.c:48
#define cone_generating_system(x)
Definition: dg.h:130
#define dg_vertex_label_statement(x)
Definition: dg.h:235
#define cone_levels(x)
Definition: dg.h:128
#define cone_undefined
Definition: dg.h:104
#define conflict_cone(x)
Definition: dg.h:169
list words_effect(effect)
#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
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
struct type_sg * Ptsg
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
#define SG_UNDEFINED_P(sg)
Definition: sg-local.h:74
void sg_fprint(FILE *f, Ptsg sg, char *(*nom_var)(Variable))
void sg_fprint(FILE * f, Ptsg sg, char * (*nom_var)()): impression d'un systeme generateur
Definition: sg.c:262
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
Definition: sg-local.h:66
void print_words(FILE *fd, cons *lw)
Definition: print.c:263

References CAR, CDR, cone_generating_system, cone_levels, cone_undefined, CONFLICT, conflict_cone, conflict_sink, conflict_source, dg_arc_label_conflicts, dg_vertex_label_statement, ENDP, entity_local_name(), fprintf(), graph_vertices, INT, MAPL, pl, print_words(), sg_fprint(), SG_UNDEFINED_P, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_successors, vertex_vertex_label, and words_effect().

+ Here is the call graph for this function:

◆ adg_pure_dfg()

graph adg_pure_dfg ( graph  in_gr)

======================================================================

GRAPH FUNCTIONS
====================================================================== ====================================================================== graph adg_pure_dfg( in_gr ) AL 18/02/94

Returns a pure Data Flow Graph : without Entry or Exit Node.

First get entry and exit nodes from in_gr

Then duplicate nodes without exit and entry nodes

If this succ is an extremity, continue

Definition at line 56 of file adg_graph.c.

58 {
59  list ver_ptr = NULL, verlist = NULL;
60  vertex v_entry = NULL, v_exit = NULL;
61 
62  debug(9, "adg_pure_dfg", "begin\n");
63 
64  /* First get entry and exit nodes from in_gr */
65  for(ver_ptr = graph_vertices(in_gr); !ENDP(ver_ptr); POP(ver_ptr)) {
66  vertex ve = NULL;
67  int or;
68 
69  ve = VERTEX(CAR(ver_ptr));
71  if (or == ENTRY_ORDER) { v_entry = ve; continue; }
72  if (or == EXIT_ORDER) { v_exit = ve; continue; }
73  }
74 
75 
76  /* Then duplicate nodes without exit and entry nodes */
77  for(ver_ptr = graph_vertices(in_gr); !ENDP(ver_ptr); POP(ver_ptr)) {
78  vertex ver, ver2 = NULL, ver5 = NULL;
79  int or = (int) NULL;
80  list succ_ptr = NIL;
81 
82  ver = VERTEX(CAR( ver_ptr ));
83  if ((ver == v_entry) || (ver == v_exit)) continue;
84 
86  ver2 = adg_same_dfg_vertex_number( verlist, or );
87  if ( ver2 == vertex_undefined ) {
88  ver2 = make_vertex(vertex_vertex_label(ver),NIL);
90  }
91 
92  for(succ_ptr = vertex_successors(ver); !ENDP(succ_ptr); POP(succ_ptr)){
93  successor succ, succ2 = NULL;
94  vertex ver3;
95  int ord = (int) NULL;
96 
97  succ = SUCCESSOR(CAR( succ_ptr ));
98  ver3 = successor_vertex( succ );
99  /* If this succ is an extremity, continue */
100  if ((ver3 == v_entry) || (ver3 == v_exit)) continue;
101 
103  ver5 = adg_same_dfg_vertex_number( verlist, ord );
104  if ( ver5 == vertex_undefined ) {
105  ver5 = make_vertex(vertex_vertex_label(ver3),NIL);
107  }
108 
109  succ2 = make_successor(successor_arc_label(succ),ver5 );
111  }
112  }
113 
114  debug(9, "adg_pure_dfg", "end\n");
115  return make_graph(verlist);
116 }
vertex adg_same_dfg_vertex_number(list in_l, int in_i)
======================================================================
Definition: adg_graph.c:358
#define EXIT_ORDER
#define ENTRY_ORDER
static list verlist
of vertex
Definition: icfg_scan.c:107

References ADD_ELEMENT_TO_LIST, adg_same_dfg_vertex_number(), CAR, debug(), dfg_vertex_label_statement, ENDP, ENTRY_ORDER, EXIT_ORDER, graph_vertices, int, make_graph(), make_successor(), make_vertex(), NIL, POP, SUCCESSOR, successor_arc_label, successor_vertex, verlist, VERTEX, vertex_successors, vertex_undefined, and vertex_vertex_label.

Referenced by array_dfg(), prgm_mapping(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), scheduling(), and single_assign().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_pure_dfg2()

graph adg_pure_dfg2 ( graph  in_gr)

======================================================================

graph adg_pure_dfg2( in_gr ) AL 18/02/94

Returns a pure Data Flow Graph : without Entry or Exit Node.

First remove entry and exit nodes from in_gr

Then remove successors that include exit node

Definition at line 123 of file adg_graph.c.

125 {
126  list vl = NULL;
127  vertex v_entry = NULL, v_exit = NULL;
128 
129  debug(9, "adg_pure_dfg2", "begin\n");
130  in_gr = copy_graph( in_gr );
131  /* First remove entry and exit nodes from in_gr */
132  for(vl = graph_vertices(in_gr); !ENDP(vl); POP(vl)) {
133  vertex ve = NULL;
134  int or = (int) NULL;
135 
136  ve = VERTEX(CAR(vl));
138  if (or == ENTRY_ORDER) v_entry = ve;
139  if (or == EXIT_ORDER) v_exit = ve;
140  }
141  gen_remove( &graph_vertices( in_gr ), v_entry );
142  gen_remove( &graph_vertices( in_gr ), v_exit );
143 
144  /* Then remove successors that include exit node */
145  for(vl = graph_vertices(in_gr); !ENDP(vl); POP(vl)) {
146  vertex ve = NULL;
147  list su_l = NULL;
148  list li = NIL;
149 
150  ve = VERTEX(CAR(vl));
151  for(su_l = vertex_successors(ve); !ENDP(su_l); POP(su_l) ) {
152  successor succ;
153 
154  succ = SUCCESSOR(CAR( su_l ));
155  if(successor_vertex(succ) != v_exit) continue;
156  ADD_ELEMENT_TO_LIST(li, SUCCESSOR, succ);
157  }
158  for(; !ENDP(li); POP(li))
159  {gen_remove( &vertex_successors(ve), SUCCESSOR(CAR(li)) );}
160  }
161 
162  debug(9, "adg_pure_dfg2", "end\n");
163  return in_gr;
164 }
graph copy_graph(graph p)
GRAPH.
Definition: graph.c:20
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

References ADD_ELEMENT_TO_LIST, CAR, copy_graph(), debug(), dfg_vertex_label_statement, ENDP, ENTRY_ORDER, EXIT_ORDER, gen_remove(), graph_vertices, int, NIL, POP, SUCCESSOR, successor_vertex, VERTEX, vertex_successors, and vertex_vertex_label.

+ Here is the call graph for this function:

◆ adg_reorder_statement_number()

void adg_reorder_statement_number ( graph  in_dfg)

======================================================================

void adg_reorder_statement_number( (graph) in_dfg ) AL 21/10/93 Input : A dfg graph with different vertices pointing on the same statement. This is possible due to duplication of vextices whose statement are controled by a disjunction of predicates (See Doc about IF statement). Output : Nothing. Each vertex has a new and distinct number for the statement tag of it dfg_vertex_label tag. PRIVATE to this pass !!

AP, oct 6th 1995: I change the way to choose the new numbers used to reorder

Definition at line 318 of file adg_graph.c.

320 {
321  list verl, l_num;
322  int order, num;
323 
324  l_num = NIL;
326 
327  debug(7, "adg_reorder_statement_number", "begin\n");
328 
329  verl = graph_vertices( in_dfg );
330  for(; !ENDP(verl); POP(verl)) {
331  vertex v = VERTEX(CAR(verl));
333  if (vl != dfg_vertex_label_undefined ) {
334  order = dfg_vertex_label_statement( vl );
335  num =
337  while(integer_in_list_p(num, l_num))
338  num++;
339  l_num = CONS(INT, num, l_num);
341  hash_put( Gvertex_number_to_statement, (char *) num, (char *) order );
342  debug(9, "adg_reorder_statement_number",
343  " Vertex-Statement : %d Ordering of Statement : %d\n",
344  num, order );
345  }
346  }
347 
348  debug(7, "adg_reorder_statement_number", "end\n");
349 }
bool integer_in_list_p(int i, list l)
===========================================================================
Definition: adg_graph.c:292
static int num
Definition: bourdoncle.c:137
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
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
@ hash_int
Definition: newgen_hash.h:32
#define BASE_NODE_NUMBER
#define statement_number(x)
Definition: ri.h:2452

References BASE_NODE_NUMBER, CAR, CONS, debug(), dfg_vertex_label_statement, dfg_vertex_label_undefined, ENDP, graph_vertices, Gvertex_number_to_statement, hash_int, hash_put(), hash_table_make(), INT, integer_in_list_p(), NIL, num, ordering_to_statement(), POP, statement_number, VERTEX, and vertex_vertex_label.

Referenced by array_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_reverse_graph()

graph adg_reverse_graph ( graph  g)

======================================================================

graph adg_reverse_graph( (graph) g ) AL 29/06/93 This function is used to reverse Pips's graph in order to have all possible sources directly (Feautrier's dependance graph).

Definition at line 1047 of file adg_graph.c.

1049 {
1050  list verlist = NIL;
1051  successor succ = NULL;
1052 
1053  debug(7, "adg_reverse_graph", "begin \n");
1054  MAPL( ver_ptr, {
1055  vertex ver = NULL;
1056  vertex ver2 = NULL;
1057  vertex ver5 = NULL;
1058 
1059  ver = VERTEX(CAR( ver_ptr ));
1060  ver5 = adg_same_order_in_dg( verlist, ver );
1061  if ( ver5 == vertex_undefined ) {
1064  }
1065  else {ver2 = ver5;}
1066 
1067  MAPL( succ_ptr, {
1068  list li = NIL;
1069  successor succ2 = NULL;
1070  vertex ver3 = NULL;
1071  vertex ver4 = NULL;
1072 
1073  succ = SUCCESSOR(CAR( succ_ptr ));
1074  ver3 = successor_vertex( succ );
1075  ver5 = adg_same_order_in_dg( verlist, ver3 );
1077  if ( ver5 == vertex_undefined ) {
1078  ADD_ELEMENT_TO_LIST( li, SUCCESSOR, succ2 );
1079  ver4 = make_vertex( (dg_vertex_label) vertex_vertex_label(ver3),(list) li );
1081  }
1082  else { ADD_ELEMENT_TO_LIST( vertex_successors( ver5 ), SUCCESSOR, succ2 );}
1083  }, vertex_successors( ver ) );
1084 
1085  }, graph_vertices( g ) );
1086 
1087  debug(7, "adg_reverse_graph", "end \n");
1088  return( make_graph( verlist ) );
1089 }
dg_arc_label dg_arc_label_dup(dg_arc_label dg_al)
======================================================================
Definition: adg_graph.c:924

References ADD_ELEMENT_TO_LIST, adg_same_order_in_dg(), CAR, debug(), dg_arc_label_dup(), graph_vertices, make_graph(), make_successor(), make_vertex(), MAPL, NIL, SUCCESSOR, successor_arc_label, successor_vertex, verlist, VERTEX, vertex_successors, vertex_undefined, and vertex_vertex_label.

Referenced by array_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_same_dfg_vertex_number()

vertex adg_same_dfg_vertex_number ( list  in_l,
int  in_i 
)

======================================================================

vertex adg_same_dfg_vertex_number( (list) in_l, (int) in_i ) AL 27/10/93 Input : A list of vertices and a number in_i. Output : A vertex v in in_l which statement associated to it
has a number equal to in_i. PRIVATE to this pass !!

Definition at line 358 of file adg_graph.c.

361 {
362  vertex ver = NULL;
363 
364  debug(9, "adg_same_dfg_vertex_number", "doing\n");
365 
366  for(;!ENDP(in_l); POP(in_l)) {
367  int prov_i;
368  ver = VERTEX(CAR( in_l ));
370  if ( prov_i == in_i ) return( ver );
371  }
372 
373  debug(9, "adg_same_dfg_vertex_number", "end\n");
374  return vertex_undefined;
375 }

References CAR, debug(), dfg_vertex_label_statement, ENDP, POP, VERTEX, vertex_undefined, and vertex_vertex_label.

Referenced by adg_dataflowgraph(), adg_pure_dfg(), and adg_update_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_same_order_in_dg()

vertex adg_same_order_in_dg ( list  l,
vertex  v 
)

======================================================================

vertex adg_same_order_in_dg( (list) l, (vertex) v ) AL 30/06/93 Input : A list l of vertices. A vertex v of a dependence graph. Returns vertex_undefined if v is not in list l. Returns v' that has the same statement_ordering than v. COMMON use possible.

Definition at line 1021 of file adg_graph.c.

1024 {
1025  vertex ver = NULL;
1026  int in;
1027  statement s = NULL;
1028 
1029  debug(9, "adg_same_order_in_dg", "doing \n");
1030 
1032  for(;!ENDP(l); POP(l)) {
1033  ver = VERTEX(CAR( l ));
1034  s = vertex_to_statement( ver );
1035  if ( statement_ordering(s) == in ) return( ver );
1036  }
1037 
1038  return vertex_undefined;
1039 }

References CAR, debug(), ENDP, POP, statement_ordering, VERTEX, vertex_to_statement(), and vertex_undefined.

Referenced by adg_only_call_WR_dependence(), and adg_reverse_graph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_same_order_in_dvl()

list adg_same_order_in_dvl ( list  l,
vertex  ver 
)

======================================================================

list adg_same_order_in_dvl( list l, vertex ver ) AL 21/07/93 Input : A list of vertices, each vertex has an unique ordering according to a statement. A vertex ver of a Data Flow Graph. Its number is not equal to an ordering statement. Output : A list or vertices with same statement ordering as ver. WARNING : Implicitly uses Gvertex_number_to_statement ! PRIVATE to this pass !!

Definition at line 549 of file adg_graph.c.

552 {
553  list ret_list = NIL;
554  int in;
555 
556  in = adg_vertex_to_ordering( ver );
557  debug(9, "adg_same_order_in_dvl", "Ordering of ver : %d\n", in);
558  for(; !ENDP(l); POP(l)) {
559  vertex v = VERTEX(CAR( l ));
561  if( in2 != in ) continue;
562  ADD_ELEMENT_TO_LIST( ret_list, VERTEX, v);
563  debug(9, "adg_same_order_in_dvl", "-> %d\n", in2);
564  break;
565  }
566  return( ret_list );
567 }
int adg_vertex_to_ordering(vertex in_ver)
======================================================================
Definition: adg_graph.c:276

References ADD_ELEMENT_TO_LIST, adg_vertex_to_ordering(), CAR, debug(), dfg_vertex_label_statement, ENDP, NIL, POP, VERTEX, and vertex_vertex_label.

+ Here is the call graph for this function:

◆ adg_update_dfg()

void adg_update_dfg ( quast  in_sou,
reference  in_ref,
vertex  in_dest,
Ppath  in_pa,
Psysteme  in_context,
Psysteme  in_test,
graph  in_gr,
list in_lp 
)

======================================================================

void adg_update_dfg((quast) in_sou,(reference) in_ref, AL 19/10/93 (vertex) in_dest, (Psysteme) in_ps, (list) *in_lp ) Input : A quast, a reference, destination vertex, a predicate representing present control condition, and a list of vertices representing a DFG. Output : Nothing. Just modify the graph *in_lp. See Doc. PRIVATE to this pass !!

Presently, newparms should be empty

if (quast_newparms(in_sou) != NIL)

fprintf(stderr, "\n Newparms list should be presently empty !\n");

Build the new dataflows list of data flow

Update graph

Do pred_v already has in_dest as a successor ?

If not, add to it the correct successor

Definition at line 386 of file adg_graph.c.

395 {
396  quast_value qv = NULL;
397 
398  debug(7, "adg_update_dfg", "begin\n");
399  if (in_sou == quast_undefined) return;
400 
401 
402  /* Presently, newparms should be empty */
403  /* if (quast_newparms(in_sou) != NIL) */
404  /* fprintf(stderr, "\n Newparms list should be presently empty !\n"); */
405 
406 
407  qv = quast_quast_value( in_sou );
408  if (qv == quast_value_undefined) return;
409  if (quast_value_quast_leaf_p( qv )) {
410  Psysteme dest_system = NULL;
411  dataflow df = NULL;
412  quast_leaf ql = NULL;
413  vertex pred_v = NULL;
414  bool get_it = false;
415  list qls = NIL;
416  leaf_label qll = NULL;
417  int sou_nb, dest_vls = (int) NULL;
418  list dfl = NIL;
419  Pdisjunct dj = NULL;
420 
421  pips_assert("adg_update_dfg",(in_dfg_vertex_list((list)*in_lp,in_dest)!= vertex_undefined));
422  ql = quast_value_quast_leaf( qv );
423  qls = quast_leaf_solution( ql );
424  qll = quast_leaf_leaf_label( ql );
425  sou_nb = leaf_label_statement(qll);
426 
427 
428  /* Build the new dataflows list of data flow */
429  dj = pa_path_to_disjunct( in_pa );
430  dest_vls = dfg_vertex_label_statement(vertex_vertex_label(in_dest));
431  if ((dest_vls != ENTRY_ORDER) && (dest_vls != EXIT_ORDER)) {
432  dest_system = predicate_system
434  }
435 
436  for(; dj != NULL; dj = dj->succ) {
437  Psysteme prov_ps = SC_UNDEFINED;
438 
439  if (!SC_UNDEFINED_P(dj->psys) && sc_empty_p( dj->psys )) continue;
440 
441  if (dj->psys != SC_UNDEFINED) {
442  prov_ps = sc_elim_redund(sc_append(sc_dup(dj->psys), in_context));
443  if (prov_ps == SC_UNDEFINED) continue;
444  prov_ps = adg_suppress_2nd_in_1st_ps(prov_ps, dest_system );
445  if (prov_ps != NULL) {prov_ps->base = NULL; sc_creer_base( prov_ps ); }
446  }
447  df = make_dataflow( in_ref, qls, make_predicate( prov_ps ), communication_undefined );
448  if (get_debug_level()>6) {
449  adg_fprint_dataflow(stderr,
451  df);
452  }
453  ADD_ELEMENT_TO_LIST( dfl, DATAFLOW, df );
454  }
455 
456 
457  /* Update graph */
458  pred_v = adg_same_dfg_vertex_number( (list) *in_lp, sou_nb );
459  if (pred_v == vertex_undefined) {
460  successor su = make_successor( make_dfg_arc_label( dfl ), in_dest);
461  pred_v = make_vertex(make_dfg_vertex_label(sou_nb,
464  CONS(SUCCESSOR, su, NIL));
465  ADD_ELEMENT_TO_LIST( *in_lp, VERTEX, pred_v );
466  }
467  else {
468  list succ_l = vertex_successors( pred_v );
469  /* Do pred_v already has in_dest as a successor ? */
470  for(; !ENDP(succ_l) && !(get_it); POP(succ_l)) {
471  successor succ = SUCCESSOR(CAR( succ_l ));
472  vertex vv = successor_vertex( succ );
473 
474  if (vv != in_dest) continue;
475  get_it = true;
477  }
478  /* If not, add to it the correct successor */
479  if (!(get_it)) {
480  successor su = make_successor( make_dfg_arc_label(dfl), in_dest);
482  }
483  }
484  }
485 
486  if (quast_value_conditional_p( qv )) {
488  quast qt = NULL, qf = NULL;
489  Psysteme ps = NULL;
490 
491  ps = predicate_system( conditional_predicate( cond ) );
492  adg_sc_update_base( &ps );
493  qt = conditional_true_quast( cond );
494  adg_update_dfg( qt, in_ref, in_dest,
495  pa_intersect_system( in_pa, ps ),
496  in_context, in_test, in_gr, in_lp );
497  qf = conditional_false_quast( cond );
498  if ((qf != quast_undefined) &&
500  adg_update_dfg( qf, in_ref, in_dest,
501  pa_intersect_complement( in_pa, ps ),
502  in_context, in_test, in_gr, in_lp );
503  }
504  }
505  debug(7, "adg_update_dfg", "end\n");
506 }
dataflow make_dataflow(reference a1, list a2, predicate a3, communication a4)
Definition: paf_ri.c:180
dfg_arc_label make_dfg_arc_label(list a)
Definition: paf_ri.c:222
void adg_update_dfg(quast in_sou, reference in_ref, vertex in_dest, Ppath in_pa, Psysteme in_context, Psysteme in_test, graph in_gr, list *in_lp)
======================================================================
Definition: adg_graph.c:386
void adg_fprint_dataflow(FILE *fp, int sink, dataflow df)
===========================================================================
void adg_sc_update_base(Psysteme *in_pps)
======================================================================
Definition: adg_utils.c:384
Psysteme adg_suppress_2nd_in_1st_ps(Psysteme in_ps1, Psysteme in_ps2)
======================================================================
Definition: adg_utils.c:403
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
vertex in_dfg_vertex_list(list, vertex)
===========================================================================
Definition: utils.c:620
#define conditional_true_quast(x)
Definition: paf_ri.h:302
#define DATAFLOW(x)
DATAFLOW.
Definition: paf_ri.h:308
#define quast_undefined
Definition: paf_ri.h:603
#define quast_value_undefined
Definition: paf_ri.h:639
#define leaf_label_statement(x)
Definition: paf_ri.h:451
#define dfg_arc_label_dataflows(x)
Definition: paf_ri.h:378
#define conditional_false_quast(x)
Definition: paf_ri.h:304
#define communication_undefined
Definition: paf_ri.h:236
#define quast_leaf_solution(x)
Definition: paf_ri.h:591
#define quast_value_conditional_p(x)
Definition: paf_ri.h:676
#define quast_value_quast_leaf_p(x)
Definition: paf_ri.h:673
#define quast_value_quast_leaf(x)
Definition: paf_ri.h:675
#define quast_leaf_leaf_label(x)
Definition: paf_ri.h:593
#define quast_quast_value(x)
Definition: paf_ri.h:627
#define dfg_vertex_label_exec_domain(x)
Definition: paf_ri.h:415
#define conditional_predicate(x)
Definition: paf_ri.h:300
#define quast_value_conditional(x)
Definition: paf_ri.h:678
Ppath pa_intersect_system(Ppath in_pa, Psysteme in_ps)
Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa ...
Definition: path.c:178
Ppath pa_intersect_complement(Ppath in_pa, Pcomplement in_pc)
Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between...
Definition: path.c:200
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
Definition: sc_alloc.c:350
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
Psysteme sc_elim_redund(Psysteme ps)
Psysteme sc_elim_redund(Psysteme ps): elimination des contraintes lineaires redondantes dans le syste...
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
Warning! Do not modify this file that is automatically generated!
Definition: union-local.h:3
Psysteme psys
Definition: union-local.h:4
struct Ssyslist * succ
Definition: union-local.h:5
#define pa_path_to_disjunct(pa)
Definition: union-local.h:115

References ADD_ELEMENT_TO_LIST, adg_fprint_dataflow(), adg_same_dfg_vertex_number(), adg_sc_update_base(), adg_suppress_2nd_in_1st_ps(), Ssysteme::base, CAR, communication_undefined, conditional_false_quast, conditional_predicate, conditional_true_quast, CONS, DATAFLOW, debug(), dfg_arc_label_dataflows, dfg_vertex_label_exec_domain, dfg_vertex_label_statement, ENDP, ENTRY_ORDER, EXIT_ORDER, gen_nconc(), get_debug_level(), in_dfg_vertex_list(), int, leaf_label_statement, make_dataflow(), make_dfg_arc_label(), make_dfg_vertex_label(), make_predicate(), make_successor(), make_vertex(), NIL, pa_intersect_complement(), pa_intersect_system(), pa_path_to_disjunct, pips_assert, POP, predicate_system, predicate_undefined, Ssyslist::psys, quast_leaf_leaf_label, quast_leaf_solution, quast_quast_value, quast_undefined, quast_value_conditional, quast_value_conditional_p, quast_value_quast_leaf, quast_value_quast_leaf_p, quast_value_undefined, sc_append(), sc_creer_base(), sc_dup(), sc_elim_redund(), sc_empty_p(), sccflags_undefined, Ssyslist::succ, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_successors, vertex_undefined, and vertex_vertex_label.

Referenced by adg_dataflowgraph(), and adg_dataflowgraph_with_extremities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_vertex_to_ordering()

int adg_vertex_to_ordering ( vertex  in_ver)

======================================================================

adg_vertex_to_ordering( (vertex) in_ver ) AL 21/10/93 Input : A vertex in_ver Output : ordering of statement associated to in_ver PRIVATE to this pass !!

Definition at line 276 of file adg_graph.c.

278 {
279  int count = (int) NULL, order = -1;
280 
281  if (in_ver != vertex_undefined ) {
283  debug(9,"adg_vertex_to_ordering","Number of ver : %d\n",count);
284  order = (int) hash_get( Gvertex_number_to_statement, (char *) count );
285  debug(9, "adg_vertex_to_ordering", " -> ordering %d\n", order);
286  }
287  return order;
288 }
static int count
Definition: SDG.c:519

References count, debug(), dfg_vertex_label_statement, Gvertex_number_to_statement, hash_get(), int, vertex_undefined, and vertex_vertex_label.

Referenced by adg_same_order_in_dvl(), and adg_vertex_to_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_vertex_to_statement()

statement adg_vertex_to_statement ( vertex  in_ver)

======================================================================

statement adg_vertex_to_statement( (vertex) in_ver ) AL 21/10/93 Input : A vertex in_ver which has been reordered by adg_reorder_statement_number. Output : A statement corresponding to the vertex number. WARNING ! Uses global variable Gvertex_number_to_statement. PRIVATE to this pass !!

Definition at line 266 of file adg_graph.c.

268 { return ordering_to_statement( adg_vertex_to_ordering( in_ver ) ); }

References adg_vertex_to_ordering(), and ordering_to_statement().

Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_decreasing_stat_order_sort(), adg_get_read_entity_vertices(), adg_get_write_entity_vertices(), adg_path_possible_source(), and read_reference_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adg_write_reference_list()

list adg_write_reference_list ( vertex  ver,
effect  reff 
)

======================================================================

list adg_write_reference_list( (vertex) ver, (effect) reff ) AL 08/07/93 Returns a list of vertices whose statement write the read effect reff. Vertex ver is a DG node.

Definition at line 688 of file adg_graph.c.

691 {
692  list ls = NULL, ret_list = NIL;
693  reference r1 = NULL, rsink = NULL;
694 
695  debug( 9, "adg_write_reference_list", "begin\n" );
696  r1 = effect_any_reference( reff );
697  ls = vertex_successors( ver );
698 
699  for(; !ENDP( ls ); POP( ls ) ) {
700  successor succ = SUCCESSOR(CAR( ls ));
701  vertex succ_ver = successor_vertex( succ );
703  list conflist = dg_arc_label_conflicts( dgal );
704 
705  for(; !ENDP( conflist ); POP( conflist )) {
706  rsink = effect_any_reference(conflict_sink( CONFLICT(CAR( conflist )) ));
707  if (!(reference_equal_p( r1, rsink )) ) continue;
708  ADD_ELEMENT_TO_LIST( ret_list, VERTEX, succ_ver );
709  }
710  }
711 
712  debug( 9, "adg_write_reference_list", "end\n" );
713  return( ret_list );
714 }
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
bool reference_equal_p(reference r1, reference r2)
Definition: expression.c:1500

References ADD_ELEMENT_TO_LIST, CAR, CONFLICT, conflict_sink, debug(), dg_arc_label_conflicts, effect_any_reference, ENDP, NIL, POP, reference_equal_p(), SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, and vertex_successors.

Referenced by adg_dataflowgraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conflict_dup()

conflict conflict_dup ( conflict  conf)

======================================================================

conflict conflict_dup( (conflict) conf ) AL 06/07/93 Duplicates a conflict copy_conflict should now be used.

Definition at line 891 of file adg_graph.c.

893 {
894  list levlist = NIL;
895  cone co = NULL, new_cone = cone_undefined;
896  conflict new_conf = NULL;
897  int in = (int) NULL;
898  Ptsg cgs = NULL, new_gs = NULL ;
899 
900  debug(9, "conflict_dup", "begin\n");
901 
902  co = conflict_cone( conf );
903  if (co != cone_undefined) {
904  MAPL( int_ptr, {
905  in = INT(CAR( int_ptr ));
906  ADD_ELEMENT_TO_LIST( levlist, INT, in );
907  }, cone_levels( co ) );
908  cgs = (Ptsg) cone_generating_system( co );
909  if (cgs != (Ptsg) NIL) new_gs = sg_dup( cgs );
910  new_cone = make_cone( levlist, new_gs );
911  }
912  new_conf = make_conflict(effect_dup(conflict_source( conf )),
913  effect_dup(conflict_sink( conf )),
914  new_cone );
915  debug(9, "conflict_dup", "end\n");
916  return( new_conf );
917 }
conflict make_conflict(effect a1, effect a2, cone a3)
Definition: dg.c:96
cone make_cone(list a1, Ptsg a2)
Definition: dg.c:54
static effect effect_dup(effect eff)
effect effect_dup(effect eff) input : an effect.
Definition: adg_graph.c:864
Ptsg sg_dup(Ptsg sg_in)
Ptsg sg_dup(Ptsg sg_in): allocation d'un systeme generateur sg_out et copie sans sharing des ensemble...
Definition: sg.c:84

References ADD_ELEMENT_TO_LIST, CAR, cone_generating_system, cone_levels, cone_undefined, conflict_cone, conflict_sink, conflict_source, debug(), effect_dup(), int, INT, make_cone(), make_conflict(), MAPL, NIL, and sg_dup().

Referenced by adg_only_call_WR_dependence(), and dg_arc_label_dup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dg_arc_label_dup()

dg_arc_label dg_arc_label_dup ( dg_arc_label  dg_al)

======================================================================

dg_arc_label dg_arc_label_dup((dg_arc_label) dg_al) AL 05/07/93 Duplicates the dg_arc_label.

Definition at line 924 of file adg_graph.c.

926 {
927  list conflist = NIL;
928  dg_arc_label ret_dg_al = NULL;
929 
930  debug(9, "dg_arc_label_dup", "begin\n");
931  MAPL( conf_ptr,{
932  conflict new_conf = conflict_dup( CONFLICT(CAR( conf_ptr )) );
933  ADD_ELEMENT_TO_LIST( conflist, CONFLICT, new_conf );
934  }, dg_arc_label_conflicts( dg_al ) );
935 
936  ret_dg_al = make_dg_arc_label( conflist );
937  debug(9, "dg_arc_label_dup", "end\n");
938  return( ret_dg_al );
939 }

References ADD_ELEMENT_TO_LIST, CAR, CONFLICT, conflict_dup(), debug(), dg_arc_label_conflicts, make_dg_arc_label(), MAPL, and NIL.

Referenced by adg_reverse_graph(), and dg_vertex_dup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dg_vertex_dup()

vertex dg_vertex_dup ( vertex  ver)

======================================================================

vertex dg_vertex_dup( (vertex) ver ) AL 05/07/93 duplicates a vertex of the Dependence Graph Be VERY CAREFULL : this code could loop for ever if one successor of 'ver' points on it. PRIVATE use !

Definition at line 960 of file adg_graph.c.

962 {
963  list succ_list = NIL;
964  dg_vertex_label vl = NULL, ve = NULL;
965  successor succ = NULL;
966  dg_arc_label al = NULL;
967  vertex ret_ver = NULL;
968 
969  debug(9, "dg_vertex_dup", "statement n. : %02d\n",
970  (int) statement_number(vertex_to_statement( ver )) );
972  MAPL( succ_ptr, {
973  succ = SUCCESSOR(CAR( succ_ptr ));
975  ve = dg_vertex_dup( successor_vertex( succ ) );
976  ADD_ELEMENT_TO_LIST( succ_list, SUCCESSOR, make_successor( al, ve ) );
977  }, vertex_successors( ver ) );
978 
979  ret_ver = make_vertex( vl, succ_list );
980  debug(9, "dg_vertex_dup", "end\n");
981  return( ret_ver );
982 }
dg_vertex_label copy_dg_vertex_label(dg_vertex_label p)
DG_VERTEX_LABEL.
Definition: dg.c:144
vertex dg_vertex_dup(vertex ver)
======================================================================
Definition: adg_graph.c:960

References ADD_ELEMENT_TO_LIST, CAR, copy_dg_vertex_label(), debug(), dg_arc_label_dup(), make_successor(), make_vertex(), MAPL, NIL, statement_number, SUCCESSOR, successor_arc_label, successor_vertex, vertex_successors, vertex_to_statement(), and vertex_vertex_label.

+ Here is the call graph for this function:

◆ dg_vertex_label_dup()

dg_vertex_label dg_vertex_label_dup ( dg_vertex_label  dg_vl)

======================================================================

dg_vertex_label dg_vertex_label_dup( AL 05/07/93 Duplicates the dg_vertex_label.

Definition at line 945 of file adg_graph.c.

947 {
948  debug(9, "dg_vertex_label_dup", "doing for statement n. : %d\n",
949  (int) dg_vertex_label_statement( dg_vl ) );
951 }
dg_vertex_label make_dg_vertex_label(intptr_t a1, sccflags a2)
Definition: dg.c:180
#define statement_undefined
Definition: ri.h:2419

References debug(), dg_vertex_label_statement, make_dg_vertex_label(), sccflags_undefined, and statement_undefined.

+ Here is the call graph for this function:

◆ effect_dup()

static effect effect_dup ( effect  eff)
static

effect effect_dup(effect eff) input : an effect.

output : a copy of the input effect (no sharing). modifies : FI: the meaning of effect_dup() is unclear; should any syntactically correct effect by duplicable? Or this function be restricted to semantically correct effects? I do not understand why SC_UNDEFINED was used instead of transformer_undefined in contexts for scalar variables (8 August 1992)

Definition at line 864 of file adg_graph.c.

866 {
867  effect ne;
868  Psysteme sc = effect_system(eff);
869 
870  if(sc == SC_UNDEFINED) {
872  effect_action(eff),
873  effect_approximation(eff));
874  }
875  else {
876  pips_assert("effect_dup", ! SC_UNDEFINED_P(sc));
878  effect_action(eff),
880  sc);
881  }
882  return ne;
883 }
#define effect_system(e)
#define effect_reference(e)
FI: it would be useful to assert cell_preference_p(effect_cell(e)), but I do not know how to do it in...
#define make_convex_effect(reference, action, approximation, system)
#define make_simple_effect(reference, action, approximation)
#define effect_approximation(x)
Definition: effects.h:644

References effect_action, effect_approximation, effect_reference, effect_system, make_convex_effect, make_simple_effect, and pips_assert.

Referenced by conflict_dup().

+ Here is the caller graph for this function:

◆ in_effect_list_p()

bool in_effect_list_p ( list  l,
effect  eff 
)

======================================================================

bool in_effect_list_p( (list) l, (effect) eff ) AL 08/07/93 Returns True if the effect list l has an element whose reference is the same as the reference of eff. returns False in other cases.

Definition at line 722 of file adg_graph.c.

725 {
726  bool ret_bo = false;
727  reference r1 = NULL;
728 
729  debug(9, "in_effect_list_p", "begin\n");
730  r1 = effect_any_reference( eff );
731 
732  for(; !ENDP(l) && !ret_bo ; POP(l) ) {
734  if ( reference_equal_p( r1, r2 ) ) ret_bo = true;
735  }
736 
737  debug(9, "in_effect_list_p", "end\n");
738  return( ret_bo );
739 }
#define EFFECT(x)
EFFECT.
Definition: effects.h:608

References CAR, debug(), EFFECT, effect_any_reference, ENDP, POP, and reference_equal_p().

Referenced by read_reference_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ integer_in_list_p()

bool integer_in_list_p ( int  i,
list  l 
)

===========================================================================

Definition at line 292 of file adg_graph.c.

295 {
296  bool is_in_list = false;
297 
298  for( ; (l != NIL) && (! is_in_list); l = CDR(l))
299  if(i == INT(CAR(l)))
300  is_in_list = true;
301 
302  return(is_in_list);
303 }

References CAR, CDR, INT, and NIL.

Referenced by adg_reorder_statement_number().

+ Here is the caller graph for this function:

◆ read_reference_list()

list read_reference_list ( vertex  ver,
list  ent_l1,
list  ent_l2 
)

======================================================================

list read_reference_list( ver, ent_l1, ent_l2 ) AL 18/02/94 Returns a list of read effect for vertex ver. Vertex ver should have dg_arc_label arc_labels. This function should be very simple knowing effects of each statement : we should just scan the read effects of statement vertex.

Current effect

Put in rl effects readen by ver and remove from it effect whose variable are in ent_l1 or in ent_l2.

Definition at line 748 of file adg_graph.c.

751 {
752  list rl = NIL, effs = NIL, aux_l;
754  effect eff = effect_undefined; /* Current effect */
755  entity ent = entity_undefined;
756 
757  sta = adg_vertex_to_statement( ver );
758  debug( 7, "read_reference_list", "statement number : %02d\n", statement_number(sta) );
759  effs = load_proper_rw_effects_list( sta );
760 
761  /* Put in rl effects readen by ver and remove from it
762  * effect whose variable are in ent_l1 or in ent_l2.
763  */
764  for(aux_l = effs; !ENDP(aux_l); POP(aux_l)) {
765  eff = EFFECT(CAR(aux_l));
767  if ( !action_read_p(effect_action( eff ))) continue;
768  if ( is_entity_in_list_p( ent, ent_l1 )) continue;
769  if ( is_entity_in_list_p( ent, ent_l2 )) continue;
770  if ( in_effect_list_p( rl, eff ) ) continue;
771  ADD_ELEMENT_TO_LIST( rl, EFFECT, eff );
772  }
773 
774  debug( 7, "read_reference_list", "end\n" );
775  return( rl );
776 }
statement adg_vertex_to_statement(vertex in_ver)
======================================================================
Definition: adg_graph.c:266
bool in_effect_list_p(list l, effect eff)
======================================================================
Definition: adg_graph.c:722
list load_proper_rw_effects_list(statement)
#define effect_undefined
Definition: effects.h:614
bool is_entity_in_list_p(entity, list)
===========================================================================
Definition: utils.c:1281
#define reference_variable(x)
Definition: ri.h:2326
#define entity_undefined
Definition: ri.h:2761

References action_read_p, ADD_ELEMENT_TO_LIST, adg_vertex_to_statement(), CAR, debug(), EFFECT, effect_action, effect_any_reference, effect_undefined, ENDP, entity_undefined, in_effect_list_p(), is_entity_in_list_p(), load_proper_rw_effects_list(), NIL, POP, reference_variable, statement_number, and statement_undefined.

Referenced by adg_dataflowgraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ Gcount_re

int Gcount_re
extern

External variables.

Definition at line 45 of file array_dfg.c.

◆ Gstco_map

hash_table Gstco_map
extern

Definition at line 47 of file array_dfg.c.

◆ Gvertex_number_to_statement

hash_table Gvertex_number_to_statement