25 #include "pips_config.h"
62 #include "constants.h"
66 #include "array_dfg.h"
67 #include "prgm_mapping.h"
101 for (; su_l !=
NIL; su_l =
CDR(su_l)) {
109 for (; df_l !=
NIL; df_l =
CDR(df_l))
132 for (i = 1; i < r; v = v->
succ, i++);
224 for (j = 1; j <= m; j++) {
256 for (i = 1; i <= m; i++)
257 for (j = 1; j <= m - r; j++)
261 for (j = 1; j <= m - r; j++) {
263 for (i = 1; i <= m; i++) {
276 if (diff_sc->
nb_eq != 0) {
277 Psysteme sc_ed, sc_gp, df_domain, impl_sc;
300 if (impl_sc != NULL) {
301 for (pd = diff_sc->
egalites, pdprec = NULL; pd != NULL; pd = pd->
succ) {
313 if ((aux_ps == NULL) || (aux_ps->
nb_eq == impl_sc->
nb_eq)) {
324 if (diff_sc->
nb_eq != 0) {
352 for (cpc = pc; cpc != NULL;) {
370 for (l = l_pc; !
ENDP(l);
POP(l)) {
413 for (l = l_ps; !
ENDP(l);
POP(l)) {
414 fprintf(fp,
"Syst %d:\n", i++);
438 for (l = l_ps; !
ENDP(l);
POP(l)) {
441 for (; pc != NULL; pc = pc->
succ) {
448 for (l = l_ps; !
ENDP(l);
POP(l)) {
452 for (; pc != NULL; pc = pc->
succ) {
455 for (ll = l_ps; !
ENDP(ll);
POP(ll)) {
460 for (; ppc != NULL; ppc = ppc->
succ) {
503 for (l = l_ps; !
ENDP(l);
POP(l)) {
539 list plcs, ind_l, mu_list, la_list;
547 fprintf(stderr,
"[mapping_on_broadcast] BEGIN **********\n");
548 fprintf(stderr,
"[mapping_on_broadcast] with stmt %d and K: \n",
stmt);
565 fprintf(stderr,
"[mapping_on_broadcast] dim(PLC) = %d, already mapped:\n", p_dim);
579 fprintf(stderr,
"[mapping_on_broadcast] Mu :");
588 fprintf(stderr,
"[mapping_on_broadcast] Space A:\n");
599 if( (
A != SC_EMPTY) && (
A->nb_eq != 0) ) {
602 for(K_dims = K->
egalites; K_dims != NULL; K_dims = K_dims->
succ) {
620 fprintf(stderr,
"[mapping_on_broadcast] Space K':\n");
628 list new_dims =
NIL, mu_l, par_l;
640 fprintf(stderr,
"[mapping_on_broadcast] Mu :");
643 fprintf(stderr,
"[mapping_on_broadcast] Lambda :");
651 for(i = 0; i<count_dim; i++) {
POP(mu_l); }
652 for(; (Kp_dims != NULL) && (count_dim < p_dim); Kp_dims = Kp_dims->
succ) {
654 list lam_l = la_list;
659 fprintf(stderr,
"[mapping_on_broadcast] Params :");
685 fprintf(stderr,
"[mapping_on_broadcast] K' current dim : ");
688 fprintf(stderr,
"[mapping_on_broadcast] PLC added dim %d : ", count_dim);
701 fprintf(stderr,
"[mapping_on_broadcast] Dims now mapped:\n");
704 fprintf(stderr,
"[mapping_on_broadcast] END **********\n\n");
729 list lambda, df_l, *sigma;
733 list l, rem_df_l =
NIL, acc_df_l =
NIL, l_M_local =
NIL, ml, dl;
735 for (l = df_l; !
ENDP(l);
POP(l)) {
741 fprintf(stderr,
"[broadcast_conditions] \t\t\tDF: ");
749 fprintf(stderr,
"[broadcast_conditions] \t\t\tComm pred: ");
751 fprintf(stderr,
"predicate_undefined");
759 list ind_l, par_l, proto_lambda, l_bdir, bl;
778 for (bl = l_bdir; !
ENDP(bl);
POP(bl)) {
780 if (ps_bdir->nb_eq > 0) {
782 for (pc = ps_pdir->
egalites; pc != NULL; pc = pc->
succ) {
791 if (prec_pc == NULL) {
800 fprintf(stderr,
"[broadcast_conditions] \t\t\tk before elim bdt = %d\n", k);
807 fprintf(stderr,
"[broadcast_conditions] \t\t\tk = %d\n", k);
822 fprintf(stderr,
"[broadcast_conditions] \t\t\tFull sys\n");
828 user_error(
"broadcast_conditions",
"m1 should be equal to n\n");
841 for (i = 1; i <= n; i++)
842 for (j = 1; j <= (n - k); j++)
863 M_local =
sc_make(new_pc, NULL);
866 fprintf(stderr,
"[broadcast_conditions] \t\t\tM_local:\n");
883 for (dl = acc_df_l, ml = l_M_local; !
ENDP(dl);
POP(dl),
POP(ml)) {
888 fprintf(stderr,
"[broadcast_conditions] \t\t\tSIGMA before:\n");
907 fprintf(stderr,
"[broadcast_conditions] \t\t\tSIGMA after:\n");
928 bool sc_found =
false;
944 ind_not_null =
false;
945 for (l = ind_l; (!
ENDP(l)) && (!ind_not_null);
POP(l)) {
communication make_communication(predicate a1, predicate a2, predicate a3)
predicate make_predicate(Psysteme a1)
static int sink_stmt
Current source node.
static list trans_l
Current list of nodes.
static predicate gov_pred
Current expression.
statement adg_number_to_statement(int in_nb)
======================================================================
void const char const char const int
Pcontrainte list_to_contraintes(list l_pc)
========================================================================
entity base_find_var_with_rank(Pbase b, int r)
========================================================================
boolean compare_eq_occ(chunk *eq1, chunk *eq2)
========================================================================
void broadcast(graph g)
========================================================================
void count_eq_occ(list l_ps)
========================================================================
list prgm_parameter_l
global variables
list stmt_bdt_directions(int stmt, list ind_l, list par_l)
=========================================================================
void broadcast_of_dataflow(dataflow df, int stmt, predicate exec_domain)
========================================================================
dfg_vertex_label vertex_label
Newgen includes
void mapping_on_broadcast(int stmt, Psysteme K)
========================================================================
void fprint_l_psysteme(FILE *fp, list l_ps)
========================================================================
void sort_eq_in_systems(list l_ps)
========================================================================
list broadcast_conditions(list lambda, list df_l, list *sigma)
========================================================================
list contraintes_to_list(Pcontrainte pc)
========================================================================
#define A(i, j)
comp_matrice.c
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_UNDEFINED
struct Scontrainte * Pcontrainte
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 ...
#define successor_vertex(x)
#define successor_arc_label(x)
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
#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)
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)
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.
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.
#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 matrice_hermite_rank(matrice a, int n, int m __attribute__((unused)))
int matrice_hermite_rank(matrice a, int n, int m): rang d'une matrice en forme de hermite
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
#define pips_internal_error
#define user_error(fn,...)
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
Pbase list_to_base(list l)
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l",...
const char * pu_variable_name(Variable)
package mapping : Alexis Platonoff, april 1993
list general_merge_sort(list, bool(*)(void))
Psysteme make_expression_equalities(list)
===========================================================================
int vertex_int_stmt(vertex)
===========================================================================
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)
========================================================================
static_control get_stco_from_current_map(statement)
========================================================================
bool pu_is_inferior_var(Variable, Variable)
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
void fprint_pred(FILE *, predicate)
===========================================================================
void pu_contraintes_to_matrices(Pcontrainte, Pbase, matrice, matrice, int, int)
===========================================================================
void fprint_dataflow(FILE *, int, dataflow)
===========================================================================
void pu_matrices_to_contraintes(Pcontrainte *, Pbase, matrice, matrice, int, int)
utils.c
#define plc_placements(x)
#define dataflow_communication(x)
#define DATAFLOW(x)
DATAFLOW.
#define dataflow_transformation(x)
#define placement_undefined
#define placement_dims(x)
#define SCHEDULE(x)
SCHEDULE.
#define dfg_arc_label_dataflows(x)
#define communication_undefined
#define PLACEMENT(x)
PLACEMENT.
#define dataflow_governing_pred(x)
#define schedule_statement(x)
#define communication_broadcast(x)
#define placement_statement(x)
Ppolynome make_polynome(float coeff, Variable var, Value expo)
Ppolynome make_polynome(float coeff, Variable var, Value expo) PRIVATE allocates space for,...
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 fprint_pla_pp_dims(FILE *fp, placement one_placement)
========================================================================
bool is_broadcast_p(dataflow df)
========================================================================
list get_stmt_index_coeff(int stmt, hash_table StoL)
========================================================================
Psysteme completer_base(Psysteme sys, list var_l, list par_l)
========================================================================
bool vecteurs_libres_p(Psysteme sys, Pbase v_base, Pbase c_base)
========================================================================
hash_table StmtToPdim
Mapping from a statement (int) to its prototype.
bool solve_system_by_succ_elim(Psysteme sys, list *sigma)
========================================================================
Psysteme broadcast_dimensions(placement pla, list mu_list)
=========================================================================
hash_table DtfToSink
The number of dataflows in the DFG.
plc pfunc
Internal variables
hash_table StmtToMu
Mapping from a stmt to its lambda coeff.
hash_table StmtToLamb
Mapping from a stmt to its iteration space dim.
bdt the_bdt
The data flow graph.
#define NORMALIZE_EXPRESSION(e)
#define EXPRESSION(x)
EXPRESSION.
#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,...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
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 ...
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 VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
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)
#define BASE_NULLE
MACROS SUR LES BASES.
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
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...
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)
========================================================================