25 #include "pips_config.h"
127 static bool descriptor_range_p =
false;
132 descriptor_range_p = b;
138 return(descriptor_range_p);
255 bool r_or_w_p =
false;
273 bool io_effect_found =
false;
279 entity private_io_entity =
286 entity a_touched_variable =
289 if (a_touched_variable == private_io_entity) {
290 io_effect_found =
true;
296 return io_effect_found;
305 bool write_effect_on_a_module_argument_found =
false;
319 && (return_variable_p
320 || (formal_p && fortran_p)
323 write_effect_on_a_module_argument_found =
true;
328 return write_effect_on_a_module_argument_found;
348 pips_debug(8,
"Reference to \"%s\" ignored\n",
374 pips_debug(8,
"References from declarations:\n");
376 pips_debug(8,
"Reference for variable \"%s\"\n",
391 fprintf(stderr,
"Cell %p = (cell_tag=%u, reference=%p)\n", c,
cell_tag(c),
405 fprintf(stderr,
"Effect %p = (domain=%td, cell=%p, action=%p,"
406 " action_kind=%p, approximation=%p, descriptor=%p\n",
424 bool sharing_p =
false;
450 fprintf(stderr,
"this effect shares its reference with "
451 "another effect in list srl\n");
452 (*effect_prettyprint_func)(e);
460 fprintf(stderr,
"this effect shares its reference with "
461 "another effect in list srl\n");
462 (*effect_prettyprint_func)(e);
470 fprintf(stderr,
"this effect shares its reference with "
471 "another effect in list srl\n");
472 (*effect_prettyprint_func)(e);
513 effect anywhere_eff = (*reference_to_effect_func)(
593 bool anywhere_w_p =
false;
594 bool anywhere_r_p =
false;
597 while ((!anywhere_w_p || !anywhere_r_p) && !
ENDP(l_tmp))
679 null_eff = (*reference_to_effect_func)(
716 undefined_eff = (*reference_to_effect_func)(
719 return undefined_eff;
753 eff_read = (*effect_dup_func)(eff_write);
772 pips_debug(8,
"adding effects to l_res : \n");
774 (*effect_prettyprint_func)(eff_write);
812 pips_debug(6,
"add_eff is %s\n", add_eff?
"true":
"false");
826 pips_debug(6,
"FILE star path -> returning NIL or the path itself \n");
834 pips_debug(6,
"anywhere effect -> returning NIL \n");
847 eff_write = (*effect_dup_func)(eff);
858 bool add_array_dims =
false;
860 pips_debug(8,
"variable case, of dimension %d\n",
870 (*effect_add_expression_dimension_func)
872 add_array_dims =
true;
884 if ((add_array_dims || add_eff) && !pointers_only)
895 if (add_array_dims || add_eff)
907 eff_write = (*effect_dup_func)(eff_write);
911 (*effect_add_expression_dimension_func)
925 pips_debug(8,
"pointer case with level == 0 -> no additional dimension\n");
941 effect current_eff = (*effect_dup_func)(eff_write);
950 (current_eff, current_type, act,
true,
level, pointers_only));
957 if (!pointers_only && (add_array_dims || add_eff))
978 pips_user_warning(
"possible effect through indirect call (type is: %s(%s)) -> returning anywhere\n",
1043 bool p =
false, finished =
false;
1045 pips_debug(7,
"begin with type %s\n and number of indices : %d\n",
1058 pips_debug(8,
"variable case, of basic %s, of dimension %d\n",
1062 while (!
ENDP(l_dim) && !
ENDP(l_ind))
1078 else if (
ENDP(l_dim))
1080 pips_assert(
"the current basic should be a pointer or a derived\n",
1111 pips_debug(7,
"field case, with field expression : %s \n",
1119 pips_assert(
"the field expression must be a reference\n",
1138 while (!
ENDP(l_ent) && p)
1156 pips_debug(8,
"end with p = %s\n", p==
false ?
"false" :
"true");
1178 pips_debug(8,
"begin with effect reference %s\n",
1190 pips_debug(8,
"end with p = %s\n", p==
false ?
"false" :
"true");
1205 bool finished =
false;
1217 pips_debug(8,
"poping one array dimension \n");
1224 pips_debug(8,
"end of reference indices, generating type\n");
1251 pips_assert(
"the field expression must be a reference\n",
1260 pips_debug(8,
"known field, poping field dimension\n");
1267 pips_debug(8,
"unknown field, returning type_undefined\n");
1341 bool anywhere_p =
false;
1344 pips_debug(6,
" effects before selection: \n");
1345 (*effects_prettyprint_func)(l_cumu_eff);
1365 pips_debug(6,
" effects after selection: \n");
1366 (*effects_prettyprint_func)(l_res);
1394 static bool effects_access_paths_comparable_p(
effect eff1,
effect eff2,
1397 bool comparable_p =
true;
1410 while( comparable_p && !
ENDP(linds1) && !
ENDP(linds2))
1412 if (!effects_reference_indices_may_equal_p(
EXPRESSION(
CAR(linds1)),
1414 comparable_p =
false;
1423 if (*result != 0) *result = *result /
abs(*result);
1426 pips_debug(8,
"end with comparable_p = %s and *result = %d",
1427 comparable_p ?
"true" :
"false", *result);
1429 return comparable_p;
1437 bool found_p =
false;
1464 list l_eff_pointers;
1466 bool anywhere_w_p =
false;
1467 bool anywhere_r_p =
false;
1472 t = (*load_completed_transformer_func)(s);
1484 l_eff = (*effects_transformer_composition_op)(l_eff, t);
1491 l_eff = (*effects_transformer_inverse_composition_op)(l_eff, t);
1495 pips_debug(5,
" effects after composition with transformer: \n");
1496 (*effects_prettyprint_func)(l_eff);
1507 while( !
ENDP(l_eff) &&
1508 ! (anywhere_w_p && anywhere_r_p))
1510 list l_eff_p_tmp = l_eff_pointers;
1516 while( !
ENDP(l_eff_p_tmp) &&
1517 !((eff_w_p && anywhere_w_p) || (!eff_w_p && anywhere_r_p)))
1524 && effects_access_paths_comparable_p(eff, eff_p, &comp_res)
1534 anywhere_w_p =
true;
1536 anywhere_r_p =
true;
1571 pips_debug(5,
" effects after composition with pointer effects: \n");
1572 (*effects_prettyprint_func)(l_res);
1643 list l_const = (*effect_to_constant_path_effects_func)(eff);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
action copy_action(action p)
ACTION.
bool effect_consistent_p(effect p)
void free_transformer(transformer p)
transformer make_transformer(list a1, predicate a2)
predicate make_predicate(Psysteme a1)
basic copy_basic(basic p)
BASIC.
reference make_reference(entity a1, list a2)
variable make_variable(basic a1, list a2, list a3)
type make_type(enum type_utype tag, void *val)
transformer copy_transformer(transformer p)
TRANSFORMER.
static reference ref
Current stmt (an integer)
bool entity_null_locations_p(entity e)
test if an entity is the NULL POINTER
bool entity_abstract_location_p(entity al)
entity entity_typed_anywhere_locations(type t)
entity entity_all_locations()
eturn ANY_MODULE:ANYWHERE (the top of the lattice)
#define value_notzero_p(val)
void const char const char const int
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
#define pips_debug_effects(level, message, l_eff)
#define pips_debug_effect(level, message, eff)
for debug
list make_anywhere_read_write_memory_effects(void)
transformer load_undefined_transformer(statement)
bool effect_pointer_type_p(effect)
effect make_undefined_pointer_value_effect(action)
effect make_anywhere_effect(action)
list make_effects_for_array_declarations(list)
string vect_debug_entity_name(entity)
list statement_modified_pointers_effects_list(statement)
bool null_pointer_value_effect_p(effect)
void descriptor_variable_rename(descriptor, entity, entity)
effect make_some_anywhere_effect(action, entity)
bool abstract_effect_in_effect_list_p(action, type, list)
list effect_to_constant_path_effects_with_no_pointer_information(effect)
list load_proper_rw_effects_list(statement)
transformer descriptor_to_context(descriptor)
transformer transformer_remove_variable_and_dup(transformer, entity)
bool region_weakly_consistent_p(effect)
bool regions_weakly_consistent_p(list)
bool get_descriptor_range_p(void)
effect make_anywhere_write_memory_effect(void)
void effects_computation_no_init(const char *)
void set_descriptor_range_p(bool)
list clean_anywhere_effects(list)
list generic_effects_store_update(list, statement, bool)
bool undefined_pointer_value_effect_p(effect)
bool normalizable_and_linear_loop_p(entity, range)
descriptor descriptor_inequality_add(descriptor, Pvecteur)
bool effects_private_current_context_stack_initialized_p(void)
bool effects_scalars_and_same_action_p(effect, effect)
bool statement_has_a_formal_argument_write_effect_p(statement)
list effect_to_effects_with_given_tag(effect, tag)
list effects_to_constant_path_effects_with_no_pointer_information(list)
descriptor descriptor_append(descriptor, descriptor)
void effect_to_may_effect(effect)
effect make_anywhere_read_memory_effect(void)
list load_rw_effects_list(statement)
void(* effect_prettyprint_func)(effect)
list load_cumulated_rw_effects_list(statement)
effect make_typed_anywhere_effect(action, type)
bool find_write_effect_on_entity(statement, entity)
type simple_effect_reference_type(reference)
effect make_null_pointer_value_effect(action)
bool effects_reference_sharing_p(list, bool)
bool some_integer_scalar_read_or_write_effects_p(cons *)
bool empty_context_test_false(transformer)
effect(* effect_dup_func)(effect eff)
transformer load_undefined_context(statement)
effect make_generic_anywhere_effect(action, reference)
void effects_computation_no_reset(const char *)
list pointer_effects_to_constant_path_effects(list)
list generic_effect_generate_all_accessible_paths_effects_with_level(effect, type, tag, bool, int, bool)
list effect_to_list(effect)
void effect_add_field_dimension(effect, entity)
bool statement_io_effect_p(statement)
list generic_effect_generate_all_accessible_paths_effects(effect, type, tag)
bool effects_private_current_stmt_stack_initialized_p(void)
list summary_effects_from_declaration(const char *)
bool r_effect_pointer_type_p(effect, list, type)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
#define effect_action_tag(eff)
#define variable_phi_p(e)
true if e is a phi variable PHI entities have a name like: REGIONS:PHI#, where # is a number.
bool type_declaration_effect_p(effect)
type points_to_reference_to_concrete_type(reference)
entity null_pointer_value_entity(void)
bool effect_reference_dereferencing_p(reference, bool *)
entity effect_entity(effect)
cproto-generated files
action make_action_write_memory(void)
To ease the extension of action with action_kind.
bool abstract_pointer_value_cell_p(cell)
bool undefined_pointer_value_entity_p(entity)
bool store_effect_p(effect)
bool environment_effect_p(effect)
bool malloc_effect_p(effect)
bool action_equal_p(action, action)
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
bool std_file_effect_p(effect)
action make_action_read_memory(void)
bool null_pointer_value_entity_p(entity)
entity undefined_pointer_value_entity(void)
pointer_values.c
#define cell_reference(x)
#define effect_undefined_p(x)
#define cell_preference(x)
#define cell_reference_p(x)
#define descriptor_convex_(x)
#define effect_domain_number(x)
#define action_write_p(x)
#define descriptor_convex_p(x)
#define effect_descriptor(x)
#define descriptor_undefined
#define descriptor_convex(x)
#define cell_preference_p(x)
#define descriptor_none_p(x)
#define effect_approximation(x)
#define newgen_Psysteme(p)
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
entity get_current_module_entity(void)
Get the entity of the current module.
#define ENDP(l)
Test if a list is empty.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#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.
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.
#define CDR(pcons)
Get the list less its first element.
#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)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
#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 DEFINE_GLOBAL_STACK(name, type)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
string reference_to_string(reference r)
string expression_to_string(expression e)
void print_reference(reference r)
string string_of_type(const type)
string basic_to_string(basic)
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
#define NORMALIZE_EXPRESSION(e)
#define IO_EFFECTS_ARRAY_NAME
array of Logical UNits; it is more or less handled as the current file pointer; in C,...
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local 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...
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool std_file_entity_p(entity e)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
bool derived_entity_p(entity e)
bool entity_pointer_p(entity e)
list extract_references_from_declarations(list decls)
FI: this function has not yet been extended for C types!!!
expression make_unbounded_expression()
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool unbounded_expression_p(expression e)
entity expression_variable(expression e)
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
bool variable_is_a_module_formal_parameter_p(entity, entity)
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
bool variable_return_p(entity)
True if a variable is the pseudo-variable used to store value returned by a function:
bool type_equal_p(type, type)
bool integer_scalar_entity_p(entity)
integer_scalar_entity_p() is obsolete; use entity_integer_scalar_p()
type type_to_pointed_type(type)
returns t if t is not a pointer type, and the pointed type if t is a pointer type.
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
bool FILE_star_type_p(type)
bool pointer_type_p(type)
Check for scalar pointers.
bool type_with_const_qualifier_p(type)
Is there a const qualifier associated to type t.
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
string type_to_string(const type)
type.c
#define transformer_undefined
#define REFERENCE(x)
REFERENCE.
#define basic_complex_p(x)
#define reference_undefined
#define normalized_linear_p(x)
#define reference_variable(x)
#define basic_typedef_p(x)
#define reference_undefined_p(x)
#define basic_pointer_p(x)
#define basic_derived_p(x)
#define range_increment(x)
#define basic_overloaded_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define entity_undefined_p(x)
#define transformer_arguments(x)
#define reference_indices(x)
#define preference_reference(x)
#define variable_dimensions(x)
#define basic_string_p(x)
#define normalized_linear(x)
#define variable_basic(x)
#define basic_logical_p(x)
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...
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
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...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Psysteme sc_safe_append(Psysteme s1, Psysteme s2)
Psysteme sc_safe_append(Psysteme s1, Psysteme s2) input : output : calcul de l'intersection des polye...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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.
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.
#define VECTEUR_UNDEFINED_P(v)
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
list current_module_declarations()