25 #include "pips_config.h"
75 bool eff1_abstract_location_p,
76 bool eff2_abstract_location_p,
77 bool *eff1_still_combinable_p,
78 bool *eff2_still_combinable_p,
84 pips_assert("eff1 and eff2 must be still combinable",
85 *eff1_still_combinable_p && *eff2_still_combinable_p);
90 if (eff1_abstract_location_p && eff2_abstract_location_p)
97 *eff1_still_combinable_p =
false;
98 *eff2_still_combinable_p =
false;
118 *eff2_still_combinable_p =
false;
124 *eff1_still_combinable_p =
false;
129 else if (eff1_abstract_location_p)
132 *eff2_still_combinable_p =
false;
134 else if (eff2_abstract_location_p)
136 *eff1_still_combinable_p =
false;
141 l_res =
gen_nconc((*concrete_effects_union_op)(eff1,eff2), l_res);
142 *eff1_still_combinable_p =
false;
143 *eff2_still_combinable_p =
false;
169 bool eff1_abstract_location_p,
170 bool eff2_abstract_location_p,
171 bool *eff1_still_combinable_p,
172 bool *eff2_still_combinable_p,
178 pips_assert("eff1 and eff2 must be still combinable",
179 *eff1_still_combinable_p && *eff2_still_combinable_p);
185 if (eff1_abstract_location_p && eff2_abstract_location_p)
196 effect r = (*effect_dup_func)(eff1);
197 *eff1_still_combinable_p =
false;
198 *eff2_still_combinable_p =
false;
211 effect r = (*effect_dup_func)(eff2);
213 *eff2_still_combinable_p =
false;
225 *eff1_still_combinable_p =
false;
231 else if (eff1_abstract_location_p)
237 effect r = (*effect_dup_func)(eff2);
240 *eff2_still_combinable_p =
false;
243 else if (eff2_abstract_location_p)
249 effect r = (*effect_dup_func)(eff1);
251 *eff1_still_combinable_p =
false;
257 l_res =
gen_nconc((*concrete_effects_intersection_op)(eff1,eff2), l_res);
258 *eff1_still_combinable_p =
false;
259 *eff2_still_combinable_p =
false;
286 bool eff1_abstract_location_p,
287 bool eff2_abstract_location_p,
288 bool *eff1_still_combinable_p,
289 bool *eff2_still_combinable_p,
295 pips_assert("eff1 and eff2 must be still combinable",
296 *eff1_still_combinable_p && *eff2_still_combinable_p);
301 if (eff1_abstract_location_p || eff2_abstract_location_p)
305 if (eff1_abstract_location_p && eff2_abstract_location_p)
310 *eff1_still_combinable_p = *eff2_still_combinable_p =
false;
317 *eff2_still_combinable_p =
false;
323 *eff1_still_combinable_p =
false;
330 *eff1_still_combinable_p = eff1_abstract_location_p;
331 *eff2_still_combinable_p = eff2_abstract_location_p;
333 if (!*eff1_still_combinable_p)
345 l_res =
gen_nconc((*concrete_effects_sup_difference_op)(eff1,eff2), l_res);
346 *eff1_still_combinable_p =
false;
347 *eff2_still_combinable_p =
false;
373 bool eff1_abstract_location_p,
374 bool eff2_abstract_location_p,
375 bool *eff1_still_combinable_p,
376 bool *eff2_still_combinable_p,
382 pips_assert("eff1 and eff2 must be still combinable",
383 *eff1_still_combinable_p && *eff2_still_combinable_p);
388 if (eff1_abstract_location_p || eff2_abstract_location_p)
394 *eff1_still_combinable_p =
false;
396 if (eff1_abstract_location_p && eff2_abstract_location_p)
401 *eff2_still_combinable_p =
false;
408 *eff2_still_combinable_p =
false;
422 *eff2_still_combinable_p = eff2_abstract_location_p;
427 l_res =
gen_nconc((*concrete_effects_inf_difference_op)(eff1,eff2), l_res);
428 *eff1_still_combinable_p =
false;
429 *eff2_still_combinable_p =
false;
485 debug_on(
"EFFECTS_OPERATORS_DEBUG_LEVEL");
497 bool r1_still_combinable_p =
true;
502 while(r1_still_combinable_p && !
ENDP(lr2))
505 bool r2_still_combinable_p =
true;
510 if ( (*r1_r2_combinable_p)(r1,r2) )
514 list l_tmp = (*r1_r2_generic_binary_op)(r1, r2,
515 r1_abstract_location_p,
516 r2_abstract_location_p,
517 &r1_still_combinable_p,
518 &r2_still_combinable_p,
519 r1_r2_concrete_binary_op);
521 if (!r2_still_combinable_p)
548 if (r1_still_combinable_p)
549 l_res =
gen_nconc((*r1_unary_op)(r1),l_res);
556 l_res =
gen_nconc((*r2_unary_op)(r2),l_res);
615 effects_generic_union_op,
616 r1_r2_concrete_union_op,
617 r_unary_op, r_unary_op);
652 effects_generic_intersection_op,
653 r1_r2_concrete_intersection_op,
689 effects_generic_intersection_op,
690 r1_r2_concrete_cells_intersection_op,
728 effects_generic_sup_difference_op,
729 r1_r2_concrete_sup_difference_op,
766 effects_generic_inf_difference_op,
767 r1_r2_concrete_inf_difference_op,
804 effects_generic_inf_difference_op,
805 r1_r2_concrete_cells_inf_difference_op,
857 eff = (*proper_to_summary_effect_func)(eff);
864 l_res = (*effects_union_op)(
effect_to_list(eff), l_res, *effects_comb_p);
915 static list __attribute__((unused)) old_proper_effects_combine(
list l_effects,
bool scalars_only_p) {
918 hash_table all_read_effects, all_write_effects;
925 pips_debug(6,
"Proper effects to combine: \n");
926 (*effects_prettyprint_func)(l_effects);
930 pips_assert(
"The very same effect does not appear twice",
942 fprintf(stderr,
"Effect %d: %p\tReference %d: %p (%spersistant)\n",
946 pips_assert(
"The very same reference does not appear twice"
947 " unless it is persistant",
gen_once_p(refl));
966 bool may_combine, do_combine =
false;
974 current = (*proper_to_summary_effect_func)(lcurrent);
1012 do_combine_item =
hash_get(all_write_effects, n);
1019 do_combine_item =
hash_get(all_read_effects, n);
1086 (*effects_prettyprint_func)(l_effects);
1110 bool combinable_p =
false;
1121 pips_debug(1,
"-> %s combinable\n", combinable_p?
"":
"not");
1123 return combinable_p;
1128 bool combinable_p =
true;
1146 combinable_p =
false;
1148 bool finished_p =
false;
1150 while(combinable_p && !finished_p)
1158 combinable_p =
false;
1193 combinable_p =
false;
1202 pips_assert(
"the current index must be an array index or a pointer dimension",
1204 combinable_p =
true;
1231 if ( al1_p || al2_p)
1240 pips_debug(8,
"eff1 is an effect on an abstract location "
1241 "and eff2 is a malloc or io effect\n");
1242 combinable_p =
false;
1248 pips_debug(8,
"eff2 is an effect on an abstract location "
1249 "and eff1 is a malloc or io effect\n");
1250 combinable_p =
false;
1254 combinable_p =
true;
1261 combinable_p =
true;
1263 combinable_p =
false;
1268 combinable_p =
false;
1272 combinable_p =
true;
1274 combinable_p =
false;
1277 combinable_p =
false;
1279 else if ( (al1_p && al2_p)
1286 if (heap1_p || heap2_p)
1288 if (heap1_context_sensitive_p && heap2_context_sensitive_p)
1292 combinable_p =
false;
1294 else if (heap1_p && heap2_p)
1298 combinable_p =
true;
1305 if ((heap1_p && !al2_p) || (heap2_p && !al1_p))
1307 combinable_p =
false;
1324 pips_assert(
"One of the effect at least is linked to an abstract location", al1_p || al2_p);
1326 combinable_p =
true;
1340 combinable_p =
true;
1342 combinable_p =
false;
1351 else combinable_p =
false;
1358 else combinable_p =
false;
1361 return combinable_p;
1372 bool same_p =
false;
1418 bool same_p =
false;
1447 bool combinable_p, act_combinable;
1458 return(combinable_p && act_combinable);
1463 bool combinable_p, act_combinable;
1474 return(combinable_p && act_combinable);
1479 bool combinable_p, act_combinable;
1490 return(combinable_p && act_combinable);
1495 bool combinable_p, act_combinable;
1506 return(combinable_p && act_combinable);
1517 pips_assert(
"unused arguments", l1==l1 && l2==l2 &&
1560 intersection_combinable_p,
1561 effect_entities_intersection);
1589 difference_combinable_p,
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
cell make_cell_reference(reference _field_)
void free_effect(effect p)
bool effect_consistent_p(effect p)
reference make_reference(entity a1, list a2)
bool entity_flow_or_context_sentitive_heap_location_p(entity e)
bool entity_heap_location_p(entity b)
package abstract location.
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 abstract_locations_max(entity al1, entity al2)
eturns the smallest abstract location set greater than or equalt to al1 and al2.
bool entity_all_locations_p(entity e)
test if an entity is the top of the lattice
bool entity_nowhere_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
bdt base
Current expression.
#define pips_debug_effects(level, message, l_eff)
#define pips_debug_effect(level, message, eff)
for debug
list list_of_effects_generic_sup_difference_op(list, list, bool(*)(effect, effect), list(*)(effect, effect))
list list_of_effects_generic_union_op(list, list, bool(*)(effect, effect), list(*)(effect, effect), list(*)(effect))
list list_of_effects_generic_binary_op(list, list, bool(*)(effect, effect), list(*)(effect, effect, bool, bool, bool *, bool *, list(*)(effect, effect)), list(*)(effect, effect), list(*)(effect), list(*)(effect))
binary_operators.c
list proper_to_summary_effects(list)
list proper_effects_contract(list)
list list_of_effects_generic_cells_inf_difference_op(list, list, bool(*)(effect, effect), list(*)(effect, effect))
bool w_r_combinable_p(effect, effect)
list proper_effects_combine(list, bool)
list effects_entities_inf_difference(list, list, bool(*)(effect, effect))
list effect_to_nil_list_and_free(effect)
bool effects_combinable_p(effect, effect)
bool effects_scalars_and_same_action_p(effect, effect)
void effect_to_may_effect(effect)
bool w_w_combinable_p(effect, effect)
list effects_entities_intersection(list, list, bool(*)(effect, effect))
list effects_undefined_binary_operator(list, list, bool(*)(effect, effect))
list list_of_effects_generic_intersection_op(list, list, bool(*)(effect, effect), list(*)(effect, effect))
list list_of_effects_generic_inf_difference_op(list, list, bool(*)(effect, effect), list(*)(effect, effect))
bool r_r_combinable_p(effect, effect)
effect(* effect_dup_func)(effect eff)
bool r_w_combinable_p(effect, effect)
list list_of_effects_generic_cells_intersection_op(list, list, bool(*)(effect, effect), list(*)(effect, effect))
list effect_to_list(effect)
list effects_to_nil_list(effect, effect)
bool cells_combinable_p(cell, cell)
bool effects_same_action_p(effect, effect)
bool effects_same_variable_p(effect, effect)
#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.
action_kind action_to_action_kind(action)
Without the consistency test, this function would certainly be inlined.
bool effect_abstract_location_p(effect)
list effect_words_reference(reference)
prettyprint.c
type points_to_reference_to_concrete_type(reference)
reference cell_any_reference(cell)
API for reference.
entity effect_entity(effect)
cproto-generated files
bool atomic_effect_p(effect)
bool undefined_pointer_value_entity_p(entity)
action_kind effect_action_kind(effect)
bool std_file_cell_p(cell)
bool effect_scalar_p(effect)
string effect_reference_to_string(reference)
bool effect_comparable_p(effect, effect)
Can we merge these two effects because they are equal or because they only differ by their approximat...
string action_kind_to_string(action_kind)
#define cell_reference(x)
#define effect_undefined_p(x)
#define cell_reference_p(x)
#define action_kind_tag(x)
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.
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)
void gen_map(gen_iter_func_t fp, const list l)
size_t gen_length(const list l)
bool gen_once_p(list l)
FC: ARGH...O(n^2)!
#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
#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 :-)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
#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
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool c_module_p(entity m)
Test if a module "m" is written in C.
bool entity_field_p(entity e)
e is the field of a structure
bool fortran_module_p(entity m)
Test if a module is in Fortran.
bool reference_equal_p(reference r1, reference r2)
bool expression_lists_equal_p(list l1, list l2)
bool array_pointer_string_type_equal_p(type, type)
Assume that a pointer to type x is equal to a 1-D array of x.
#define syntax_reference_p(x)
#define REFERENCE(x)
REFERENCE.
#define syntax_reference(x)
#define reference_variable(x)
#define EXPRESSION(x)
EXPRESSION.
#define reference_indices(x)
#define expression_syntax(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
string words_to_string(cons *lw)