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 "prettyprint.h"
#include "effects-util.h"
#include "text-util.h"
#include "dg.h"
#include "graph.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "polyedre.h"
#include "phrase_tools.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
#include "phrase_distribution.h"
Go to the source code of this file.
Typedefs | |
typedef dg_arc_label | arc_label |
General computation for PHRASE distribution DISTRIBUTION CONTEXT. More... | |
typedef dg_vertex_label | vertex_label |
Functions | |
bool | internal_compute_distribution_context (statement externalized_code, hash_table *ht_params, hash_table *ht_private, hash_table *ht_in_regions, hash_table *ht_out_regions, void *key_value) |
Internally used to compute distribution context for statement externalized_code. More... | |
bool | compute_distribution_context (list l_stats, statement module_stat, entity module, hash_table *ht_stats, hash_table *ht_params, hash_table *ht_private, hash_table *ht_in_regions, hash_table *ht_out_regions) |
This function is called during PHRASE distribution. More... | |
bool | compute_distribution_controlization_context (list l_calls, statement module_stat, entity module, hash_table *ht_calls, hash_table *ht_params, hash_table *ht_private, hash_table *ht_in_regions, hash_table *ht_out_regions) |
This function is called during PHRASE distribution controlization. More... | |
list | compute_regions_union (list l_in, list l_out) |
Compute union of exact regions. More... | |
string | get_externalizable_function_name (statement stat) |
Return the identified function name of the externalized portion of code by searching comment matching tag EXTERNALIZED_CODE_PRAGMA_BEGIN. More... | |
string | get_externalized_function_name (statement stat) |
Return the identified function name of the externalized portion of code by searching comment matching tag EXTERNALIZED_CODE_PRAGMA_CALL. More... | |
string | get_externalized_and_analyzed_function_name (statement stat, int *stats_nb) |
Return the identified function name of the externalized portion of code by searching comment matching tags EXTERNALIZED_CODE_PRAGMA_ANALYZED Sets the number of statements of this externalizable statement. More... | |
string | variable_to_string (variable var) |
Return a unique (regarding variable_equal_p(var1,var2)) string representation of a variable var. More... | |
void | register_scalar_communications (hash_table *ht_communications, entity function, list l_regions) |
Build an HASHTABLE where keys are VARIABLE and values are HASHTABLE where keys are modules or externalized function (ENTITY) and values are list of regions. More... | |
typedef dg_arc_label arc_label |
General computation for PHRASE distribution DISTRIBUTION CONTEXT.
Definition at line 52 of file distribution_context.c.
typedef dg_vertex_label vertex_label |
Definition at line 53 of file distribution_context.c.
bool compute_distribution_context | ( | list | l_stats, |
statement | module_stat, | ||
entity | module, | ||
hash_table * | ht_stats, | ||
hash_table * | ht_params, | ||
hash_table * | ht_private, | ||
hash_table * | ht_in_regions, | ||
hash_table * | ht_out_regions | ||
) |
This function is called during PHRASE distribution.
The goal here is to compute the context of the distribution from a given list of statements (after distribution initialization). Those results are stored in following hashtable:
HT_STATS: This hashtable stores the statement (values) associated to names (keys) of externalized function.
HT_PARAMS: This hashtable stores the list of regions (values) associated to names (keys) of externalized function. Those regions are computed as union of IN and OUT regions of specified statement. If two or more regions refer to the same variable (entity), those regions are transformed into ONE region (which could be converted to a MAY region). This hashtable is used to compute the parameters of specified externalized function.
HT_PRIVATE: This hashtable stores the list of privates regions (values) associated to names (keys) of externalized function. This hashtable is used to compute the private working area in specified externalized function.
HT_IN_REGIONS: This hashtable stores the list of IN regions (values) associated to names (keys) of externalized function. This hashtable is used to compute OUTPUT communication after externalized function execution.
HT_OUT_REGIONS: This hashtable stores the list of OUT regions (values) associated to names (keys) of externalized function. This hashtable is used to compute OUTPUT communication after externalized function execution.
Return true if everything is OK
NB: All lists are sorted using externalized fonction name
lazy init
lazy init
lazy init
lazy init
lazy init
Register new externalized function
l_stats | _stats |
module_stat | odule_stat |
module | odule |
ht_stats | t_stats |
ht_params | t_params |
ht_private | t_private |
ht_in_regions | t_in_regions |
ht_out_regions | t_out_regions |
Definition at line 113 of file distribution_context.c.
References entity_local_name(), get_externalized_and_analyzed_function_name(), hash_defined_p(), hash_pointer, hash_put(), hash_table_make(), internal_compute_distribution_context(), MAP, module, pips_debug, pips_internal_error, pips_user_warning, sequence_statement_containing(), and STATEMENT.
Referenced by comEngine_distribute(), and distribute().
bool compute_distribution_controlization_context | ( | list | l_calls, |
statement | module_stat, | ||
entity | module, | ||
hash_table * | ht_calls, | ||
hash_table * | ht_params, | ||
hash_table * | ht_private, | ||
hash_table * | ht_in_regions, | ||
hash_table * | ht_out_regions | ||
) |
This function is called during PHRASE distribution controlization.
The goal here is to compute the context of the distribution from a given list of call statements (after distribution). Those results are stored in following hashtable:
HT_CALLS: This hashtable stores the list of call statements (values) associated to entity representing the external function (keys). This is a list because a same function can be called from multiple points of original program
HT_PARAMS: This hashtable stores the list of regions (values) associated to entity representing the external function (keys). Those regions are computed as union of IN and OUT regions of specified statement. If two or more regions refer to the same variable (entity), those regions are transformed into ONE region (which could be converted to a MAY region). This hashtable is used to compute the parameters of specified externalized function.
HT_PRIVATE: This hashtable stores the list of privates regions (values) associated to entity representing the external function (keys). This hashtable is used to compute the private working area in specified externalized function.
HT_IN_REGIONS: This hashtable stores the list of IN regions (values) associated to entity representing the external function (keys). This hashtable is used to compute OUTPUT communication after externalized function execution.
HT_OUT_REGIONS: This hashtable stores the list of OUT regions (values) associated to entity representing the external function (keys). This hashtable is used to compute OUTPUT communication after externalized function execution.
Return true if everything is OK
NB: All lists are sorted using externalized fonction name
lazy init
lazy init
lazy init
lazy init
lazy init
Register new externalized function
This function has NOT been already defined, Register it
This function has already been defined, add this statement to the list
Check that IN and OUT regions match !
NOT IMPLEMENTED Yet !
l_calls | _calls |
module_stat | odule_stat |
module | odule |
ht_calls | t_calls |
ht_params | t_params |
ht_private | t_private |
ht_in_regions | t_in_regions |
ht_out_regions | t_out_regions |
Definition at line 216 of file distribution_context.c.
References CONS, entity_local_name(), get_externalized_function_name(), hash_defined_p(), hash_get(), hash_pointer, hash_put(), hash_table_make(), ifdebug, internal_compute_distribution_context(), MAP, module, module_name_to_entity(), NIL, pips_debug, print_statement(), and STATEMENT.
Referenced by controlize_distribution().
Compute union of exact regions.
l_in | _in |
l_out | _out |
Definition at line 291 of file distribution_context.c.
References CONS, entity_local_name(), gen_copy_seq(), gen_length(), gen_nth(), gen_remove(), MAP, pips_debug, pips_internal_error, print_region, print_regions(), region, REGION, region_entity, region_must_union(), region_scalar_p, and same_entity_p().
Referenced by internal_compute_distribution_context().
Return the identified function name of the externalized portion of code by searching comment matching tag EXTERNALIZED_CODE_PRAGMA_BEGIN.
stat | tat |
Definition at line 449 of file distribution_context.c.
References EXTERNALIZED_CODE_PRAGMA_BEGIN, and get_function_name_by_searching_tag().
Referenced by identify_statements_to_distribute(), and isolate_code_portion().
Return the identified function name of the externalized portion of code by searching comment matching tags EXTERNALIZED_CODE_PRAGMA_ANALYZED Sets the number of statements of this externalizable statement.
stat | tat |
stats_nb | tats_nb |
Definition at line 470 of file distribution_context.c.
References EXTERNALIZED_CODE_PRAGMA_ANALYZED, gen_nth(), instruction_sequence, instruction_tag, is_instruction_sequence, malloc(), pips_debug, sequence_statements, STATEMENT, statement_comments, statement_instruction, statement_with_empty_comment_p(), and strdup().
Referenced by compute_distribution_context().
Return the identified function name of the externalized portion of code by searching comment matching tag EXTERNALIZED_CODE_PRAGMA_CALL.
stat | tat |
Definition at line 459 of file distribution_context.c.
References EXTERNALIZED_CODE_PRAGMA_CALL, and get_function_name_by_searching_tag().
Referenced by compute_distribution_controlization_context().
bool internal_compute_distribution_context | ( | statement | externalized_code, |
hash_table * | ht_params, | ||
hash_table * | ht_private, | ||
hash_table * | ht_in_regions, | ||
hash_table * | ht_out_regions, | ||
void * | key_value | ||
) |
Internally used to compute distribution context for statement externalized_code.
Storing results in hash_tables
externalized_code | xternalized_code |
ht_params | t_params |
ht_private | t_private |
ht_in_regions | t_in_regions |
ht_out_regions | t_out_regions |
key_value | ey_value |
Definition at line 346 of file distribution_context.c.
References compare_effect_reference(), compute_regions_union(), gen_sort_list(), hash_defined_p(), hash_put(), ifdebug, load_statement_in_regions(), load_statement_local_regions(), load_statement_out_regions(), NIL, pips_debug, pips_user_warning, print_regions(), regions_dup(), regions_read_regions(), regions_write_regions(), RegionsEntitiesInfDifference(), w_r_combinable_p(), and w_w_combinable_p().
Referenced by compute_distribution_context(), and compute_distribution_controlization_context().
void register_scalar_communications | ( | hash_table * | ht_communications, |
entity | function, | ||
list | l_regions | ||
) |
Build an HASHTABLE where keys are VARIABLE and values are HASHTABLE where keys are modules or externalized function (ENTITY) and values are list of regions.
Iterate on all regions of the given list
Get the variable type
Look if this variable is already registered
ht_communications | t_communications |
function | unction |
l_regions | _regions |
Definition at line 538 of file distribution_context.c.
References basic_to_string(), CONS, entity_type, gen_length(), hash_defined_p(), hash_get(), HASH_MAP, hash_pointer, hash_put(), hash_table_make(), hash_update(), MAP, NIL, pips_debug, print_region, REGION, region_entity, region_scalar_p, type_variable, variable_basic, variable_dimensions, and variable_equal_p().
Referenced by controlize_distribution().
Return a unique (regarding variable_equal_p(var1,var2)) string representation of a variable var.
var | ar |
Definition at line 511 of file distribution_context.c.
References basic_to_string(), buffer, concatenate(), DIMENSION, dimension_lower, dimension_upper, expression_integer_value(), FOREACH, intptr_t, strdup(), variable_basic, variable_dimensions, and VARIABLE_NAME_FORMAT.
Referenced by get_receive_parameter_module_name(), and get_send_parameter_module_name().