PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "pipsdbm.h"
#include "properties.h"
#include "ri.h"
#include "ri-util.h"
#include "effects.h"
#include "effects-simple.h"
Go to the source code of this file.
Data Structures | |
struct | flfl |
Functions | |
static bool | filterout_statement (void *obj) |
static bool | wipeout_entity (entity e) |
entities that match the following conditions are not cleaned from declarations: More... | |
static void | statement_clean_declarations_helper (list declarations, statement stmt) |
remove useless entities from declarations an entity is flagged useless when no reference is found in stmt and when it is not used by an entity found in stmt More... | |
static void | entity_generate_missing_declarations (entity module, statement s) |
check if all entities used in s and module are declared in module does not work as well as expected on c module because it does not fill the statement declaration More... | |
void | statement_clean_declarations (statement s) |
remove all the entity declared in s but never referenced it's a lower version of use-def-elim ! More... | |
void | entity_clean_declarations (entity module, statement s) |
remove all entities declared in module but never used in s More... | |
static bool | find_loop_from_label_walker (loop l, struct flfl *p) |
statement | find_loop_from_label (statement s, entity label) |
hmmm... More... | |
static bool | clean_statement_label (statement st) |
bool | clean_labels (const string mod_name) |
int | get_processor_number (void) |
int | get_vector_register_length (void) |
int | get_vector_register_number (void) |
mod_name | od_name |
Definition at line 238 of file util.c.
References clean_statement_label(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, gen_null(), gen_recurse, module_name_to_entity(), reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), statement_domain, and strdup().
Definition at line 226 of file util.c.
References entity_empty_label(), entity_empty_label_p(), entity_user_name(), gen_clear_tabulated_element(), get_string_property(), and statement_label.
Referenced by clean_labels().
remove all entities declared in module but never used in s
module | module to check |
s | statement where entites may be used |
to keep backward compatibility with hpfc
module | odule |
Definition at line 177 of file util.c.
References entity_declarations, entity_generate_missing_declarations(), entity_undefined, entity_undefined_p, fortran_module_p(), get_current_module_entity(), module, reset_current_module_entity(), same_entity_p(), set_current_module_entity(), and statement_clean_declarations_helper().
Referenced by compile_module(), and module_clean_declarations().
check if all entities used in s and module are declared in module does not work as well as expected on c module because it does not fill the statement declaration
module | module to check |
s | statement where reference can be found |
gather referenced entities
fill the declarations with missing entities (ohhhhh a nice 0(n²) algorithm
Definition at line 140 of file util.c.
References CONS, ENTITY, entity_declarations, gen_chunk_undefined_p, gen_find_eq(), gen_nconc(), get_referenced_entities(), module, NIL, SET_FOREACH, set_free(), and sort_list_of_entities().
Referenced by entity_clean_declarations().
|
static |
Definition at line 48 of file util.c.
References INSTANCE_OF.
Referenced by statement_clean_declarations_helper().
hmmm...
when all header files are not yet generated cproto may silently fail to generate these headers. this few declarations allow to generate headers without anything else. ri needed for statement_mapping in pipsdbm...
label | abel |
Definition at line 218 of file util.c.
References find_loop_from_label_walker(), flfl::found, gen_context_recurse, gen_null2(), flfl::label, loop_domain, and statement_undefined.
Referenced by full_unroll(), get_loop_execution_parallel(), loop_auto_unroll(), loop_expansion(), loop_expansion_init(), loop_pragma(), module_loops(), print_loopnest_dependence_cone(), set_loop_execution_parallel(), simdizer_auto_tile(), symbolic_tiling(), and unroll().
Definition at line 204 of file util.c.
References flfl::found, gen_eq(), gen_get_ancestor(), gen_recurse_stop(), flfl::label, loop_label, statement_domain, and statement_label.
Referenced by find_loop_from_label().
int get_vector_register_length | ( | void | ) |
int get_vector_register_number | ( | void | ) |
void statement_clean_declarations | ( | statement | s | ) |
remove all the entity declared in s but never referenced it's a lower version of use-def-elim !
cproto-generated files
s | statement to check |
Definition at line 164 of file util.c.
References statement_block_p, statement_clean_declarations_helper(), and statement_declarations.
Referenced by module_clean_declarations().
remove useless entities from declarations an entity is flagged useless when no reference is found in stmt and when it is not used by an entity found in stmt
declarations | list of entity to purge |
stmt | statement where entities are used |
look for entity that are used in the statement SG: we need to work on a copy of the declarations because of the RemoveLocalEntityFromDeclarations
filtered referenced entities are always used, some entity types listed in keep_entity cannot be wiped out
entities whose declaration have a side effect are always used too
one should check if dimensions do not have side effects either
do not keep the declaration, and remove it from any declaration_statement
Definition at line 80 of file util.c.
References action_write_p, DIMENSION, dimension_lower, dimension_upper, EFFECT, effect_action, ENTITY, entity_initial, entity_name, entity_type, entity_variable_p, expression_to_proper_effects(), filterout_statement(), FOREACH, gen_copy_seq(), gen_free_list(), gen_full_free_list(), gen_nconc(), get_current_module_entity(), get_referenced_entities_filtered(), ifdebug, NIL, pips_debug, print_effect, RemoveLocalEntityFromDeclarations(), set_belong_p(), set_free(), type_variable, value_expression, value_expression_p, variable_dimensions, and wipeout_entity().
Referenced by entity_clean_declarations(), and statement_clean_declarations().
entities that match the following conditions are not cleaned from declarations:
Definition at line 56 of file util.c.
References entity_area_p(), entity_name, entity_not_constant_or_intrinsic_p(), entity_storage, entity_struct_p(), entity_union_p(), formal_parameter_p(), pips_debug, storage_return_p, and typedef_entity_p().
Referenced by statement_clean_declarations_helper().