25 #include "pips_config.h"
33 #include "resources.h"
62 if(v==curr)
return true;
200 if(read_p||write_p) {
223 bool same_chain_p =
false;
233 else if(same_chain_p) {
278 FILE * fd = fopen(
"/tmp/a.dot",
"w");
314 debug_on(
"SCALAR_RENAMING_DEBUG_LEVEL");
322 pips_assert(
"Statement is consistent after SCALAR_RENAMING",
basic copy_basic(basic p)
BASIC.
bool statement_consistent_p(statement p)
value copy_value(value p)
VALUE.
struct _newgen_struct_entity_ * entity
static statement module_statement
static bool chains(char *module_name, enum chain_type use)
Compute chain dependence for a module according different kinds of store-like effects.
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
struct _newgen_struct_statement_ * statement
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define conflict_source(x)
list load_proper_rw_effects_list(statement)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
#define effect_any_entity(e)
some useful SHORTHANDS for EFFECT:
bool effects_read_variable_p(list, entity)
bool effects_write_variable_p(list, entity)
#define gen_chunk_undefined_p(c)
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
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 replace_entity(void *s, entity old, entity new)
per variable version of replace_entities.
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
void gen_remove_once(list *pl, const void *o)
Remove the first occurence of o in list pl:
#define NIL
The empty list (nil in Lisp)
#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.
void * gen_find_eq(const void *item, const list seq)
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.
statement make_assign_statement(expression, expression)
void insert_statement(statement, statement, bool)
This is the normal entry point.
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_put_or_update(h, k, v)
#define HASH_FOREACH(key_type, k, value_type, v, ht)
#define HASH_DEFAULT_SIZE
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
list set_to_sorted_list(const set, gen_cmp_func_t)
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_inclusion_p(const set, const set)
return whether s1 \included s2
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
void unnormalize_expression(void *st)
void unnormalize_expression(expression exp): puts all the normalized field of expressions in "st" to ...
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define entity_declarations(e)
MISC: newgen shorthands.
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool local_entity_of_module_p(entity e, entity module)
This test shows that "e" has been declared in "module".
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
bool entity_static_variable_p(entity)
return true if the entity is declared with the keyword static
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
entity make_new_scalar_variable_with_prefix(const char *, entity, basic)
Create a new scalar variable of type b in the given module.
#define statement_ordering(x)
#define statement_declarations(x)
#define entity_initial(x)
int compare_vertex(const void *, const void *)
compare two vertices based on their ordering
void prettyprint_dot_dependence_graph(FILE *, statement, graph)
Output dependence graph in a file in graphviz dot format.
static void do_prune_arcs(list l, list l2)
we know l is included in l2, let's remove redundant arcs
static set vertex_to_chains(vertex v, entity e, set visited)
recursievly computes the set of all chains involving e starting from v
static void do_scalar_renaming_in_graph(graph g, entity e)
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
static void simplify_dg(entity module, graph dg)
removes redundant arcs from dg.
bool scalar_renaming(char *mod_name)
rename scalars to remove some false dependencies
static bool vertex_in_cycle_p(vertex v, entity e)
check if there is a cycle from @pv to v following chains from e
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
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
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
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)
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.