25 #include "pips_config.h"
63 #include "constants.h"
79 #include "resources.h"
83 #include "array_dfg.h"
84 #include "reindexing.h"
94 #define SUCC(cp) (((cp) == NULL) ? NULL : (cp)->succ)
109 if( l == NULL || l->succ == NULL )
return(l) ;
113 next_next =
SUCC(next);
115 for( ; next != NULL ; )
120 next_next =
SUCC(next_next);
137 entity and_ent, leq_ent, equ_ent;
141 if (SC_UNDEFINED_P(ps))
159 for(pc = ps->inegalites; pc!=NULL; pc = pc->
succ) {
168 for(pc = ps->egalites; pc!=NULL; pc = pc->
succ) {
177 fprintf(stderr,
"\t[predicate_to_expression] Result: %s\n",
225 SAT,
num, (
char *) NULL));
228 SAI,
num, (
char *) NULL));
251 fprintf(stderr,
"\n***\nCreate an ARRAY ENTITY : %s, %s\n",
318 if (l1 ==
NIL)
return(l2);
319 if (l2 ==
NIL)
return(l1);
346 fprintf(fp,
"\nListe of instruction:");
347 fprintf(fp,
"\n=====================");
349 for (; li !=
NIL; li =
CDR(li))
351 fprintf(fp,
"\nInstruction n. %d:\n", i);
368 fprintf(fp,
"\nIndice de boucle :");
370 fprintf(fp,
"\nDomaine (lower, upper, inc):");
377 fprintf(fp,
"\nCorps de boucle :");
381 fprintf(fp,
"\nType d'execution");
384 else fprintf(fp,
"->parallele");
429 fprintf(stderr,
"\nC'est un block de statement :");
435 fprintf(stderr,
"\nFin du block");
441 fprintf(stderr,
"\nC'est un test :");
442 fprintf(stderr,
"\nTrue statement :");
445 fprintf(stderr,
"\nFin de la branche True");
446 fprintf(stderr,
"\nFalse statement :");
449 fprintf(stderr,
"\nFin du test.");
455 fprintf(stderr,
"\nC'est une boucle :");
458 fprintf(stderr,
"\nFin de boucle.");
464 fprintf(stderr,
"\nC'est une instruction goto ");
466 fprintf(stderr,
"\nFin du goto");
472 fprintf(stderr,
"\nC'est un call ");
474 fprintf(stderr,
"\nFin du call");
480 fprintf(stderr,
"\nC'est un unstructured ;");
485 fprintf(stderr,
"\nFin du unstructured");
504 if (l2 == NULL)
return(l1);
542 list var_l, par_l, *new_l;
548 for (l = var_l; (!
ENDP(l)) && (new_ps->nb_eq < dim);
POP(l))
640 Pbase index_base,const_base;
655 for(pv = index_base, j=1; pv != NULL; pv = pv->
succ, j++)
658 for(pv = const_base, j=1; pv != NULL; pv = pv->
succ, j++)
697 Pbase new_base, index_base, const_base;
703 Value cst, coeff, dena, denb, ppc;
714 ppc =
ppcm(dena, denb);
716 for (i = n; i >= 1; i--)
731 for (j = 1; j <= m1; vect = vect->
succ, j++)
749 for (j = 1; j <= m2-1; vect = vect->
succ, j++)
810 Pbase new_base, index_base, const_base;
816 Value cst, coeff, dena, denb, ppc;
825 ppc =
ppcm(dena, denb);
827 for (i = n; i >= 1; i--)
842 for (j = 1; j <= m1; vect = vect->
succ, j++)
860 for (j = 1; j <= m2-1; vect = vect->
succ, j++)
918 fprintf(stderr,
"\nmatrcix_to_ps");
942 while (ps->egalites != NULL)
945 ps->egalites = (ps->egalites)->succ;
952 while (ps->inegalites != NULL)
954 pc1 = ps->inegalites;
955 ps->inegalites = (ps->inegalites)->succ;
959 ps->inegalites = pc2;
978 for(lv = vars; !
ENDP(lv) && no_var;
POP(lv)) {
1008 else if(max_or_min ==
IS_MIN)
1011 user_error(
"merge_expressions",
"Bad max or min tag\n");
1096 user_error(
"extract_plc",
"A plc is undefined\n");
1123 name = (
char*)
malloc(32);
1124 sprintf(name,
"%s%d%s%d",
STAT_SYM, st, typ, nb);
1173 "\nErreur dans le nombre d'equations ds chg_base()!\n");
1174 fprintf(stderr,
"\nnb eq = %d",lequ->nb_eq);
1178 "Erreur dans le nombre d'equations !\n");
1181 cequ = lequ->egalites;
1182 for (le = lvar; le !=
NIL;
POP(le), cequ = cequ->
succ) {
1250 cont = ps->egalites;
1251 while (cont != NULL) {
1258 cont = ps->inegalites;
1259 while (cont != NULL) {
1263 ps->nb_ineq =
count;
1281 if ((v->var ==
TCST)&&(v->succ == NULL))
1300 bool not_found =
true;
1304 for(av = b; (av != NULL) && not_found; av = av->
succ) {
1327 for(lle = le; !
ENDP(lle);
POP(lle)) {
1348 expressio`n_to_string(
exp));
call make_call(entity a1, list a2)
expression make_expression(syntax a1, normalized a2)
basic make_basic(enum basic_utype tag, void *val)
storage make_storage(enum storage_utype tag, void *val)
value make_value(enum value_utype tag, void *val)
reference make_reference(entity a1, list a2)
variable make_variable(basic a1, list a2, list a3)
syntax make_syntax(enum syntax_utype tag, void *val)
type make_type(enum type_utype tag, void *val)
string db_get_current_module_name(void)
Also used to check whether set...
#define value_notzero_p(val)
#define value_zero_p(val)
#define value_division(ref, val)
#define value_product(v, w)
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
#define value_div(v1, v2)
Value ppcm(Value, Value)
ppcm.c
#define A(i, j)
comp_matrice.c
#define CONTRAINTE_UNDEFINED_P(c)
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
string make_entity_fullname(const char *module_name, const char *local_name)
END_EOLE.
entity get_current_module_entity(void)
Get the entity of the current module.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#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.
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.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
int vect_size(Pvecteur v)
package vecteur - reductions
#define MATRIX_NB_LINES(matrix)
#define MATRIX_NB_COLUMNS(matrix)
#define MATRIX_DENOMINATOR(matrix)
int MATRIX_DENONIMATOR(matrix): acces au denominateur global d'une matrice matrix
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
void matrix_nulle(Pmatrix Z)
void matrix_nulle(Pmatrix Z): Initialisation de la matrice Z a la valeur matrice nulle
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#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",...
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MODULE_SEP_STRING
string concatenate(const char *,...)
Return the concatenation of the given strings.
void * gen_find_tabulated(const char *, int)
void substitute_var_with_vec(Psysteme, entity, Value, Pvecteur)
===========================================================================
void fprint_psysteme(FILE *, Psysteme)
===========================================================================
#define plc_placements(x)
#define placement_undefined
#define SCHEDULE(x)
SCHEDULE.
#define PLACEMENT(x)
PLACEMENT.
#define schedule_statement(x)
#define placement_statement(x)
void fprint_list_of_exp(FILE *fp, list exp_l)
void fprint_list_of_exp(FILE *fp, list exp_l): prints in the file "fp" the list of expression "exp_l"...
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
string expression_to_string(expression e)
bool vecteurs_libres_p(Psysteme sys, Pbase v_base, Pbase c_base)
========================================================================
Psysteme append_eg(Psysteme M1, Psysteme M2)
========================================================================
void fprint_call(FILE *fp, call ca)
=======================================================================
bool array_ref_exp_p(expression e)
======================================================================
Psyslist reverse_psyslist(Psyslist l)
======================================================================
entity create_new_entity(int st, char *typ, int nb)
========================================================================
Psysteme my_clean_ps(Psysteme ps)
=======================================================================
reference my_build_new_ref(int kind, int n, list subscripts, reference old_r)
========================================================================
Psysteme change_base_in_sc(Psysteme ps, list lvar, Psysteme lequ)
========================================================================
placement extract_plc(plc p, int cn)
========================================================================
list remove_minmax(list le)
=====================================================================
void my_matrices_to_constraints_with_sym_cst_2(Pcontrainte *pc, Pbase new_base, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=====================================================================
void my_lhs_subs_in_ins(instruction ins, string SA, int n, list subscripts)
========================================================================
Psyslist add_sclist_to_sclist(Psyslist l1, Psyslist l2)
=======================================================================
void fprint_loop(FILE *fp, loop lp)
=======================================================================
expression psystem_to_expression(Psysteme ps)
======================================================================
bool min_or_max_expression_p(expression exp)
===================================================================
dfg_vertex_label vertex_label
Name : reindexing_utils.c Package : reindexing Author : Alexis Platonoff & Antoine Cloue Date : May 1...
void matrix_coef_mult(Pmatrix A, Value nb)
========================================================================
Psysteme matrix_to_system(Pmatrix A, Pbase b)
==================================================================
void fprint_list_of_ins(FILE *fp, list li)
=======================================================================
void print_detailed_ins(instruction ins)
======================================================================
bool vars_in_vect_p(Pvecteur pv, list vars)
======================================================================
Psysteme sc_reverse_constraints(Psysteme ps)
========================================================================
list find_new_variables(list l1, list l2)
========================================================================
expression merge_expressions(expression exp1, expression exp2, int max_or_min)
===================================================================
Psysteme sc_add_egalite_at_end(Psysteme ps, Pcontrainte co)
=======================================================================
bool is_vect_constant_p(Pvecteur v)
========================================================================
list extract_bdt(bdt b, int cn)
=======================================================================
void my_constraints_with_sym_cst_to_matrices(Pcontrainte pc, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=====================================================================
bool cst_vector_p(Pvecteur v, Pbase b)
========================================================================
list ADD_LIST_TO_LIST(list l1, list l2)
=======================================================================
void my_matrices_to_constraints_with_sym_cst(Pcontrainte *pc, Pbase new_base, Pbase index_base, Pbase const_base, Pmatrix A, Pmatrix B)
=====================================================================
Psysteme base_complete(Psysteme sys, list var_l, list par_l, list *new_l)
=======================================================================
#define ENTITY_ASSIGN_P(e)
#define EQUAL_OPERATOR_NAME
#define NORMALIZE_EXPRESSION(e)
#define make_entity(n, t, s, i)
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
#define LESS_OR_EQUAL_OPERATOR_NAME
#define ENTITY_MIN_OR_MAX_P(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...
code entity_code(entity e)
list entities_to_expressions(list l_ent)
build a list of expressions from a list of entities
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
basic basic_of_reference(reference)
Retrieves the basic of a reference in a newly allocated basic object.
#define normalized_undefined
#define syntax_reference_p(x)
#define loop_execution(x)
#define syntax_reference(x)
#define instruction_loop(x)
#define INSTRUCTION(x)
INSTRUCTION.
#define instruction_goto(x)
#define code_declarations(x)
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
@ is_instruction_unstructured
#define instruction_tag(x)
#define execution_sequential_p(x)
#define normalized_tag(x)
#define reference_indices(x)
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define expression_syntax(x)
#define instruction_unstructured(x)
#define entity_domain
newgen_syntax_domain_defined
#define STATEMENT(x)
STATEMENT.
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.
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
void sa_print_ins(FILE *fp, instruction i)
=========================================================================
list dims_of_nest(int n)
=========================================================================
entity create_entity(string name, variable v)
=========================================================================
struct Scontrainte * succ
Warning! Do not modify this file that is automatically generated!
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
struct cons * cdr
The pointer to the next element.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
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...
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val)
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val): mise de la coordonnee var du vecteur *pp...