PIPS
|
#include "defines-local.h"
#include "prettyprint.h"
#include "effects.h"
#include "effects-util.h"
#include "effects-generic.h"
#include "effects-simple.h"
Go to the source code of this file.
Macros | |
#define | XDEBUG(msg) pips_debug(6, "%s and %s: " msg "\n", entity_name(e1), entity_name(e2)) |
Functions | |
bool | ref_to_dist_array_p (void *obj) |
this file describe a few functions usefull to the compiler to manage the hpfc data structures. More... | |
bool | written_effect_p (entity var, list le) |
written_effects_to_dist_arrays_p More... | |
bool | written_effects_to_dist_arrays_p (expression expr) |
bool | replicated_p (entity e) |
replicated_p More... | |
bool | ith_dim_replicated_p (_UNUSED_ entity template, int i, list la, distribution dist) |
bool ith_dim_replicated_p(template, i, la, dist) More... | |
bool | processors_dim_replicated_p (_UNUSED_ entity p, entity a, int i) |
true if array a is replicated on processors p i-th dimension. More... | |
bool | ith_dim_distributed_p (entity array, int i, int *pprocdim) |
whether a dimension is distributed or not. More... | |
bool | ith_dim_overlapable_p (entity array, int i) |
statement | MakeStatementLike (statement stat, int the_tag) |
creates a new statement for the given module that looks like the stat one, i.e. More... | |
static void | stmt_rwt (statement s) |
void | kill_statement_number_and_ordering (statement s) |
list | DistArraysEffects (expression expr) |
effects' action in an expression are here supposed to be read one's but that may not be correct? More... | |
list | FindRefToDistArrayFromList (list lexpr) |
FindRefToDistArrayFromList. More... | |
static void | FindRefToDistArray_syntax_rewrite (syntax s) |
list | FindRefToDistArray (void *obj) |
void | AddEntityToHostAndNodeModules (entity e) |
AddEntityToHostAndNodeModules. More... | |
void | AddCommonToModule (entity common, entity module, void(*update)(), string suffix) |
The common name is changed to distinguish the current, host and node instances of the common. More... | |
void | AddCommonToHostAndNodeModules (entity common) |
alignment | FindAlignmentOfDim (list lal, int dim) |
alignment | FindAlignmentOfTemplateDim (list lal, int dim) |
distribution | FindDistributionOfDim (list ldi, int dim, int *pdim) |
distribution | FindDistributionOfProcessorDim (list ldi, int dim, int *tdim) |
int | template_dimension_of_array_dimension (entity array, int dim) |
int | processor_dimension_of_template_dimension (entity template, int dim) |
int | DistributionParameterOfArrayDim (entity array, int dim, int *pprocdim) |
int | processor_number (entity template, int tdim, int tcell, int *pprocdim) |
int processor_number(template, tdim, tcell, pprocdim) More... | |
int | template_cell_local_mapping (entity array, int dim, int tc) |
int template_cell_local_mapping(array, dim, tc) More... | |
int | global_array_cell_to_local_array_cell (entity array, int dim, int acell) |
int global_array_cell_to_local_array_cell(array, dim, acell) More... | |
int | HpfcExpressionToInt (expression e) |
HpfcExpressionToInt(e) More... | |
void | get_alignment (entity array, int dim, int *ptdim, int *pa, int *pb) |
void | get_distribution (entity template, int dim, int *ppdim, int *pn) |
void | get_entity_dimensions (entity e, int dim, int *plow, int *pup) |
bool | alignments_compatible_p (entity e1, int dim1, entity e2, int dim2) |
bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2) More... | |
static int | expression_number_for_index (entity index, list le) |
bool references_aligned_p(reference r1, reference r2) More... | |
bool | references_aligned_p (reference r1, reference r2) |
void | hpfc_util_error_handler () |
removes IF (.TRUE.) THEN and DO X=n, n More... | |
static void | test_rewrite (test t) |
static void | loop_rewrite (loop l) |
void | statement_structural_cleaning (statement s) |
Variables | |
static list | found_syntaxes = NIL |
#define XDEBUG | ( | msg | ) | pips_debug(6, "%s and %s: " msg "\n", entity_name(e1), entity_name(e2)) |
Definition at line 722 of file hpfc-util.c.
void AddCommonToHostAndNodeModules | ( | entity | common | ) |
common | ommon |
Definition at line 371 of file hpfc-util.c.
References AddCommonToModule(), host_module, HOST_NAME, node_module, NODE_NAME, store_new_host_variable(), and store_new_node_variable().
Referenced by init_host_and_node_entities().
The common name is changed to distinguish the current, host and node instances of the common.
The layout list must be updated to the right entities
!!! not in current
Definition at line 328 of file hpfc-util.c.
References AddEntityToDeclarations(), AddEntityToModule(), area_layout, concatenate(), CONS, ENTITY, entity_local_name(), entity_type, entity_undefined, FindOrCreateEntityLikeModel(), free(), gen_find_eq(), gen_nconc(), gen_nreverse(), HPFC_PACKAGE, local_entity_of_module_p(), MAP, module, NIL, strdup(), and type_area.
Referenced by AddCommonToHostAndNodeModules().
void AddEntityToHostAndNodeModules | ( | entity | e | ) |
AddEntityToHostAndNodeModules.
added because of some entity errors.
Definition at line 298 of file hpfc-util.c.
References AddEntityToDeclarations(), AddEntityToModule(), array_distributed_p(), bound_new_host_p(), bound_new_node_p(), entity_undefined, host_module, load_new_host(), load_new_node(), node_module, store_new_host(), store_new_host_variable(), store_new_node(), and store_new_node_variable().
Referenced by generate_parallel_body(), generate_read_of_ref_for_all(), generate_read_of_ref_for_computer(), generate_update_distributed_value_from_host(), and init_host_and_node_entities().
bool alignments_compatible_p(entity e1, int dim1, entity e2, int dim2)
what: whether e1 and e2 dimensions dim1 and dim2 are aligned. how: basic low level comparison input: entities and dimension numbers output: the bool result side effects:
e1 | 1 |
dim1 | im1 |
e2 | 2 |
dim2 | im2 |
Definition at line 678 of file hpfc-util.c.
References get_alignment().
Referenced by references_aligned_p().
list DistArraysEffects | ( | expression | expr | ) |
effects' action in an expression are here supposed to be read one's but that may not be correct?
expr | xpr |
Definition at line 241 of file hpfc-util.c.
References array_distributed_p(), CONS, EFFECT, effect_variable, FOREACH, gen_free_list(), NIL, proper_effects_of_expression(), and store_effect_p().
Referenced by written_effects_to_dist_arrays_p().
array | rray |
dim | im |
pprocdim | procdim |
Definition at line 472 of file hpfc-util.c.
References alignment_templatedim, array, array_to_template, distribute_distribution, distribution_parameter, FindArrayDimAlignmentOfArray, FindDistributionOfDim(), HpfcExpressionToInt(), and load_hpf_distribution().
Referenced by generate_one_message(), message_manageable_p(), shape_one_message(), and template_cell_local_mapping().
bool references_aligned_p(reference r1, reference r2)
what: tells whether the references are aligned or not how: quite basic and low level input: both references output: the returned boolean side effects:
le | of expression |
Definition at line 706 of file hpfc-util.c.
References EXPRESSION, expression_reference_p(), expression_syntax, MAP, reference_variable, and syntax_reference.
Referenced by references_aligned_p().
lal | al |
dim | im |
Definition at line 377 of file hpfc-util.c.
References ALIGNMENT, alignment_arraydim, alignment_undefined, CAR, ENDP, NIL, and POP.
Referenced by ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), expr_compute_local_index(), ith_dim_distributed_p(), ith_dim_overlapable_p(), and template_dimension_of_array_dimension().
lal | al |
dim | im |
Definition at line 389 of file hpfc-util.c.
References ALIGNMENT, alignment_templatedim, alignment_undefined, CAR, ENDP, and POP.
Referenced by array_distribution_similar_p(), array_ranges_to_template_ranges(), create_init_common_param_for_arrays(), get_alignment(), hpfc_compute_align_constraints(), hpfc_compute_unicity_constraints(), and processors_dim_replicated_p().
distribution FindDistributionOfDim | ( | list | ldi, |
int | dim, | ||
int * | pdim | ||
) |
ldi | di |
dim | im |
pdim | dim |
Definition at line 401 of file hpfc-util.c.
References CAR, DISTRIBUTION, distribution_style, gen_length(), pips_assert, POP, and style_none_p.
Referenced by ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), DistributionParameterOfArrayDim(), expr_compute_local_index(), get_distribution(), ith_dim_distributed_p(), ith_dim_overlapable_p(), and processor_number().
distribution FindDistributionOfProcessorDim | ( | list | ldi, |
int | dim, | ||
int * | tdim | ||
) |
ldi | di |
dim | im |
tdim | dim |
Definition at line 421 of file hpfc-util.c.
References DISTRIBUTION, distribution_style, distribution_undefined, MAP, pips_internal_error, and style_none_p.
Referenced by array_distribution_similar_p(), hpfc_compute_distribute_constraints(), processors_dim_replicated_p(), and template_ranges_to_processors_ranges().
list FindRefToDistArray | ( | void * | obj | ) |
obj | bj |
Definition at line 282 of file hpfc-util.c.
References FindRefToDistArray_syntax_rewrite(), found_syntaxes, gen_multi_recurse(), gen_true(), NIL, and syntax_domain.
Referenced by FindRefToDistArrayFromList(), FindRefToDistArrayInStatement_call_filter(), FindRefToDistArrayInStatement_expression_filter(), generate_c1_alpha(), and ref_to_dist_array_p().
|
static |
Definition at line 272 of file hpfc-util.c.
References array_distributed_p(), CONS, found_syntaxes, reference_variable, SYNTAX, syntax_reference, and syntax_reference_p.
Referenced by FindRefToDistArray().
FindRefToDistArrayFromList.
these functions compute the list of syntax that are references to a distributed variable.
lexpr | expr |
Definition at line 262 of file hpfc-util.c.
References EXPRESSION, FindRefToDistArray(), gen_nconc(), MAP, and NIL.
Referenced by generate_c1_beta().
a nicer interface to extract the needed information. FC 29/03/94
replication
array | rray |
dim | im |
ptdim | tdim |
pa | a |
pb | b |
Definition at line 606 of file hpfc-util.c.
References align_alignment, alignment_constant, alignment_rate, alignment_undefined, array, array_distributed_p(), FindAlignmentOfTemplateDim(), HpfcExpressionToInt(), load_hpf_alignment(), pips_assert, and template_dimension_of_array_dimension().
Referenced by alignments_compatible_p(), and hpfc_compute_entity_to_new_declaration().
template | emplate |
dim | im |
ppdim | pdim |
pn | n |
Definition at line 638 of file hpfc-util.c.
References distribute_distribution, distribution_parameter, distribution_undefined_p, FindDistributionOfDim(), HpfcExpressionToInt(), and load_hpf_distribution().
Referenced by hpfc_compute_entity_to_new_declaration(), and processor_dimension_of_template_dimension().
dim | im |
plow | low |
pup | up |
Definition at line 651 of file hpfc-util.c.
References dimension_lower, dimension_undefined, dimension_upper, entity_ith_dimension(), entity_variable_p, ExpressionToInt(), and pips_assert.
Referenced by conformant_entities_p(), extract_the_align(), full_linearization(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_lid(), partial_linearization(), and safe_static_domain_bound().
int global_array_cell_to_local_array_cell(array, dim, acell)
??? not enough general a function
array | rray |
dim | im |
acell | cell |
Definition at line 550 of file hpfc-util.c.
References alignment_constant, alignment_rate, alignment_undefined, array, FindArrayDimAlignmentOfArray, HpfcExpressionToInt(), pips_assert, and template_cell_local_mapping().
Referenced by shape_one_message().
void hpfc_util_error_handler | ( | void | ) |
removes IF (.TRUE.) THEN and DO X=n, n
Definition at line 785 of file hpfc-util.c.
Referenced by hpfc_error_handler().
int HpfcExpressionToInt | ( | expression | e | ) |
HpfcExpressionToInt(e)
uses the normalized value if possible.
just to avoid a gcc warning
Definition at line 569 of file hpfc-util.c.
References expression_integer_value(), expression_normalized, ifdebug, intptr_t, normalized_linear, normalized_linear_p, normalized_undefined, pips_internal_error, print_expression(), TCST, VALUE_TO_INT, vect_coeff(), and vect_size().
Referenced by align_check(), array_access_to_array_ranges(), array_ranges_to_template_ranges(), complementary_range(), compute_receive_content(), compute_receive_domain(), ComputeNewSizeOfIthDimension(), create_init_common_param_for_arrays(), create_init_common_param_for_processors(), create_init_common_param_for_templates(), create_parameters_h(), DistributionParameterOfArrayDim(), expr_compute_local_index(), generate_one_message(), get_alignment(), get_distribution(), get_ith_dim_new_declaration(), global_array_cell_to_local_array_cell(), handle_set_directive(), hpfc_compute_align_constraints(), hpfc_compute_distribute_constraints(), hpfc_compute_unicity_constraints(), loop_filter(), make_guard_expression(), NormalizeOneTemplateDistribution(), overlap_redefine_expression(), processor_number(), same_alignment_p(), shape_one_message(), simple_indices_p(), template_cell_local_mapping(), and template_ranges_to_processors_ranges().
whether a dimension is distributed or not.
array | rray |
pprocdim | procdim |
Definition at line 160 of file hpfc-util.c.
References align_alignment, align_template, alignment_templatedim, alignment_undefined_p, array, distribute_distribution, distribution_style, FindAlignmentOfDim(), FindDistributionOfDim(), load_hpf_alignment(), load_hpf_distribution(), and style_none_p.
Referenced by align_check(), atomize_one_message(), compute_receive_content(), generate_optimized_code_for_loop_nest(), loop_flt(), NewDeclarationOfDistributedArray(), number_of_distributed_dimensions(), shape_one_message(), simple_indices_p(), and subarray_shift_assignment_p().
array | rray |
Definition at line 178 of file hpfc-util.c.
References align_alignment, align_template, alignment_templatedim, alignment_undefined_p, array, distribute_distribution, distribution_style, FindAlignmentOfDim(), FindDistributionOfDim(), load_hpf_alignment(), load_hpf_distribution(), and style_block_p.
Referenced by add_bound_arguments(), caller_list_of_bounds(), create_parameters_h(), and declaration_with_overlaps().
bool ith_dim_replicated_p(template, i, la, dist)
true if template dimension i distributed with dist leads to a replication for array align al.
select the relevent alignment if exists. could be some kind of gen_find_if()...
Definition at line 125 of file hpfc-util.c.
References ALIGNMENT, alignment_templatedim, distribution_style, MAP, and style_none_p.
Referenced by replicated_p().
void kill_statement_number_and_ordering | ( | statement | s | ) |
Definition at line 232 of file hpfc-util.c.
References gen_recurse, gen_true(), statement_domain, and stmt_rwt().
Referenced by compile_module().
|
static |
instruction i = statement_instruction(s);
Do not forget to move forbidden information associated with block:
free_instruction(i);
??? memory leak, cores on AIX
Definition at line 822 of file hpfc-util.c.
References CONS, copy_expression(), current_stmt_head, entity_name, entity_to_expression(), expression_equal_p(), fix_sequence_statement_attributes(), loop_body, loop_index, loop_range, make_assign_statement(), make_instruction_block(), NIL, pips_debug, range_lower, range_upper, STATEMENT, statement_instruction, and statement_undefined.
Referenced by statement_structural_cleaning().
creates a new statement for the given module that looks like the stat one, i.e.
same comment, same label, and so on. The goto table is updated. The instruction is also created. (is that really a good idea?)
stat | tat |
the_tag | he_tag |
Definition at line 203 of file hpfc-util.c.
References copy_extensions(), fix_statement_attributes_if_sequence(), is_instruction_sequence, loop_undefined, make_instruction(), make_sequence(), make_statement(), make_synchronization_none(), NIL, statement_comments, statement_extensions, statement_label, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, strdup(), string_undefined_p, and x.
Referenced by hpf_compile_block(), hpf_compile_call(), hpf_compile_parallel_loop(), hpf_compile_sequential_loop(), hpf_compile_test(), and hpf_compile_unstructured().
template | emplate |
dim | im |
Definition at line 462 of file hpfc-util.c.
References get_distribution().
int processor_number(template, tdim, tcell, pprocdim)
the processor number of a template cell, on dimension *pprocdim template dimension, template cell
just to avoid a gcc warning
template | emplate |
tdim | dim |
tcell | cell |
pprocdim | procdim |
Definition at line 492 of file hpfc-util.c.
References dimension_lower, distribute_distribution, distribute_processors, distribution_parameter, distribution_style, FindDistributionOfDim(), FindIthDimension(), HpfcExpressionToInt(), load_hpf_distribution(), SizeOfIthDimension(), style_block_p, style_cyclic_p, and style_none_p.
Referenced by aligned_p(), on_same_proc_p(), and template_ranges_to_processors_ranges().
true if array a is replicated on processors p i-th dimension.
Definition at line 143 of file hpfc-util.c.
References align_alignment, align_template, alignment_undefined_p, distribute_distribution, distribution_style, FindAlignmentOfTemplateDim(), FindDistributionOfProcessorDim(), load_hpf_alignment(), load_hpf_distribution(), and style_none_p.
Referenced by hpfc_broadcast_buffers(), hpfc_compute_lid(), partial_linearization(), and remapping_variables().
bool ref_to_dist_array_p | ( | void * | obj | ) |
this file describe a few functions usefull to the compiler to manage the hpfc data structures.
Fabien Coelho, May 1993. Predicates true if there is a reference to a distributed array within obj
??? not very intelligent, should use the regions, the problem is that I should normalize the code before the pips analysis...
obj | bj |
Definition at line 48 of file hpfc-util.c.
References FindRefToDistArray(), gen_free_list(), and NIL.
Referenced by call_filter(), hpf_compile_call(), and test_atomization().
of expression
both references must be aligned to the same template and be of the same arity.
r1 | 1 |
r2 | 2 |
Definition at line 726 of file hpfc-util.c.
References align_template, alignments_compatible_p(), array_distributed_p(), EXPRESSION, expression_number_for_index(), expression_reference_p(), expression_syntax, gen_length(), load_hpf_alignment(), MAP, reference_indices, reference_variable, syntax_reference, and XDEBUG.
Referenced by full_copy_p().
replicated_p
check whether the distributed array e is replicated or not.
Definition at line 96 of file hpfc-util.c.
References align_alignment, align_template, array_distributed_p(), CAR, distribute_distribution, DISTRIBUTION, ith_dim_replicated_p(), load_hpf_alignment(), load_hpf_distribution(), NumberOfDimension(), pips_assert, and POP.
Referenced by generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), hpfc_broadcast_buffers(), if_different_pe_and_not_twin(), io_efficient_compile(), Overlap_Analysis(), st_receive_from(), st_send_to_computer_if_necessary(), and st_send_to_host_and_nodes().
void statement_structural_cleaning | ( | statement | s | ) |
Definition at line 847 of file hpfc-util.c.
References gen_multi_recurse(), gen_true(), loop_domain, loop_rewrite(), statement_domain, test_domain, and test_rewrite().
Referenced by compile_module().
|
static |
Definition at line 225 of file hpfc-util.c.
References statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, and STATEMENT_ORDERING_UNDEFINED.
Referenced by kill_statement_number_and_ordering().
int template_cell_local_mapping(array, dim, tc)
??? should check that it is indeed block distributed ! or should implement all the formulas...
array | rray |
dim | im |
tc | c |
Definition at line 532 of file hpfc-util.c.
References alignment_templatedim, array, array_to_template, dimension_lower, DistributionParameterOfArrayDim(), FindArrayDimAlignmentOfArray, FindIthDimension(), HpfcExpressionToInt(), and tc.
Referenced by generate_one_message(), global_array_cell_to_local_array_cell(), and update_indices_for_local_computation().
array | rray |
dim | im |
Definition at line 448 of file hpfc-util.c.
References align_alignment, alignment_templatedim, alignment_undefined, array, FindAlignmentOfDim(), and load_hpf_alignment().
Referenced by aligned_p(), get_alignment(), and message_manageable_p().
|
static |
instruction i = statement_instruction(s);
Fix attributes if it is a sequence:
free_instruction(i);
???
instruction i = statement_instruction(s);
Fix attributes if it is a sequence:
free_instruction(i);
???
Definition at line 790 of file hpfc-util.c.
References current_stmt_head, ENTITY_FALSE_P, ENTITY_TRUE_P, expression_to_entity(), fix_statement_attributes_if_sequence(), instruction_undefined, pips_debug, statement_instruction, test_condition, test_false, and test_true.
Referenced by statement_structural_cleaning().
written_effects_to_dist_arrays_p
var | ar |
le | e |
Definition at line 58 of file hpfc-util.c.
References action_write_p, EFFECT, effect_action, effect_any_reference, FOREACH, reference_variable, and store_effect_p().
Referenced by locally_constant_vector_p().
bool written_effects_to_dist_arrays_p | ( | expression | expr | ) |
expr | xpr |
Definition at line 73 of file hpfc-util.c.
References action_write_p, CAR, DistArraysEffects(), EFFECT, effect_action, ENDP, gen_free_list(), POP, and store_effect_p().
Definition at line 270 of file hpfc-util.c.
Referenced by FindRefToDistArray(), and FindRefToDistArray_syntax_rewrite().