25 #include "pips_config.h"
83 pips_debug(9,
"entity e: %s, entity f: %s, %s\n",
85 assignment?
"Is an assignment" :
"Is not an assignment");
116 pips_debug(9,
"entity e: %s, entity e1: %s, entity e2: %s, %s\n",
120 addition_p?
"Is an addition" :
"Is a subtraction");
151 pips_debug(9,
"Begin for entity e1: %s of basic %s, "
152 "entity e2: %s of basic %s and operator %s\n",
321 for(ce2 = a2; !
ENDP(ce2);
POP(ce2)) {
356 pips_debug(9,
"global linear system r1 before projection\n");
368 if (sc_expensive_projection_p(r1,(
Variable) e_temp)) {
370 pips_debug(9,
"expensive projection on %s with\n",
389 "variable eliminated\n",
395 sc_and_base_projection_along_variable_ofl_ctrl
412 pips_debug(9,
"global linear system r1 after projection\n");
479 pips_assert(
"The two lists have the same number of elements",
501 pips_debug(9,
"Side effects of tf2 on tf1\n");
503 "of an expression affects variable(s) used in a later part\n");
507 pips_debug(9,
"Side effects of tf2 on tf1\n");
509 "of an expression affect variables used in an earlier part\n");
523 pips_debug(9,
"Side effects on other variables\n");
545 pips_debug(9,
"Begins with t1 = %p and t2 = %p, image_only=%s\n",
590 pips_debug(9,
"Exit with t=%p, for t1 = %p and t2 = %p\n", t, t1, t2);
612 pips_debug(9,
"begins with t1 = %p and t2 = %p\n", t1, t2);
616 pips_debug(9,
"ends with t = %p, t1 = %p and t2 = %p\n", t, t1, t2);
667 pips_assert(
"pre does not involve old values and has no arguments",
670 pips_debug(9,
"Begin with tf=%p and pre=%p\n", tf, pre);
719 Pbase b = sc_base(sc);
777 Pbase b = sc_base(sc);
832 pips_assert(
"r does not involve old values and has no arguments",
851 Pbase b = sc_base(scr);
872 int is_inferior =
true;
876 is_inferior = (strcmp(
s1, s2) > 0 );
935 pips_assert(
"Transformer t is consistent on entrance",
944 pips_assert(
"t is consistent after floating point simplification\n",
1075 sc_rm(r2), r2 = NULL;
1079 if (SC_EMPTY_P(r)) {
1098 fprintf(stderr,
"After normalization of transformer t=%p at level %d:\n",
1104 pips_assert(
"Transformer t is consistent on exit",
1177 pips_assert(
"No temporary values exist in the system since a reset "
1178 "counter for them has been performed\n",
ENDP(tv));
1223 Pbase b = sc_base(sc);
1244 pips_debug(1,
"Transformer before projection:\n");
1289 Pbase b = sc_base(sc);
1328 (t, args, elim,
true);
1340 (t, args, elim,
false);
1347 bool check_consistency_p)
1361 pips_debug(9,
"Begin for transformer %p\n", t);
1365 pips_debug(9,
"and entities to be projected: ");
1378 else if(!
ENDP(args)) {
1383 for (cea = args ; !
ENDP(cea);
POP(cea)) {
1387 pips_assert(
"base contains variable to project...",
1398 "variable eliminated\n",
1405 sc_projection_along_variable_ofl_ctrl
1456 if (SC_EMPTY_P(r)) {
1478 pips_debug(9,
"System after redundancy elimination\n");
1505 if(check_consistency_p
1507 fprintf(stderr,
"Value %s should have been eliminated earlier\n",
1534 pips_debug(9,
"Transformer after argument list update\n");
1541 if(check_consistency_p)
1542 pips_assert(
"After projection and redundancy elimination,"
1543 " transformer t is consistent",
1724 pips_debug(9,
"Begin for transformer %p\n", t);
1728 pips_debug(9,
"and entities to be projected: ");
1733 if(!
ENDP(args) && !SC_EMPTY_P(r)) {
1737 for(cea=args; !
ENDP(cea);
POP(cea)) {
1750 "variable eliminated\n",
1757 sc_projection_along_variable_ofl_ctrl
1797 pips_debug(9,
"Transformer after argument list update\n");
1804 " transformer t is consistent",
1872 bool affect_p =
false;
1896 bool affect_p =
false;
2035 bool substitutable_p =
true;
2045 return substitutable_p;
2065 bool is_float =
true;
2082 x += (
long double)(val) * (
long double) (d);
2102 if(is_float &&
vect_size(nv) > 0 && occ > 1 ) {
2128 if((!is_equation_p &&
x >0)
2129 || (is_equation_p &&
x!=0.)) {
2163 Pbase ob = sc_base(ps);
2190 bool is_string =
false;
2191 bool is_float =
false;
2192 bool type_undecided_p =
true;
2194 bool is_checked =
true;
2195 int number_of_strings = 0;
2215 if(type_undecided_p) {
2216 type_undecided_p =
false;
2228 if(type_undecided_p) {
2229 type_undecided_p =
false;
2238 if(number_of_strings==0) {
2243 else if(number_of_strings==1) {
2251 number_of_strings++;
2269 is_checked = (is_equation_p ?
false : (val <= 0));
2273 "non-integer constants\n");
2278 pips_assert(
"It can't be a float and a string simultaneously",
2279 !(is_float && is_string));
2282 if(number_of_strings!=2)
2292 if(i1>0 && i1+i2==0)
2294 else if(i1<0 && i1+i2==0)
2303 is_checked = (
x==0.);
2305 is_checked = (
x<0.);
2328 bool empty_p =
false;
2329 volatile bool consistent_p =
true;
2350 if(SC_EMPTY_P(new_ps)) {
2383 "variable eliminated\n",
2390 sc_projection_along_variable_ofl_ctrl
2413 pips_debug(9,
"System after all projections or emptiness detection:\n");
2419 for(
eq = sc_egalites(new_ps);
2425 for(ineq = sc_inegalites(new_ps);
2430 empty_p = !consistent_p;
2440 pips_debug(9,
"End: %sfeasible\n", empty_p?
"not " :
"");
2483 Pbase b = sc_base(sc);
2491 int n = sc_nbre_egalites(sc);
2550 debug(6,
"formal_and_actual_parameters_association",
2555 pips_assert(
"formal_and_actual_parameters_association",
2557 pips_assert(
"formal_and_actual_parameters_association",
2561 for( ce = formals; !
ENDP(ce);
POP(ce)) {
2568 user_error(
"formal_and_actual_parameters_association",
2569 "not enough args for formal parm. %d\n", r);
2584 debug(6,
"formal_and_actual_parameters_association",
2585 "new pre=%x\n", pre);
2587 debug(6,
"formal_and_actual_parameters_association",
"end for call to %s\n",
2619 fprintf(stderr,
"\n First expression : ");
2621 fprintf(stderr,
"\n Second expression : ");
2623 fprintf(stderr,
" \n equal in the context ?");
2693 dummy_upper,dummy_lower);
2695 actual_upper,actual_lower);
2699 if (l_actual_ref ==
NIL)
2830 bool remove_p =
false;
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
void free_transformer(transformer p)
transformer make_transformer(list a1, predicate a2)
predicate make_predicate(Psysteme a1)
expression copy_expression(expression p)
EXPRESSION.
bool transformer_consistent_p(transformer p)
transformer copy_transformer(transformer p)
TRANSFORMER.
struct _newgen_struct_entity_ * entity
bool entity_stub_sink_p(entity e)
test if an entity is a stub sink for a formal parameter e.g.
cons * dup_arguments(cons *args)
void free_arguments(cons *args)
bool arguments_set_equal_p(list a1, list a2)
Set equality of lists a1 and a2.
bool entity_is_argument_p(entity e, cons *args)
cons * arguments_add_entity(cons *a, entity e)
void dump_arguments(cons *args)
entity_name is a macro, hence the code replication
cons * arguments_difference(cons *a1, cons *a2)
set difference: a1 - a2 ; similar to set intersection
list base_to_entities(Pvecteur b)
generate a Newgen list with all entities refered in vector b
list arguments_intersection(list a1, list a2)
Build a new list with all entities occuring in both a1 and a2.
#define value_notzero_p(val)
void const char const char const int
#define value_zero_p(val)
int rank_of_variable(Pbase base, Variable var)
this function returns the rank of the variable var in the base 0 encodes TCST, but I do not know why,...
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Pbase base_union(Pbase b1, Pbase b2)
Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all eleme...
transformer transformer_dup(transformer t_in)
transformer package - basic routines
void transformer_free(transformer t)
bool transformer_weak_consistency_p(transformer t)
Interprocedural transformers do not meet all conditions.
bool transformer_is_rn_p(transformer t)
Check that transformer t is the canonical representation of the whole afine space defined by its basi...
transformer transformer_equality_add(transformer tf, Pvecteur i)
transformer empty_transformer(transformer t)
Do not allocate an empty transformer, but transform an allocated transformer into an empty_transforme...
transformer transformer_identity()
Allocate an identity transformer.
bool transformer_consistency_p(transformer t)
FI: I do not know if this procedure should always return or fail when an inconsistency is found.
transformer transformer_empty()
Allocate an empty transformer.
transformer move_transformer(transformer t1, transformer t2)
Move arguments and predicate of t2 into t1, free old arguments and predicate of t1,...
bool transformer_is_empty_p(transformer t)
Check that transformer t is the canonical representation of an empty transformer.
#define A(i, j)
comp_matrice.c
double float_constant_to_double(entity c)
entity float_to_entity(float c)
bool float_constant_p(entity ent)
ent can be either a numerical or a symbolic float constant
basic constant_basic(entity c)
#define CONTRAINTE_UNDEFINED_P(c)
#define contrainte_succ(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
transformer transformer_derivative_fix_point(transformer)
Computation of a transitive closure using constraints on the discrete derivative.
#define newgen_Psysteme(p)
#define chunk_undefined
obsolete
#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)
#define VOLATILE_FOREACH(_fe_CASTER, _fe_item, _fe_list)
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.
void gen_free_list(list l)
free the spine of the list
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
void * gen_find_eq(const void *item, const list seq)
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
int vect_size(Pvecteur v)
package vecteur - reductions
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
Pmatrix matrix_new(int m, int n)
package matrix
int matrices_to_1D_lattice(Pmatrix, Pmatrix, int, int, int, Value *, Value *)
Under the assumption A x = B, A[n,m] and B[n], compute the 1-D lattice for x_i of x[m] as.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#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.
string bool_to_string(bool)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
#define dump_transformer(t)
string basic_to_string(basic)
#define ENTITY_NON_EQUAL_P(e)
#define ENTITY_EQUAL_P(e)
#define MINUS_OPERATOR_NAME
#define ENTITY_LESS_THAN_P(e)
#define NORMALIZE_EXPRESSION(e)
#define binary_intrinsic_expression(name, e1, e2)
#define ENTITY_GREATER_THAN_P(e)
#define ENTITY_LESS_OR_EQUAL_P(e)
#define entity_constant_p(e)
#define ENTITY_GREATER_OR_EQUAL_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...
string entity_global_name(entity e)
Used instead of the macro to pass as formal argument.
code entity_code(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
void print_entities(list l)
bool entity_module_p(entity e)
void clean_all_normalized(expression e)
int fortran_string_compare(string fs1, string fs2)
compare pips fortran string constants from the fortran point of view.
expression find_ith_argument(list args, int n)
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool expression_equal_integer_p(expression exp, int i)
================================================================
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
bool same_expression_p(expression e1, expression e2)
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
bool same_scalar_location_p(entity, entity)
FI: transferred from semantics (should be used for effect translation as well)
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
#define transformer_undefined
#define transformer_undefined_p(x)
#define storage_formal_p(x)
#define value_reference(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define TRANSFORMER(x)
TRANSFORMER.
#define dimension_lower(x)
#define basic_pointer_p(x)
#define entity_storage(x)
#define code_declarations(x)
#define storage_formal(x)
#define entity_undefined_p(x)
#define expression_undefined
#define transformer_relation(x)
#define transformer_arguments(x)
#define dimension_upper(x)
#define value_reference_p(x)
#define variable_dimensions(x)
#define predicate_system_(x)
#define call_arguments(x)
#define normalized_linear(x)
#define storage_return_p(x)
#define predicate_system(x)
#define storage_return(x)
#define variable_basic(x)
#define basic_logical_p(x)
#define entity_initial(x)
struct Ssysteme * Psysteme
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_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...
bool sc_weak_consistent_p(Psysteme sc)
check that sc is well defined, that the numbers of equalities and inequalities are consistent with th...
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...
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
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 sc_safe_build_sc_nredund_1pass(Psysteme volatile *ps)
Psysteme sc_safe_elim_redund(Psysteme ps)
Same as above, but the basis is preserved and sc_empty is returned is the system is not feasible.
bool efficient_sc_check_inequality_feasibility(Pvecteur v, Psysteme prec)
Value b1
booleen indiquant quel membre est en cours d'analyse
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
void sc_dump(Psysteme sc)
void sc_dump(Psysteme sc): dump to stderr
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Psysteme sc_normalize2(volatile Psysteme ps)
Psysteme sc_normalize2(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires...
Psysteme sc_strong_normalize3(Psysteme ps)
Psysteme sc_strong_normalize5(Psysteme ps, char *(*variable_name)(Variable))
Psysteme sc_strong_normalize4(Psysteme ps, char *(*variable_name)(Variable))
Psysteme sc_strong_normalize4(Psysteme ps, char * (*variable_name)(Variable))
Psysteme sc_strong_normalize2(volatile Psysteme ps)
Psysteme sc_strong_normalize2(Psysteme ps)
Psysteme sc_safe_normalize(Psysteme ps)
Psysteme sc_safe_normalize(Psysteme ps) output : ps, normalized.
Psysteme sc_bounded_normalization(Psysteme ps)
Eliminate trivially redundant integer constraint using a O(n x d^2) algorithm, where n is the number ...
Psysteme sc_strong_normalize(Psysteme ps)
Psysteme sc_strong_normalize(Psysteme ps)
Psysteme sc_elim_var(Psysteme sc, Variable v)
package sur les systemes de contraintes sc
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
void constraints_to_matrices(Pcontrainte, Pbase, Pmatrix, Pmatrix)
=======================================================================
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 TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
char *(* get_variable_name_t)(Variable)
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.
#define VECTEUR_UNDEFINED_P(v)
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.
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_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_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...
void vect_sort_in_place(Pvecteur *pv, int *compare)
void vect_sort_in_place(pv, compare) Pvecteur *pv; int (*compare)(Pvecteur *, Pvecteur *);