25 #include "pips_config.h"
41 #define NEXT(cp) (((cp) == NIL) ? NIL : (cp)->cdr)
81 debug(1,
"adg_dataflowgraph",
"begin \n");
99 vertex ret_dest_ver = NULL, dest_ver = NULL;
104 Psysteme dest_test_context = NULL, dest_loop_context = NULL;
107 int dest_nb, dest_order;
128 else dest_test_context = SC_RN;
133 else dest_loop_context = SC_RN;
134 dest_context =
sc_append(
sc_dup( dest_test_context ),dest_loop_context);
156 fprintf(stderr,
"\n========================================\n");
157 fprintf(stderr,
"Destination Statement (ordering %d) :\n",dest_order);
159 fprintf(stderr,
"Read Effects :\n");
162 for(; !
ENDP( dest_readl );
POP( dest_readl )) {
163 effect dest_read_eff = NULL;
164 list sou_l = NULL, sou_lll =
NIL;
171 dest_read_eff =
EFFECT(
CAR( dest_readl ));
174 fprintf(stderr,
"\n\n--> Source of Effect ? ");
190 debug(9,
"adg_dataflowgraph",
"No candidates => Entry Flow\n");
192 fprintf(stderr,
"\n ------ Final Source ------\n");
213 for(; !
ENDP(sou_l);
POP(sou_l)) {
220 debug(9,
"adg_dataflowgraph",
"\nPossible source : stat %d at depth %d\n",
229 for(prov_l = sou_lll; !
ENDP(prov_l);
POP(prov_l)) {
231 if( dep2 > max_depth ) max_depth = dep2;
233 for(prov_i = max_depth; prov_i >= 0; prov_i-- ) {
235 for(; !
ENDP(prov_l);
POP(prov_l) ) {
249 for(; !
ENDP( cand_l );
POP(cand_l) ) {
251 int sou_order, sou_d;
254 list sou_lcl = NULL, sou_args =
NIL;
260 list ent_l = NULL, renamed_l = NULL, merged_l = NULL;
265 quast prov_q = NULL, sou_q = NULL;
267 quast *local_source = NULL;
296 else prov_ps = local_path->
psys;
297 local_source = (
quast*) (poss->
qua);
299 prov_ps = SC_UNDEFINED;
303 fprintf(stderr,
"\nPossible Source Statement (ordering %d) ",sou_order);
304 fprintf(stderr,
"at depth %d :\n", sou_d);
327 for(prov_i=0; prov_i < sou_d; prov_i++)
POP(sou_lcl);
336 for(prov_l2=sou_args;!
ENDP(prov_l2);
POP(prov_l2)){
356 if ( (sou_d >= 0) && (sou_d < max_depth) ) {
410 fprintf(stderr,
"\nSource Psysteme :\n");
414 fprintf(stderr,
"\nContext Psysteme :\n");
419 if (sou_ps == SC_UNDEFINED) {
448 fprintf(stderr,
"\nPresent source quast :\n");
457 fprintf(stderr,
"\n Updated Source :\n");
471 fprintf(stderr,
"\n ------ Final Source ------\n");
487 debug(1,
"adg_dataflowgraph",
"end \n");
506 graph dg = NULL, rev_dg = NULL, wr_dg = NULL;
507 graph dup_dg = NULL, ret_dfg = NULL;
517 user_log(
"\n\n *** COMPUTE ARRAY DATA FLOW GRAPH for %s\n",mod_name);
537 " CAN'T APPLY FEAUTRIER'S ALGORITHM:\n"
538 " This is not a static control program !");
545 SUMMARY = ((ss = getenv(
"SUMMARY")) != NULL)? atoi(ss) :
false;
void user_log(const char *format,...)
vertex make_vertex(vertex_label a1, list a2)
leaf_label make_leaf_label(intptr_t a1, intptr_t a2)
quast_value make_quast_value(enum quast_value_utype tag, void *val)
quast make_quast(quast_value a1, list a2)
conditional make_conditional(predicate a1, quast a2, quast a3)
quast_leaf make_quast_leaf(list a1, leaf_label a2)
dfg_vertex_label make_dfg_vertex_label(intptr_t a1, predicate a2, sccflags a3)
predicate make_predicate(Psysteme a1)
expression copy_expression(expression p)
EXPRESSION.
graph adg_dup_disjunctive_nodes(graph g, statement_mapping stco_map)
======================================================================
list adg_write_reference_list(vertex ver, effect reff)
======================================================================
int adg_number_to_ordering(int in_nb)
======================================================================
statement adg_vertex_to_statement(vertex in_ver)
======================================================================
vertex adg_number_to_vertex(graph in_dfg, int in_nb)
======================================================================
list read_reference_list(vertex ver, list ent_l1, list ent_l2)
======================================================================
graph adg_pure_dfg(graph in_gr)
======================================================================
graph adg_only_call_WR_dependence(graph g)
======================================================================
void adg_reorder_statement_number(graph in_dfg)
======================================================================
graph adg_reverse_graph(graph g)
======================================================================
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)
======================================================================
vertex adg_same_dfg_vertex_number(list in_l, int in_i)
======================================================================
predicate adg_get_predicate_of_loops(list loops)
======================================================================
void fprint_dfg(FILE *fp, graph obj)
===========================================================================
void imprime_special_quast(FILE *fp, quast qu)
===========================================================================
graph adg_dataflowgraph_with_extremities(statement mod_stat, statement_mapping stco_map, graph dup_dg)
======================================================================
list adg_merge_entities_lists(list l1, list l2)
======================================================================
statement adg_number_to_statement(int in_nb)
======================================================================
quast adg_path_max_source(quast *tsou, quast *tsou2, Ppath in_pa, list psl, boolean take_last)
======================================================================
quast adg_compact_quast(quast in_q)
======================================================================
Pvecteur adg_list_to_vect(list in_list, bool with_tcst)
======================================================================
void adg_fill_with_quast(quast *in_pq, quast in_q)
======================================================================
int adg_number_of_same_loops(list in_l1, list in_l2)
======================================================================
void adg_sc_update_base(Psysteme *in_pps)
======================================================================
list adg_decreasing_stat_order_sort(list in_list)
======================================================================
bool adg_is_textualy_after_p(statement in_s1, statement in_s2)
======================================================================
Psysteme adg_sc_dup(Psysteme in_ps)
======================================================================
Pposs_source adg_path_possible_source(quast *in_tsou, vertex in_ver, int in_dep, Ppath in_pa, bool take_last)
======================================================================
list adg_get_loop_indices(list ll)
======================================================================
void adg_enrichir(quast in_qu, leaf_label in_ll)
======================================================================
list adg_rename_entities(list le, hash_table fst)
======================================================================
Psysteme adg_suppress_2nd_in_1st_ps(Psysteme in_ps1, Psysteme in_ps2)
======================================================================
#define EXPRESSION_PVECTEUR(e)
graph adg_dataflowgraph(statement mod_stat, statement_mapping stco_map, graph dup_dg)
======================================================================
int Gcount_re
External variables.
bool my_sc_faisabilite(Psysteme in_ps)
hash_table Gvertex_number_to_statement
Global variables.
list Gstructural_parameters
boolean array_dfg(char *mod_name)
======================================================================
statement_mapping Gstco_map
static hash_table Gforward_substitute_table
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
struct _newgen_struct_statement_ * statement
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
#define sccflags_undefined
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
struct _newgen_struct_graph_ * graph
#define vertex_vertex_label(x)
#define vertex_successors(x)
#define graph_vertices(x)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
entity set_current_module_entity(entity)
static.c
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define CAR(pcons)
Get the value of the first element of a list.
list gen_append(list l1, const list l2)
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
hash_table hash_table_make(hash_key_type key_type, size_t size)
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.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
static statement mod_stat
We want to keep track of the current statement inside the recurse.
#define pips_internal_error
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Pbase list_to_base(list l)
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l",...
#define GET_STATEMENT_MAPPING(map, stat)
hash_table statement_mapping
these macros are obsolete! newgen functions (->) should be used instead
#define HASH_MAP(k, v, code, ht)
int stco_common_loops_of_statements(statement_mapping, statement, statement)
AP, sep 25th 1995 : I have added a function from static_controlise/utils.c.
void pu_vect_fprint(FILE *, Pvecteur)
===========================================================================
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
#define static_control_loops(x)
struct _newgen_struct_static_control_ * static_control
#define leaf_label_statement(x)
@ is_quast_value_quast_leaf
@ is_quast_value_conditional
#define static_control_params(x)
#define static_control_yes(x)
#define dfg_vertex_label_statement(x)
#define quast_leaf_undefined
#define leaf_label_depth(x)
#define dfg_vertex_label_exec_domain(x)
#define LEAF_LABEL(x)
LEAF_LABEL.
Ppath pa_full()
Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new()
bool pa_empty_p(Ppath in_pa)
pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)
quast pip_integer_max(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
void sort_psysteme(Psysteme ps, Pvecteur pv)
==================================================================
void print_statement(statement)
Print a statement on stderr.
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
#define syntax_reference(x)
#define reference_variable(x)
#define statement_ordering(x)
#define predicate_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define predicate_undefined
#define reference_indices(x)
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define statement_number(x)
#define expression_syntax(x)
#define predicate_system(x)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new)
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new): reecriture du systeme s remp...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void forward_substitute_in_exp(expression *, hash_table)
Structure for return of a possible source.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define PA_UNDEFINED_P(pa)
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...