25 #include "pips_config.h"
87 #include "pips-libs.h"
88 #ifdef HAVE_PIPS_points_to_LIBRARY
142 entity rv_new = is_internal?
176 bool processed_p =
false;
231 for(cexpr = args; !
ENDP(cexpr);
POP(cexpr)) {
259 sc_dimension(sc) = 1;
468 pips_debug(9,
"Begin officialy... but a lot has been done already!\n");
491 pips_debug(9,
"End with transformer tf=%p\n", tf);
527 pips_debug(9,
"A transformer has been obtained:\n");
552 pips_debug(9,
"After substitution v_new=%s -> v_old=%s\n",
557 pips_debug(9,
"After substitution tmp=%s -> v_new=%s\n",
611 pips_debug(9,
"Begin officialy... but a lot has been done already!\n");
622 pips_debug(8,
"before projection, with temporaries v=%s, tmp1=%s, tmp2=%s,"
623 " transformer rf=%p\n",
639 pips_debug(8,
"End with transformer tf=%p\n", tf);
669 if(llhs==-1 || llhs >= lrhs) {
675 string n =
malloc(llhs+3);
680 pips_assert(
"A simple or a double quote is used", *n==
'"' || *n==
'\'');
687 pips_user_error(
"CHARACTER variable assigned a non CHARACTER constant, \"%s\"\n",
716 # define DEBUG_TRANSFORMER_ADD_CONDITION_INFORMATION_UPDOWN 7
737 pips_debug(9,
"Begin with pre=%p, veracity=%s, upwards=%s\n,",
756 (pre, c1,
context, veracity, upwards);
764 (pre1, c2,
context, veracity, upwards);
771 else if(!upwards || upwards) {
779 (pre1, c1,
context,
false, upwards);
781 (pre2, c2,
context,
false, upwards);
806 pips_debug(9,
"end with newpre=%p\n", newpre);
830 pips_debug(9,
"Begin with pre=%p, context=%p, veracity=%s, upwards=%s\n,",
837 (pre, c1,
context,
false, upwards);
839 (newpre, c2,
context,
false, upwards);
847 (pre1, c1,
context,
true, upwards);
849 (pre2, c2,
context,
true, upwards);
875 pips_debug(9,
"end with newpre=%p\n", newpre);
894 pips_debug(9,
"Begin with pre=%p, op=%s, veracity=%s, upwards=%s\n,",
911 (pre, c1, c2,
context, veracity, upwards);
915 (pre, c1, c2,
context, veracity, upwards);
919 (pre, c1,
context, !veracity, upwards);
942 pips_debug(9,
"end with newpre=%p\n", newpre);
974 "begin upwards=%s veracity=%s c=",
977 (void)
fprintf(stderr,
"pre=%p\n", pre);
999 (pre,
f, args,
context, veracity, upwards);
1085 "end newpre=%p\n", newpre);
1122 (pre, c,
context, veracity,
false);
1128 (pre, c, new_context, veracity,
false);
1237 pips_debug(8,
"\nLinearized expression for incrementation:\n");
1490 if(gcd<0) gcd = -gcd;
1494 bool is_positive_p =
false;
1495 bool is_negative_p =
false;
1499 is_positive_p = imin>=0;
1500 is_negative_p = imax<=0;
1513 else if(is_negative_p)
1525 else if(is_negative_p) {
1539 else if(is_negative_p)
1736 int lb=INT_MIN, ub=INT_MAX;
1990 if(lb2>INT_MIN && ub2<INT_MAX) {
2031 if(lb2>INT_MIN && ub2<INT_MAX) {
2048 long long p1 = ((
long long) lb1 )*((
long long) lb2 );
2049 long long p2 = ((
long long) lb1 )*((
long long) ub2 );
2050 long long p3 = ((
long long) ub1 )*((
long long) lb2 );
2051 long long p4 = ((
long long) ub1 )*((
long long) ub2 );
2052 long long lb = (p2<p1)? p2 : p1;
2053 long long ub = (p2>p1)? p2 : p1;
2055 lb = (p3<lb)? p3 : lb;
2056 lb = (p4<lb)? p4 : lb;
2058 ub = (p3>ub)? p3 : ub;
2059 ub = (p4>ub)? p4 : ub;
2064 if(lb > INT_MIN || ub < INT_MAX)
2248 if(lb1>INT_MIN && ub1<INT_MAX) {
2262 if(lb > INT_MIN || ub < INT_MAX)
2357 else if(0<lb2 && ub2<INT_MAX) {
2397 if(lb2>=0 && lb1>=1) {
2402 else if(lb2>=0 && lb1==0) {
2407 else if(lb2>0 && ub1<0) {
2411 else if(lb2>0 && ub1==0) {
2462 pips_assert(
"Shut up the compiler", is_internal==is_internal);
2465 bool arg1_is_constant_p =
false;
2470 arg1_is_constant_p =
true;
2474 bool arg2_is_constant_p =
false;
2479 arg2_is_constant_p =
true;
2483 if(arg1_is_constant_p && arg2_is_constant_p) {
2562 else if(arg1_is_constant_p) {
2666 is_min?
"minimum" :
"maximum",
2667 is_internal?
"intraprocedural" :
"interprocedural");
2669 for(cexpr = args; !
ENDP(cexpr);
POP(cexpr)) {
2678 bound =
is_min? LONG_MIN : LONG_MAX;
2696 if(bound!=LONG_MIN && bound!=LONG_MAX) {
2698 int b = (
int) bound;
2760 pips_debug(6,
"return tf=%lx\n", (
unsigned long)tf);
2834 " It might generate more accurate transformers.\n");
2839 " It might generate more accurate transformers.\n");
2842 "setproperty SEMANTICS_ANALYZE_CONSTANT_PATH TRUE."
2843 " It might generate more accurate transformers.\n");
3143 if(lb2==0&&ub2==0) {
3262 if(lb1!=INT_MIN && ub1!=INT_MAX) {
3263 int u = ub1>=-lb1? ub1: -lb1;
3264 int l = -ub1<=lb1? -ub1: lb1;
3317 int lb1 = 0, ub1 = 0, lb2 = 0, ub2 = 0;
3375 pips_debug(8,
"Begin with precondition %p\n", pre);
3487 pips_debug(8,
"begin with precondition %p for expression: ", pre);
3660 pips_debug(9,
"Begin for value %s with subtransformers:\n",
3670 pips_debug(9,
"Union of subtransformers:\n");
3871 if(vmin>=0 && vmax<=1)
3873 else if(vmin>=1 || vmax<=-1) {
4031 if(llhs == -1 || llhs >= lrhs) {
4396 pips_internal_error(
"illegal expression_syntax, syntax_call_function\n syntax_tag : %i\n call_function : %s\n",
4509 pips_debug(8,
"Begin with precondition %p\n", pre);
4591 pips_debug(8,
"begin with precondition %p for expression: ", pre);
4642 "(except for NULL pointer).\n");
4701 upwards?
"upwards" :
"downwards", pre);
4792 pips_assert(
"Pre is still consistent with tf1 and tf2 and rel",
5017 pips_debug(8,
"begin for entity %s of type %s and %s expression ",
5052 "Apply PIPS type checker for better results\n");
5100 pips_internal_error(
"entities of type \"derived\" that are not \"enum\" cannot be analyzed");
5114 "expression \"%s\" of type \"%s\" may reduce semantic analysis accuracy.\n"
5115 "You might apply 'type_checker' to explicit all type coercions.\n",
5127 "expression \"%s\" with overloaded type may reduce semantic analysis accuracy for variable \"%s\" of type \"%s\".\n"
5128 "You might apply 'type_checker' to explicit all type coercions.\n",
5147 pips_assert(
"No obvious aliasing between tf and pre", tf!=pre);
5365 bool relation_p =
false;
5371 bool upwards =
false;
5408 (tf, tcond, safe_pre, veracity, upwards);
5412 else if(relation_p) {
5449 fprintf(stderr,
"tf_plus %p:\n", tf_plus);
5451 fprintf(stderr,
"tf_minus %p:\n", tf_minus);
5588 else if(lb>0 || ub<0)
5652 if(lb1==ub1 && lb2==ub2) {
5657 else if(0<=lb1 && ub1 <= 1 && 0<=lb2 && ub2 <= 1) {
5705 if(lbd==0 && ubd==0) {
5862 intptr_t lhs_lbound,lhs_ubound,rhs_lbound,rhs_ubound,diff_lbound,diff_ubound;
5864 (diff_lbound>=0 || diff_ubound<=0)) {
5893 bool result =
false;
5902 bool result =
false;
5911 bool result =
false;
5937 # define DEBUG_TRANSFORMER_ADD_RELATION_INFORMATION 7
5946 "begin upwards=%s veracity=%s relop=%s e1=",
5952 (void)
fprintf(stderr,
"pre=");
6055 pips_assert(
"Transformer is internally consistent",
6094 validity = 1 - validity;
6172 if(validity==0||validity==1) {
6196 bool usable_p =
false;
6208 pips_user_error(
"The pointer expression \"%s\" always points to NULL\n",
6244 usable_p ?
"usable" :
"not usable");
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)
void free_entity(entity p)
predicate make_predicate(Psysteme a1)
basic copy_basic(basic p)
BASIC.
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
void free_expression(expression p)
transformer copy_transformer(transformer p)
TRANSFORMER.
bool entity_heap_location_p(entity b)
package abstract location.
bool active_phase_p(const char *phase)
bool entity_null_locations_p(entity e)
test if an entity is the NULL POINTER
bool entity_typed_anywhere_locations_p(entity e)
Test if an entity is the bottom of the lattice.
bool entity_anywhere_locations_p(entity e)
test if an entity is the bottom of the lattice
bool entity_typed_nowhere_locations_p(entity e)
test if an entity is the bottom of the lattice
bool entity_is_argument_p(entity e, cons *args)
#define value_lshift(v1, v2)
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
void const char const char const int
#define MIN(x, y)
minimum and maximum if they are defined somewhere else, they are very likely to be defined the same w...
Value exponentiate(Value, int)
exp.c
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...
Pvecteur vect_variable_rename(Pvecteur v, Variable v_old, Variable v_new)
Pvecteur vect_variable_rename(Pvecteur v, Variable v_old, Variable v_new): rename the potential coord...
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_identity_p(transformer t)
Check that t is an identity function.
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!!!
void transformer_free(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.
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.
transformer transformer_inequality_add(transformer tf, Pvecteur i)
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_inequalities_add(transformer tf, Pcontrainte ineqs)
Warning:
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.
transformer transformer_empty()
Allocate an empty transformer.
transformer transformer_add_equality(transformer tf, entity v1, entity v2)
Add an equality between two values (two variables?)
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.
bdt base
Current expression.
entity make_constant_entity(string name, tag bt, size_t size)
For historical reason, call the Fortran version.
double float_constant_to_double(entity c)
bool integer_constant_p(entity ent, int *int_p)
Returns the double value associated to a PIPS constant.
bool float_constant_p(entity ent)
ent can be either a numerical or a symbolic float constant
bool logical_constant_p(entity ent)
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_NULLE_P(c)
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
#define CONTRAINTE_UNDEFINED
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
bool test_warning_counters(void)
list expression_to_proper_constant_path_effects(expression)
bool location_entity_p(entity)
type points_to_reference_to_concrete_type(reference)
reference cell_any_reference(cell)
API for reference.
entity null_pointer_value_entity(void)
bool pt_to_list_undefined_p(void)
points_to.c
bool effect_list_can_be_safely_full_freed_p(list)
Check if some references might be freed with the effects.
entity constant_memory_access_path_to_location_entity(reference)
A constant memory access path may not be considered.
bool null_pointer_value_entity_p(entity)
#define cell_reference(x)
#define cell_preference(x)
#define cell_preference_p(x)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
void gen_full_free_list(list l)
bool references_may_conflict_p(reference r1, reference r2)
Check if two references may conflict.
entity get_current_module_entity(void)
Get the entity of the current module.
#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)
#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
list gen_last(list l)
Return the last element of a list.
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
#define list_undefined
Undefined list definition :-)
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
string bool_to_string(bool)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
string reference_to_string(reference r)
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)
#define print_transformer(t)
#define dump_transformer(t)
string basic_to_string(basic)
#define SEMANTICS_INTERPROCEDURAL
#define ENTITY_PLUS_UPDATE_P(e)
#define ENTITY_DIVIDE_P(e)
#define ENTITY_RELATIONAL_OPERATOR_P(e)
#define ENTITY_POWER_P(e)
#define ENTITY_DMAX1_P(e)
#define GREATER_THAN_OPERATOR_NAME
#define ENTITY_NON_EQUAL_P(e)
#define binary_call_rhs(c)
#define ENTITY_EQUAL_P(e)
#define ENTITY_LEFT_SHIFT_P(e)
#define ENTITY_ASSIGN_P(e)
#define MINUS_OPERATOR_NAME
#define ENTITY_FABSL_P(e)
#define ENTITY_MINUS_P(e)
#define LESS_THAN_OPERATOR_NAME
#define ENTITY_COMMA_P(e)
#define ENTITY_UNARY_MINUS_P(e)
#define ENTITY_DEREFERENCING_P(e)
#define ENTITY_CABSL_P(e)
#define ENTITY_AMIN1_P(e)
#define ENTITY_LESS_THAN_P(e)
#define ENTITY_CABSF_P(e)
#define ENTITY_MULTIPLY_P(e)
#define ENTITY_C_CABS_P(e)
#define NORMALIZE_EXPRESSION(e)
#define ENTITY_POINT_TO_P(e)
#define ENTITY_PRE_DECREMENT_P(e)
#define ENTITY_CONTINUE_P(e)
#define ENTITY_POST_DECREMENT_P(e)
#define ENTITY_C_MAX_P(e)
#define ENTITY_IMAXABS_P(e)
#define ENTITY_POST_INCREMENT_P(e)
#define ENTITY_CONDITIONAL_P(e)
#define ENTITY_C_ABS_P(e)
#define ENTITY_PRE_INCREMENT_P(e)
#define ENTITY_C_MIN_P(e)
#define ENTITY_PLUS_C_P(e)
#define ENTITY_LLABS_P(e)
#define ENTITY_GREATER_THAN_P(e)
#define ENTITY_FIELD_P(e)
C data structure and pointer management.
#define ENTITY_LOGICAL_OPERATOR_P(e)
Attention : This definition is different with the Fortran Standard where the logical operators are th...
#define ENTITY_MINUS_C_P(e)
#define ENTITY_RIGHT_SHIFT_P(e)
#define binary_call_lhs(c)
#define ENTITY_AMAX1_P(e)
#define ENTITY_BITWISE_OR_P(e)
#define ENTITY_BITWISE_XOR_P(e)
#define ENTITY_ADDRESS_OF_P(e)
#define ENTITY_LESS_OR_EQUAL_P(e)
#define ENTITY_DMIN1_P(e)
#define ENTITY_FALSE_P(e)
#define ENTITY_MINUS_UPDATE_P(e)
#define ENTITY_FABSF_P(e)
#define ENTITY_BITWISE_AND_P(e)
#define entity_constant_p(e)
#define ENTITY_C_MODULO_P(e)
#define ENTITY_GREATER_OR_EQUAL_P(e)
#define ENTITY_MODULO_P(e)
#define PLUS_C_OPERATOR_NAME
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
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 intrinsic_entity_p(entity e)
entity update_operator_to_regular_operator(entity op)
Returns the binary operator associated to a C update operator such as +=.
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
bool entity_field_p(entity e)
e is the field of a structure
const char * module_local_name(entity e)
Returns the module local user name.
bool entity_module_p(entity e)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
value EvalSizeofexpression(sizeofexpression soe)
subscript expression_subscript(expression e)
bool expression_sizeofexpression_p(expression e)
bool expression_opposite_p(expression e1, expression e2)
e1+e2==0, i.e.
bool expression_minmax_p(expression e)
application expression_application(expression e)
bool logical_operator_expression_p(expression e)
C xor is missing.
bool expression_constant_p(expression exp)
================================================================
bool expression_call_p(expression e)
bool call_constant_p(call c)
bool call_constant_p(call c): Returns true if "c" is a call to a constant, that is,...
bool expression_cast_p(expression e)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
bool expression_subscript_p(expression e)
bool expression_null_p(expression exp)
returns true if the expression is equal to zero or NULL (even if there is a cast before such as in (v...
void local_assign_expression(expression caller, expression field)
replace expression caller by expression field , where field is contained by caller
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression replace_expression_content(expression e1, expression e2)
Use side effects to move the content of e2, s2 and n2, into e1; s1 and n1 are freed,...
expression make_zero_expression(void)
Make a zero expression.
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
call expression_call(expression e)
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
cast expression_cast(expression e)
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
bool integer_constant_expression_p(expression e)
positive integer constant expression: call to a positive constant or to a sum of positive integer con...
bool comma_expression_p(expression e)
expression make_false_expression()
bool expression_application_p(expression e)
Duplicate bool expression_subscript_p(expression e) { return(syntax_subscript_p(expression_syntax(e))...
sizeofexpression expression_sizeofexpression(expression e)
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool store_independent_reference_p(reference r)
Does this reference define the same set of memory locations regardless of the current (environment an...
bool unbounded_expression_p(expression e)
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
expression make_true_expression()
int integer_constant_expression_value(expression e)
bool c_language_module_p(entity m)
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
type expression_to_type(expression)
For an array declared as int a[10][20], the type returned for a[i] is int [20].
bool type_equal_p(type, type)
bool integer_type_p(type)
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
type compute_basic_concrete_type(type)
computes a new type which is the basic concrete type of the input type (this new type is not stored i...
int string_type_size(basic)
bool type_struct_variable_p(type)
bool volatile_variable_p(variable)
#define syntax_reference_p(x)
#define transformer_undefined
#define functional_result(x)
#define transformer_undefined_p(x)
#define value_constant(x)
#define syntax_reference(x)
#define value_reference(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define basic_typedef_p(x)
#define sizeofexpression_expression(x)
#define type_functional(x)
#define syntax_application(x)
#define basic_pointer_p(x)
#define basic_derived_p(x)
#define syntax_sizeofexpression_p(x)
@ is_syntax_sizeofexpression
#define value_constant_p(x)
#define basic_overloaded_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define cast_expression(x)
#define application_arguments(x)
#define subscript_indices(x)
#define type_undefined_p(x)
#define entity_undefined_p(x)
#define constant_int_p(x)
#define expression_undefined
#define transformer_relation(x)
#define transformer_arguments(x)
#define reference_indices(x)
#define syntax_sizeofexpression(x)
#define sizeofexpression_expression_p(x)
#define preference_reference(x)
#define expression_undefined_p(x)
#define subscript_array(x)
#define application_function(x)
#define variable_dimensions(x)
#define syntax_subscript(x)
#define call_arguments(x)
#define basic_string_p(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define type_variable_p(x)
#define predicate_system(x)
#define variable_basic(x)
#define basic_logical_p(x)
#define entity_initial(x)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
Value b1
booleen indiquant quel membre est en cours d'analyse
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 ...
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
#define semantics_user_warning
transformer any_assign_operation_to_transformer(entity tmp, list args, transformer pre, bool is_internal __attribute__((unused)))
Similar to any_assign_to_transformer(), which is a simpler case.
transformer safe_integer_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
Always return a defined transformer, using effects in case a more precise analysis fails.
static bool have_sizeof_value_in_multiply_pointer_expression_p(expression expr)
Maybe move in ri-util/expression.c or in effect-util/pointer_values.c.
static transformer pointer_unary_operation_to_transformer(entity e, entity op, expression e1, transformer pre, bool is_internal)
transformer transformer_add_integer_relation_information(transformer pre, entity relop, expression e1, expression e2, bool veracity, bool upwards)
It is supposed to be obsolete but is still called.
static transformer pointer_call_expression_to_transformer(entity e, expression expr, transformer pre, bool is_internal)
bool semantics_usable_points_to_reference_p(reference rlhs, expression lhs, int n)
See if references rlhs is usable and process null, undefined and anywhere locations defined by rlhs.
static transformer iabs_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
static int semantics_basic_tag(basic b)
Assimilate enum and logical to int (used when they appear in logical operations)
static transformer modulo_of_a_positive_value_to_transformer(entity e, int lb1, int ub1, int lb2, int ub2)
static transformer update_operation_to_transformer(entity v, entity op, expression e1, expression e2, transformer pre, bool is_internal)
v = (e1 = e1 op e2) ; e1 must be a reference; does not compute information for dereferenced pointers ...
static transformer integer_call_expression_to_transformer(entity e, expression expr, transformer pre, bool is_internal)
transformer affine_increment_to_transformer(entity e, Pvecteur a)
transformer safe_any_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
Always return a usable transformer.
static transformer integer_minmax_to_transformer(entity v, list args, transformer pre, bool is_min, bool is_internal)
static transformer logical_reference_to_transformer(entity v, entity r, bool is_internal)
v is assumed to be a temporary value and r a logical program variable
static transformer float_binary_operation_to_transformer(entity e, entity op, expression e1, expression e2, transformer pre, bool is_internal)
transformer points_to_unary_operation_to_transformer(entity e, entity op, expression e1, transformer pre, bool is_internal, bool is_pointer)
This function is redundant with generic_unary_operation_to_transformer() except for its use of parame...
transformer transformer_add_any_relation_information(transformer pre, entity op, expression e1, expression e2, transformer context, bool veracity, bool upwards)
compute transformer or precondition
transformer safe_any_assign_operation_to_transformer(entity tmp, list args, transformer pre, bool is_internal)
static transformer float_call_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
static transformer logical_binary_function_to_transformer(entity v, call c, transformer pre, bool is_internal)
transformer expression_effects_to_transformer(expression expr)
static transformer logical_unary_operation_to_transformer(entity v, call c, transformer pre, bool is_internal)
bool false_condition_wrt_precondition_p(expression c, transformer pre)
bool precondition_minmax_of_value(entity val, transformer tr, intptr_t *pmin, intptr_t *pmax)
compute integer bounds pmax, pmin of value val under preconditions tr require value mappings set !
transformer affine_to_transformer(entity e, Pvecteur a, bool assignment)
static transformer modulo_of_a_constant_to_transformer(entity e, int lb1, int lb2, int ub2)
transformer generic_reference_to_transformer(entity v, reference r, transformer pre, bool is_internal)
TYPE INDEPENDENT OPERATIONS.
static transformer transformer_add_ored_conditions_updown(transformer pre, expression c1, expression c2, transformer context, bool veracity, bool upwards)
call transformer_add_condition_information_updown() recursively on both sub-expressions if veracity =...
static transformer generic_abs_to_transformer(entity, expression, transformer, bool)
forward declaration
transformer any_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
A set of functions to compute the transformer associated to an expression evaluated in a given contex...
transformer any_basic_update_operation_to_transformer(entity tmp, entity v, entity op)
See also any_basic_update_to_transformer(), which should be based on this function.
static transformer transformer_add_condition_information_updown(transformer, expression, transformer, bool, bool)
call transformer_add_condition_information_updown() recursively on both sub-expressions if veracity =...
static transformer max0_to_transformer(entity e, list args, transformer pre, bool is_internal)
transformer precondition_add_condition_information(transformer pre, expression c, transformer context, bool veracity)
context might be derivable from pre as transformer_range(pre) but this is sometimes very computationa...
static transformer generic_minmax_to_transformer(entity e, list args, transformer pre, bool minmax, bool is_internal)
static transformer float_unary_operation_to_transformer(entity e, entity op, expression e1, transformer pre, bool is_internal)
static transformer integer_divide_to_transformer(entity e, expression arg1, expression arg2, transformer pre, bool is_internal)
More could be done along the line of integer_multiply_to_transformer()...
int simplify_boolean_expression_with_precondition(expression e, transformer p)
Simplification of bool expressions with precondition.
transformer any_expressions_to_transformer(entity v, list expl, transformer pre)
Compute the transformer associated to a list of expressions such as "i=0, j = 1;".
transformer bitwise_xor_to_transformer(entity v, list args, transformer pre)
returns the transformer associated to a C bitwise xor, ^, applied to two integer argument,...
transformer pointer_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
transformer transformer_add_domain_condition(transformer tf, expression c, transformer context, bool veracity)
static transformer unary_minus_operation_to_transformer(entity v, expression e1, transformer pre, bool is_internal)
Type independent.
transformer expressions_to_transformer(list expl, transformer pre)
Compute the transformer associated to a list of expressions such as "i=0, j = 1;".
transformer expression_to_transformer(expression exp, transformer pre, list el)
Just to capture side effects as the returned value is ignored.
bool precondition_minmax_of_expression(expression exp, transformer tr, intptr_t *pmin, intptr_t *pmax)
compute integer bounds pmax, pmin of expression exp under preconditions tr require value mappings set...
static transformer integer_right_shift_to_transformer(entity e, expression arg1, expression arg2, transformer pre, bool is_internal)
More could be done along the line of integer_left_shift_to_transformer()...
transformer transformer_add_condition_information(transformer pre, expression c, transformer context, bool veracity)
static transformer modulo_to_transformer(entity e, expression arg1, expression arg2, transformer pre, bool is_internal __attribute__((unused)))
Modulo and integer division.
transformer logical_intrinsic_to_transformer(entity v, call c, transformer pre, bool is_internal)
static list expression_to_points_to_sources(_UNUSED_ expression e, _UNUSED_ points_to_graph in)
static transformer integer_left_shift_to_transformer(entity v, expression e1, expression e2, transformer prec, bool is_internal)
Assumes that e1 and e2 are integer expressions, i.e.
static bool have_null_value_in_pointer_expression_p(expression expr)
POINTER EXPRESSION.
static transformer integer_power_to_transformer(entity e, expression arg1, expression arg2, transformer prec, bool is_internal)
static transformer process_bounds_for_divide(transformer tf, entity v, entity v1, int lb1, int ub1, entity v2, int lb2, int ub2)
Auxiliary function for non-affine operators such as divide, multiply, modulo...
static transformer addition_operation_to_transformer(entity v, expression e1, expression e2, transformer pre, bool addition_p, bool is_internal)
Type independent.
transformer any_conditional_to_transformer(entity v, list args, transformer pre)
Take care of the returned value.
transformer simple_affine_to_transformer(entity e, Pvecteur a, bool is_internal)
INTEGER EXPRESSIONS.
static transformer integer_multiply_to_transformer(entity v, expression e1, expression e2, transformer prec, bool is_internal)
Assumes that e1 and e2 are integer expressions, i.e.
static transformer logical_binary_operation_to_transformer(entity v, call c, transformer pre, bool is_internal)
transformer any_expression_side_effects_to_transformer(expression e, transformer p, bool is_internal __attribute__((unused)))
The value of the expression is irrelevant, but its sub-expressions may generate a transformer.
static points_to_graph get_points_to_graph_from_statement(_UNUSED_ statement st)
semantic analysis: processing of expressions, with or without preconditions.
transformer logical_not_to_transformer(entity v, list args, transformer pre)
returns the transformer associated to a C logical not, !, applied to an integer argument,...
transformer string_expression_to_transformer(entity v, expression rhs)
transformer safe_expression_to_transformer(expression exp, transformer pre)
static transformer generic_unary_operation_to_transformer(entity e, entity op, expression e1, transformer pre, bool is_internal)
static transformer logical_constant_to_transformer(entity v, entity f)
static transformer integer_nullary_operation_to_transformer(entity e __attribute__((unused)), entity f __attribute__((unused)), transformer pre __attribute__((unused)), bool is_internal __attribute__((unused)))
FI: this function is no longer useful (11 August 2013)
transformer conditional_to_transformer(expression cond, expression te, expression fe, transformer pre, list ef)
FI: not too smart to start with the special case with no value returned, just side-effects....
static transformer pointer_binary_operation_to_transformer(entity e, expression expr, transformer pre, bool is_internal)
transformer transformer_logical_inequalities_add(transformer tf, entity v)
PROCESSING OF LOGICAL EXPRESSIONS.
transformer transformer_add_range_condition(transformer tf, expression c, transformer context, bool veracity)
static transformer modulo_of_a_negative_value_to_transformer(entity e, int lb1, int ub1, int lb2, int ub2)
e = [lb1,ub1] % [lb2,ub2] with ub1<=0
bool true_condition_wrt_precondition_p(expression c, transformer pre)
transformer safe_any_expression_side_effects_to_transformer(expression e, transformer p, bool is_internal)
Same as any_expression_side_effects_to_transformer() but effects are used to always generate a transf...
static list expression_to_points_to_sinks(_UNUSED_ expression e, _UNUSED_ points_to_graph in)
transformer integer_expression_to_transformer(entity v, expression expr, transformer pre, bool is_internal)
Do check wrt to value mappings...
static transformer transformer_add_anded_conditions_updown(transformer pre, expression c1, expression c2, transformer context, bool veracity, bool upwards)
static transformer integer_unary_operation_to_transformer(entity e, entity op, expression e1, transformer pre, bool is_internal)
bool eval_condition_wrt_precondition_p(expression c, transformer pre, bool veracity)
transformer lhs_expression_to_transformer(entity e, expression lhs, transformer pre)
This function deals with e1.e2 and e1->e2, not with simple references such as x or a[i].
static transformer expression_multiply_sizeof_to_transformer(entity v, expression e1, transformer prec, bool is_internal)
cut-and-pasted and adapted from multiply_to_transformer();
#define DEBUG_TRANSFORMER_ADD_CONDITION_INFORMATION_UPDOWN
HANDLING OF CONDITIONS.
transformer float_expression_to_transformer(entity v, expression rhs, transformer pre, bool is_internal)
static transformer constant_to_transformer(entity v, expression rhs)
transformer any_expressions_side_effects_to_transformer(list el, transformer p, bool is_internal)
same as any_expression_side_effects_to_transformer() but for a list of expressions
transformer assign_operation_to_transformer(entity val, expression lhs, expression rhs, transformer pre)
Returns an undefined transformer in case of failure.
transformer modulo_by_a_constant_to_transformer(entity v1, transformer prec, entity v2, int k)
Analyze v2 % k, with v2 constrainted by tf, assuming tf is a precondition.
void simplify_minmax_expression(expression e, transformer tr)
tries hard to simplify expression e if it is a min or a max operator, by evaluating it under precondi...
static transformer integer_binary_operation_to_transformer(entity e, entity op, expression e1, expression e2, transformer pre, bool is_internal)
transformer condition_to_transformer(expression cond, transformer pre, bool veracity)
To capture side effects and to add C twist for numerical conditions.
transformer logical_expression_to_transformer(entity v, expression rhs, transformer pre, bool is_internal)
Could be used to compute preconditions too.
static transformer transformer_add_call_condition_information_updown(transformer pre, entity op, list args, transformer context, bool veracity, bool upwards)
static transformer min0_to_transformer(entity e, list args, transformer pre, bool is_internal)
#define DEBUG_TRANSFORMER_ADD_RELATION_INFORMATION
bool value_mappings_compatible_vector_p(Pvecteur iv)
transform a vector based on variable entities into a vector based on new value entities when possible...
void variables_to_new_values(Pvecteur v)
replace variables by new values which is necessary for equivalenced variables
void upwards_vect_rename(Pvecteur v, transformer post)
Renaming of variables in v according to transformations occuring later.
list semantics_expression_to_points_to_sinks(expression e)
Returns a list of cells.
list semantics_expression_to_points_to_sources(expression e)
Special wrapping for the semantics analyses.
void integer_value_and_precondition_to_integer_interval(entity, transformer, int *, int *)
Should be used by previous function, integer_expression_and_precondition_to_integer_interval()
void integer_expression_and_precondition_to_integer_interval(expression, transformer, int *, int *)
Could be used for bool expressions too? Extended to any kind of expression?
void expression_and_precondition_to_integer_interval(expression, transformer, int *, int *)
Evaluate expression e in context p, assuming that e is an integer expression.
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 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....
#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_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
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...