PIPS
|
#include <stdio.h>
#include <ctype.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "text-util.h"
#include "properties.h"
#include "prettyprint.h"
#include "dg.h"
#include "graph.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "polyedre.h"
#include "semantics.h"
#include "control.h"
#include "callgraph.h"
#include "phrase_tools.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
#include "transformer.h"
#include "phrase_distribution.h"
Go to the source code of this file.
Typedefs | |
typedef dg_arc_label | arc_label |
typedef dg_vertex_label | vertex_label |
Functions | |
entity | create_parameter_for_new_module (variable var, const char *parameter_name, const char *module_name, entity module, int param_nb) |
Create new variable parameter for a newly created module. More... | |
entity | create_integer_parameter_for_new_module (const char *parameter_name, const char *module_name, entity module, int param_nb) |
Create new integer variable parameter for a newly created module. More... | |
void | store_new_module (const char *module_name, entity module, statement module_statement) |
Store (PIPDBM) newly created module module with module_statement as USER_FILE by saving pretty printing. More... | |
entity | create_new_common_variable (string name, entity module, entity common, variable var) |
Creates and declares a new variable for a newly created common. More... | |
entity | create_new_scalar_common_variable (string name, entity module, entity common, basic b) |
Creates and declares a new scalar variable for a newly created common. More... | |
entity | create_new_integer_scalar_common_variable (string name, entity module, entity common) |
Creates and declares a new integer scalar variable for a newly created common. More... | |
void | declare_common_variables_in_module (entity common, entity module) |
Creates all the things that need to be created in order to declare common in module (all the variable are created) More... | |
string | get_controlized_statement_comment (entity function) |
string | get_in_param_id_name (entity variable, entity function) |
string | get_out_param_id_name (entity variable, entity function) |
string | get_function_id_name (entity function) |
static string | get_function_common_name (entity function) |
string | get_common_param_name (entity variable, entity function) |
static string | get_unit_id_name (int unit) |
string | get_send_parameter_module_name (variable var) |
string | get_receive_parameter_module_name (variable var) |
entity | entity_in_module (const char *name, entity module) |
Return entity named name in specified module. More... | |
static statement | make_global_common_and_initialize (entity main_module, statement module_stat, entity *global_common, int number_of_deployment_units, hash_table ht_calls, hash_table ht_in_regions, hash_table ht_out_regions) |
Build and return CONTROL_DATA global common used to store global information on phrase distribution controlization and initialization of values contained in CONTROL_DATA common. More... | |
static entity | create_externalized_function_common (entity main_module, entity externalized_function, list params_regions, int number_of_deployment_units) |
Creates and returns a common used to store variable for communications between control code and externalized code. More... | |
static statement | controlize_distribution (statement module_stat, entity module) |
Main function for PHRASE_DISTRIBUTION_CONTROL_CODE. More... | |
bool | phrase_distributor_control_code (const char *module_name) |
Variables | |
static entity | dynamic_area = entity_undefined |
typedef dg_arc_label arc_label |
Definition at line 48 of file phrase_distributor_control_code.c.
typedef dg_vertex_label vertex_label |
Definition at line 49 of file phrase_distributor_control_code.c.
Main function for PHRASE_DISTRIBUTION_CONTROL_CODE.
We identify all the statements containing an externalized-call tag
Compute the context of distribution, before to controlize
OK, be begin deployement...
Get the loop label form the user
Declare global common for controlization and make initializations
Let's begin to iterate on all externalized functions, in order to build commons and controlization modules
Get the function name
Creates a common used to store variable for communications between control code and externalized code
And register it to the list of commons
Build START_RU module
Build WAIT_RU module
Let's begin to iterate on all externalized functions and statements, in order to add controlization code
Get the function name
Retrieve variables func_id_variable and unit_id_variable
Iterate on all the statements where externalized function is called
Some debug
SEND PARAMS calls
Add dynamic variables
list of entities: phi1, phi2,...
list of dynamic variables....
START_RU_CALL
WAIT_RU_CALL
RECEIVE PARAMS calls
Add dynamic variables
list of entities: phi1, phi2,...
list of dynamic variables....
Now, just inverse list of statements
And replace CALL instruction by SEQUENCE instruction
Definition at line 615 of file phrase_distributor_control_code.c.
References asprintf, compute_distribution_controlization_context(), compute_region_variables(), CONS, create_externalized_function_common(), db_get_memory_resource(), empty_comments, empty_extensions(), ENTITY, entity_empty_label(), entity_in_module(), entity_local_name(), entity_to_expression(), EXPRESSION, EXTERNALIZED_CODE_PRAGMA_CALL, f(), free(), gen_length(), gen_nreverse(), get_controlized_statement_comment(), get_function_id_name(), get_in_param_id_name(), get_out_param_id_name(), get_receive_param_module_name(), get_send_param_module_name(), get_statements_with_comments_containing(), get_unit_id_name(), hash_get(), HASH_MAP, hash_pointer, hash_table_entry_count(), hash_table_free(), hash_table_make(), ifdebug, is_instruction_call, is_instruction_sequence, l_commons, make_call(), make_global_common_and_initialize(), make_instruction(), make_receive_array_params_modules(), make_receive_scalar_params_modules(), make_send_array_params_modules(), make_send_scalar_params_modules(), make_sequence(), make_start_ru_module(), make_statement(), make_synchronization_none(), make_wait_ru_module(), MAP, module, module_name_to_entity(), NIL, pips_debug, print_statement(), REGION, region_entity, region_scalar_p, register_scalar_communications(), STATEMENT, statement_comments, statement_instruction, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, and user_request().
Referenced by phrase_distributor_control_code().
|
static |
Creates and returns a common used to store variable for communications between control code and externalized code.
Creates params variables
If many deployment units, add dimension to handle those different units
Definition at line 578 of file phrase_distributor_control_code.c.
References CONS, copy_variable(), create_new_common_variable(), DIMENSION, entity_type, gen_nconc(), get_common_param_name(), get_function_common_name(), int_to_expression(), make_dimension(), make_new_common(), MAP, NIL, REGION, region_entity, type_variable, and variable_dimensions.
Referenced by controlize_distribution().
entity create_integer_parameter_for_new_module | ( | const char * | parameter_name, |
const char * | module_name, | ||
entity | module, | ||
int | param_nb | ||
) |
Create new integer variable parameter for a newly created module.
parameter_name | arameter_name |
module_name | odule_name |
module | odule |
param_nb | aram_nb |
Definition at line 126 of file phrase_distributor_control_code.c.
References create_parameter_for_new_module(), is_basic_int, make_variable(), MakeBasic(), module, module_name(), and NIL.
Referenced by make_array_communication_module(), make_scalar_communication_module(), make_start_ru_module(), and make_wait_ru_module().
Creates and declares a new variable for a newly created common.
gen_nreverse(CONS(ENTITY,e,old_layout));
name | ame |
module | odule |
common | ommon |
var | ar |
Definition at line 194 of file phrase_distributor_control_code.c.
References AddEntityToDeclarations(), area_layout, area_size, concatenate(), CONS, ENTITY, entity_storage, entity_type, gen_nconc(), is_storage_ram, is_type_variable, make_entity, make_ram(), make_storage(), make_type(), make_value_unknown(), module, module_local_name(), MODULE_SEP_STRING, NIL, pips_debug, storage_space_of_variable(), storage_undefined, strdup(), and type_area.
Referenced by create_externalized_function_common(), and create_new_scalar_common_variable().
Creates and declares a new integer scalar variable for a newly created common.
name | ame |
module | odule |
common | ommon |
Definition at line 228 of file phrase_distributor_control_code.c.
References create_new_scalar_common_variable(), is_basic_int, MakeBasic(), and module.
Referenced by make_global_common_and_initialize().
Creates and declares a new scalar variable for a newly created common.
name | ame |
module | odule |
common | ommon |
Definition at line 220 of file phrase_distributor_control_code.c.
References create_new_common_variable(), make_variable(), module, and NIL.
Referenced by create_new_integer_scalar_common_variable().
entity create_parameter_for_new_module | ( | variable | var, |
const char * | parameter_name, | ||
const char * | module_name, | ||
entity | module, | ||
int | param_nb | ||
) |
Create new variable parameter for a newly created module.
phrase_distributor_control_code.c
This entity does not exist, we can safely create it
G used to be strdup("")
var | ar |
parameter_name | arameter_name |
module_name | odule_name |
module | odule |
param_nb | aram_nb |
Definition at line 74 of file phrase_distributor_control_code.c.
References code_declarations, concatenate(), CONS, copy_variable(), ENTITY, entity_domain, entity_initial, entity_type, entity_undefined, functional_parameters, gen_find_tabulated(), make_dummy_identifier(), make_entity, make_formal(), make_mode_reference(), make_parameter(), make_storage_formal(), make_type_variable(), make_value_unknown(), module, module_declarations(), module_name(), MODULE_SEP_STRING, new_variable, PARAMETER, pips_internal_error, strdup(), type_functional, and value_code.
Referenced by create_integer_parameter_for_new_module(), make_array_communication_module(), and make_scalar_communication_module().
Creates all the things that need to be created in order to declare common in module (all the variable are created)
Compute the primary variables
We iterate on the primary variables declared in the common and create a new variable mapping the one declared in common
Creates the name for the new variable
Copy type of variable
Create storage for new variable
Copy initial value of variable
Build the new variable
Mark for addition
Add to declarations....
Add those new variable to common layout
common | ommon |
module | odule |
Definition at line 237 of file phrase_distributor_control_code.c.
References AddEntityToDeclarations(), area_layout, concatenate(), CONS, copy_type(), copy_value(), ENTITY, entity_global_name(), entity_initial, entity_local_name(), entity_storage, entity_type, gen_nconc(), gen_nreverse(), ifdebug, is_storage_ram, make_entity, make_ram(), make_storage(), MAP, module, module_local_name(), MODULE_SEP_STRING, new_variable, NIL, offset, pips_debug, ram_offset, storage_ram, strdup(), and type_area.
Referenced by make_array_communication_module(), make_scalar_communication_module(), make_start_ru_module(), and make_wait_ru_module().
Return entity named name in specified module.
Is it the main module ?
name | ame |
module | odule |
Definition at line 434 of file phrase_distributor_control_code.c.
References entity_local_name(), FindEntity(), and module.
Referenced by controlize_distribution(), make_array_communication_statement(), make_communication_statement(), make_scalar_communication_module(), and make_start_ru_module().
function | unction |
Definition at line 391 of file phrase_distributor_control_code.c.
References asprintf, buffer, COMMON_PARAM_NAME, entity_local_name(), and strdup().
Referenced by create_externalized_function_common(), make_array_communication_statement(), make_communication_statement(), and make_start_ru_module().
function | unction |
Definition at line 329 of file phrase_distributor_control_code.c.
References asprintf, buffer, CONTROLIZED_STATEMENT_COMMENT, and entity_local_name().
Referenced by controlize_distribution().
Definition at line 379 of file phrase_distributor_control_code.c.
References asprintf, buffer, entity_local_name(), FUNCTION_COMMON_NAME, and strdup().
Referenced by create_externalized_function_common().
function | unction |
Definition at line 367 of file phrase_distributor_control_code.c.
References asprintf, buffer, entity_local_name(), FUNCTION_ID_NAME, and strdup().
Referenced by controlize_distribution(), make_global_common_and_initialize(), make_scalar_communication_module(), and make_start_ru_module().
function | unction |
Definition at line 341 of file phrase_distributor_control_code.c.
References asprintf, buffer, entity_local_name(), and IN_PARAM_ID_NAME.
Referenced by controlize_distribution(), make_global_common_and_initialize(), and make_scalar_communication_module().
function | unction |
Definition at line 354 of file phrase_distributor_control_code.c.
References asprintf, buffer, entity_local_name(), and OUT_PARAM_ID_NAME.
Referenced by controlize_distribution(), make_global_common_and_initialize(), and make_scalar_communication_module().
var | ar |
Definition at line 424 of file phrase_distributor_control_code.c.
References asprintf, buffer, RECEIVE_PARAMETER_MODULE_NAME, strdup(), and variable_to_string().
Referenced by get_receive_param_module_name(), and make_scalar_communication_modules().
var | ar |
Definition at line 414 of file phrase_distributor_control_code.c.
References asprintf, buffer, SEND_PARAMETER_MODULE_NAME, strdup(), and variable_to_string().
Referenced by get_send_param_module_name(), and make_scalar_communication_modules().
Definition at line 404 of file phrase_distributor_control_code.c.
References asprintf, buffer, strdup(), and UNIT_ID_NAME.
Referenced by controlize_distribution(), and make_global_common_and_initialize().
|
static |
Build and return CONTROL_DATA global common used to store global information on phrase distribution controlization and initialization of values contained in CONTROL_DATA common.
_in = regions_dup(load_statement_in_regions(s)); l_out = regions_dup(load_statement_out_regions(s));
Definition at line 452 of file phrase_distributor_control_code.c.
References CONS, CONTROL_DATA_COMMON_NAME, create_new_integer_scalar_common_variable(), effect_any_reference, empty_comments, empty_extensions(), entity_empty_label(), entity_local_name(), FUNCTIONS_NB_NAME, get_function_id_name(), get_in_param_id_name(), get_out_param_id_name(), get_unit_id_name(), hash_get(), HASH_MAP, hash_table_entry_count(), int_to_expression(), is_instruction_sequence, make_assignement_statement(), make_instruction(), make_new_common(), make_sequence(), make_statement(), make_synchronization_none(), MAP, NIL, pips_debug, ref, reference_variable, REGION, STATEMENT, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, and UNITS_NB_NAME.
Referenced by controlize_distribution().
bool phrase_distributor_control_code | ( | const char * | module_name | ) |
set and get the current properties concerning regions
get the resources
sets dynamic_area
Get the READ, WRITE, IN and OUT regions of the module
Now do the job
Display the statement before to check consistency
Check the coherency of data
Reorder the module, because new statements have been added
update/release resources
module_name | odule_name |
Definition at line 1039 of file phrase_distributor_control_code.c.
References compute_callees(), controlize_distribution(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dynamic_area, DYNAMIC_AREA_LOCAL_NAME, entity_undefined, entity_undefined_p, FindOrCreateEntity(), free_value_mappings(), gen_consistent_p(), get_regions_properties(), ifdebug, module, module_local_name(), module_name(), module_name_to_entity(), module_reorder(), module_to_value_mappings(), pips_assert, pips_debug, print_statement(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_in_effects(), reset_out_effects(), reset_proper_rw_effects(), reset_rw_effects(), set_bool_property(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_in_effects(), set_out_effects(), set_proper_rw_effects(), set_rw_effects(), and statement_consistent_p().
Store (PIPDBM) newly created module module with module_statement as USER_FILE by saving pretty printing.
module_name | odule_name |
module | odule |
module_statement | odule_statement |
Definition at line 143 of file phrase_distributor_control_code.c.
References close_prettyprint(), code_declarations, db_build_file_resource_name(), DB_PUT_NEW_FILE_RESOURCE, empty_text(), ENTITY, entity_global_name(), entity_initial, fprint_environment(), get_current_module_entity(), ifdebug, init_prettyprint(), make_text_resource(), MAP, module, module_name(), module_statement, pips_debug, print_statement(), reset_current_module_entity(), set_current_module_entity(), text_module(), and value_code.
Referenced by make_array_communication_module(), make_scalar_communication_module(), make_start_ru_module(), and make_wait_ru_module().
|
static |
Definition at line 1037 of file phrase_distributor_control_code.c.
Referenced by phrase_distributor_control_code().