PIPS
|
#include "defines-local.h"
#include "conversion.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
Go to the source code of this file.
Data Structures | |
struct | t_reduction |
Macros | |
#define | MAX_REDUCTION 1 |
HPFC module, Fabien Coelho, May 1993. More... | |
#define | MIN_REDUCTION 2 |
#define | SUM_REDUCTION 3 |
#define | expression_complex_p(e) (normalized_complex_p(expression_normalized(e))) |
bool subarray_shift_p(s, pe, plvect) statement s; entity *pe; list *plvect; More... | |
#define | XDEBUG(msg) pips_debug(6, "statement %p: " msg "\n", (void*) s) |
bool full_copy_p(statement s, reference * pleft, reference * pright) More... | |
Typedefs | |
typedef struct t_reduction | t_reduction |
Variables | |
static t_reduction | all_reductions [] |
static entity | searched_variable |
hpfc_reductions = initial:entity x replacement:entity x operator:reduction ; reduction = { min , max , sum , prod , and , or } ; More... | |
static tag | found_operator |
static bool | subarray_shift_ok = true |
some static variables used for the detection... More... | |
static entity | array = entity_undefined |
static list | current_regions = NIL |
static list | lvect = NIL |
static statement | simple_found |
tests whether a loop nest is a full copy loop nest, i.e. More... | |
static bool | ok |
#define expression_complex_p | ( | e | ) | (normalized_complex_p(expression_normalized(e))) |
bool subarray_shift_p(s, pe, plvect) statement s; entity *pe; list *plvect;
checks whether a loop nest is a subarray shift, that is a parallel loop nest with one assign in the body which is a 1D shift of a locally constant value. returns false if this dimension is not distributed, because the overlap analysis will make a better job. should also check that the accessed subarray is a section. and that it is a block distribution. ??? should also check for a 1 alignment
the entity returned *pe is the shifted array the list returned is the list of the vector shifts for each dimension
Definition at line 379 of file special_cases.c.
#define MAX_REDUCTION 1 |
HPFC module, Fabien Coelho, May 1993.
Definition at line 39 of file special_cases.c.
#define MIN_REDUCTION 2 |
Definition at line 40 of file special_cases.c.
#define SUM_REDUCTION 3 |
Definition at line 41 of file special_cases.c.
#define XDEBUG | ( | msg | ) | pips_debug(6, "statement %p: " msg "\n", (void*) s) |
bool full_copy_p(statement s, reference * pleft, reference * pright)
what: tells whether a loop nest is a 'full copy' one, that is it fully define an array from another, with perfect alignment. how: pattern matching of what we are looking for... input: the statement output: the bool result, plus both references. side effects:
Definition at line 857 of file special_cases.c.
typedef struct t_reduction t_reduction |
else: private variable assigned in a parallel loop, ok?!
Definition at line 505 of file special_cases.c.
References array, call_function, ENTITY_ASSIGN_P, ENTITY_CONTINUE_P, entity_name, entity_undefined_p, pips_debug, ref_to_dist_array_p(), subarray_shift_assignment_p(), and subarray_shift_ok.
Referenced by subarray_shift_p().
Definition at line 87 of file special_cases.c.
References call_function, and hpfc_entity_reduction_p().
Referenced by compile_reduction(), and hpf_compile_call().
Definition at line 525 of file special_cases.c.
References subarray_shift_ok.
Referenced by subarray_shift_p().
Definition at line 718 of file special_cases.c.
References call_function, CONTINUE_FUNCTION_NAME, current_stmt_head, entity_local_name(), gen_recurse_stop(), ok, same_string_p, and simple_found.
Referenced by simple_statement().
of statement
of statement
lr | of hpfc_reductions |
prolog | rolog |
host | ost |
Definition at line 347 of file special_cases.c.
References compile_one_reduction(), CONS, HPFC_REDUCTIONS, MAP, NIL, and STATEMENT.
Referenced by hpf_compiler().
|
static |
Definition at line 327 of file special_cases.c.
References call_to_statement, CONS, element_number(), entity_basic(), entity_to_expression(), entity_type, EXPRESSION, hpfc_reductions_initial, hpfc_reductions_operator, int_to_expression(), make_call(), make_new_reduction_function(), NIL, type_variable, variable_basic, and variable_dimensions.
Referenced by compile_hpf_reduction().
bool compile_reduction(initial, phost, pnode)
true is the compiler succeeded in compiling the reduction that way. ??? many conditions are not yet checked...
initial | nitial |
phost | host |
pnode | node |
Definition at line 148 of file special_cases.c.
References array, array_distributed_p(), array_lower_upper_bounds_list(), call_arguments, call_function, call_reduction_p(), CAR, CDR, CONS, copy_expression(), ENTITY_ASSIGN_P, entity_name, entity_to_expression(), EXPRESSION, expression_syntax, gen_length(), gen_nconc(), instruction_call, instruction_call_p, int_to_expression(), t_reduction::kind, load_hpf_number(), make_assign_statement(), make_call_expression(), make_reduction_function(), NIL, pips_assert, pips_debug, reduction_parameters(), ref, reference_variable, statement_instruction, syntax_call, syntax_call_p, syntax_reference, and syntax_reference_p.
Referenced by hpf_compile_call().
bool full_define_p (reference r, list ll)
what: true if the loop nest ll fully scans r how: not very beautiful. input: r and ll output: the bool result side effects: none bugs or features:
if not found
ll | of loops |
Definition at line 765 of file special_cases.c.
References LOOP, loop_index, and MAP.
Referenced by full_define_p().
|
static |
static t_reduction *find_reduction(c)
look for the presence of the reduction in the reduction list.
Definition at line 67 of file special_cases.c.
References all_reductions, t_reduction::kind, t_reduction::name, and same_string_p.
Referenced by hpfc_entity_reduction_p(), and reduction_parameters().
void free_vector_list | ( | list | l | ) |
Definition at line 382 of file special_cases.c.
References gen_free_list(), gen_map(), and vect_rm().
Referenced by generate_subarray_shift(), subarray_shift_assignment_p(), and subarray_shift_p().
of lists
of loops
of expressions
the loop nest must be perfect... !!! should check for continues?
the body must be a simple assignment
compatible arities
number of enclosing loops
the lhs should be fully defined by the loop nest... but it does not matter for the rhs!
both lhs and rhs references must be aligned
??? should check the new declarations...
pleft | left |
pright | right |
Definition at line 869 of file special_cases.c.
References call_arguments, CAR, CDR, CONSP, DEBUG_STAT, EXPRESSION, expression_reference(), expression_reference_p(), full_define_p(), gen_free_list(), gen_length(), instruction_assign_p(), instruction_call, int, NIL, number_of_non_empty_statements(), parallel_loop_nest_to_body(), pips_assert, POP, reference_indices, references_aligned_p(), simple, simple_statement(), statement_instruction, and XDEBUG.
Referenced by hpf_compile_loop().
of expression
of dimension
of entity
checks that the indices are simply the loop indexes, and that the whole dimension is scanned. Also avoids (i,i)...
checks that the loop range scans the whole dimension
increment must be 1. lowers and uppers must be equal.
ll | of loops |
Definition at line 771 of file special_cases.c.
References array, CAR, CONS, DIMENSION, dimension_lower, dimension_upper, ENTITY, entity_name, entity_type, entity_variable_p, EXPRESSION, expression_syntax, find_loop(), gen_free_list(), gen_in_list_p(), gen_length(), integer_constant_expression_p(), integer_constant_expression_value(), loop_range, NIL, pips_assert, pips_debug, POP, range_increment, range_lower, range_upper, reference_indices, reference_variable, same_expression_p(), syntax_reference, syntax_reference_p, type_variable, and variable_dimensions.
Referenced by full_copy_p().
statement generate_full_copy(reference left, reference right)
what: copies directly right into left, that must conform... how: direct loop nest on local data input: both entities output: the returned statement side effects: bugs or features:
of entity
of dimension
indexes are reused. bounds are taken from the node entity declaration.
left | eft |
right | ight |
Definition at line 964 of file special_cases.c.
References array, CAR, copy_expression(), copy_reference(), DIMENSION, dimension_lower, dimension_upper, ENTITY, entity_empty_label(), entity_type, expressions_to_entities(), gen_free_list(), gen_length(), int_to_expression(), is_execution_sequential, load_new_node(), loop_to_statement, make_assign_statement(), make_execution(), make_loop(), make_range(), NIL, POP, reference_indices, reference_to_expression(), reference_variable, type_variable, UU, and variable_dimensions.
Referenced by hpf_compile_loop().
statement generate_subarray_shift(s, var, lshift) statement s; entity var; list lshift;
generates a call to the runtime library shift subroutine for the given array, the given shift and the corresponding region in statement s. this function assumes that subarray_shift_p was true on s, and does not checks the conditions again.
gets the shifted dimension and the shift
all the arguments
var | ar |
lshift | shift |
Definition at line 643 of file special_cases.c.
References array, array_lower_upper_bounds_list(), CAR, CONS, entity_to_expression(), EXPRESSION, expression_undefined, free_vector_list(), gen_nconc(), hpfc_make_call_statement(), int_to_expression(), load_hpf_number(), make_rectangular_area(), make_shift_subroutine(), make_vecteur_expression(), MAPL, pips_assert, PVECTOR, and vecteur_nul_p().
Referenced by hpf_compile_loop().
|
static |
Definition at line 248 of file special_cases.c.
References call_domain, found_operator, gen_multi_recurse(), gen_null(), make_reduction_operator(), pips_assert, ref_filter(), reference_domain, searched_variable, tag_undefined, and UU.
Referenced by reduction_of_in().
le | e |
var | ar |
Definition at line 584 of file special_cases.c.
References action_read_p, EFFECT, effect_action, effect_any_reference, effect_system, MAP, and reference_variable.
Referenced by make_rectangular_area().
of hpfc_reductions
of hpfc_reductions
Definition at line 274 of file special_cases.c.
References CONS, entities_list, ENTITY, HPFC_REDUCTIONS, load_hpf_reductions(), MAP, NIL, and reduction_of_in().
Referenced by hpf_compiler().
bool call_reduction_p(c)
true if a given call is a call to reduction function. ??? a generic function name should be managed here?
Definition at line 82 of file special_cases.c.
References find_reduction(), and module_local_name().
Referenced by call_reduction_p(), hpfc_compile(), and hpfc_directives_handler().
void hpfc_special_cases_error_handler | ( | void | ) |
Definition at line 705 of file special_cases.c.
Referenced by hpfc_error_handler().
Definition at line 395 of file special_cases.c.
References current_regions, Svecteur::succ, TCST, var_of, and written_effect_p().
Referenced by subarray_shift_assignment_p().
Definition at line 499 of file special_cases.c.
References HpfcExpressionToInt(), loop_range, range_increment, and subarray_shift_ok.
Referenced by subarray_shift_p().
|
static |
name is {H,N}{PRE,POST}_{SUM,PROD,MIN,...}_{REAL4,INTERGER4,...}
Definition at line 311 of file special_cases.c.
References base, buffer, concatenate(), MakeRunTimeSupportSubroutine(), new_reduction_name(), and pvm_what_options().
Referenced by compile_one_reduction().
st | t |
var | ar |
Definition at line 597 of file special_cases.c.
References CONS, constraints_for_bounds(), constraints_to_loop_bound(), CONTRAINTE_UNDEFINED, contraintes_free(), entity_type, EXPRESSION, gen_length(), get_ith_region_dummy(), get_read_effect_area(), hpfc_name_to_entity(), IDIVIDE, load_statement_local_regions(), NIL, sc_dup(), sc_rm(), sc_transform_eg_in_ineg(), type_variable, and variable_dimensions.
Referenced by generate_subarray_shift().
|
static |
find or create an entity for the reduction function...
Definition at line 128 of file special_cases.c.
References base, basic_tag, buffer, MakeRunTimeSupportFunction(), prefix, pvm_what_options(), and reduction_name().
Referenced by compile_reduction().
generates the needed subroutine
Definition at line 565 of file special_cases.c.
References buffer, entity_type, entity_undefined_p, gen_length(), MakeRunTimeSupportSubroutine(), pips_assert, pvm_what_options(), type_variable, type_variable_p, variable_basic, and variable_dimensions.
Referenced by generate_subarray_shift().
|
static |
for reduction directive:
Definition at line 287 of file special_cases.c.
References pips_internal_error, reduction_operator_and_p, reduction_operator_max_p, reduction_operator_min_p, reduction_operator_or_p, reduction_operator_prod_p, reduction_operator_sum_p, and reduction_operator_tag.
Referenced by make_new_reduction_function().
Definition at line 711 of file special_cases.c.
References gen_recurse_stop(), and ok.
Referenced by simple_statement().
ls | of statement |
Definition at line 861 of file special_cases.c.
References empty_code_p(), MAP, and STATEMENT.
Referenced by full_copy_p().
|
static |
Definition at line 117 of file special_cases.c.
References pips_assert.
Referenced by make_reduction_function(), and translate_reduction().
|
static |
finally, I can do without replacement: the host keeps and contributes the initial value!
Definition at line 266 of file special_cases.c.
References entity_name, entity_undefined, get_operator(), make_hpfc_reductions(), and pips_debug.
Referenced by handle_hpf_reduction().
|
static |
Definition at line 97 of file special_cases.c.
References call_arguments, call_function, CAR, CDR, entity_basic(), EXPRESSION, expression_syntax, find_reduction(), module_local_name(), NumberOfDimension(), pips_assert, pl, reference_variable, syntax_reference, and syntax_reference_p.
Referenced by compile_reduction().
get the call just above – well, what about intermediate casts ???
Definition at line 223 of file special_cases.c.
References call_function, ENTITY_AND_P, ENTITY_MAX0_P, ENTITY_MAX_P, ENTITY_MIN0_P, ENTITY_MIN_P, ENTITY_MINUS_P, ENTITY_MULTIPLY_P, ENTITY_OR_P, ENTITY_PLUS_P, found_operator, is_reduction_operator_and, is_reduction_operator_max, is_reduction_operator_min, is_reduction_operator_or, is_reduction_operator_prod, is_reduction_operator_sum, reference_variable, and searched_variable.
Referenced by get_operator().
Definition at line 735 of file special_cases.c.
References call_domain, check_simple(), expression_domain, gen_false(), gen_multi_recurse(), gen_null(), loop_domain, not_simple(), ok, simple_found, statement_domain, and test_domain.
Referenced by full_copy_p().
LHS must be a reference
is RHS a reference?
same array, and a block-distributed one ?
compute the difference of every indices, if possible.
else compute the difference
now checks for a constant shift on a distributed dimension and that's all. ??? I could deal with other constant shifts on non distributed dims
else the vector is not null
Definition at line 405 of file special_cases.c.
References array, array_distributed_p(), block_distributed_p(), call_arguments, CAR, CDR, CONS, ENDP, entity_local_name(), EXPRESSION, expression_complex_p, expression_normalized, expression_reference_p(), expression_syntax, free_vector_list(), gen_length(), gen_nreverse(), ith_dim_distributed_p(), locally_constant_vector_p(), lvect, MAPL, NIL, normalized_linear, pips_assert, pips_debug, PVECTOR, reference_indices, reference_variable, syntax_reference, vect_substract(), vecteur_nul_p(), and VECTOR.
Referenced by call_filter().
pe | e |
plvect | lvect |
Definition at line 530 of file special_cases.c.
References array, call_domain, call_filter(), cannot_be_a_shift(), current_regions, DEBUG_STAT, entity_undefined, entity_undefined_p, expression_domain, free_vector_list(), gen_false(), gen_multi_recurse(), gen_null(), load_statement_local_regions(), loop_domain, loop_filter(), lvect, NIL, pips_debug, rectangular_must_region_p(), subarray_shift_ok, and test_domain.
Referenced by hpf_compile_loop().
|
static |
Definition at line 50 of file special_cases.c.
Referenced by find_reduction().
|
static |
Definition at line 392 of file special_cases.c.
Referenced by add_declaration_to_host_and_link(), add_one_bound_argument(), alive_arrays(), argument_bound_entity(), array_access_to_array_ranges(), array_as_template(), array_bounds_list(), array_lower_upper_bounds_list(), array_must_fully_written_by_regions_p(), array_ranges_to_template_ranges(), array_synonym_aligned_as(), atomize_one_message(), block_distributed_p(), bound_parameter_name(), buffer_full_condition(), build_call_STEP_AllToAll(), build_call_STEP_init_regionArray(), call_filter(), clean_distributed_io_system(), clean_shared_io_system(), compile_reduction(), complementary_range(), compute_receive_content(), ComputeNewSizeOfIthDimension(), continue_propagation_p(), create_bound_entity(), create_init_common_param_for_arrays(), create_parameters_h(), deal_with_similars(), dims_array_init(), DistributionParameterOfArrayDim(), entity_to_new_declaration(), eov_add_entity_to_eliminate(), eov_get_replaced_enity(), expr_compute_local_index(), extract_the_align(), full_define_p(), generate_all_liveness_but(), generate_call_set_regionarray(), generate_call_stepalltoall(), generate_compute_local_indices(), generate_distributed_io_system(), generate_dynamic_liveness_for_primary(), generate_dynamic_liveness_management(), generate_full_copy(), generate_get_value_locally(), generate_io_collect_or_update(), generate_io_statements_for_shared_arrays(), generate_io_system(), generate_message_from_3_lists(), generate_one_message(), generate_optimized_code_for_loop_nest(), generate_receive_from_computer(), generate_send_to_computer(), generate_shared_io_system(), generate_subarray_shift(), generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), generate_update_values_on_nodes(), GENERATION(), get_alignment(), get_help_topic(), get_help_topics(), get_ith_dim_new_declaration(), global_array_cell_to_local_array_cell(), handle_prescriptive_directive(), hpfc_array_bound(), hpfc_broadcast_if_necessary(), hpfc_buffer_entity(), hpfc_buffer_packing(), hpfc_buffer_reference(), hpfc_check_for_similarities(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_lid(), hpfc_hcast(), hpfc_hmessage(), hpfc_init_dummy_to_prime(), hpfc_lazy_buffer_packing(), hpfc_lazy_packing(), hpfc_nrecv(), hpfc_nsend(), hpfc_packing_of_current__buffer(), hpfc_unstutter_dummies(), initial_alignment(), io_efficient_compile(), ith_dim_distributed_p(), ith_dim_overlapable_p(), loop_nest_guard(), mchoose(), message_manageable_p(), messages_generation(), new_declaration_tag(), NewDeclarationOfDistributedArray(), NewDeclarationsOfDistributedArrays(), one_align_directive(), one_distribute_directive(), one_message_guards_and_neighbour(), one_receive_message(), Overlap_Analysis(), partial_linearization(), pips_get_fortran_list(), pips_get_workspace_list(), processor_loop(), put_variables_in_ordered_lists(), region_reduction_p(), region_to_statement(), remapping_file_name(), remove_from_entities(), remove_not_remapped_leavings(), root_statement_remapping_inits(), safe_static_domain_bound(), schoose(), set_array_dimension_checked(), set_similar_mappings_for_updates(), shape_one_message(), simple_indices_p(), st_compute_ith_local_index(), st_generate_packing(), st_one_message(), st_send_to_computer_if_necessary(), step_local_regionArray(), store_a_new_declaration(), string_array_join(), subarray_shift_assignment_p(), subarray_shift_p(), template_cell_local_mapping(), template_dimension_of_array_dimension(), top_down_abc_array(), top_down_abc_call(), top_down_abc_dimension(), top_down_abc_flt(), top_down_abc_not_exact_case(), and update_indices_for_local_computation().
Definition at line 393 of file special_cases.c.
Referenced by locally_constant_vector_p(), and subarray_shift_p().
|
static |
Definition at line 221 of file special_cases.c.
Referenced by get_operator(), and ref_filter().
Definition at line 393 of file special_cases.c.
Referenced by constraint_to_bound(), Overlap_Analysis(), subarray_shift_assignment_p(), subarray_shift_p(), and system_new_var_subst().
|
static |
Definition at line 702 of file special_cases.c.
Referenced by adg_suppress_2nd_in_1st_ps(), align_check(), capply(), check_C_function_type(), check_call_mode_consistency(), check_call_types_compatibility(), check_common_inclusion(), check_simple(), check_the_reference(), compact_phi_functions(), comparable_entity_in_list_p(), control_type_in_expression(), cool_enough_for_a_last_substitution(), db_create_workspace(), db_module_exists_p(), db_open_workspace(), db_set_current_module_name(), do_array_expansion(), find_bd_reference(), handle_file_name(), handle_include_file(), internal_sc_feasibility(), load_meta_data(), main(), make_text_resource_and_free(), MakeFortranType(), normalizable_loop_p_retrieved(), not_simple(), number_of_elements(), number_of_items(), NumberOfElements(), partial_eval_min_or_max_operator(), pips_process_file(), print_initial_precondition(), print_points_to_graph(), print_program_precondition(), safe_concurrent_apply(), sc_feasibility_ofl_ctrl(), sc_fourier_motzkin_feasibility_ofl_ctrl_timeout_ctrl(), sc_janus_feasibility(), sc_janus_feasibility_ofl_ctrl_timeout_ctrl(), sc_simplexe_feasibility_ofl_ctrl_timeout_ctrl(), signed_constant_expression_p(), simple_statement(), SizeOfArray(), subscripted_field_list_to_type(), suppress_sc_in_sc(), terapix_gram_allocate(), test_run_time_communications(), TestDependence(), and ValueSizeOfDimension().
|
static |
hpfc_reductions = initial:entity x replacement:entity x operator:reduction ; reduction = { min , max , sum , prod , and , or } ;
looking for the reduction operator is a basic recursion. no check.
Definition at line 220 of file special_cases.c.
Referenced by get_operator(), and ref_filter().
|
static |
tests whether a loop nest is a full copy loop nest, i.e.
it copies an array into another, both being aligned. ??? it should share some code with the subarray shift detection... ??? another quick hack for testing purposes (remappings). statement simple_statement(statement s)
what: tells whether s is (after simplification) a simple statement, i.e. a call, and returns it (may be hidden by blocks and continues). how: recursion thru the IR. input: statement s output: returned statement, or NULL if not simple... side effects:
Definition at line 701 of file special_cases.c.
Referenced by check_simple(), and simple_statement().
some static variables used for the detection...
Definition at line 391 of file special_cases.c.
Referenced by call_filter(), cannot_be_a_shift(), loop_filter(), and subarray_shift_p().