25 #include "pips_config.h"
61 pips_assert(
"transformer_dup", !SC_UNDEFINED_P(sc));
163 && sc_nbre_inegalites(s) == 0;
189 return sc_nbre_egalites(s)==0 && sc_nbre_inegalites(s)==0;
207 pips_assert(
"Transformer tf is consistent on entrance",
240 pips_assert(
"Transformer tf is consistent on exit",
361 "trivial constraint 0 %s 0 found: code should be optimized\n",
362 (equality)?
"==" :
"<=");
564 bool consistent =
true;
566 Pbase b = sc_base(sc);
570 consistent =
ENDP(args);
571 pips_assert(
"Empty transformer must have no arguments", consistent);
591 pips_assert(
"Argument variables must have values in basis", consistent);
618 bool consistent_p =
true;
634 #define TRANSFORMER_CONSISTENCY_P_DEBUG_LEVEL 0
649 bool consistent =
true;
658 "transformer tf is not gen_defined\n");
667 "sc is not weakly consistent\n");
673 Pbase b = sc_base(sc);
682 bool aliasing =
false;
687 for (lt = args; lt && !aliasing ;
POP(lt)) {
689 consistent = consistent &&
698 "arguments and basis: \"%s\"\n", eln);
724 "Old value of \"%s\" in sc but not in arguments of transformer tf, %p\n",
730 consistent = consistent && !
term_cst(t);
733 "TCST in sc basis\n");
741 consistent = consistent && (e != (
entity)
TCST);
745 "transformer_consistency_p",
"TCST appears in arguments\n");
779 if(consistent && !is_weak)
793 Pbase b = sc_base(sc);
803 " as long as equivalence equations are not added\n",
819 pips_assert(
"Basis variables must be an internal value",
false);
846 bool found_p =
false;
895 Pbase b = sc_base(sc);
914 Pbase b = sc_base(sc);
void free_transformer(transformer p)
transformer make_transformer(list a1, predicate a2)
bool transformer_defined_p(transformer p)
predicate make_predicate(Psysteme a1)
void free_predicate(predicate p)
transformer copy_transformer(transformer p)
TRANSFORMER.
struct _newgen_struct_entity_ * entity
bool entity_null_locations_p(entity e)
test if an entity is the NULL POINTER
bool entity_stub_sink_p(entity e)
test if an entity is a stub sink for a formal parameter e.g.
void free_arguments(cons *args)
bool entity_is_argument_p(entity e, cons *args)
cons * arguments_add_entity(cons *a, entity e)
Pbase base_add_variable(Pbase b, Variable var)
Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end...
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
bool transformer_argument_consistency_p(transformer t)
transformer transformer_add_inequality_with_linear_term(transformer tf, entity v, entity x, int a, bool less_than_p)
Add the inequality v <= a x or v >= a x.
transformer transformer_add_modified_variable(transformer tf, entity var)
FI: this function does not end up with a consistent transformer because the old value is not added to...
transformer transformer_dup(transformer t_in)
transformer package - basic routines
bool transformer_general_consistency_p(transformer tf, bool is_weak)
transformer transformer_add_value_update(transformer t, entity v)
Add an update of variable v to t (a value cannot be updated)
transformer transformer_add_identity(transformer tf, entity v)
bool transformer_identity_p(transformer t)
Check that t is an identity function.
transformer precondition_to_abstract_store(transformer pre)
Get rid of all old values and arguments.
transformer transformer_constraint_add(transformer tf, Pvecteur i, bool equality)
transformer transformer_add_sign_information(transformer tf, entity v, int v_sign)
CHANGE THIS NAME: no loop index please, it's not directly linked to loops!!!
transformer transformer_equalities_add(transformer tf, Pcontrainte eqs)
void transformer_free(transformer t)
bool transformer_equations_constrain_variable_p(const transformer t, const entity v)
Is value v used with a non-zero coefficient by the equations of transformer t?
transformer transformer_add_inequality_with_integer_constraint(transformer tf, entity v, long long int cst, bool less_than_p)
Add the inequality v <= cst or v >= cst.
#define TRANSFORMER_CONSISTENCY_P_DEBUG_LEVEL
void old_transformer_free(transformer t)
transformer transformer_add_3d_affine_constraint(transformer tf, int a1, entity v1, int a2, entity v2, int a3, entity v3, int cst, bool equation_p)
Add the constraint a1 v1 + a2 v2 + a3 v3 + cst <= or == 0.
bool transformer_argument_weak_consistency_p(transformer t)
bool transformer_weak_consistency_p(transformer t)
Interprocedural transformers do not meet all conditions.
transformer transformer_inequality_add(transformer tf, Pvecteur i)
bool transformer_inequalities_constrain_variable_p(const transformer t, const entity v)
Is value v used with a non-zero coefficient by the inequalities of transformer t?
bool value_belongs_to_transformer_space(entity v, transformer tf)
transformer transformer_add_equality_with_integer_constant(transformer tf, entity v, long long int cst)
Add an equality between a value and an integer constant: v==cst.
transformer transformer_add_modified_variable_entity(transformer tf, entity var)
FI: like the previous function, but supposed to end up with a consistent transformer.
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_inequalities_add(transformer tf, Pcontrainte ineqs)
Warning:
transformer transformer_add_variable_incrementation(transformer t, entity i, Pvecteur incr)
transformer transformer_add_loop_index(transformer t, entity i, Pvecteur incr): add the index increme...
bool transformers_consistency_p(list tl)
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.
transformer transformer_add_inequality_with_affine_term(transformer tf, entity v, entity x, int a, int cst, bool less_than_p)
Add the inequality v <= a x + cst or v >= a x + cst.
bool transformer_consistency_p(transformer t)
FI: I do not know if this procedure should always return or fail when an inconsistency is found.
void free_transformers(transformer t,...)
transformer transformer_empty()
Allocate an empty transformer.
transformer transformer_add_variables_update(transformer t, list vl)
transformer transformer_add_equality(transformer tf, entity v1, entity v2)
Add an equality between two values (two variables?)
transformer move_transformer(transformer t1, transformer t2)
Move arguments and predicate of t2 into t1, free old arguments and predicate of t1,...
void add_value_to_transformer_space(entity v, transformer tf)
list transformer_projectable_values(transformer tf)
bool transformer_argument_general_consistency_p(transformer t, bool is_weak)
bool transformer_is_empty_p(transformer t)
Check that transformer t is the canonical representation of an empty transformer.
transformer transformer_add_variable_update(transformer t, entity v)
Add an update of variable v into t.
bool transformer_internal_consistency_p(transformer t)
Same as above but equivalenced variables should not appear in the argument list or in the predicate b...
transformer transformer_add_equality_with_affine_term(transformer tf, entity v, entity x, int a, int cst)
Add the equality v = a x + cst.
transformer transformer_add_inequality(transformer tf, entity v1, entity v2, bool strict_p)
Add the equality v1 <= v2 or v1 < v2.
#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 entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
#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)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#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
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#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 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_warning(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define same_string_p(s1, s2)
#define dump_transformer(t)
#define entity_symbolic_p(e)
#define entity_constant_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...
bool entity_in_formal_area_p(entity e)
Formal parameters do not use the standard ram storage.
const char * entity_module_name(entity e)
See comments about module_name().
#define transformer_undefined
#define TRANSFORMER(x)
TRANSFORMER.
#define entity_storage(x)
#define transformer_relation(x)
#define transformer_arguments(x)
#define predicate_system_(x)
#define storage_return_p(x)
#define predicate_system(x)
struct Ssysteme * Psysteme
void sc_base_add_variable(Psysteme sc, Variable var)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
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;
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 ...
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.
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...
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Psysteme sc_equation_add(Psysteme sc, Pcontrainte c)
The basis of the constraint system is updated.
Psysteme sc_constraint_add(Psysteme sc, Pcontrainte c, bool equality)
bool sc_inequalities_constrain_variable_p(Psysteme sc, Variable var)
bool sc_equations_constrain_variable_p(Psysteme sc, Variable var)
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 BASE_UNDEFINED_P(b)
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...
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...
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...