25 #include "pips_config.h"
46 #include "constants.h"
54 #include "resources.h"
153 l_glob = (*effects_local_to_global_translation_op)(l_loc);
155 (*db_put_live_in_summary_paths_func)(
module_name, l_glob);
317 pips_debug(1,
"begin for %s with %td callers\n",
367 pips_debug(1,
"begin for statement with ordering: %03zd and number: %03zd\n",
393 transformer t = (*load_completed_transformer_func)(s);
400 (*effects_transformer_composition_op)(l_live_out, t);
420 list l_live_in = (*effects_union_op)(
422 (*effects_sup_difference_op)(l_live_out, l_write,
475 (ctrl, unstr, l_nodes,
478 pips_debug(3,
"visiting node statement with ordering: "
479 "%03zd and number: %03zd\n",
492 l_in = (*effects_union_op)(l_in_node_may, l_in,
503 list l_live_out_nodes = (*effects_union_op)(l_in, l_live_out_unstr,
517 pips_debug(3,
"storing live out paths for node statement "
518 "with ordering: %03zd and number: %03zd\n",
572 list l_live_out_after_cond =
573 (*effects_union_op)(l_live_out_loop,
578 l_live_out_after_cond);
611 list l_live_out_body =
612 (*effects_union_op)(l_in_cond,
613 (*effects_sup_difference_op)(l_live_out_after_cond,
670 list l_live_out_after_cond =
671 (*effects_union_op)(l_live_out_loop,
676 l_live_out_after_cond);
705 list l_live_out_body =
706 (*effects_union_op)(l_in_cond,
707 (*effects_sup_difference_op)(l_live_out_after_cond,
753 pips_debug(1,
"do while loop: live in paths are those of the body\n");
754 l_live_in_loop = l_live_in_body;
784 list l_live_out_after_cond =
785 (*effects_union_op)(l_live_out_loop,
790 l_live_out_after_cond);
820 (*effects_union_op)(l_in_cond,
821 (*effects_sup_difference_op)(l_live_out_after_cond,
878 l_live_out_loop = (*effects_sup_difference_op)(l_live_out_loop, l_w_body,
880 pips_debug_effects(3,
"live out paths of an iteration due to live out paths of whole loop\n", l_live_out_loop);
898 list l_inv_in_body_may =
908 list l_live_out_body = (*effects_union_op)(l_live_out_loop,
915 list l_live_in_header =
939 l_live_out_body = (*effects_union_op)(l_live_out_body,
984 list l_live_in_header =
997 l_masked_vars =
CONS(
ENTITY, index, l_masked_vars);
999 list l_live_in_first_iter =
1005 CDR(l_masked_vars) =
NIL;
1021 l_live_in_first_iter =
NIL;
1039 list l_live_in_loop = (*effects_union_op)(l_live_in_header,
1040 l_live_in_first_iter,
1109 pips_debug(1,
"dealing with statement with ordering: %03zd and number: %03zd\n",
1112 list l_live_out = l_next_stmt_live_in;
1130 pips_debug_effects(2,
"storing live_in paths of sequence statement:\n", l_next_stmt_live_in);
1180 debug_on(
"LIVE_PATHS_DEBUG_LEVEL");
1214 list l_sum_live_out = (*db_get_live_out_summary_paths_func)(
module_name);
1265 Pbase base_keep = NULL;
1320 sc_projection_along_variable_ofl_ctrl(&nsc, elim,
FWD_OFL_CTRL);
1396 bool good_result_p =
true;
1443 return (good_result_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.
action copy_action(action p)
ACTION.
descriptor make_descriptor_convex(Psysteme _field_)
approximation copy_approximation(approximation p)
APPROXIMATION.
effect make_effect(cell a1, action a2, approximation a3, descriptor a4)
cell copy_cell(cell p)
CELL.
reference make_reference(entity a1, list a2)
bool statement_consistent_p(statement p)
static reference ref
Current stmt (an integer)
static statement module_statement
static const char * caller_name
Pbase base_add_variable(Pbase b, Variable var)
Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end...
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...
struct _newgen_struct_statement_ * statement
static statement current_stmt
#define pips_debug_effects(level, message, l_eff)
effects_representation_val
void free_effects_private_current_context_stack(void)
void set_invariant_in_effects(statement_effects)
void set_cumulated_in_effects(statement_effects)
void init_live_out_regions(void)
void reset_live_out_regions(void)
void set_live_in_paths(statement_effects)
list effects_store_effects(list)
statement_effects(* db_get_invariant_in_effects_func)(const char *)
void set_rw_effects(statement_effects)
void reset_invariant_in_effects(void)
void effects_to_may_effects(list)
list effects_read_effects_dup(list)
void reset_live_out_paths(void)
void make_effects_private_current_context_stack(void)
list load_live_out_paths_list(statement)
statement_effects(* db_get_live_in_paths_func)(const char *)
list generic_effects_forward_translation(entity, list, list, transformer)
void init_live_out_paths(void)
list load_live_in_paths_list(statement)
statement_effects get_live_out_regions(void)
list proper_to_summary_effects(list)
list load_invariant_in_effects_list(statement)
void reset_cumulated_in_effects(void)
statement_effects(* db_get_invariant_rw_effects_func)(const char *)
statement_effects(* db_get_live_out_paths_func)(const char *)
void init_live_in_paths(void)
list effects_write_effects_dup(list)
list load_proper_rw_effects_list(statement)
descriptor(* loop_descriptor_make_func)(loop)
effect(* reference_to_effect_func)(reference, action, bool)
void reset_out_effects(void)
void set_live_out_paths(statement_effects)
descriptor loop_undefined_descriptor_make(loop)
void store_live_out_regions_list(statement, list)
void reset_proper_rw_effects(void)
statement_effects get_live_in_paths(void)
void set_proper_rw_effects(statement_effects)
bool normalizable_and_linear_loop_p(entity, range)
list load_in_effects_list(statement)
statement_effects(* db_get_cumulated_in_effects_func)(const char *)
void set_out_effects(statement_effects)
statement_effects get_live_out_paths(void)
void set_in_effects(statement_effects)
void reset_in_effects(void)
list filter_effects_with_declaration(list, entity)
list load_rw_effects_list(statement)
void store_live_in_paths_list(statement, list)
void store_live_out_paths_list(statement, list)
void reset_invariant_rw_effects(void)
list load_statement_out_regions(statement)
bool bound_live_in_paths_p(statement)
effect(* effect_dup_func)(effect eff)
statement_effects(* db_get_in_effects_func)(const char *)
void reset_live_in_paths(void)
bool r_w_combinable_p(effect, effect)
bool bound_live_out_paths_p(statement)
list effects_dup_without_variables(list, list)
void set_invariant_rw_effects(statement_effects)
statement_effects(* db_get_proper_rw_effects_func)(const char *)
void reset_rw_effects(void)
bool effects_same_action_p(effect, effect)
statement_effects(* db_get_rw_effects_func)(const char *)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
action make_action_read_memory(void)
#define descriptor_tag(x)
@ is_descriptor_convexunion
#define effect_descriptor(x)
#define descriptor_convex(x)
#define effect_approximation(x)
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....
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
#define UNSTRUCTURED_CONTROL_MAP(c, u, l, code)
Walk through all the controls of un unstructured.
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_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
bool gen_false(__attribute__((unused)) gen_chunk *unused)
Return false and ignore the argument.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
bool loop_parallel_p(loop l)
Test if a loop is parallel.
bool loop_executed_never_p(loop l)
Check if loop bound are constant and then if upper < lower.
bool loop_executed_at_least_once_p(loop l)
Check if loop bound are constant and then if upper >= lower.
#define ENDP(l)
Test if a list is empty.
#define list_undefined_p(c)
Return if a list is undefined.
#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)
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 :-)
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.
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
static void init_live_paths_context(live_paths_analysis_context *ctxt, effects_representation_val representation)
static bool live_paths_from_block_to_statements(sequence seq, live_paths_analysis_context *ctxt)
static void reset_converted_rw_effects(list *lrw, live_paths_analysis_context *ctxt)
static void reset_converted_in_effects(list *lin, live_paths_analysis_context *ctxt)
static list convert_rw_effects(list lrw, live_paths_analysis_context *ctxt)
static void update_live_out_summary_engine_context_paths(live_out_summary_engine_context *ctxt, list l_paths)
static bool live_out_paths_from_call_site_to_callee(call c, live_out_summary_engine_context *ctxt)
static bool live_out_paths_from_forloop_to_body(forloop l, live_paths_analysis_context *ctxt)
bool live_paths_engine(const char *module_name, effects_representation_val representation)
static void live_paths_of_module_statement(statement stmt, live_paths_analysis_context *ctxt)
static Psysteme new_system_with_only_live_variable(Psysteme sc, reference ref, list llivein, list lliveout)
Create a new nsc system from the sc system of a region.
static void reset_live_out_summary_engine_context(live_out_summary_engine_context *ctxt)
static void live_in_paths_of_loop(loop l, live_paths_analysis_context *ctxt)
static bool live_out_paths_from_test_to_branches(test t, _UNUSED_ live_paths_analysis_context *ctxt)
static void live_out_paths_from_caller_to_callee(entity caller, entity callee, live_out_summary_engine_context *ctxt)
static bool live_out_paths_from_loop_to_body(loop l, live_paths_analysis_context *ctxt)
static bool live_out_paths_from_whileloop_to_body(whileloop l, live_paths_analysis_context *ctxt)
static void live_in_paths_of_statement(statement s, live_paths_analysis_context *ctxt)
static void live_in_paths_of_whileloop(whileloop l, live_paths_analysis_context *ctxt)
bool live_out_summary_paths_engine(const char *module_name)
static bool filter_live_out_regions_statement(statement st)
For each statement store the new live_out_regions.
static bool live_out_summary_paths_stmt_filter(statement s, __attribute__((unused)) live_out_summary_engine_context *ctxt)
static list convert_in_effects(list lin, live_paths_analysis_context *ctxt)
static void set_live_out_summary_engine_context(live_out_summary_engine_context *ctxt, entity callee)
bool live_in_summary_paths_engine(const char *module_name)
liveness_analysis_engine.c
static bool live_out_paths_from_unstructured_to_nodes(unstructured unstr, live_paths_analysis_context *ctxt)
static void reset_live_paths_context(live_paths_analysis_context *ctxt)
bool live_out_region_engine(const char *module_name, __attribute__((unused)) effects_representation_val representation)
#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
void print_statement(statement)
Print a statement on stderr.
void set_bool_property(const char *, bool)
bool static_area_p(entity aire)
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.
const char * module_local_name(entity e)
Returns the module local user name.
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
void free_statement_global_stack(void)
void make_statement_global_stack(void)
#define forloop_domain
newgen_extensions_domain_defined
#define test_domain
newgen_entity_domain_defined
struct _newgen_struct_callees_ * callees
#define expression_domain
newgen_execution_domain_defined
#define unstructured_domain
newgen_type_domain_defined
#define callees_callees(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define control_predecessors(x)
#define statement_ordering(x)
#define whileloop_evaluation(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define CONTROL(x)
CONTROL.
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define sequence_statements(x)
#define reference_indices(x)
#define control_successors(x)
#define unstructured_exit(x)
#define whileloop_body(x)
#define whileloop_domain
newgen_variable_domain_defined
#define statement_declarations(x)
#define call_arguments(x)
#define control_statement(x)
#define statement_number(x)
#define sequence_domain
newgen_reference_domain_defined
#define evaluation_before_p(x)
#define STATEMENT(x)
STATEMENT.
void sc_base_remove_variable(Psysteme sc, Variable v)
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
char * default_variable_to_string(Variable v)
void sc_print(Psysteme ps, get_variable_name_t nom_var)
void sc_print()
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
effects_representation_val representation
bool memory_in_out_effects_only
@ keep
bj > b1 -> h1/hj = h1
char *(* get_variable_name_t)(Variable)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define BASE_FOREACH(v, b)
Pbase base_copy(Pbase b)
Direct duplication.
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....