25 #include "pips_config.h"
98 bool conflict_p =
false;
126 bool conflict_p =
true;
148 conflict_p = v1 == v2;
165 bool conflict_p =
true;
183 bool conflict_p =
false;
208 for ( cind1 = ind1, cind2 = ind2; !
ENDP(cind1) && !
ENDP(cind2);
POP(cind1),
POP(cind2) ) {
222 conflict_p = ( i1 == i2 );
252 if ( conflict_p != old_conflict_p )
277 bool conflict_p =
true;
281 for ( cind1 = sl1, cind2 = sl2; conflict_p && !
ENDP(cind1) && !
ENDP(cind2);
POP(cind1),
POP(cind2) ) {
295 conflict_p = ( i1 == i2 );
316 bool conflict_p =
true;
322 if ( sl1n == sl2n && sl1n == nd ) {
330 for ( cind1 = sl1, cind2 = sl2; !
ENDP(cind1) && !
ENDP(cind2)
331 && conflict_p;
POP(cind1),
POP(cind2) ) {
369 conflict_p = ( i1 == i2 );
427 bool conflict_p =
true;
462 bool e1_heap_location_p = e1_abstract_location_p
464 bool e2_heap_location_p = e2_abstract_location_p
467 pips_assert(
"there shouldn't be two abstract locations here.",
468 !( (e1_abstract_location_p && !e1_heap_location_p)
469 && (e2_abstract_location_p && !e2_heap_location_p)));
495 if (e1_null_p || e2_null_p)
496 conflict_p = e1_null_p && e2_null_p;
497 else if ((e1_abstract_location_p && !e1_heap_location_p )
498 || (e2_abstract_location_p && !e2_heap_location_p ))
500 entity abstract_location_e = e1_abstract_location_p? e1: e2;
503 pips_debug(5,
"abstract location vs. concrete location case\n");
515 pips_debug(5,
"two concrete locations case \n");
531 bool t1_to_be_freed =
false, t2_to_be_freed =
false;
538 pips_debug(5,
"no conflict because types are not equal\n");
547 pips_debug(5,
"no conflict because entities are formals\n");
597 pips_debug(5,
"there is %s may conflict\n", conflict_p?
"a":
"no");
608 bool conflict_p =
false;
654 conflict_p = !diff_p;
658 pips_debug(5,
"there is %s must conflict\n", conflict_p?
"a":
"no");
668 bool conflict_p =
false;
684 "not implemented yet\n");
705 bool conflict_p =
false;
731 bool conflict_p =
false;
773 bool conflict_p = !must_p;
777 conflict_p = (e1 == e2);
780 conflict_p = (e1 == e2);
784 conflict_p = (e1 == e2);
787 pips_debug(5,
"fortran case, C case with semantics constant path analysis\n");
803 conflict_p = !must_p;
825 conflict_p = !must_p;
847 abstract_locations_conflict_p =
851 if (e1_abstract_location_p && e2_abstract_location_p)
854 conflict_p = abstract_locations_conflict_p( e1, e2 );
856 else if (e1_abstract_location_p || e2_abstract_location_p)
859 entity abstract_location = e1_abstract_location_p? e1 : e2;
860 entity concrete_location = e1_abstract_location_p? e2 : e1;
878 entity concrete_location_al =
880 conflict_p = abstract_locations_conflict_p(abstract_location,
881 concrete_location_al);
886 entity concrete_location_al =
888 conflict_p = abstract_locations_conflict_p(abstract_location,
889 concrete_location_al);
1012 bool r1_certainly_includes_r2_p =
false;
1016 r1_certainly_includes_r2_p =
true;
1018 return r1_certainly_includes_r2_p;
1028 bool cell1_certainly_includes_cell2_p =
false;
1034 return cell1_certainly_includes_cell2_p;
1062 bool eff1_certainly_includes_eff2_p =
false;
1068 eff1_certainly_includes_eff2_p =
true;
1071 return eff1_certainly_includes_eff2_p;
1076 bool eff1_certainly_includes_eff2_p =
false;
1081 pips_assert(
"the first effect is an exact and scalar effect",
1083 eff1_certainly_includes_eff2_p =
true;
1086 return eff1_certainly_includes_eff2_p;
struct _newgen_struct_entity_ * entity
bool entity_flow_or_context_sentitive_heap_location_p(entity e)
bool entity_null_locations_p(entity e)
test if an entity is the NULL POINTER
bool entity_abstract_location_p(entity al)
bool abstract_locations_must_conflict_p(entity al1 __attribute__((__unused__)), entity al2 __attribute__((__unused__)))
Do these two abstract locations MUST share some real memory locations ? Never ! DO NOT USE THIS FUNCT...
entity variable_to_abstract_location(entity v)
returns the smallest abstract locations containing the location of variable v.
bool entity_all_locations_p(entity e)
test if an entity is the top of the lattice
bool entity_anywhere_locations_p(entity e)
test if an entity is the bottom of the lattice
bool abstract_locations_may_conflict_p(entity al1, entity al2)
Do these two abstract locations MAY share some real memory locations ?
void const char const char const int
static string read_or_write(bool a)
bool constant_string_entity_p(entity e)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_exact_p(eff)
#define effect_variable(e)
For COMPATIBILITY purpose only - DO NOT USE anymore.
action_kind action_to_action_kind(action)
Without the consistency test, this function would certainly be inlined.
bool location_entity_p(entity)
bool effect_reference_dereferencing_p(reference, bool *)
bool store_effect_p(effect)
bool effect_scalar_p(effect)
reference cell_to_reference(cell)
FI: probably to be moved elsewhere in ri-util.
type cell_reference_to_type(reference, bool *)
computes the type of a cell reference representing a memory access path.
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
string effect_reference_to_string(reference)
entity constant_memory_access_path_to_location_entity(reference)
A constant memory access path may not be considered.
#define cell_reference(x)
#define cell_preference(x)
#define cell_reference_p(x)
#define action_kind_tag(x)
#define action_kind_store_p(x)
#define approximation_exact_p(x)
#define action_write_p(x)
#define cell_preference_p(x)
#define effect_approximation(x)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
list concrete_effects_entities_which_may_conflict_with_scalar_entity(list fx, entity e)
bool first_effect_certainly_includes_second_effect_p(effect eff1, effect eff2)
tests whether first effect certainly includes second one.
bool entities_must_conflict_p(entity e1, entity e2)
Check if two entities must conflict.
static bool first_cell_certainly_includes_second_cell_p(cell c1, cell c2)
tests whether first cell certainly includes second one
bool effects_maymust_read_or_write_scalar_entity_p(list fx, entity e, bool must_p)
bool points_to_cell_lists_must_conflict_p(list l1, list l2)
Same as above, but for lists.
bool cells_must_conflict_p(cell c1, cell c2)
Check if two cell must conflict.
bool concrete_effects_may_read_or_write_scalar_entity_p(list fx, entity e)
static bool user_effects_on_std_files_p
static bool first_reference_certainly_includes_second_reference_p(reference r1, reference r2)
Inclusion tests.
static list generic_effects_entities_which_may_conflict_with_scalar_entity(list fx, entity e, bool concrete_p)
Returns the list of entities used in effect list fx and potentially conflicting with e.
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
bool first_exact_scalar_effect_certainly_includes_second_effect_p(effect eff1, effect eff2)
bool effects_might_conflict_even_read_only_p(effect eff1, effect eff2)
Check if two effect might conflict, even if they are read only @description Two effects may conflict ...
static bool aliasing_across_formal_parameters_p
bool references_may_conflict_p(reference r1, reference r2)
Check if two references may conflict.
static bool cells_maymust_conflict_p(cell c1, cell c2, bool must_p)
Check if two cell may or must conflict.
void set_conflict_testing_properties()
conflicts.c
bool entities_maymust_conflict_p(entity e1, entity e2, bool must_p)
Check if two entities may or must conflict.
bool effects_may_read_or_write_scalar_entity_p(list fx, entity e)
check whether scalar entity e may be read or written by effects fx or cannot be accessed at all
static bool aliasing_across_types_p
bool effects_conflict_p(effect eff1, effect eff2)
Synonym for effects_may_conflict_p().
static bool old_effects_conflict_p(effect eff1, effect eff2)
OBSOLETE, was never used !!
bool effects_must_read_or_write_scalar_entity_p(list fx, entity e)
check whether scalar entity e must be read or written by any effect of fx or if it simply might be ac...
bool generic_effects_maymust_read_or_write_scalar_entity_p(list fx, entity e, bool must_p, bool concrete_p)
bool cells_may_conflict_p(cell c1, cell c2)
Check if two cell may conflict.
bool variable_references_may_conflict_p(entity v, list sl1, list sl2)
FIXME ?
bool effects_must_conflict_p(effect eff1, effect eff2)
Intersection tests.
bool concrete_effects_maymust_read_or_write_scalar_entity_p(list fx, entity e, bool must_p)
static bool trust_constant_path_effects_p
static bool constant_path_effects_p
Properties settings for conflict testing functions.
bool effects_may_read_or_write_memory_paths_from_entity_p(list l_eff, entity e)
tests whether the input effects list may contain effects with a memory path from the input entity e; ...
bool points_to_cell_lists_may_conflict_p(list l1, list l2)
Same as above, but for lists.
list effects_entities_which_may_conflict_with_scalar_entity(list fx, entity e)
bool array_references_may_conflict_p(list sl1, list sl2)
Check if there may be a conflict between two array references.
bool effect_may_read_or_write_memory_paths_from_entity_p(effect ef, entity e)
misc functions
bool effects_may_conflict_p(effect eff1, effect eff2)
Check if two effect may conflict @description Two effects may conflict if their abstract two location...
bool references_must_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)
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.
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define list_undefined
Undefined list definition :-)
#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 same_string_p(s1, s2)
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool entity_register_p(entity e)
bool entity_formal_p(entity p)
is p a formal parameter?
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool std_file_entity_p(entity e)
bool c_module_p(entity m)
Test if a module "m" is written in C.
bool entity_function_p(entity e)
bool effects_package_entity_p(entity e)
checks if an entity is an IO_EFFECTS_PACKAGE_NAME, a MALLOC_EFFECTS_NAME or a RAND_EFFECTS_PACKAGE_NA...
bool entity_field_p(entity e)
e is the field of a structure
bool expression_integer_value(expression e, intptr_t *pval)
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool unbounded_expression_p(expression e)
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
entity expression_variable(expression e)
bool reference_scalar_p(reference r)
This function returns true if Reference r is scalar.
bool extended_expression_constant_p(expression exp)
Returns true if the value of the expression does not depend syntactically on the current store.
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 variable_entity_p(entity)
variable.c
bool variable_entities_may_conflict_p(entity, entity)
bool type_equal_p(type, type)
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
bool type_union_variable_p(type)
bool overloaded_type_p(type)
Returns true if t is a variable type with a basic overloaded.
bool type_struct_variable_p(type)
#define type_functional_p(x)
#define value_reference(x)
#define reference_undefined
#define reference_variable(x)
#define reference_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define entity_undefined_p(x)
#define reference_indices(x)
#define preference_reference(x)
#define variable_dimensions(x)
#define type_variable_p(x)
#define entity_initial(x)
The structure used to build lists in NewGen.