25 #include "pips_config.h"
55 #include "resources.h"
154 if(strcmp(fp_name,
"transfer")==0) {
157 else if(strcmp(fp_name,
"pattern")==0) {
160 else if(strcmp(fp_name,
"derivative")==0) {
164 user_error(
"select_fix_point_operator",
"Unknown value %s for property %s\n",
165 fp_name,
"SEMANTICS_FIX_POINT_OPERATOR");
208 if(!precondition_p) {
282 "SEMANTICS_COMPUTE_TRANSFORMERS_IN_CONTEXT, "
283 "you should activate TRANSFORMERS_INTER_FULL\n");
511 debug(8,
"summary_precondition",
"begin\n");
527 pips_debug(8,
"initial summary precondition %p for %s:\n",
602 "Initial preconditions are not consistent.\n"
603 " The Fortran standard rules about variable initialization"
604 " with DATA statements are likely to be violated.\n"
605 "set property PARSER_ACCEPT_ANSI_EXTENSIONS to false\n"
606 "and CHECK_FORTRAN_SYNTAX_BEFORE_PIPS to true.\n");
650 pips_debug(1,
"begin for %s with %zd callers\n",
679 "because not in call tree from main.\n",
module_name);
775 "initial summary precondition %p for %s (%d call sites):\n",
807 debug(1,
"summary_precondition",
"begin for %s with %d callers\n",
832 "because not in call tree from main.\n",
module_name);
873 "summary total postcondition %p for %s (%d call sites):\n",
969 "Initial preconditions are not consistent.\n"
970 " The Fortran standard rules about variable initialization"
971 " with DATA statements are likely to be violated.\n"
972 "set property PARSER_ACCEPT_ANSI_EXTENSIONS to false\n"
973 "and CHECK_FORTRAN_SYNTAX_BEFORE_PIPS to true.\n");
979 else if(in_context) {
1047 bool save_prop =
get_bool_property(
"SEMANTICS_COMPUTE_TRANSFORMERS_IN_CONTEXT");
1051 " is not set, it is used because it is necessary for this "
1052 "recomputation to be useful\n");
1181 pips_debug(8,
"postcondition computed for %s\n",
1184 debug(1,
"module_name_to_preconditions",
"end\n");
1271 pips_debug(8,
"\t summary_total_postcondition %p after translation:\n",
1274 pips_assert(
"The summary total postcondition is consistent",
1303 (
char*) t_pre_inter);
1305 pips_debug(8,
"total precondition computed for %s\n",
1397 debug(8,
"update_summary_precondition",
"begin\n");
1404 debug(8,
"update_summary_precondition",
" old precondition for %s:\n",
1421 debug(8,
"update_summary_precondition",
"new precondition for %s:\n",
1424 debug(8,
"update_summary_precondition",
"end\n");
1481 pips_debug(8,
" total postcondition for %s:\n",
void free_transformer(transformer p)
transformer copy_transformer(transformer p)
TRANSFORMER.
bool db_resource_p(const char *rname, const char *oname)
true if exists and in loaded or stored state.
static const char * caller_name
transformer transformer_dup(transformer t_in)
transformer package - basic routines
void transformer_free(transformer t)
transformer transformer_inequality_add(transformer tf, Pvecteur i)
transformer transformer_identity()
Allocate an identity transformer.
bool transformer_consistency_p(transformer t)
FI: I do not know if this procedure should always return or fail when an inconsistency is found.
transformer transformer_empty()
Allocate an empty transformer.
struct _newgen_struct_statement_ * statement
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
void close_reachable(void)
Remove reachability information about previously checked statements.
void init_reachable(statement)
unreachable.c
#define database_undefined
bool preconditions_intra_fast(char *module_name)
bool interprocedural_summary_precondition(char *module_name)
transformer transformer_equality_fix_point(transformer)
Let A be the affine loop transfert function.
list load_module_intraprocedural_effects(entity e)
bool summary_total_precondition(char *module_name)
static int wc
FI: Provisional management of warnings.
static void select_fix_point_operator()
static void transformer_add_declaration_information(transformer pre, entity m)
transformer load_summary_total_postcondition(entity e)
summary_preconditions are expressed in any possible frame, in fact the frame of the last procedure th...
bool generic_module_name_to_transformers(const char *module_name, bool in_context)
bool generic_module_name_to_transformers(char * module_name, bool in_context): compute a transformer ...
bool transformers_inter_full_with_points_to(char *module_name)
transformer load_completed_statement_transformer(statement s)
three mappings used throughout semantics analysis:
bool summary_precondition(char *module_name)
bool preconditions_inter_full_with_points_to(char *module_name)
bool refine_transformers_p
Transformer recomputation cannot be of real use unless an interprocedural analysis is performed.
bool module_name_to_transformers_in_context(const char *module_name)
bool transformers_intra_fast(char *module_name)
Functions to make transformers.
bool transformers_inter_full(char *module_name)
bool test_warning_counters(void)
void cumulated_effects_map_print(void)
ca n'a rien a` faire ici, et en plus, il serait plus inte'ressant d'avoir une fonction void statement...
bool summary_total_postcondition(char *module_name)
bool module_name_to_preconditions(const char *module_name)
resource module_name_to_preconditions(char * module_name): compute a transformer for each statement o...
void set_warning_counters(void)
transformer(* transformer_fix_point_operator)(transformer)
Interface between the untyped database manager and clean code and between pipsmake and clean code.
bool total_preconditions_inter(char *module_name)
transformer transformer_pattern_fix_point(transformer)
This fixpoint function was developped to present a talk at FORMA.
bool interprocedural_summary_precondition_with_points_to(char *module_name)
bool module_name_to_transformers(const char *module_name)
list load_body_effects(entity e)
bool transformers_inter_fast(char *module_name)
bool refine_transformers_with_points_to(char *module_name)
bool preconditions_inter_full(char *module_name)
bool module_name_to_total_preconditions(const char *module_name)
void add_declaration_list_information(transformer pre, list dl, bool precondition_p)
bool summary_transformer(char *module_name)
static void reset_use_points_to()
transformer load_summary_precondition(entity e)
summary_preconditions are expressed in any possible frame, in fact the frame of the last procedure th...
bool preconditions_intra(char *module_name)
bool refine_transformers(char *module_name)
static bool use_points_to_information_p
list load_summary_effects(entity e)
FI->FI, FI->BC: these two functions should be moved into effects-util or effects-simple.
static void add_declaration_information(transformer pre, entity m, bool precondition_p)
static transformer main_summary_precondition(entity callee)
Special case: main module.
bool old_summary_precondition(char *module_name)
void update_summary_precondition(entity e, transformer t)
void update_summary_precondition(e, t): t is supposed to be a precondition related to one of e's call...
transformer load_summary_transformer(entity e)
static void precondition_add_declaration_information(transformer pre, entity m)
bool transformers_intra_full(char *module_name)
static transformer ordinary_summary_precondition(const char *module_name, entity callee)
Standard cases: called modules.
bool total_preconditions_intra(char *module_name)
bool preconditions_inter_fast(char *module_name)
static void set_use_points_to()
bool intraprocedural_summary_precondition(char *module_name)
transformer transformer_derivative_fix_point(transformer)
Computation of a transitive closure using constraints on the discrete derivative.
statement_effects get_cumulated_rw_effects(void)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
list load_cumulated_rw_effects_list(statement)
void generic_effects_reset_all_methods(void)
void reset_cumulated_rw_effects(void)
void set_methods_for_simple_effects(void)
void set_pt_to_list(statement_points_to)
list effects_to_list(effects)
void reset_pt_to_list(void)
#define statement_effects_hash_table(x)
struct _newgen_struct_effects_ * effects
struct _newgen_struct_statement_effects_ * statement_effects
#define STATEMENT_EFFECTS_MAP(k, v, c, f)
#define effects_effects(x)
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
transformer transformer_basic_fix_point(transformer tf)
Computation of a fix point: drop all constraints, remember which variables are changed.
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.
#define ENDP(l)
Test if a list is empty.
size_t gen_length(const list l)
#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 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.
#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_error(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define DEFINE_CURRENT_MAPPING(name, type)
#define MAKE_STATEMENT_MAPPING()
#define HASH_GET(start, image, h, k)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
bool some_main_entity_p(void)
util.c
#define print_transformer(t)
#define dump_transformer(t)
#define SEMANTICS_FIX_POINT
#define SEMANTICS_FLOW_SENSITIVE
#define SEMANTICS_DEBUG_LEVEL
#define SEMANTICS_INTERPROCEDURAL
#define SEMANTICS_INEQUALITY_INVARIANT
void set_bool_property(const char *, bool)
#define NORMALIZE_EXPRESSION(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 c_module_p(entity m)
Test if a module "m" is written in C.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
bool entity_main_module_p(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
bool entity_module_p(entity e)
void free_statement_global_stack(void)
void make_statement_global_stack(void)
struct _newgen_struct_callees_ * callees
#define transformer_undefined
#define transformer_undefined_p(x)
#define normalized_linear_p(x)
#define callees_callees(x)
#define statement_ordering(x)
#define dimension_lower(x)
#define transformer_arguments(x)
#define dimension_upper(x)
#define variable_dimensions(x)
struct _newgen_struct_transformer_ * transformer
#define normalized_linear(x)
#define type_variable_p(x)
#define statement_undefined
#define entity_initial(x)
transformer data_to_precondition(entity m)
restricted to variables with effects.
void set_module_global_arguments(list args)
transformer statement_to_postcondition(transformer, statement)
end of the non recursive section
transformer statement_to_total_precondition(transformer, statement)
semantical analysis
void sc_variable_name_pop(void)
void sc_variable_name_push(char *(*fun)(Variable))
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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.
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)
void reset_call_site_number()
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 upwards_vect_rename(Pvecteur v, transformer post)
Renaming of variables in v according to transformations occuring later.
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
void transformer_add_type_information(transformer)
type.c
void set_total_precondition_map(statement_mapping)
void reset_total_precondition_map(void)
void set_transformer_map(statement_mapping)
transformer load_statement_transformer(statement)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
statement_mapping get_total_precondition_map(void)
statement_mapping get_transformer_map(void)
void reset_transformer_map(void)
statement_mapping get_precondition_map(void)
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....
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...
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()