PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "resources.h"
#include "database.h"
#include "ri.h"
#include "ri-util.h"
#include "effects.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "control.h"
#include "misc.h"
#include "properties.h"
#include "text-util.h"
#include "task_parallelization.h"
#include "prettyprint.h"
Go to the source code of this file.
Data Structures | |
struct | ctx_eov |
ctx_eov: More... | |
Typedefs | |
typedef struct ctx_eov | ctx_eov_t |
ctx_eov: More... | |
Functions | |
static void | print_ctx (const ctx_eov_t ctx) |
static ctx_eov_t | eov_make_ctx (int nbr_cluster, string prefix_new_entity) |
static void | eov_free_ctx (ctx_eov_t *ctx) |
static void | eov_stack_task_push_task (ctx_eov_t *ctx, task t) |
static task | eov_stack_task_pop_task (ctx_eov_t *ctx) |
static void | eov_add_entity_to_eliminate (ctx_eov_t *ctx, entity e) |
static bool | eov_entity_to_eliminate_p (ctx_eov_t *ctx, entity e) |
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 eov_get_replaced_enity More... | |
static void | eov_set_current_cluster (ctx_eov_t *ctx, int on_cluster) |
static int | eov_get_current_cluster (ctx_eov_t *ctx) |
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 present in reference r by the corresponding one on the corresponding cluster. More... | |
static bool | prepare_context (statement st, ctx_eov_t *ctx) |
The function in this section modify the context to know. More... | |
static void | release_context (__attribute__((unused)) statement st, ctx_eov_t *ctx) |
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 it's needed, variable present in list of variable to eliminate, substitute the variable entity present in loop l by the corresponding one on the corresponding cluster. More... | |
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 can not recurse with this domain but directly recurse with reference_domain It was done like this because at the beginning, it was expected to use substitute_entity_in_expression But a custom substitution is more efficient. More... | |
static bool | make_eliminate_original_variables (__attribute__((unused)) entity module, statement module_statement) |
bool | eliminate_original_variables (const char *module_name) |
PIPS pass. More... | |
Variables | |
static int | compteur_stack_task = 0 |
Pass: ELIMINATE_ORIGINAL_VARIABLES Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used: More... | |
bool eliminate_original_variables | ( | const char * | module_name | ) |
PIPS pass.
eliminate_original_variables.c
Reorder the module, because some statements have been added. Well, the order on the remaining statements should be the same, but by reordering the statements, the number are consecutive. Just for pretty print... :-)
module_name | odule_name |
Definition at line 474 of file eliminate_original_variables.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, get_current_module_entity(), get_current_module_statement(), make_eliminate_original_variables(), module, module_name(), module_name_to_entity(), module_reorder(), module_statement, pips_assert, pips_debug, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_parallel_task_mapping(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_parallel_task_mapping(), statement_consistent_p(), and strdup().
Definition at line 172 of file eliminate_original_variables.c.
References array, concatenate(), entity_domain, entity_local_name(), entity_module_name(), entity_undefined, entity_user_name(), gen_array_addto(), gen_array_make(), gen_find_tabulated(), ctx_eov::hash_entity_to_eliminate, hash_put(), i2a(), local_name_to_scope(), MODULE_SEP_STRING, ctx_eov::nbr_cluster, pips_internal_error, prefix, and ctx_eov::prefix_new_entity.
Referenced by prepare_context().
Definition at line 202 of file eliminate_original_variables.c.
References hash_defined_p(), and ctx_eov::hash_entity_to_eliminate.
Referenced by loop_replace_variable(), and subtsitute_variable_in_reference().
|
static |
Definition at line 139 of file eliminate_original_variables.c.
References gen_array_free(), ctx_eov::hash_entity_to_eliminate, HASH_FOREACH, hash_table_free(), pips_assert, stack_size(), and ctx_eov::stack_task.
Referenced by make_eliminate_original_variables().
Definition at line 223 of file eliminate_original_variables.c.
References ctx_eov::current_cluster.
Referenced by loop_replace_variable(), and subtsitute_variable_in_reference().
call entity_to_eliminate_p before eov_get_replaced_enity check on_cluster <= ctx->nbr_cluster before eov_get_replaced_enity
Definition at line 209 of file eliminate_original_variables.c.
References array, gen_array_item(), ctx_eov::hash_entity_to_eliminate, and hash_get().
Referenced by loop_replace_variable(), and subtsitute_variable_in_reference().
Definition at line 128 of file eliminate_original_variables.c.
References ctx_eov::current_cluster, ctx_eov::current_task, ctx_eov::hash_entity_to_eliminate, hash_pointer, hash_table_make(), ctx_eov::nbr_cluster, pips_assert, ctx_eov::prefix_new_entity, stack_make(), ctx_eov::stack_task, task_domain, and task_undefined.
Referenced by make_eliminate_original_variables().
Definition at line 220 of file eliminate_original_variables.c.
References ctx_eov::current_cluster.
Referenced by prepare_context().
Definition at line 154 of file eliminate_original_variables.c.
References compteur_stack_task, ctx_eov::current_cluster, ctx_eov::current_task, stack_empty_p(), stack_head(), stack_pop(), ctx_eov::stack_task, task_on_cluster, and task_undefined.
Referenced by release_context().
Definition at line 148 of file eliminate_original_variables.c.
References compteur_stack_task, ctx_eov::current_cluster, ctx_eov::current_task, stack_push(), ctx_eov::stack_task, and task_on_cluster.
Referenced by prepare_context().
|
static |
expression_substitute_variable will substitute variable entity that have to be substitute In fact we can not recurse with this domain but directly recurse with reference_domain It was done like this because at the beginning, it was expected to use substitute_entity_in_expression But a custom substitution is more efficient.
Definition at line 423 of file eliminate_original_variables.c.
References gen_context_recurse, gen_true2(), ifdebug, pips_debug, print_ctx(), print_expression(), reference_domain, and subtsitute_variable_in_reference().
Referenced by make_eliminate_original_variables().
have to separate loop from reference because index and locals of loop can also be entity variables If it's needed, variable present in list of variable to eliminate, substitute the variable entity present in loop l by the corresponding one on the corresponding cluster.
l | loop on which the variable will be substituted |
ctx | context that content the cluster in which the reference will be executed list on var to eliminate correspondence between variable and new_variable |
Definition at line 340 of file eliminate_original_variables.c.
References CONS, ENTITY, eov_entity_to_eliminate_p(), eov_get_current_cluster(), eov_get_replaced_enity(), FOREACH, gen_nconc(), ifdebug, loop_index, loop_locals, ctx_eov::nbr_cluster, NIL, pips_debug, pips_user_error, print_ctx(), and printf_loop().
Referenced by make_eliminate_original_variables().
|
static |
Definition at line 442 of file eliminate_original_variables.c.
References eov_free_ctx(), eov_make_ctx(), expression_domain, expression_substitute_variable(), gen_context_multi_recurse(), gen_null(), get_int_property(), get_string_property(), ifdebug, loop_domain, loop_replace_variable(), module_statement, MPI_GENERATION_NBR_CLUSTER, MPI_GENERATION_PREFIX, pips_debug, prefix, prepare_context(), print_ctx(), release_context(), and statement_domain.
Referenced by eliminate_original_variables().
The function in this section modify the context to know.
st | current statement |
ctx | context to uppdate |
Definition at line 250 of file eliminate_original_variables.c.
References call_function, COMMENT_VARIABLE_REPLICATION, comments_equal_p(), declaration_statement_p(), ENTITY, ENTITY_C_RETURN_P, entity_in_list_p(), entity_type, entity_user_name(), eov_add_entity_to_eliminate(), eov_set_current_cluster(), eov_stack_task_push_task(), FOREACH, gen_context_recurse, gen_true2(), ifdebug, load_parallel_task_mapping(), pips_debug, ctx_eov::prefix_new_entity, print_ctx(), print_entity_variable(), print_statement(), reference_domain, statement_call(), statement_call_p(), statement_comments, statement_declarations, subtsitute_variable_in_reference(), task_private_data, task_to_string(), type_variable, and variable_entity_dimension().
Referenced by make_eliminate_original_variables().
|
static |
Definition at line 116 of file eliminate_original_variables.c.
References ctx_eov::current_cluster, ctx_eov::current_task, fprintf(), ctx_eov::hash_entity_to_eliminate, HASH_FOREACH, ctx_eov::nbr_cluster, print_entity_variable(), and print_task().
Referenced by expression_substitute_variable(), loop_replace_variable(), make_eliminate_original_variables(), prepare_context(), release_context(), and subtsitute_variable_in_reference().
|
static |
Definition at line 317 of file eliminate_original_variables.c.
References eov_stack_task_pop_task(), ifdebug, pips_debug, and print_ctx().
Referenced by make_eliminate_original_variables().
if it's needed, variable present in list of variable to eliminate, substitute the variable entity present in reference r by the corresponding one on the corresponding cluster.
r | reference on which the variable will be substituted |
ctx | context that content the cluster in which the reference will be executed list on var to eliminate correspondence between variable and new_variable |
Definition at line 385 of file eliminate_original_variables.c.
References eov_entity_to_eliminate_p(), eov_get_current_cluster(), eov_get_replaced_enity(), gen_get_ancestor(), ifdebug, pips_debug, pips_user_error, print_ctx(), print_reference(), reference_variable, statement_domain, statement_to_text(), and text_to_string().
Referenced by expression_substitute_variable(), and prepare_context().
|
static |
Pass: ELIMINATE_ORIGINAL_VARIABLES Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used:
Definition at line 66 of file eliminate_original_variables.c.
Referenced by eov_stack_task_pop_task(), and eov_stack_task_push_task().