PIPS
|
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "effects-util.h"
#include "text-util.h"
#include "pipsdbm.h"
#include "effects-generic.h"
#include "control.h"
#include "transformations.h"
#include "effects-simple.h"
#include "sac.h"
#include "ricedg.h"
Go to the source code of this file.
Functions | |
static bool | successor_conflicts_on_entity_p (successor s, entity e) |
helper thats checks if entity e is involved in a conflict of successor s More... | |
static bool | vertex_in_cycle_aux_p (vertex v, entity e, vertex curr, set visited) |
helper that checks if there is a cycle from curr back to v following chains of e More... | |
static bool | vertex_in_cycle_p (vertex v, entity e) |
check if there is a cycle from @pv to v following chains from e More... | |
static set | graph_to_live_writes (graph g, entity e) |
static void | do_scalar_renaming_in_successors (vertex v, entity e, entity new, set live_writes, hash_table visited, hash_table renamings) |
static void | do_scalar_renaming_in_vertex (vertex v, entity e, set live_writes, hash_table visited, hash_table renamings) |
static void | do_scalar_renaming_in_graph (graph g, entity e) |
static void | do_scalar_renaming (entity module, statement module_statement, graph dg) |
do scalar renaming for graph dg of module module and statements module_statement More... | |
static set | vertex_to_chains (vertex v, entity e, set visited) |
recursievly computes the set of all chains involving e starting from v More... | |
static void | do_prune_arcs (list l, list l2) |
we know l is included in l2, let's remove redundant arcs More... | |
static void | do_simplify_dg (graph g, entity e) |
remove all conflicts that involve entity e and that can be regenerated from another conflict chain More... | |
static void | simplify_dg (entity module, graph dg) |
removes redundant arcs from dg. More... | |
bool | scalar_renaming (char *mod_name) |
rename scalars to remove some false dependencies More... | |
we know l is included in l2, let's remove redundant arcs
arc between prev and v are not needed
Definition at line 222 of file singleass.c.
References CAR, ENDP, FOREACH, gen_remove_once(), POP, set_add_element(), SET_FOREACH, set_free(), set_make(), set_pointer, SUCCESSOR, successor_vertex, VERTEX, vertex_successors, and vertex_undefined.
Referenced by do_simplify_dg().
do scalar renaming for graph dg
of module module
and statements module_statement
only local non static scalar entities non static as a quick fix ...
Definition at line 180 of file singleass.c.
References dg, do_scalar_renaming_in_graph(), ENTITY, entity_declarations, entity_scalar_p(), entity_static_variable_p(), FOREACH, local_entity_of_module_p(), module, module_clean_declarations(), module_statement, and unnormalize_expression().
Referenced by scalar_renaming().
Definition at line 160 of file singleass.c.
References compare_vertex(), declaration_statement_p(), do_scalar_renaming_in_vertex(), FOREACH, gen_chunk_undefined_p, gen_find_eq(), gen_free_list(), graph_to_live_writes(), HASH_DEFAULT_SIZE, HASH_FOREACH, hash_pointer, hash_table_free(), hash_table_make(), set_free(), set_to_sorted_list(), statement_declarations, VERTEX, and vertex_to_statement().
Referenced by do_scalar_renaming().
|
static |
check if sink is read
this successor belongs to the def-use chain
was it already renamed ?
no -> proceeed
yes, but no conflict
yes and a conbflict -> fix it by adding an assign
Definition at line 102 of file singleass.c.
References CONFLICT, conflict_sink, dg_arc_label_conflicts, effect_read_p, entity_to_expression(), FOREACH, hash_get(), hash_put(), hash_put_or_update, HASH_UNDEFINED_VALUE, insert_statement(), make_assign_statement(), replace_entity(), same_entity_p(), set_add_element(), set_belong_p(), set_make(), set_pointer, SUCCESSOR, successor_arc_label, successor_conflicts_on_entity_p(), successor_vertex, vertex_successors, and vertex_to_statement().
Referenced by do_scalar_renaming_in_vertex().
|
static |
create new assigned value
propagate it to each reading successor
Definition at line 148 of file singleass.c.
References AddEntityToCurrentModule(), copy_basic(), copy_value(), do_scalar_renaming_in_successors(), entity_basic(), entity_initial, entity_user_name(), get_current_module_entity(), make_new_scalar_variable_with_prefix(), replace_entity(), and vertex_to_statement().
Referenced by do_scalar_renaming_in_graph().
remove all conflicts that involve entity e and that can be regenerated from another conflict chain
SG: I am not sure it is ok to prune the exploration space like this
arcs now holds all possible arcs of g that impact e let's remove the chains that are not needed, that is those that have an englobing chain
if s is included in s2, arcs in s not is s2 are not needed
prune some arcs
Definition at line 249 of file singleass.c.
References chains(), do_prune_arcs(), FOREACH, get_current_module_statement(), graph_vertices, prettyprint_dot_dependence_graph(), set_assign_list(), SET_FOREACH, set_free(), set_inclusion_p(), set_make(), set_pointer, set_union(), VERTEX, and vertex_to_chains().
Referenced by simplify_dg().
e
leads to a new declaration that is writes without reductions or cycles Definition at line 90 of file singleass.c.
References effects_read_variable_p(), effects_write_variable_p(), FOREACH, graph_vertices, load_proper_rw_effects_list(), set_add_element(), set_make(), set_pointer, VERTEX, vertex_in_cycle_p(), and vertex_to_statement().
Referenced by do_scalar_renaming_in_graph().
bool scalar_renaming | ( | char * | mod_name | ) |
rename scalars to remove some false dependencies
Get the resources
needed for vertex_to_statement
prune graph
Now do the job
Reorder the module, because new statements have been added
update/release resources
mod_name | od_name |
Definition at line 300 of file singleass.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dg, do_scalar_renaming(), get_current_module_entity(), get_current_module_statement(), module_name_to_entity(), module_reorder(), pips_assert, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_rw_effects(), simplify_dg(), and statement_consistent_p().
removes redundant arcs from dg.
An arc from v to v' is redundant if there exist a chain in dg that goes from v to v'
only local entity
Definition at line 288 of file singleass.c.
References dg, do_simplify_dg(), ENTITY, entity_declarations, entity_scalar_p(), FOREACH, get_current_module_entity(), local_entity_of_module_p(), and module.
Referenced by scalar_renaming().
helper thats checks if entity e
is involved in a conflict of successor s
Definition at line 51 of file singleass.c.
References CONFLICT, conflict_sink, conflict_source, dg_arc_label_conflicts, effect_any_entity, FOREACH, same_entity_p(), and successor_arc_label.
Referenced by do_scalar_renaming_in_successors(), vertex_in_cycle_aux_p(), vertex_in_cycle_p(), and vertex_to_chains().
helper that checks if there is a cycle from curr
back to v
following chains of e
Definition at line 61 of file singleass.c.
References FOREACH, set_add_element(), set_belong_p(), SUCCESSOR, successor_conflicts_on_entity_p(), successor_vertex, and vertex_successors.
Referenced by vertex_in_cycle_p().
check if there is a cycle from @pv to v
following chains from e
Definition at line 74 of file singleass.c.
References FOREACH, set_free(), set_make(), set_pointer, SUCCESSOR, successor_conflicts_on_entity_p(), successor_vertex, vertex_in_cycle_aux_p(), and vertex_successors.
Referenced by graph_to_live_writes().
recursievly computes the set of all chains involving e starting from v
Definition at line 193 of file singleass.c.
References CONS, effects_read_variable_p(), effects_write_variable_p(), FOREACH, load_proper_rw_effects_list(), NIL, set_add_element(), set_belong_p(), SET_FOREACH, set_free(), set_make(), set_pointer, statement_ordering, SUCCESSOR, successor_conflicts_on_entity_p(), successor_vertex, VERTEX, vertex_successors, and vertex_to_statement().
Referenced by do_simplify_dg().