PIPS
|
Go to the source code of this file.
Functions | |
static vertex | get_vertex_of_statement (graph dg, statement stmt) |
– defs_elim.c More... | |
bool | true_dependence_with_entity_p (conflict conf, entity e) |
=========================================================================== More... | |
static bool | entity_dynamic_p (entity e) |
=========================================================================== More... | |
bool | defs_elim_of_assign_call (statement assign_stmt, graph dg) |
=========================================================================== More... | |
bool | defs_elim_of_statement (statement s, graph dg) |
=========================================================================== More... | |
void | defs_elim_of_unstructured (unstructured u, graph dg) |
=========================================================================== More... | |
===========================================================================
bool defs_elim_of_assign_call(statement assign_stmt, graph dg): returns true if "assign_stmt" is to be eliminated. It is eliminated if the lhs of this assignment verifies two conditions :
Definitions upon non local (non dynamic) variables are always kept.
Gets the vertex of the dependence graph that gives all the edges of which the assign statement is the source.
We scan all the dependences of the assign statement. If at least one true dependence is found, the statement is not removed.
assign_stmt | ssign_stmt |
dg | g |
Definition at line 136 of file defs_elim.c.
References bool_to_string(), call_arguments, call_function, CAR, CDR, CONFLICT, debug(), dg, dg_arc_label_conflicts, ENTITY_ASSIGN_P, entity_dynamic_p(), EXPRESSION, expression_syntax, get_vertex_of_statement(), instruction_call, instruction_tag, is_instruction_call, is_syntax_reference, NIL, pips_debug, pips_internal_error, reference_variable, statement_instruction, SUCCESSOR, successor_arc_label, syntax_reference, syntax_tag, true_dependence_with_entity_p(), user_warning, vertex_successors, vertex_undefined, Words_Call(), and words_to_string().
Referenced by defs_elim_of_statement().
===========================================================================
bool defs_elim_of_statement(statement s, graph dg): returns true if "s" is to be eliminated. As we eliminate assign statements, only statement with call to the assign function may be eliminated.
Called_functions : _ make_empty_statement() : ri-util/statement.c
We scan all the statements of the block, and we build in the same time a new block where the statements to delete do not appear.
dg | g |
Definition at line 211 of file defs_elim.c.
References call_function, CAR, CDR, CONS, debug(), defs_elim_of_assign_call(), defs_elim_of_statement(), defs_elim_of_unstructured(), dg, ENTITY_ASSIGN_P, entity_local_name(), gen_nconc(), instruction_block, instruction_call, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, loop_body, make_empty_statement, NIL, pips_internal_error, STATEMENT, statement_instruction, test_false, and test_true.
Referenced by atomizer(), defs_elim_of_statement(), and defs_elim_of_unstructured().
void defs_elim_of_unstructured | ( | unstructured | u, |
graph | dg | ||
) |
===========================================================================
void defs_elim_of_unstructured(unstructured, graph dg): computes the elimination of all the definitions with no def-use dependence of an unstructured instruction.
If the statement of the control of a node of the control graph has to be eliminated, it is replaced by an empty block of statement.
Called_functions : _ make_empty_statement() : ri-util/statement.c
dg | g |
Definition at line 291 of file defs_elim.c.
References CONTROL_MAP, control_statement, debug(), defs_elim_of_statement(), dg, gen_free_list(), make_empty_statement, NIL, and unstructured_control.
Referenced by defs_elim_of_statement().
===========================================================================
static bool entity_dynamic_p(entity e): returns true if "e" is a local variable, ie an entity with a storage DYNAMIC.
Called_functions : _ dynamic_area_p() : ri-util/util.c
Definition at line 114 of file defs_elim.c.
References dynamic_area_p(), entity_storage, is_storage_ram, ram_section, storage_ram, and storage_tag.
Referenced by defs_elim_of_assign_call().
Those functions remove the definition instructions with no def-use dependence. =========================================================================== static vertex get_vertex_of_statement(graph dg, statement stmt): returns the vertex of "dg" corresponding to "stmt".
We scan all the "dg" until we find the "vertex" with the same "ordering" as "stmt".
Definition at line 49 of file defs_elim.c.
References CAR, CDR, dg, graph_vertices, NIL, statement_ordering, VERTEX, vertex_ordering(), and vertex_undefined.
Referenced by defs_elim_of_assign_call().
===========================================================================
bool true_dependence_with_entity_p(conflict conf, entity e): returns TRUE if the conflict "conf" is a true dependence upon the entity "e".
A true dependence is a conflict with a Write at the "source" and a Read at the "sink".
called functions : _ effect_entity() : ri-util/util.c _ same_entity_p() : ri-util/util.c
conf | onf |
Definition at line 82 of file defs_elim.c.
References action_tag, conflict_sink, conflict_source, effect_action, effect_entity(), effect_to_string(), is_action_read, is_action_write, pips_debug, pips_internal_error, and same_entity_p().
Referenced by defs_elim_of_assign_call().