25 #include "pips_config.h"
43 #include <sys/times.h>
65 #include "constants.h"
81 #include "resources.h"
85 #include "array_dfg.h"
86 #include "prgm_mapping.h"
90 #define BDT_STRING "bdt"
91 #define STMT_HT_SIZE 100
92 #define DTF_HT_SIZE 200
93 #define ENT_HT_SIZE 200
121 #define PLC_EXT ".plc_file"
132 debug_on(
"PRINT_PLC_DEBUG_LEVEL" );
141 "/", localfilename, NULL));
152 fprintf(stderr,
"\n\n *** PRINT_PLC DONE\n");
200 list l, l_lamb =
NIL, stmt_lamb;
202 Ppolynome pp_proto, pp_ind, pp_par, pp_coeff, pp_new;
218 list ind_l, par_l, aux_par_l;
242 for( ; ind_l !=
NIL; ind_l =
CDR(ind_l)) {
258 for(aux_par_l = par_l ; !
ENDP(aux_par_l);
POP(aux_par_l)) {
293 for(i = 0; i < dim; i++) {
319 int dmin = 1, bdmax = 1;
329 int stmt, dim, b_dim, p_dim;
346 if((bdmax <= b_dim) && (dmin < p_dim))
384 int dim, b_dim = 0, sdim;
408 ind_not_null =
false;
409 for(l = ind_l; (!
ENDP(l)) && (!ind_not_null);
POP(l)) {
481 for( ; su_l !=
NIL; su_l =
CDR(su_l)) {
493 for( ; df_l !=
NIL; df_l =
CDR(df_l)) {
496 Psysteme impl_sc, elim_sc, sc_ed = SC_UNDEFINED,
497 sc_gp = SC_UNDEFINED, df_domain;
498 list elim_vvs, impl_var, elim_var;
535 fprintf(stderr,
"[plc_make_distance] \t\tSource prototype:\n");
560 fprintf(stderr,
"[plc_make_distance] \t\t\tTransformation for index %s : %s\n",
562 fprintf(stderr,
"[plc_make_distance] \t\t\tCrt PI(source, h(x)):\n");
570 fprintf(stderr,
"[plc_make_distance] \t\t\tPI(sink, x) :\n");
573 fprintf(stderr,
"[plc_make_distance] \t\t\tPI(source, h(x)) :\n");
585 fprintf(stderr,
"[plc_make_distance] BEFORE IMPL ELIM \t\tDistance pp:\n");
614 fprintf(stderr,
"[plc_make_distance] \t\t Exec domain: ");
616 fprintf(stderr,
"[plc_make_distance] \t\t Gov pred : ");
618 fprintf(stderr,
"[plc_make_distance] \t\t Inter the 2: ");
625 fprintf(stderr,
"[plc_make_distance] \t\t Impl sys : ");
629 if(impl_sc != NULL) {
636 fprintf(stderr,
"[plc_make_distance] \t\t New subs :\n");
644 fprintf(stderr,
"[plc_make_distance] \t\tDistance pp:\n");
688 list l, sink_ind_l, sink_par_l;
696 for(l = df_l; !
ENDP(l);
POP(l)) {
723 fprintf(stderr,
"[plc_make_distance] \tDistance Mi:\n");
725 fprintf(stderr,
"[plc_make_distance] \tDistance Mp:\n");
759 for(l = l_nodes; l !=
NIL; l =
CDR(l)) {
818 for( ; su_l !=
NIL; su_l =
CDR(su_l)) {
827 for(; df_l !=
NIL; df_l =
CDR(df_l)) {
858 fprintf(stderr,
"[edge_weight] \ttrans system is:");
870 fprintf(stderr,
"[edge_weight] \t\t\tElim equations are: ");
872 fprintf(stderr,
"[edge_weight] \t\t\tAfter elim equations: ");
876 for( ; si_l !=
NIL; si_l =
CDR(si_l)) {
878 sc_trans = sc_integer_projection_along_variable(
sc_dup(sc_trans),
882 debug(7,
"edge_weight",
"\t\t\t\tElim ineq with %s\n",
890 fprintf(stderr,
"[edge_weight] \t\tNumber of implicit equa is %d of: ", n_impl);
898 debug(4,
"edge_weight",
"\tWeight of the edge: %d\n", poids);
922 bool not_found =
true;
924 for( ; !
ENDP(ll) && (not_found);
POP(ll) ) {
991 matrice mat_A, mat_Z, mat_P, mat_Q, mat_H;
997 fprintf(stderr,
"[prototype_dimension] Prototype : ");
1000 fprintf(stderr,
"[prototype_dimension] Indices : ");
1009 for(li = ind_l; !
ENDP(li);
POP(li)) {
1016 base_L = ps_AL->
base;
1019 fprintf(stderr,
"[prototype_dimension] ps_AL : ");
1021 fprintf(stderr,
"[prototype_dimension] base_L : ");
1029 if( (n == 0) || (m == 0) )
1039 dim =
dim_H(mat_H, n, m);
1042 fprintf(stderr,
"[prototype_dimension] A of rank = %d : ", dim);
1105 int stmt, dim_plc, dim_bdt;
1107 bool proto_not_triv =
true;
1110 fprintf(stderr,
"[is_not_trivial_p] \t\t\tSub is:\n");
1130 fprintf(stderr,
"[is_not_trivial_p] \t\t\t\tProto is:");
1138 fprintf(stderr,
"[is_not_trivial_p] must be of dim %d, After apply sub:", dim_plc);
1145 proto_not_triv =
false;
1151 fprintf(stderr,
"[is_not_trivial_p] \t\t\t\tTriviality:");
1158 if(proto_not_triv) {
1163 fprintf(stderr,
"[is_not_trivial_p] New protos:\n");
1170 return(proto_not_triv);
1195 list l, ll, vl, var_l, sol, farkas_mult;
1196 int count_xc = 0, count_auxil_coeff = 0,
stmt, count_farkas_mult;
1208 fprintf(stderr,
"\nPLC at dim %2d :\n===============\n", dim);
1215 for(l = xunks; l !=
NIL; l =
CDR(l)) {
1217 for(ll = xus; !
ENDP(ll);
POP(ll)) {
1227 for(l = pcunks; l !=
NIL; l =
CDR(l)) {
1229 count_auxil_coeff++;
1241 fprintf(stderr,
"\nNew subs:\n");
1248 count_farkas_mult = 0;
1251 list vvs, elim_vvs, aux_vvs;
1252 Psysteme elim_ps, farkas_ps, sc_ed;
1273 farkas_pp =
apply_farkas(sub_pp, sc_ed, &init_l, &count_farkas_mult);
1276 fprintf(stderr,
"\nFarkas DONE:\n");
1278 fprintf(stderr,
"\nCoeff of Farkas: ");
1287 fprintf(stderr,
"\n List of Var to elim: ");
1298 fprintf(stderr,
"\nEquations :\n");
1306 fprintf(stderr,
"\nAfter ELIM LAMBDAS\n");
1307 fprintf(stderr,
"\nElim Coeff and System: ");
1310 fprintf(stderr,
"Remaining Coeff and System :\n");
1317 farkas_mult =
gen_nconc(farkas_mult, init_l);
1321 if(farkas_ps->
nb_eq != 0) {
1332 fprintf(stderr,
"\nAfter ELIM AUXIL\n");
1333 fprintf(stderr,
"\nElim Coeff and System: ");
1336 fprintf(stderr,
"Remaining Coeff and System :\n");
1345 for(vvs = elim_vvs ; vvs !=
NIL; vvs =
CDR(vvs)) {
1350 for(pc = farkas_ps->
egalites; pc != NULL; pc = pc->
succ) {
1357 fprintf(stderr,
"\nNEW PIP systeme :\n");
1359 fprintf(stderr,
"\nVL subs:\n");
1366 fprintf(stderr,
"\nNEW subs (before):\n");
1374 fprintf(stderr,
"\nNEW subs:\n");
1379 pip_ps->
base = NULL;
1389 fprintf(stderr,
"\nSol to PIP sys :\n\tList of unks:");
1403 user_error(
"valuer",
"Pip sol conditional\n");
1409 for( ; sol !=
NIL;
POP(sol),
POP(var_l)) {
1426 fprintf(stderr,
"\nNEW subs (FINAL):\n");
1449 int nb_xl = 0, *frenq_tab, r;
1451 for(cl = newl; !
ENDP(cl);
POP(cl)) {
1469 frenq_tab = (
int *)
malloc(
sizeof(
int) * nb_xl);
1470 for(r = 0; r < nb_xl; r++) {frenq_tab[r] = 0;}
1476 for(cl = xl, r = 0; cl !=
NIL; cl =
CDR(cl), r++) {
1481 for(cl = xl, r = 0 ; cl !=
NIL; cl =
CDR(cl), r++) {
1485 debug(5,
"sort_unknowns",
"Frenq of %s is %d\n",
1504 list l, xl =
NIL, cl, xunks, pcunks, aux_xl, xul;
1508 fprintf(stderr,
"[partition_unknowns] BEGIN with dmax = %d, and unks: ", dmax);
1514 for(cl = *unks; !
ENDP(cl);
POP(cl)) {
1525 fprintf(stderr,
"[partition_unknowns] pcunks: ");
1528 fprintf(stderr,
"[partition_unknowns] %d in xl: ", nb_xl);
1551 fprintf(stderr,
"[partition_unknowns] stmt %d, proto: ",
stmt);
1556 for(cl = xl; cl !=
NIL; cl =
CDR(cl)) {
1565 fprintf(stderr,
"[partition_unknowns] xl of crt proto:");
1570 for(lax = xunks; !
ENDP(lax) && !
ENDP(rem_xl) && !
ENDP(aux_xl);
POP(lax)) {
1572 bool not_found =
true;
1575 for(cl = aux_xl; !
ENDP(cl) && not_found; cl =
CDR(cl)) {
1581 for(cl = aux_xl; !
ENDP(cl) && not_found; cl =
CDR(cl)) {
1598 fprintf(stderr,
"[partition_unknowns] xl of crt proto (again):");
1601 fprintf(stderr,
"[partition_unknowns] Remaining xl:");
1605 fprintf(stderr,
"[partition_unknowns] Crt unks (addition): ");
1606 for(xul = xunks; !
ENDP(xul);
POP(xul)) {
1615 for(cl = aux_xl; !
ENDP(cl); cl =
CDR(cl)) {
1631 fprintf(stderr,
"[partition_unknowns] Remaining xl (again):");
1635 fprintf(stderr,
"[partition_unknowns] Crt unks (appendition): ");
1636 for(xul = xunks; !
ENDP(xul);
POP(xul)) {
1665 list unks_l, var_l, par_l;
1671 int n, m1, m2, r, d, i, j;
1692 r = n - nb_restrict;
1697 for(i = 1; i <= n; i++)
1698 for(j = 1; j <= r; j++)
1717 return(
sc_make(new_pc, NULL));
1727 list sig = *sigma, sigma_p;
1732 for(leg = sys->egalites; leg != NULL; leg = leg->
succ) {
1734 fprintf(stderr,
"[solve_system_by_succ_elim] \tCrt equation:");
1742 fprintf(stderr,
"[solve_system_by_succ_elim] \t\tEqu after apply crt subs:");
1752 fprintf(stderr,
"[solve_system_by_succ_elim] \t\tSubs of non elim var:\n");
1757 if(sigma_p ==
NIL) {
1764 fprintf(stderr,
"[solve_system_by_succ_elim] \tCrt local subs :\n");
1791 return( (pv->succ == NULL) && (pv->var ==
TCST) );
1803 list plc_dims, mu_l;
1809 if(plc_dims !=
NIL) {
1812 for(; !
ENDP(plc_dims);
POP(plc_dims),
POP(mu_l)) {
1841 int crt_dim = sys->nb_eq;
1849 else if(dim == crt_dim)
1852 for(pc = dims_sys->egalites; crt_dim < dim; pc = pc->succ) {
1861 new_ps = aux_new_ps;
1883 for(i = 1; i <= m; i++) {
1884 for(j = 1; j <= n; j++) {
1885 ACCESS(mat_M, m, i, j) = scal *
ACCESS(mat_M, m, i, j);
1950 fprintf(stderr,
"[partial_broadcast_coefficients] for stmt %d, with dims:\n",
crt_stmt);
1955 if(crt_dims !=
NIL) {
1956 list mu_list, ind_l, par_l, vl, il, init_l, elim_l, vvs_L;
1957 Psysteme ps_bp, ps_pp_dims, new_ps, elim_ps;
1959 int i,j, sd, n, m, l;
1962 matrice mat_Q, mat_Qc, mat_P, mat_Pc, mat_A;
1976 for(vl = var_l; !
ENDP(vl);
POP(vl)) {
1983 ps_pp_dims =
append_eg(ps_pp_dims, aux_ps);
1988 fprintf(stderr,
"[partial_broadcast_coefficients] Prototype dir:\n");
1997 fprintf(stderr,
"[partial_broadcast_coefficients] Broadcast dir:\n");
2005 fprintf(stderr,
"[partial_broadcast_coefficients] FULL Broadcast dir:\n");
2015 mat_Q, mat_Qc, n, m);
2023 fprintf(stderr,
"[partial_broadcast_coefficients] Matrix -P:\n");
2031 for(il = ind_l, i=1; !
ENDP(il);
POP(il), i++) {
2035 for(vl = var_l, j=1; !
ENDP(vl);
POP(vl), j++) {
2044 fprintf(stderr,
"[partial_broadcast_coefficients] Matrix A|D:\n");
2060 new_ps =
sc_make(new_pc, NULL);
2063 fprintf(stderr,
"[partial_broadcast_coefficients] A.L + D - P.M:\n");
2065 fprintf(stderr,
"\t Var to eliminate : ");
2075 fprintf(stderr,
"[partial_broadcast_coefficients] After ELIM LAMBDAs\n");
2076 fprintf(stderr,
"\tElim Coeff and System: ");
2079 fprintf(stderr,
"\tRemaining Coeff and System : ");
2088 fprintf(stderr,
"[partial_broadcast_coefficients] Sub for elim lambdas:\n");
2093 if(new_ps->
nb_eq != 0) {
2095 list elim_l2, init_l2;
2103 fprintf(stderr,
"[partial_broadcast_coefficients] After ELIM MUs\n");
2104 fprintf(stderr,
"\tElim Coeff and System: ");
2107 fprintf(stderr,
"\tRemaining Coeff and System : ");
2116 fprintf(stderr,
"[partial_broadcast_coefficients] Sub for elim mus:\n");
2124 fprintf(stderr,
"[partial_broadcast_coefficients] Sub for MUs and LAMBDAs:\n");
2132 fprintf(stderr,
"[partial_broadcast_coefficients] Crt sub:\n");
2160 for(vl = sigma; !
ENDP(vl);
POP(vl)) {
2229 struct tms chrono1, chrono2;
2233 list lambda, xmu_lambda, mu_lambda, mu,
2234 sigma, sigma1, sigma2, sigma_p, *sigma3,
2236 sorted_df_l, l, remnants_df_l, df_l;
2276 fprintf(stderr,
"[prgm_mapping] Structure parameters of the program: ");
2317 fprintf(stderr,
"[prgm_mapping] Nodes order:");
2334 fprintf(stderr,
"[prgm_mapping] Nodes prototypes:\n");
2336 fprintf(stderr,
"[prgm_mapping] LAMBDAS: ");
2352 i = ((md = getenv(
"MINIMUM_DIMENSION")) != NULL) ? 1 : 0;
2359 "Minimum number of dimensions: %d instead of %d\n",
2367 i = ((md = getenv(
"MAPPING_DIMENSION")) != NULL) ? atoi(md) : dmax;
2370 "environment variable MAPPING_DIMENSION has set the mapping dimension to %d instead of %d\n",
2388 debug(3,
"prgm_mapping",
"DIM des fonctions de placement : %d\n", dmax);
2410 fprintf(stderr,
"[prgm_mapping] Edges UNorder:\n");
2418 fprintf(stderr,
"[prgm_mapping] Edges order:\n");
2431 fprintf(stderr,
"[prgm_mapping] Dif Red restriction:\n");
2433 fprintf(stderr,
"[prgm_mapping] Remnants :\n");
2437 for(sigma_p = sigma; !
ENDP(sigma_p);
POP(sigma_p))
2442 fprintf(stderr,
"[prgm_mapping] Prototypes after broadcast conditions:\n");
2452 fprintf(stderr,
"[prgm_mapping] ******* Partial broadcast sub:");
2461 fprintf(stderr,
"[prgm_mapping] Prototypes after partial broadcast sub:\n");
2466 for(sigma_p = sigma1; !
ENDP(sigma_p);
POP(sigma_p)) {
2473 fprintf(stderr,
"[prgm_mapping] ******* Remaining lambdas and Mus:\n");
2474 fprintf(stderr,
"\t LAMBDAs:");
2489 fprintf(stderr,
"[prgm_mapping] Edges distances:\n");
2500 fprintf(stderr,
"[prgm_mapping] Matrix M:\n");
2509 fprintf(stderr,
"Crt subs:\n");
2514 fprintf(stderr,
"[prgm_mapping] Prototypes after distance conditions:\n");
2528 for(sigma_p = sigma2; !
ENDP(sigma_p);
POP(sigma_p)) {
2535 fprintf(stderr,
"[prgm_mapping] ******* Remaining lambdas:");
2538 fprintf(stderr,
"[prgm_mapping] ******* Remaining mus:");
2548 fprintf(stderr,
"[prgm_mapping] ******* Sorted lambdas:");
2551 fprintf(stderr,
"[prgm_mapping] ******* Sorted mus:");
2562 fprintf(stderr,
"[prgm_mapping] \nRemaining unknowns\n");
2563 fprintf(stderr,
"\tX COEFF: ");
2564 for(l = xmu_lambda; !
ENDP(l);
POP(l)) {
2569 fprintf(stderr,
"\tPC COEFF: ");
2581 for(i = 0; i < dmax; i++) {
2584 sigma3[i] =
valuer(i, xmu_lambda, mu_lambda);
2588 fprintf(stderr,
"[prgm_mapping] Plc dim %d, new subs is\n", i);
2619 fprintf(stderr,
"\n RESULT OF MAPPING:\n**************\n");
2621 for(i = 0; i < dmax; i++) {
2623 "Distance for dim %d\n=================================\n", i);
2625 for(l = df_l; !
ENDP(l);
POP(l)) {
2649 "\n*******\nTIMING:\n*******\n\tuser : %ld, system : %ld \n",
2650 (
long) chrono2.tms_utime - chrono1.tms_utime,
2651 (
long) chrono2.tms_stime - chrono1.tms_stime );
2655 fprintf(stderr,
"\n MAPPING:\n**************\n");
2657 fprintf(stderr,
"\n\n *** MAPPING done\n");
void user_log(const char *format,...)
placement make_placement(intptr_t a1, list a2)
graph adg_pure_dfg(graph in_gr)
======================================================================
void fprint_dfg(FILE *fp, graph obj)
===========================================================================
static int sink_stmt
Current source node.
static list trans_l
Current list of nodes.
static int source_stmt
Current sink statement.
static int crt_stmt
Current source statement.
static hash_table STS
The "STS" global variable is the hash table that maps the static_control on the statements.
static predicate gov_pred
Current expression.
statement adg_number_to_statement(int in_nb)
======================================================================
void const char const char const int
void broadcast(graph g)
========================================================================
list broadcast_conditions(list lambda, list df_l, list *sigma)
========================================================================
struct _newgen_struct_statement_ * statement
#define A(i, j)
comp_matrice.c
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
const char * module_name(const char *s)
Return the module part of an entity name.
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
#define successor_vertex(x)
#define successor_arc_label(x)
#define vertex_vertex_label(x)
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
#define ENDP(l)
Test if a list is empty.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_concatenate(const list l1x, const list l2x)
concatenate two lists.
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)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
#define CDR(pcons)
Get the list less its first element.
list gen_append(list l1, const list l2)
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.
#define DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
hash_table hash_table_make(hash_key_type key_type, size_t size)
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.
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.
void * hash_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
void fprint_entity_list(FILE *fp, list l)
void fprint_entity_list(FILE *fp,list l): prints a list of entities on file fp.
list base_to_list(Pbase base)
Most includes are centralized here.
static statement mod_stat
We want to keep track of the current statement inside the recurse.
int vect_size(Pvecteur v)
package vecteur - reductions
#define DENOMINATOR(matrix)
int DENOMINATEUR(matrix): acces au denominateur global d'une matrice matrix La combinaison *(&()) est...
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
#define matrice_new(n, m)
Allocation et desallocation d'une matrice.
Value * matrice
package matrice
int dim_H(matrice H, int n, int m)
Calcul de la dimension de la matrice de Hermite H.
void matrice_hermite(Value *MAT, int n, int m, Value *P, Value *H, Value *Q, Value *det_p, Value *det_q)
package matrice
void matrice_general_inversion(matrice a, matrice inv_a, int n)
void matrice_general_inversion(matrice a; matrice inv_a; int n) calcul de l'inversion du matrice gene...
void matrice_transpose(matrice a, matrice a_t, int n, int m)
package matrice
void matrice_nulle(matrice Z, int n, int m)
void matrice_nulle(matrice Z, int n, int m): Initialisation de la matrice Z a la valeur matrice nulle
void matrice_fprint(FILE *, matrice, int, int)
matrice_io.c
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define user_error(fn,...)
#define user_warning(fn,...)
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
string concatenate(const char *,...)
Return the concatenation of the given strings.
const char * pu_variable_name(Variable)
package mapping : Alexis Platonoff, april 1993
list general_merge_sort(list, bool(*)(void))
void matrices_to_contraintes_with_sym_cst(Pcontrainte *, Pbase, Pbase, matrice, matrice, int, int, int)
Psysteme make_expression_equalities(list)
===========================================================================
int vertex_int_stmt(vertex)
===========================================================================
Psysteme elim_var_with_eg(Psysteme, list *, list *)
===========================================================================
Pvecteur prototype_factorize(Ppolynome, Variable)
========================================================================
void contraintes_with_sym_cst_to_matrices(Pcontrainte, Pbase, Pbase, matrice, matrice, int, int, int)
Creation de la matrice A correspondant au systeme lineaire et de la matrice correspondant a la partie...
void pu_vect_fprint(FILE *, Pvecteur)
===========================================================================
list static_control_to_indices(static_control)
package mapping : Alexis Platonoff, july 1993
Psysteme find_implicit_equation(Psysteme)
========================================================================
Pvecteur polynome_to_vecteur(Ppolynome)
========================================================================
void reset_current_stco_map(void)
========================================================================
static_control get_stco_from_current_map(statement)
========================================================================
void imprime_quast(FILE *, quast)
===========================================================================
bool pu_is_inferior_var(Variable, Variable)
void pu_egalite_fprint(FILE *, Pcontrainte, const char *(*)(entity))
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
Ppolynome prototype_var_subst(Ppolynome, Variable, Ppolynome)
=================================================================
void set_current_stco_map(statement_mapping)
========================================================================
void pu_contraintes_to_matrices(Pcontrainte, Pbase, matrice, matrice, int, int)
===========================================================================
void fprint_bdt(FILE *, bdt)
===========================================================================
void fprint_dataflow(FILE *, int, dataflow)
===========================================================================
void pu_matrices_to_contraintes(Pcontrainte *, Pbase, matrice, matrice, int, int)
utils.c
#define plc_placements(x)
#define var_val_variable(x)
#define DATAFLOW(x)
DATAFLOW.
#define dataflow_transformation(x)
#define quast_value_undefined
struct _newgen_struct_static_control_ * static_control
struct _newgen_struct_bdt_ * bdt
#define placement_dims(x)
#define SCHEDULE(x)
SCHEDULE.
@ is_quast_value_quast_leaf
@ is_quast_value_conditional
#define dfg_arc_label_dataflows(x)
#define static_control_params(x)
#define static_control_yes(x)
#define PLACEMENT(x)
PLACEMENT.
#define quast_leaf_solution(x)
#define quast_value_tag(x)
#define static_control_undefined
#define dataflow_governing_pred(x)
struct _newgen_struct_plc_ * plc
#define dfg_vertex_label_statement(x)
#define VAR_VAL(x)
VAR_VAL.
#define schedule_statement(x)
#define quast_value_quast_leaf(x)
#define quast_quast_value(x)
#define placement_statement(x)
quast pip_integer_min(Psysteme ps_dep, Psysteme ps_context, Pvecteur pv_unknowns)
==================================================================
string db_get_current_workspace_directory(void)
Ppolynome make_polynome(float coeff, Variable var, Value expo)
Ppolynome make_polynome(float coeff, Variable var, Value expo) PRIVATE allocates space for,...
Ppolynome polynome_dup(Ppolynome pp)
Ppolynome polynome_dup(Ppolynome pp) creates and returns a copy of pp.
void polynome_rm(Ppolynome *ppp)
void polynome_rm(Ppolynome* ppp) frees space occupied by polynomial *ppp returns *ppp pointing to POL...
Ppolynome polynome_free(Ppolynome pp)
Ppolynome polynome_free(Ppolynome pp) frees space occupied by polynomial pp returns pp == POLYNOME_NU...
Ppolynome vecteur_to_polynome(Pvecteur pv)
===========================================================================
Ppolynome polynome_mult(Ppolynome pp1, Ppolynome pp2)
Ppolynome polynome_mult(Ppolynome pp1, Ppolynome pp2) returns pp1 * pp2.
void polynome_add(Ppolynome *ppp, Ppolynome pp2)
void polynome_add(Ppolynome* ppp, Ppolynome pp2) (*ppp) = (*ppp) + pp2.
void polynome_fprint(FILE *fd, Ppolynome pp, char *(*variable_name)(Variable), int *is_inferior_var)
void polynome_fprint(FILE* fd, Ppolynome pp, char* (*variable_name)(), bool (*is_inferior_var)()) Out...
void polynome_negate(Ppolynome *ppp)
void polynome_negate(Ppolynome *ppp); changes sign of polynomial *ppp.
struct Spolynome * Ppolynome
string expression_to_string(expression e)
#define SUCC_DATAFLOWS(s)
void fprint_plc(FILE *fp, plc obj)
========================================================================
void plc_fprint_dfs(FILE *fp, list df_l, hash_table DtfToStmt, hash_table DtfToWgh)
========================================================================
void fprint_pla_pp_dims(FILE *fp, placement one_placement)
========================================================================
void plc_fprint_distance(FILE *fp, graph g, hash_table DtfToDist)
========================================================================
void plc_fprint_proto(FILE *fp, graph g, hash_table StmtToProto)
========================================================================
void fprint_plc_pp_dims(FILE *fp, plc one_plc)
========================================================================
Ppolynome apply_farkas(Ppolynome F, Psysteme D, list *L, int *count_lambdas)
bool is_broadcast_p(dataflow df)
========================================================================
bool compare_dfs_weight(chunk *d1, chunk *d2)
========================================================================
int count_implicit_equation(Psysteme ps)
========================================================================
entity find_or_create_coeff(string prefix, int n)
========================================================================
int communication_dim(dataflow df)
========================================================================
bool is_index_coeff_p(entity e)
========================================================================
list get_graph_dataflows(graph g)
========================================================================
bool is_reduction_p(dataflow df)
========================================================================
Psysteme completer_base(Psysteme sys, list var_l, list par_l)
========================================================================
bool vecteurs_libres_p(Psysteme sys, Pbase v_base, Pbase c_base)
========================================================================
bool compare_nodes_dim(chunk *n1, chunk *n2)
========================================================================
Psysteme append_eg(Psysteme M1, Psysteme M2)
========================================================================
entity make_coeff(string prefix, int n)
========================================================================
Psysteme nullify_factors(Ppolynome *pp, list var_l, bool with_remnants)
========================================================================
bool compare_coeff(chunk *c1, chunk *c2)
========================================================================
list put_source_ind(list le)
========================================================================
bool compare_unks_frenq(chunk *e1, chunk *e2)
========================================================================
bool prgm_mapping(char *module_name)
=========================================================================
int plc_make_min_dim()
========================================================================
hash_table StmtToPdim
Mapping from a statement (int) to its prototype.
int nb_dfs
The number of nodes in the DFG.
bool in_list_p(chunk *c, list l)
========================================================================
int plc_make_dim()
========================================================================
Psysteme completer_n_base(Psysteme sys, Psysteme dims_sys, list var_l, list par_l, int dim)
========================================================================
graph the_dfg
The placement function.
Psysteme system_inversion_restrict(Psysteme sys, list unks_l, list var_l, list par_l, int nb_restrict, bool is_first)
========================================================================
list valuer(int dim, list xunks, list pcunks)
========================================================================
void sort_unknowns(list *lambda, int dmax)
========================================================================
hash_table DtfToDist
Mapping from a dataflow to its sink statement.
bool solve_system_by_succ_elim(Psysteme sys, list *sigma)
========================================================================
hash_table DtfToWgh
Mapping from a dataflow to its distance.
void pm_matrice_scalar_mult(int scal, matrice mat_M, int m, int n)
=========================================================================
bool print_plc(char *module_name) const
========================================================================
list prgm_parameter_l
global variables
int nb_nodes
The timing function.
list sort_dfg_node(list l_nodes)
========================================================================
list partial_broadcast_coefficients(list var_l, list *used_mu)
=========================================================================
Psysteme broadcast_dimensions(placement pla, list mu_list)
=========================================================================
dfg_vertex_label vertex_label
Local defines.
void edge_weight()
========================================================================
bool constant_vecteur_p(Pvecteur pv)
=========================================================================
bool is_mu_coeff_p(entity e)
========================================================================
hash_table DtfToSink
The number of dataflows in the DFG.
hash_table StmtToProto
Mapping from a dataflow to its weight.
Psysteme cutting_conditions(list df_l)
========================================================================
hash_table StmtToBdim
Mapping from a statement to the dim of its plc func.
list partition_unknowns(list *unks, int dmax)
========================================================================
bool is_not_trivial_p(list vvs)
========================================================================
list plc_make_proto()
========================================================================
list get_mu_coeff(list sigma)
=========================================================================
void add_to_list(chunk *c, list *l)
========================================================================
void plc_make_distance()
========================================================================
plc pfunc
Internal variables
int prototype_dimension(Ppolynome pp, list ind_l)
========================================================================
void vvs_on_prototypes(list sigma)
=========================================================================
hash_table StmtToMu
Mapping from a stmt to its lambda coeff.
hash_table StmtToDim
Mapping from a statement to the dim of its bdt.
hash_table UnkToFrenq
Mapping from a stmt to its mu coeff.
hash_table StmtToLamb
Mapping from a stmt to its iteration space dim.
bdt the_bdt
The data flow graph.
int count_mu_coeff
Mapping from an entity to its frenq in the plc proto.
void initialize_mu_list(int stmt, int dim)
========================================================================
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
#define NORMALIZE_EXPRESSION(e)
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...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
expression Pvecteur_to_expression(Pvecteur vect)
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
int expression_to_int(expression exp)
================================================================
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Ppolynome expression_to_polynome(expression exp)
===========================================================================
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
#define predicate_undefined
#define expression_normalized(x)
#define normalized_linear(x)
#define predicate_system(x)
struct Ssysteme * Psysteme
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
Psysteme sc_intersection(Psysteme s1, Psysteme s2, Psysteme s3)
Psysteme sc_intersection(Psysteme s1, Psysteme s2, Psysteme s3): calcul d'un systeme de contraintes s...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define base_dimension(b)
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_cl2_ofl_ctrl(Value x1, Pvecteur v1, Value x2, Pvecteur v2, int ofl_ctrl)
Pvecteur vect_cl2_ofl(Value x1, Pvecteur v1, Value x2, Pvecteur v2): allocation d'un vecteur v dont l...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
void fprint_vvs(FILE *fp, list vvs)
========================================================================
list compose_vvs(list vv1, list vv2)
========================================================================
list make_vvs_from_sc(Psysteme ps_aux, list var_l)
========================================================================
list vvs_on_vvs(list vv1, list vv2)
========================================================================
Ppolynome vvs_on_polynome(list vvs, Ppolynome pp)
========================================================================
Psysteme vvs_on_systeme(list vvs, Psysteme ps)
========================================================================
list plc_make_vvs_with_vector(Pvecteur v)
========================================================================
Pvecteur vvs_on_vecteur(list vvs, Pvecteur pv)
========================================================================
list make_vvs(entity var, int coeff, Pvecteur val)
========================================================================