PIPS
|
#include "defines-local.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
Go to the source code of this file.
Macros | |
#define | STATIC_LIST_OF_HPF_OBJECTS(name, set_name, pred_name) |
in static_controlize More... | |
#define | normalized_dimension_p(dim) (HpfcExpressionToInt(dimension_lower(dim))==1) |
local macros... More... | |
Functions | |
bool | expression_constant_p (expression) |
HPFC module by Fabien COELHO. More... | |
STATIC_LIST_OF_HPF_OBJECTS (distributed_arrays, set_array_as_distributed, array_distributed_p) | |
list | list_of_distributed_arrays_for_module (entity module) |
returns the list of entities that are 'local' to module More... | |
void | reset_hpf_object_lists () |
void | free_hpf_object_lists () |
static void | init_currents () |
void | init_hpf_number_status () |
STANDARS STATIC MANAGEMENT. More... | |
numbers_status | get_hpf_number_status () |
void | reset_hpf_number_status () |
void | set_hpf_number_status (numbers_status s) |
void | close_hpf_number_status () |
void | GiveToHpfObjectsTheirNumber () |
give to hpf objects listed in distributedarrays, templates and processors their number for the code generation... More... | |
expression | entity_hpf_number (entity e) |
returns the hpf_number parameter as a string not really needed ??? ??? never called More... | |
tag | new_declaration_tag (entity array, int dim) |
static void | create_new_declaration (entity e) |
static void | store_a_new_declaration (entity array, int dim, tag what) |
void | get_ith_dim_new_declaration (entity array, int i, int *pmin, int *pmax) |
void | init_data_status () |
data_status | get_data_status () |
void | reset_data_status () |
void | set_data_status (data_status s) |
void | close_data_status () |
static void | NormalizeOneTemplateDistribution (distribution d, entity templ, int *templdimp, entity procs, int *procsdimp) |
NormalizeOneTemplateDistribution. More... | |
void | normalize_distribute (entity t, distribute d) |
void | normalize_align (_UNUSED_ entity e, align a) |
void | normalize_hpf_object (entity v) |
void | NormalizeHpfDeclarations () |
static int | ComputeNewSizeOfIthDimension (dimension dim, int i, entity array, tag *newdeclp) |
here the new size of the ith dimension of the given array is computed. More... | |
static void | NewDeclarationOfDistributedArray (entity array) |
for node this are reformated, and for host these variables are deleted. More... | |
void | NewDeclarationsOfDistributedArrays () |
this procedure generate the new declarations of every distributed arrays of the program, in order to minimize the amount of memory used. More... | |
static void | create_overlaps (entity e) |
void | set_overlap (entity ent, int dim, int side, int width) |
set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer. More... | |
int | get_overlap (entity ent, int dim, int side) |
returns the overlap for a given entity, dimension and side, to be used in the declaration modifications More... | |
static void | overlap_redefine_expression (expression *pexpr, int ov) |
redefines the bound given the overlap which is to be included More... | |
static void | declaration_with_overlaps (list l) |
void | declaration_with_overlaps_for_module (entity module) |
static void | update_overlaps_of (entity u, entity v) |
void | update_overlaps_in_caller (entity fun, list le) |
the overlaps of the actual parameters are updated according to the formal requirements. More... | |
Variables | |
static int | current_array_index = 1 |
static int | current_template_index = 1 |
static int | current_processors_index = 1 |
#define normalized_dimension_p | ( | dim | ) | (HpfcExpressionToInt(dimension_lower(dim))==1) |
local macros...
Definition at line 447 of file declarations.c.
#define STATIC_LIST_OF_HPF_OBJECTS | ( | name, | |
set_name, | |||
pred_name | |||
) |
in static_controlize
DISTRIBUTED ARRAYS
Definition at line 46 of file declarations.c.
void close_data_status | ( | void | ) |
Definition at line 339 of file declarations.c.
References close_hpf_alignment(), close_hpf_distribution(), and free_hpf_object_lists().
void close_hpf_number_status | ( | void | ) |
Definition at line 157 of file declarations.c.
References close_hpf_number(), and init_currents().
|
static |
here the new size of the ith dimension of the given array is computed.
because the declarations are static, there is a majoration of the space required on each processors to held his part of the distributed array.
default: the new declaration is the same as the old one.
looking for the matching alignment...
no alignment => scratching of the dimension...
there is an alignment, but the rate is zero, so the whole dimension has to be declared on every processors, despite the fact that the dimension is mapped on only one element.
looking for the matching distribution... pdim is the corresponding dimension of processors p
no style => scratching of the dimension...
??? should delete the alignment which is not usefull...
alpha case
and now, let's look at the different cases.
beta case
gamma case
??? what about rate==-1 ?
delta case
alpha case, if nothing matches, what shouldn't be the case :
Definition at line 455 of file declarations.c.
References abs, align_alignment, align_template, alignment_rate, alignment_templatedim, alignment_undefined, array, choice, dimension_size(), distribute_distribution, distribute_processors, distribution_parameter, distribution_style, distribution_undefined, entity_name, FindAlignmentOfDim(), FindDistributionOfDim(), HpfcExpressionToInt(), iceil, ifdebug, is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, load_hpf_alignment(), load_hpf_distribution(), min, normalized_dimension_p, pips_debug, print_align(), print_distribute(), SizeOfIthDimension(), style_block_p, style_cyclic_p, and style_none_p.
Referenced by NewDeclarationOfDistributedArray().
|
static |
Definition at line 248 of file declarations.c.
References CONS, entity_type, gen_length(), HPF_NEWDECL, is_hpf_newdecl_none, make_hpf_newdecl(), make_hpf_newdecls(), NIL, pips_assert, type_variable, type_variable_p, UU, and variable_dimensions.
Referenced by store_a_new_declaration().
|
static |
Definition at line 693 of file declarations.c.
References bound_overlap_status_p(), CONS, entity_type, gen_length(), make_overlap(), NIL, OVERLAP, pips_assert, store_overlap_status(), type_variable, type_variable_p, and variable_dimensions.
Referenced by get_overlap(), and set_overlap().
|
static |
arguments are passed the declarations from outside
??? memory leak
Definition at line 780 of file declarations.c.
References dimension_lower, dimension_upper, ENTITY, entity_ith_dimension(), entity_name, entity_storage, entity_type, get_overlap(), hpfc_array_bound(), ith_dim_overlapable_p(), load_new_node(), MAP, overlap_redefine_expression(), pips_assert, pips_debug, storage_formal_p, type_variable_p, and variable_entity_dimension().
Referenced by declaration_with_overlaps_for_module().
void declaration_with_overlaps_for_module | ( | entity | module | ) |
module | odule |
Definition at line 835 of file declarations.c.
References declaration_with_overlaps(), gen_free_list(), list_of_distributed_arrays_for_module(), and module.
Referenced by compile_common(), and compile_module().
expression entity_hpf_number | ( | entity | e | ) |
returns the hpf_number parameter as a string not really needed ??? ??? never called
Definition at line 196 of file declarations.c.
References concatenate(), entity_in_common_p(), entity_local_name(), entity_storage, entity_variable_p, MakeCharacterConstantExpression(), pips_assert, prefix, ram_function, ram_section, ram_undefined, storage_ram, storage_ram_p, and strdup().
bool expression_constant_p | ( | expression | exp | ) |
HPFC module by Fabien COELHO.
new declarations compilation. normalization of HPF declarations.
HPFC module by Fabien COELHO.
bool expression_constant_p(expression exp) Returns true if "exp" is an (integer) constant value.
Note : A negativePositive constant can be represented with a call to the unary minus/plus intrinsic function upon a positive value.
See below extended_expression_constant_p() for a more general function.
Definition at line 2453 of file expression.c.
References constant_undefined_p, exp, and expression_constant().
Referenced by add_const_expr_p(), analyze_expression(), array_indices_check(), array_size_stride(), atom_cse_expression(), atomize_this_expression(), compute_final_index_value(), constant_step_loop_p(), constraints_to_loop_bound(), do_loop_expansion(), do_loop_expansion_init(), do_solve_hardware_constraints_on_volume(), effect_field_dimension_entity(), equal_must_vreference(), expression_plusplus(), expression_try_find_size(), formal_variable_add_aliases(), freia_insert_added_stats(), incrementation_expression_to_increment(), inline_expression_call(), loop_annotate(), loop_normalize_of_loop(), make_loadsave_statement(), make_max_exp(), make_send_receive_conversion(), MakeCaseStatement(), MakeEquivAtom(), malloc_arg_to_type(), normalizable_loop_p(), opkill_may_vreference(), opkill_must_vreference(), overlap_redefine_expression(), plc_make_dim(), points_to_compare_cell(), points_to_compare_cells(), points_to_compare_location(), points_to_compare_ptr_cell(), process_true_call_stat(), rational_op_exp(), replace_subscript(), size_of_dummy_array(), sp_feautrier_expression_p(), splc_feautrier_expression_p(), stmt_bdt_directions(), subscript_value(), terapixify_loops(), valuer(), and words_dimension().
void free_hpf_object_lists | ( | void | ) |
Definition at line 98 of file declarations.c.
References gen_free_list(), and reset_hpf_object_lists().
Referenced by close_data_status().
data_status get_data_status | ( | void | ) |
??? previsous data_status lost: memory leak
Definition at line 308 of file declarations.c.
References get_hpf_alignment(), get_hpf_distribution(), list_of_distributed_arrays(), list_of_processors(), list_of_templates(), and make_data_status().
Referenced by init_hpfc_status(), and save_hpfc_status().
numbers_status get_hpf_number_status | ( | void | ) |
Definition at line 134 of file declarations.c.
References current_array_index, current_processors_index, current_template_index, get_hpf_number(), and make_numbers_status().
Referenced by init_hpfc_status(), and save_hpfc_status().
array | rray |
pmin | min |
pmax | max |
Definition at line 285 of file declarations.c.
References array, array_distributed_p(), dimension_lower, dimension_upper, entity_ith_dimension(), entity_variable_p, HpfcExpressionToInt(), load_new_node(), and pips_assert.
Referenced by hpfc_compute_entity_to_new_declaration().
returns the overlap for a given entity, dimension and side, to be used in the declaration modifications
ent | nt |
dim | im |
side | ide |
Definition at line 743 of file declarations.c.
References bound_overlap_status_p(), create_overlaps(), entity_name, gen_nth(), load_overlap_status(), OVERLAP, overlap_lower, overlap_upper, pips_assert, and pips_debug.
Referenced by declaration_with_overlaps(), and update_overlaps_of().
void GiveToHpfObjectsTheirNumber | ( | void | ) |
give to hpf objects listed in distributedarrays, templates and processors their number for the code generation...
Definition at line 166 of file declarations.c.
References bound_hpf_number_p(), current_array_index, current_processors_index, current_template_index, ENTITY, MAP, pips_debug, and store_hpf_number().
Referenced by NormalizeHpfDeclarations().
|
static |
Definition at line 116 of file declarations.c.
References current_array_index, current_processors_index, and current_template_index.
Referenced by close_hpf_number_status(), init_hpf_number_status(), and reset_hpf_number_status().
void init_data_status | ( | void | ) |
Definition at line 300 of file declarations.c.
References init_hpf_alignment(), init_hpf_distribution(), and reset_hpf_object_lists().
Referenced by init_hpfc_status().
void init_hpf_number_status | ( | void | ) |
STANDARS STATIC MANAGEMENT.
functions: {init,get,set,reset,close}_hpf_number_status
Definition at line 128 of file declarations.c.
References init_currents(), and init_hpf_number().
Referenced by init_hpfc_status().
returns the list of entities that are 'local' to module
module | odule |
Definition at line 72 of file declarations.c.
References CONS, ENTITY, hpfc_main_entity(), list_of_distributed_arrays(), MAP, module, and NIL.
Referenced by create_init_common_param_for_arrays(), create_parameters_h(), declaration_with_overlaps_for_module(), and root_statement_remapping_inits().
array | rray |
dim | im |
Definition at line 229 of file declarations.c.
References array, array_distributed_p(), entity_name, gen_nth(), HPF_NEWDECL, hpf_newdecl_tag, hpf_newdecls_dimensions, pips_assert, and pips_debug.
Referenced by block_distributed_p(), create_init_common_param_for_arrays(), expr_compute_local_index(), and hpfc_compute_entity_to_new_declaration().
|
static |
for node this are reformated, and for host these variables are deleted.
it may happen that no newarray is available, when a module with no distributed variables is considered...
compute the new size for every dimension on the array, then update the dimensions of the newarray. remember that the dimensions are shared between the old and new arrays.
Definition at line 615 of file declarations.c.
References array, array_distributed_p(), bound_new_node_p(), ComputeNewSizeOfIthDimension(), CONS, copy_dimension(), DIMENSION, entity_name, entity_type, entity_variable_p, gen_nconc(), int_to_expression(), is_hpf_newdecl_none, ith_dim_distributed_p(), load_new_node(), make_dimension(), MAP, NIL, pips_assert, pips_debug, store_a_new_declaration(), type_variable, and variable_dimensions.
Referenced by NewDeclarationsOfDistributedArrays().
void NewDeclarationsOfDistributedArrays | ( | void | ) |
this procedure generate the new declarations of every distributed arrays of the program, in order to minimize the amount of memory used.
The new declarations have to be suitable for the new index computation which is to be done dynamically...
Definition at line 676 of file declarations.c.
References array, ENTITY, entity_name, list_of_distributed_arrays(), MAP, NewDeclarationOfDistributedArray(), and pips_debug.
Referenced by init_host_and_node_entities().
Definition at line 426 of file declarations.c.
References normalize_first_expressions_of().
Referenced by one_align_directive().
void normalize_distribute | ( | entity | t, |
distribute | d | ||
) |
of distribution
Definition at line 408 of file declarations.c.
References distribute_distribution, distribute_processors, DISTRIBUTION, entity_name, MAP, normalize_first_expressions_of(), NormalizeOneTemplateDistribution(), NumberOfDimension(), and pips_user_error.
Referenced by one_distribute_directive().
void normalize_hpf_object | ( | entity | v | ) |
Definition at line 431 of file declarations.c.
References entity_type, and normalize_first_expressions_of().
void NormalizeHpfDeclarations | ( | void | ) |
Definition at line 437 of file declarations.c.
References GiveToHpfObjectsTheirNumber(), ifdebug, and print_hpf_dir().
Referenced by compile_module().
|
static |
NormalizeOneTemplateDistribution.
compute the missing value, in case of BLOCK distribution
check the given value
Definition at line 352 of file declarations.c.
References distribution_parameter, distribution_style, entity_name, expression_undefined, HpfcExpressionToInt(), iceil, int_to_expression(), is_style_block, pips_internal_error, pips_user_error, SizeOfIthDimension(), style_none_p, and style_tag.
Referenced by normalize_distribute().
|
static |
redefines the bound given the overlap which is to be included
this avoid a memory leak
Definition at line 761 of file declarations.c.
References expression_constant_p(), FindOrCreateEntity(), free_expression(), HpfcExpressionToInt(), int_to_expression(), MakeBinaryCall(), PLUS_OPERATOR_NAME, and TOP_LEVEL_MODULE_NAME.
Referenced by declaration_with_overlaps().
void reset_data_status | ( | void | ) |
Definition at line 320 of file declarations.c.
References reset_hpf_alignment(), reset_hpf_distribution(), and reset_hpf_object_lists().
Referenced by reset_hpfc_status().
void reset_hpf_number_status | ( | void | ) |
Definition at line 142 of file declarations.c.
References init_currents(), and reset_hpf_number().
Referenced by reset_hpfc_status().
void reset_hpf_object_lists | ( | void | ) |
Definition at line 91 of file declarations.c.
References NIL.
Referenced by free_hpf_object_lists(), init_data_status(), and reset_data_status().
void set_data_status | ( | data_status | s | ) |
Definition at line 328 of file declarations.c.
References data_status_alignmap, data_status_arrays, data_status_distributemap, data_status_newdeclmap, data_status_processors, data_status_templates, set_hpf_alignment(), and set_hpf_distribution().
Referenced by load_hpfc_status().
void set_hpf_number_status | ( | numbers_status | s | ) |
Definition at line 148 of file declarations.c.
References current_array_index, current_processors_index, current_template_index, numbers_status_arrays, numbers_status_numbermap, numbers_status_processors, numbers_status_templates, and set_hpf_number().
Referenced by load_hpfc_status().
set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a positive integer.
if necessary, the overlap is updates with the value width.
upper
lower
ent | nt |
dim | im |
side | ide |
width | idth |
Definition at line 713 of file declarations.c.
References bound_overlap_status_p(), create_overlaps(), current, entity_name, gen_nth(), load_overlap_status(), OVERLAP, overlap_lower, overlap_upper, pips_assert, and pips_debug.
Referenced by message_manageable_p(), and update_overlaps_of().
STATIC_LIST_OF_HPF_OBJECTS | ( | distributed_arrays | , |
set_array_as_distributed | , | ||
array_distributed_p | |||
) |
Definition at line 54 of file declarations.c.
References array_distributed_p(), entity_in_common_p(), load_old_host(), and load_old_node().
Definition at line 266 of file declarations.c.
References array, array_distributed_p(), create_new_declaration(), gen_nth(), HPF_NEWDECL, hpf_newdecl_tag, hpf_newdecls_dimensions, and pips_assert.
Referenced by NewDeclarationOfDistributedArray().
the overlaps of the actual parameters are updated according to the formal requirements.
fun | un |
le | the function of expression call arguments in the initial code |
Definition at line 864 of file declarations.c.
References array_distributed_p(), bound_new_node_p(), CAR, entity_name, EXPRESSION, expression_to_entity(), find_ith_parameter(), gen_length(), load_new_node(), pips_assert, pips_debug, POP, and update_overlaps_of().
Referenced by hpf_compile_call().
u | distributed variable in the caller |
v | formal parameter in the callee |
Definition at line 843 of file declarations.c.
References entity_name, get_overlap(), NumberOfDimension(), pips_assert, pips_debug, and set_overlap().
Referenced by update_overlaps_in_caller().
|
static |
Definition at line 112 of file declarations.c.
Referenced by get_hpf_number_status(), GiveToHpfObjectsTheirNumber(), init_currents(), and set_hpf_number_status().
|
static |
Definition at line 114 of file declarations.c.
Referenced by get_hpf_number_status(), GiveToHpfObjectsTheirNumber(), init_currents(), and set_hpf_number_status().
|
static |
Definition at line 113 of file declarations.c.
Referenced by get_hpf_number_status(), GiveToHpfObjectsTheirNumber(), init_currents(), and set_hpf_number_status().