25 #include "pips_config.h"
84 user_error(
"parallelize",
"too many nested loops\n");
126 user_error(
"parallelize",
"too many nested loops\n");
168 if(l < 1 || l >
MAXSV)
169 user_error(
"parallelize",
"too many scalar variables\n");
173 for (i = 0; i <
MAXSV; i++)
275 if(l <= 0 || l > cl) {
278 "projection sur %s\n",
280 if(SC_EMPTY_P(s = sc_projection_pure(s, v))) {
281 debug(8,
"ProjectOnDi",
"infaisable\n");
284 debug(8,
"ProjectOnDi",
"faisable\n");
301 for (i = 1; i <= n; i++) {
311 while(n1 !=
NIL && n2 !=
NIL) {
325 #define ILCMAX 100000
435 fprintf(stderr,
"The list of variables to be eliminated is :\n");
440 pips_assert(
"Dependence system *psc is consistent before projection",
445 pips_assert(
"Dependence system *psc is consistent after projection",
457 pips_assert(
"Dependence system *psc is consistent after empty test",
486 debug(6,
"sc_faisabilite_optim",
"begin\n");
495 pips_debug(7,
"overflow error, returning TRUE. \n");
497 debug(6,
"sc_faisabilite_optim",
"end\n");
505 debug(7,
"sc_faisabilite_optim",
"system not feasible\n");
506 debug(6,
"sc_faisabilite_optim",
"end\n");
512 debug(7,
"sc_faisabilite_optim",
"system feasible\n");
513 debug(6,
"sc_faisabilite_optim",
"end\n");
519 debug(7,
"sc_faisabilite_optim",
"normalized system not feasible\n");
520 debug(6,
"sc_faisabilite_optim",
"end\n");
549 pos = neg = nul = NULL;
576 if((i = np * nn) <= 16)
581 for (pcp = pos; pcp != NULL; pcp = pcp->
succ) {
582 for (pcn = neg; pcn != NULL; pcn = pcn->
succ) {
583 bool int_comb_p =
true;
585 sc_integer_inequalities_combination_ofl_ctrl(sc1,
669 if(pve != NULL && sc->
nb_eq != 0) {
672 pips_debug(7,
"carry out the integer elimination by equation:\n");
689 sc = sc_variable_substitution_with_eq_ofl_ctrl(sc,
eq, v,
FWD_OFL_CTRL);
697 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
716 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
734 fprintf(stderr,
"projected normalised system is:\n");
740 pve = pv1 = pv1->
succ;
750 pips_assert(
"sc is consistent after the first use of equations",
753 pips_debug(7,
"Variables left to project after the first step: ");
759 if(pve != NULL && sc->
egalites != NULL) {
760 pips_debug(7,
"carry out the non integer elimination by equation:\n");
763 while((sc->
egalites != 0) && (pv1 != NULL)) {
766 if(
eq == NULL && pv1 != NULL) {
781 sc = sc_variable_substitution_with_eq_ofl_ctrl(sc,
792 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
807 pips_debug(7,
"normalization detects a non-feasible constraint system\n");
813 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
828 fprintf(stderr,
"projected normalised system is:\n");
833 pve = pv1 = pv1->
succ;
841 pips_assert(
"sc is consistent after the second use of equations",
844 pips_debug(7,
"Variables left to project with Fourier-Motzkin: ");
863 fprintf(stderr,
"%s\n",
"exact");
865 fprintf(stderr,
"%s\n",
"not exact");
876 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
895 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
919 fprintf(stderr,
"%s\n",
"exact");
921 fprintf(stderr,
"%s\n",
"not exact");
922 fprintf(stderr,
"projected normalised system is:\n");
931 pips_assert(
"sc is consistent before base update", sc);
950 for (pv1 = pv; pv1 != NULL; pv1 = pv1->
succ) {
955 pips_assert(
"sc is consistent after base update", sc);
1001 "sc_minmax_of_variable_optim",
1002 " overflow error, returning INT_MAX and INT_MIN. \n");
1026 for (pc = ps->inegalites; pc != NULL; pc = pc->
succ) {
1084 for (pvcour = (*ppv); pvcour != NULL; pvcour = pvcour->
succ)
1085 if(pvcour->
var == var)
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define value_oppose(ref)
#define value_pdiv(v1, v2)
#define value_uminus(val)
unary operators on values
#define value_notone_p(val)
#define value_product(v, w)
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Pbase base_intersection(Pbase b1, Pbase b2)
Return variables/dimensions present in bases b1 and b2.
void vect_debug(Pvecteur v)
constraint.c
void sc_syst_debug(Psysteme s)
constraint_to_text.c
void egalite_debug(Pcontrainte c)
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
Pcontrainte contrainte_var_min_coeff(Pcontrainte, Variable, Value *, bool)
Pcontrainte contrainte_var_min_coeff(Pcontrainte contraintes, Variable v, int *coeff) input : a list ...
int nb_elems_list(Pcontrainte)
int nb_elems_list(Pcontrainte list): nombre de contraintes se trouvant dans une liste de contraintes
bool contrainte_constante_p(Pcontrainte)
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<...
bool contrainte_verifiee(Pcontrainte, bool)
bool contrainte_verifiee(Pcontrainte ineg, bool eq_p): test de faisabilite d'inegalite (eq_p == false...
#define action_write_p(x)
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
#define CDR(pcons)
Get the list less its first element.
void vect_dump(Pvecteur v)
void vect_dump(Pvecteur v): print sparse vector v on stderr.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define user_error(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define MODULE_SEP_STRING
void * gen_find_tabulated(const char *, int)
#define LOOP_COUNTER_MODULE_NAME
moved from ricedg-local.h
#define make_entity(n, t, s, i)
#define DI_VAR_MODULE_NAME
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...
#define entity_domain
newgen_syntax_domain_defined
#define storage_undefined
#define MAXDEPTH
maximun number of nested loops
#define MAXSV
maximum number of scalar variables
bool is_test_exact
or counting the number of F-M complexity less than 16.
void sc_base_remove_variable(Psysteme sc, Variable v)
bool sc_consistent_p(Psysteme sc)
bool sc_consistent_p(Psysteme sc): check that sc is well defined, that the numbers of equalities and ...
Psysteme sc_empty(Pbase b)
Psysteme sc_empty(Pbase b): build a Psysteme with one unfeasible constraint to define the empty subsp...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Pbase sc_to_minimal_basis(Psysteme ps)
creation d'une base contenant toutes les variables apparaissant avec des coefficients non-nuls dans l...
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.
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
void build_sc_nredund_2pass_ofl_ctrl(Psysteme volatile *psc, int ofl_ctrl)
bool sc_value_of_variable(Psysteme ps, Variable var, Value *pval)
bool sc_value_for_variable(Psysteme ps, Variable var, Value *pval): examine les egalites du systeme p...
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
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.
entity MakeDiVar(int l)
This function creates di variables.
bool sc_minmax_of_variable_optim(Psysteme volatile ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable_optim(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme p...
void sc_add_dsi(int l, entity e, Psysteme s)
Psysteme sc_projection_optim_along_vecteur_ofl(Psysteme sc, Pvecteur pv)
Psysteme sc_projection_optim_along_vecteur_ofl(Psysteme sc, Pvecteur pv)
entity DiVars[MAXDEPTH]
here is a collection of function intended to create and manipulate "di" variables and test of depende...
entity MakeLiVar(int l)
This function creates li variables(thee ith loop index variable).
Pbase MakeDibaseinorder(int n)
Pbase MakeDibaseinorder(int n) make a base of D#1 ...
int sc_proj_optim_on_di_ofl(int cl, Psysteme *psc)
int sc_proj_optim_on_di_ofl(cl, sc)
static bool combiner_ofl_with_test(Psysteme sc, Variable v)
bool combiner_ofl_with_test(Psysteme sc, Variable v):
void sc_add_di(int l, entity e, Psysteme s, int li)
bool sc_faisabilite_optim(Psysteme sc)
bool sc_faisabilite_optim (Psysteme sc) :
int sc_proj_on_di(int cl, Psysteme s)
int dep_type(action ac1, action ac2)
int dep_type(action ac1,action ac2) This function test the type of the dependence.
Psysteme sc_invers(Psysteme ps)
Psysteme sc_invers(Psysteme ps): calcul un systeme des contraintes qui est l'invers du systeme initia...
int FindMaximumCommonLevel(cons *n1, cons *n2)
entity MakeDsiVar(int l)
This function creates dsi variables.
entity GetDiVar(int l)
This functions looks up a di variable of nesting level l in table DiVars.
int DiVarLevel(entity e)
this function returns the nesting level of a given di variable e.
entity MakeLoopCounter()
Create a new loop counter variable.
void vect_chg_var_sign(Pvecteur *ppv, Variable var)
void vect_chg_var_sign(Pvecteur *ppv, Variable var) changement de signe de la coordonnee var du vecte...
#define ILCMAX
Management of loop counters.
#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....
#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;.
Pbase base_dup(Pbase b)
Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...