25 #include "pips_config.h"
46 #include "resources.h"
117 fprintf(stderr,
"current_task:\n");
119 fprintf(stderr,
"entities to eliminate:\n");
129 pips_assert(
"number of cluster can't be equal to 0", nbr_cluster != 0);
181 for (
int i=0; i<nbr_cluster; i++) {
193 " PIPS can't generate the copy for this variable.\n"
194 " Try to launch pass VARIABLE_REPLICATION.\n", name);
281 pips_debug(5,
"add entity to entity_to_eliminate:\n");
300 if (scurrent_cluster != NULL) {
301 int current_cluster = atoi(scurrent_cluster+1);
352 pips_user_error(
"the cluster asked is out of bounded, on_cluster=%%d", on_cluster);
400 if (on_cluster==-1) {
404 else if (on_cluster < ctx->nbr_cluster) {
409 pips_user_error(
"the cluster asked is out of bounded, on_cluster=%%d", on_cluster);
477 bool good_result_p =
true;
479 debug_on(
"MPI_GENERATION_DEBUG_LEVEL");
525 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.
int get_int_property(const string)
bool statement_consistent_p(statement p)
static statement module_statement
gen_array_t gen_array_make(size_t size)
declarations...
void gen_array_addto(gen_array_t a, size_t i, void *what)
void * gen_array_item(const gen_array_t a, size_t i)
void gen_array_free(gen_array_t a)
struct _newgen_struct_statement_ * statement
static void eov_add_entity_to_eliminate(ctx_eov_t *ctx, entity e)
static int compteur_stack_task
Pass: ELIMINATE_ORIGINAL_VARIABLES Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used:
static void subtsitute_variable_in_reference(reference r, ctx_eov_t *ctx)
if it's needed, variable present in list of variable to eliminate, substitute the variable entity pre...
static ctx_eov_t eov_make_ctx(int nbr_cluster, string prefix_new_entity)
static bool expression_substitute_variable(expression e, ctx_eov_t *ctx)
expression_substitute_variable will substitute variable entity that have to be substitute In fact we ...
static bool prepare_context(statement st, ctx_eov_t *ctx)
The function in this section modify the context to know.
static void release_context(__attribute__((unused)) statement st, ctx_eov_t *ctx)
struct ctx_eov ctx_eov_t
ctx_eov:
static bool make_eliminate_original_variables(__attribute__((unused)) entity module, statement module_statement)
static void print_ctx(const ctx_eov_t ctx)
static task eov_stack_task_pop_task(ctx_eov_t *ctx)
static int eov_get_current_cluster(ctx_eov_t *ctx)
static void eov_set_current_cluster(ctx_eov_t *ctx, int on_cluster)
static entity eov_get_replaced_enity(ctx_eov_t *ctx, entity e, int on_cluster)
call entity_to_eliminate_p before eov_get_replaced_enity check on_cluster <= ctx->nbr_cluster before ...
static void eov_stack_task_push_task(ctx_eov_t *ctx, task t)
static bool eov_entity_to_eliminate_p(ctx_eov_t *ctx, entity e)
static void eov_free_ctx(ctx_eov_t *ctx)
bool eliminate_original_variables(const char *module_name)
PIPS pass.
static bool loop_replace_variable(loop l, ctx_eov_t *ctx)
have to separate loop from reference because index and locals of loop can also be entity variables If...
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
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_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#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)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
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.
call statement_call(statement)
Get the call of a statement.
bool statement_call_p(statement)
bool comments_equal_p(string, string)
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.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define MODULE_SEP_STRING
char * i2a(int)
I2A (Integer TO Ascii) yields a string for a given Integer.
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_FOREACH(key_type, k, value_type, v, ht)
void * gen_find_tabulated(const char *, int)
bool stack_empty_p(const stack)
void * stack_head(const stack)
returns the item on top of stack s
int stack_size(const stack)
observers
void stack_push(void *, stack)
stack use
stack stack_make(int, int, int)
allocation
void * stack_pop(stack)
POPs one item from stack s.
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 print_entity_variable(entity e)
print_entity_variable(e)
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
void print_reference(reference r)
void printf_loop(loop lp)
=======================================================================
void print_statement(statement)
Print a statement on stderr.
text statement_to_text(statement)
static const char * prefix
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define ENTITY_C_RETURN_P(e)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
bool entity_in_list_p(entity ent, list ent_l)
look for ent in ent_l
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
string local_name_to_scope(const char *ln)
allocates a new string
const char * entity_module_name(entity e)
See comments about module_name().
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
#define expression_domain
newgen_execution_domain_defined
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define statement_domain
newgen_sizeofexpression_domain_defined
#define reference_domain
newgen_range_domain_defined
#define statement_declarations(x)
#define statement_comments(x)
#define entity_domain
newgen_syntax_domain_defined
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
The structure used to build lists in NewGen.
hash_table hash_entity_to_eliminate
string task_to_string(task t, bool pretty_print)
void print_task(task t)
Pass: TASK_MAPPING Debug mode: MPI_GENERATION_DEBUG_LEVEL Resource generated:
#define MPI_GENERATION_NBR_CLUSTER
#define COMMENT_VARIABLE_REPLICATION
#define MPI_GENERATION_PREFIX
task load_parallel_task_mapping(statement)
void set_parallel_task_mapping(statement_task)
void reset_parallel_task_mapping(void)
struct _newgen_struct_task_ * task
#define task_on_cluster(x)
#define task_domain
newgen_statement_task_domain_defined
#define task_private_data(x)
string text_to_string(text t)
SG: moved here from ricedg.