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 "effects-convex.h"
#include "control.h"
#include "misc.h"
#include "properties.h"
#include "conversion.h"
#include "task_parallelization.h"
#include "prettyprint.h"
#include "workspace-util.h"
Go to the source code of this file.
Functions | |
static string | copy_variable_declaration_commenter (__attribute__((unused)) entity e) |
Pass: COPY_VALUE_OF_WRITE Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used: More... | |
static void | statement_convert_to_statement_with_sequence_of_intruction (statement s, bool extensions_on_sequence) |
Maybe these function can be move in statement.c? More... | |
static bool | statement_with_side_effect_p (statement s) |
statement_with_side_effect_p Check if the statement make side effect in a variable a side effect for a statement is defined by doing a read and a write on the same variable for the statement More... | |
static entity | region_entity_variable_to_new_declare_entity (entity ent, int taskid) |
translate an entity region in a variable entity if it's need if ent is an entity region return a variable entity else ent is already a variable entity so just return ent More... | |
static void | translate_reference_region (reference ref, int *taskid) |
call with gen_recurse modify by side effect the variable of the reference to be sure to be a variable entity and not a region entity in some cases More... | |
static statement | make_statement_copy_i (reference ref, int i, int taskid) |
make_statement_copy_i generate a copy_statement with ref, generate a statement: ref_i = ref; More... | |
static void | copy_n_statement (list lweffects, int nbr, statement st) |
copy_n_statement generate and add nbr statements of copy with reference ref, we have the variable that has a write effect and make some copy for the variables on the other proc example: lhs = rhs; ----—> lhs_0 = rhs; lhs_1 = rhs; ... More... | |
static void | copy_n_reference (reference ref, int nbr, statement st) |
copy_n_reference generate and add nbr statements of copy with reference ref, we have the variable that has a write effect and make some copy for the variables on the other proc example: lhs = rhs; ----—> lhs = rhs; lhs_0 = lhs; lhs_1 = lhs; ... More... | |
static void | copy_write_statement (statement s) |
copy_write_statement for the statement s, check if there is/are write effect foreach write effect make a copy statement for the variable written on there equivalent for each cluster. More... | |
bool | copy_value_of_write (const char *module_name) |
PIPS pass. More... | |
static void | copy_write_statement_with_cumulated_regions (statement module_statement) |
copy_write_statement_with_cumulated_regions foreach first level statement in module_statement generate copies for variables present in out-region if it's an array region, generate variable for indices More... | |
bool | copy_value_of_write_with_cumulated_regions (const char *module_name) |
PIPS pass. More... | |
copy_n_reference generate and add nbr statements of copy with reference ref, we have the variable that has a write effect and make some copy for the variables on the other proc example: lhs = rhs; ----—> lhs = rhs; lhs_0 = lhs; lhs_1 = lhs; ...
ref | reference of the variable written |
nbr | number of copy wanted (number of proc asked) |
st | statement after which we make the copy/ statement which has a write effect |
TODO tester si side effect dans les subscripte si oui renvoyer erreur faire pass pour extraire side-effect des subscript si possible existe déjà ?
Definition at line 432 of file copy_value_of_write.c.
References CAR, EXPRESSION, expression_to_string(), expression_with_side_effect_p(), FOREACH, ifdebug, indices, insert_statement(), instruction_sequence, instruction_sequence_p, load_parallel_task_mapping(), make_statement_copy_i(), NIL, pips_assert, pips_debug, pips_user_warning, print_statement(), ref, reference_indices, sequence_statements, STATEMENT, statement_consistent_p(), statement_convert_to_statement_with_sequence_of_intruction(), statement_instruction, statement_undefined, store_or_update_parallel_task_mapping(), and task_id.
Referenced by copy_write_statement(), and copy_write_statement_with_cumulated_regions().
copy_n_statement generate and add nbr statements of copy with reference ref, we have the variable that has a write effect and make some copy for the variables on the other proc example: lhs = rhs; ----—> lhs_0 = rhs; lhs_1 = rhs; ...
nbr | number of copy wanted (number of proc asked) |
st | statement after which we make the copy/ statement which has a write effect |
Definition at line 336 of file copy_value_of_write.c.
References CAR, CONS, copy_statement(), EFFECT, effect_any_reference, effects_package_entity_p(), empty_extensions(), ENDP, entity_empty_label(), ENTITY_STDERR_P, ENTITY_STDIN_P, ENTITY_STDOUT_P, FOREACH, ifdebug, insert_statement(), instruction_sequence, instruction_sequence_p, instruction_undefined, load_parallel_task_mapping(), make_instruction_sequence(), make_sequence(), make_statement_copy_i(), make_task(), NIL, pips_assert, pips_debug, pips_internal_error, pips_user_warning, print_statement(), reference_variable, sequence_statements, STATEMENT, statement_comments, statement_consistent_p(), statement_convert_to_statement_with_sequence_of_intruction(), statement_declarations, statement_decls_text, statement_extensions, statement_identification(), statement_instruction, statement_label, statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, STATEMENT_ORDERING_UNDEFINED, statement_undefined, statement_with_side_effect_p(), store_or_update_parallel_task_mapping(), string_undefined, task_id, task_private_data, and task_synchronization.
Referenced by copy_write_statement(), and copy_write_statement_with_cumulated_regions().
bool copy_value_of_write | ( | const char * | module_name | ) |
PIPS pass.
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 542 of file copy_value_of_write.c.
References copy_write_statement(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_recurse, gen_true(), get_current_module_statement(), get_parallel_task_mapping(), module_name(), module_name_to_entity(), module_reorder(), module_statement, pips_assert, pips_debug, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_parallel_task_mapping(), reset_proper_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_parallel_task_mapping(), set_proper_rw_effects(), statement_consistent_p(), statement_domain, strdup(), and unspaghettify_statement().
bool copy_value_of_write_with_cumulated_regions | ( | const char * | module_name | ) |
PIPS pass.
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 806 of file copy_value_of_write.c.
References copy_write_statement_with_cumulated_regions(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, get_current_module_statement(), module_name(), module_name_to_entity(), module_reorder(), module_statement, pips_assert, pips_debug, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_live_out_regions(), reset_ordering_to_statement(), reset_parallel_task_mapping(), reset_proper_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_live_out_regions(), set_ordering_to_statement(), set_parallel_task_mapping(), set_proper_rw_effects(), statement_consistent_p(), strdup(), and unspaghettify_statement().
|
static |
Pass: COPY_VALUE_OF_WRITE Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used:
Pass: COPY_VALUE_OF_WRITE_WITH_CUMULATED_REGIONS Debug mode: MPI_GENERATION_DEBUG_LEVEL Properties used:
Definition at line 84 of file copy_value_of_write.c.
References COMMENT_COPY_VARIABLE, and strdup().
Referenced by copy_write_statement_with_cumulated_regions().
|
static |
copy_write_statement for the statement s, check if there is/are write effect foreach write effect make a copy statement for the variable written on there equivalent for each cluster.
s | statement to check if it's need to make copy |
Definition at line 495 of file copy_value_of_write.c.
References copy_n_reference(), copy_n_statement(), declaration_statement_p(), EFFECT, effect_any_reference, effects_package_entity_p(), effects_write_effects(), ENDP, entity_in_list_p(), ENTITY_STDERR_P, ENTITY_STDIN_P, ENTITY_STDOUT_P, FOREACH, get_int_property(), load_parallel_task_mapping(), load_proper_rw_effects_list(), MPI_GENERATION_NBR_CLUSTER, NIL, pips_debug, reference_variable, task_on_cluster, and task_private_data.
Referenced by copy_value_of_write().
|
static |
copy_write_statement_with_cumulated_regions foreach first level statement in module_statement generate copies for variables present in out-region if it's an array region, generate variable for indices
module_statement | a module statement to work on modification of module_statement by side effect |
test if the entity went is not in the private list of the task, don't want rand, malloc, printf, scanf... if so no copy
Definition at line 625 of file copy_value_of_write.c.
References add_declaration_statement(), AddLocalEntityToDeclarationsOnly(), algorithm_row_echelon(), base_add_variable(), BASE_FOREACH, base_to_list(), CONS, copy_n_reference(), copy_n_statement(), copy_variable_declaration_commenter(), descriptor_convex, descriptor_convex_p, descriptor_convexunion_p, descriptor_none_p, descriptor_tag, DIVIDE_OPERATOR_NAME, EFFECT, effect_any_reference, effect_descriptor, effects_package_entity_p(), effects_write_effects(), ENDP, ENTITY, entity_in_list_p(), entity_intrinsic(), ENTITY_STDERR_P, ENTITY_STDIN_P, ENTITY_STDOUT_P, EXPRESSION, expression_to_entity(), FOREACH, get_current_module_entity(), get_int_property(), ifdebug, indices, insert_comments_to_statement(), insert_statement(), load_live_out_regions_list(), load_parallel_task_mapping(), make_empty_block_statement(), module_statement, MPI_GENERATION_NBR_CLUSTER, NIL, pips_debug, pips_internal_error, pips_region_user_name(), pop_generated_variable_commenter(), print_entity_variable(), print_region_sc(), print_statement(), push_generated_variable_commenter(), reference_indices, reference_variable, region_entity_variable_to_new_declare_entity(), sc_dup(), sc_print(), sc_variable_rename(), sequence_statements, STATEMENT, statement_convert_to_statement_with_sequence_of_intruction(), statement_declarations, statement_sequence(), statement_sequence_p(), statement_to_direct_declarations(), store_or_update_parallel_task_mapping(), systeme_to_loop_nest(), task_id, task_on_cluster, task_private_data, and task_undefined.
Referenced by copy_value_of_write_with_cumulated_regions().
make_statement_copy_i generate a copy_statement with ref, generate a statement: ref_i = ref;
ref | reference lhs/rhs |
i | cluster number for the lhs of the statement generate |
Definition at line 274 of file copy_value_of_write.c.
References concatenate(), copy_reference(), entity_domain, entity_local_name(), entity_module_name(), entity_undefined, entity_user_name(), gen_context_recurse, gen_find_tabulated(), gen_full_copy_list(), gen_true2(), get_string_property(), i2a(), ifdebug, local_name_to_scope(), make_assign_statement(), make_nop_statement, make_reference(), MODULE_SEP_STRING, MPI_GENERATION_PREFIX, pips_assert, pips_debug, pips_internal_error, pips_user_warning, prefix, print_statement(), ref, reference_domain, reference_indices, reference_to_expression(), reference_undefined, reference_variable, statement_comments, statement_consistent_p(), statement_undefined, strdup(), and translate_reference_region().
Referenced by copy_n_reference(), and copy_n_statement().
translate an entity region in a variable entity if it's need if ent is an entity region return a variable entity else ent is already a variable entity so just return ent
ent | possible entity region |
Definition at line 227 of file copy_value_of_write.c.
References BLOCK_SEP_STRING, concatenate(), entity_local_name(), find_or_create_scalar_entity(), free(), get_current_module_name(), get_string_property(), i2a(), is_basic_int, MPI_GENERATION_PREFIX, prefix, strdup(), variable_beta_p, variable_phi_p, variable_psi_p, and variable_rho_p.
Referenced by copy_write_statement_with_cumulated_regions(), and translate_reference_region().
|
static |
Maybe these function can be move in statement.c?
statement_convert_to_statement_with_sequence_of_intruction transform a statement s to a statement of sequence Maybe can be move to statement.C but need to add some tests in that case inspired by generic_insert_statement
s | statement to convert into a sequence modify s by side effect |
extensions_on_sequence | determine where the extension have to be place if true, the extension is for the sequence statement if false, the extension is for the statement inside the sequence |
Definition at line 105 of file copy_value_of_write.c.
References CONS, empty_extensions(), entity_empty_label(), ifdebug, instruction_undefined, make_instruction_sequence(), make_sequence(), make_statement(), make_synchronization_none(), NIL, pips_assert, pips_debug, print_statement(), STATEMENT, statement_comments, statement_consistent_p(), statement_declarations, statement_decls_text, statement_extensions, statement_instruction, statement_label, statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, STATEMENT_ORDERING_UNDEFINED, and string_undefined.
Referenced by copy_n_reference(), copy_n_statement(), and copy_write_statement_with_cumulated_regions().
statement_with_side_effect_p Check if the statement make side effect in a variable a side effect for a statement is defined by doing a read and a write on the same variable for the statement
Maybe can be move to statement.c
s | statement to check the presence of modification by side effect |
Definition at line 180 of file copy_value_of_write.c.
References cells_may_conflict_p(), EFFECT, effect_cell, effects_read_effects(), effects_write_effects(), FOREACH, and load_cumulated_rw_effects_list().
Referenced by copy_n_statement().
call with gen_recurse modify by side effect the variable of the reference to be sure to be a variable entity and not a region entity in some cases
ref | reference to treat |
Definition at line 260 of file copy_value_of_write.c.
References ref, reference_variable, and region_entity_variable_to_new_declare_entity().
Referenced by make_statement_copy_i().