25 #include "pips_config.h"
46 #include "resources.h"
141 pips_debug(8,
"call site precondition %p:\n", p);
153 pips_debug(8,
"filtered call site precondition:\n");
164 pips_debug(8,
"old module precondition undefined\n");
169 pips_debug(8,
"new module precondition in current frame:\n");
195 pips_debug(8,
"old module precondition in current frame:\n");
218 pips_debug(8,
"new module precondition in current frame:\n");
290 pips_debug(6,
"begin for call to %s from %s, pre=%p\n",
300 for( ce = formals; !
ENDP(ce);
POP(ce)) {
306 pips_user_error(
"not enough args in call to %s from %s for formal parameter %s of rank %d\n",
318 " (rank %d)\nin call to \"%s\" from \"%s\"\n",
342 pips_debug(6,
"Full type incompatibility (%s/%s) for formal parameter %s (rank %d)"
343 " in call to %s from %s\n"
344 "Association ignored",
399 #define DEBUG_PRECONDITION_INTRA_TO_INTER 1
410 "begin for call to %s\nwith precondition:\n",
430 "entitiy %s not belonging to module %s\n",
445 "meaningless old value(s):\n");
463 for(b = r->
base; b != NULL; b = b->
succ) {
477 for(ca = values; !
ENDP(ca);
POP(ca)) {
494 else if (
ENDP(l_callee)) {
497 "value %s lost according to effect list\n",
513 "value %s substituted by %s according to effect list le:\n",
522 "value %s lost because non analyzable scalar entity\n",
531 "value %s lost because non analyzable scalar entity\n",
545 "value %s substituted by %s the first element list according to effect list le:\n",
555 "value %s lost - list of conflicting entities with different types\n",
572 "values lost because they do not appear in the effect list le:\n");
575 "values preserved because they do appear in the effect list le"
576 " and in the transformer basis:\n");
587 if(
ENDP(preserved_values)) {
617 "return pre=%p\n",pre);
638 for(bv = b; bv != NULL; bv = bv->
succ) {
706 pips_debug(7,
"end: No need to translate %s yet\n",
717 pips_debug(7,
"%s is not translatable: store tag %d\n",
727 pips_debug(7,
"formal %s is not translatable\n",
732 pips_debug(7,
"return %s is not translatable\n",
742 pips_debug(7,
"let's do it for v = %s and tf =\n",
774 pips_debug(7,
"No equivalent for %s in %s: project %s\n",
777 "Information about %s lost,\n"
778 "check structure of common /%s/ in modules %s and %s\n",
792 pips_debug(7,
"No equivalent location for %s and %s: project %s\n",
796 "Information about %s lost,\n"
797 "check structure of common /%s/ in modules %s and %s\n",
810 pips_debug(7,
"Same location but different types for %s (%s) and %s (%s):"
811 " project both %s and %s\n",
817 "Information about %s lost,\n"
818 "check types for variables in common /%s/ in modules %s and %s\n",
864 pips_debug(7,
"%s has already been translated into %s\n",
868 "Variable %s is probably aliased with a formal parameter"
869 " by the current call to %s from %s.\n"
870 "This is forbidden by the Fortran 77 standard.\n",
875 "%s should again be translated into %s by projection of %s\n",
1030 "call to constant %s\n",
1067 (DBR_CUMULATED_EFFECTS,
1139 bool go_down =
false;
1178 #define PROCESS_CALL_DEBUG_LEVEL 5
1192 "Begin for module %s with %d call sites with caller %s\n",
1201 "current summary precondition for callee %s, %p:\n",
1214 "call site precondition in caller %s with bindings %p:\n",
1237 "call site precondition with filtered actual parameters:\n");
1245 "new call site precondition in caller's frame:\n");
1282 "old module current summary precondition (%p) in current frame:\n",
1299 new_current_summary_precondition =
1317 "new current summary precondition for module %s in current frame, %p:\n",
1341 static bool process_statement_for_summary_precondition(
statement s)
1402 (DBR_CUMULATED_EFFECTS,
1407 (DBR_PROPER_EFFECTS,
1449 pips_user_error(
"No summary precondition for module \"%s\". The callgraph "
1450 "is probably broken because stubs have been generated."
1451 "Please (re)compute the call graph,"
1452 " e.g. display CALLGRAPH_FILE.\n",
void free_transformer(transformer p)
bool transformer_defined_p(transformer p)
bool db_resource_p(const char *rname, const char *oname)
true if exists and in loaded or stored state.
struct _newgen_struct_entity_ * entity
void free_arguments(cons *args)
bool entity_is_argument_p(entity e, cons *args)
cons * arguments_add_entity(cons *a, entity e)
void dump_arguments(cons *args)
entity_name is a macro, hence the code replication
cons * arguments_difference(cons *a1, cons *a2)
set difference: a1 - a2 ; similar to set intersection
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...
transformer transformer_dup(transformer t_in)
transformer package - basic routines
bool transformer_identity_p(transformer t)
Check that t is an identity function.
void transformer_free(transformer t)
transformer transformer_identity()
Allocate an identity transformer.
transformer transformer_empty()
Allocate an empty transformer.
struct _newgen_struct_statement_ * statement
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
list load_summary_effects(entity e)
FI->FI, FI->BC: these two functions should be moved into effects-util or effects-simple.
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
bool location_entity_p(entity)
void set_pt_to_list(statement_points_to)
void reset_pt_to_list(void)
#define gen_recurse(start, domain_number, flt, rwt)
list concrete_effects_entities_which_may_conflict_with_scalar_entity(list fx, entity e)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#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)
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
#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)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
#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,...)
#define MODULE_SEP_STRING
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
#define dump_transformer(t)
string basic_to_string(basic)
#define module_language(e)
implemented as a macro to allow lhs
#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 local_entity_of_module_p(entity e, entity module)
This test shows that "e" has been declared in "module".
code entity_code(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
bool entity_module_p(entity e)
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
const char * entity_module_name(entity e)
See comments about module_name().
expression find_ith_argument(list args, int n)
bool c_language_module_p(entity m)
bool fortran_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".
statement pop_statement_global_stack(void)
bool same_basic_p(basic, basic)
check if two basics are similar.
bool type_equal_p(type, type)
bool same_scalar_location_p(entity, entity)
FI: transferred from semantics (should be used for effect translation as well)
void push_statement_on_statement_global_stack(statement)
string type_to_string(const type)
type.c
#define transformer_undefined
#define transformer_undefined_p(x)
#define storage_formal_p(x)
#define statement_ordering(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define call_domain
newgen_callees_domain_defined
#define storage_formal(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
#define transformer_relation(x)
#define transformer_arguments(x)
#define formal_function(x)
#define statement_declarations(x)
struct _newgen_struct_transformer_ * transformer
#define call_arguments(x)
#define expression_syntax(x)
#define storage_return_p(x)
#define predicate_system(x)
#define entity_domain
newgen_syntax_domain_defined
#define variable_basic(x)
#define statement_undefined
#define storage_undefined
#define entity_initial(x)
transformer propagate_preconditions_in_declarations(list dl, transformer pre, void(*process_initial_expression)(expression, transformer))
This function is mostly copied from declarations_to_transformer().
struct Ssysteme * Psysteme
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 ...
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.
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Psysteme sc_safe_normalize(Psysteme ps)
Psysteme sc_safe_normalize(Psysteme ps) output : ps, normalized.
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 precondition_intra_to_inter(entity callee, transformer pre, list le)
void translate_global_value(entity m, transformer tf, entity v)
Try to convert an value on a non-local variable into an value on a local variable using a guessed nam...
static transformer current_precondition
transformer update_precondition_with_call_site_preconditions(transformer t, entity caller, entity callee)
Update precondition t for callee with preconditions of call sites to callee in caller.
void expressions_to_summary_precondition(transformer pre, list le)
void expression_to_summary_precondition(transformer pre, expression e)
transformer new_add_formal_to_actual_bindings(call c, transformer pre, entity caller)
Take side effects into account:
static bool memorize_precondition_for_summary_precondition(statement s)
Each time a statement is entered, its precondition is memorized.
static bool process_call_for_summary_precondition(call c)
Update the current_summary_precondition, if necessary.
#define PROCESS_CALL_DEBUG_LEVEL
transformer get_module_precondition(entity m)
package semantics
void add_module_call_site_precondition(entity m, transformer p)
static entity current_caller
Context to compute summary preconditions.
void call_to_summary_precondition(transformer pre, call c)
static transformer current_summary_precondition
void update_summary_precondition_in_declaration(expression e, transformer pre)
This function is called to deal with call sites located in initialization expressions carried by decl...
static entity current_callee
bool same_analyzable_type_scalar_entity_list_p(list l)
#define DEBUG_PRECONDITION_INTRA_TO_INTER
static statement current_statement
transformer value_passing_summary_transformer(entity f, transformer tf)
With value passing, writes on formal parameters are not effective interprocedurally unless an array i...
int get_call_site_number()
void translate_global_values(entity m, transformer tf)
static list summary_effects_of_callee
void reset_call_site_number()
text call_site_to_module_precondition_text(entity caller, entity callee, statement s, call c)
This function does everything needed.
list module_to_formal_analyzable_parameters(entity f)
returns a module's parameter's list
static int number_of_call_sites
transformer add_formal_to_actual_bindings(call c, transformer pre, entity caller)
add_formal_to_actual_bindings(call c, transformer pre, entity caller):
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
transformer substitute_stubs_in_transformer(transformer tf, call c, statement s, bool backward_p)
Exploit the binding map to substitute calles's stubs by actual arguments, which may be stubs of the c...
text text_for_a_transformer(transformer tran, bool is_a_transformer)
call this one from outside.
transformer load_statement_semantic(statement)
void set_semantic_map(statement_mapping)
void reset_semantic_map(void)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
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...