PIPS
|
#include "defines-local.h"
#include "prettyprint.h"
#include "access_description.h"
#include "effects-generic.h"
Go to the source code of this file.
Macros | |
#define | RETURN(x) |
must clear everything before returning in Overlap_Analysis... More... | |
Functions | |
bool | block_distributed_p (entity array) |
true if there is no cyclic distribution for the array More... | |
static bool | simple_indices_p (reference r) |
true if indices are constants or index More... | |
static bool | aligned_p (reference r1, reference r2, list lvref, list lkref) |
true if references are aligned or, for constants, on the same processor... More... | |
static bool | on_same_proc_p (int t1, int t2, entity template, int dim) |
true if the given template elements on the specified dimension are mapped on the same processor. More... | |
static bool | message_manageable_p (entity array, list lpref, list lkref) |
every thing should be manageable, i.e. More... | |
static statement | statement_compute_bounds (entity newlobnd, entity newupbnd, entity oldidxvl, expression lb, expression ub, int an, int dp) |
generate the call to the dynamic loop bounds computation More... | |
static void | hpfc_overlap_kill_unused_scalars_rewrite (statement stat) |
static bool | hpfc_overlap_kill_unused_scalars (statement stat) |
true if one statement was killed More... | |
static int | which_array_dimension (reference r, entity e) |
returns the dimension of reference on which index entity e is used More... | |
static loop | make_loop_skeleton (entity newindex, expression lower_expression, expression upper_expression) |
static void | update_indices_for_local_computation (entity_mapping new_indexes, list Ref, list lRef) |
static statement | make_increment_statement (entity index) |
static void | variable_used_rewrite (reference r) |
static void | initialize_variable_used_map_for_current_loop_nest (statement inner_body) |
static void | close_variable_used_map_for_statement () |
static bool | variable_used_in_statement_p (entity ent, statement stat) |
static int | number_of_distributed_dimensions (entity a) |
static syntax | choose_one_syntax_in_references_list (list *pls) |
one of the syntax is chosen from the list. More... | |
static statement | make_loop_nest_for_overlap (list lold, list lnew, list lbl, entity_mapping new_indexes, entity_mapping old_indexes, statement innerbody) |
static bool | generate_optimized_code_for_loop_nest (statement innerbody, statement *pstat, syntax the_computer_syntax, list Wa, list Ra, list Ro, list lWa, list lRa, list lRo) |
bool | Overlap_Analysis (statement stat, statement *pstat) |
check conditions and compile... More... | |
Variables | |
static list | lblocks = NIL |
Overlap Analysis Module for HPFC. More... | |
static list | lloop = NIL |
static bool | hpfc_killed_scalar |
To Kill scalar definitions within the generated code recognize if only one reference. More... | |
static statement | current_variable_used_statement = statement_undefined |
bool variable_used_in_statement_p(ent, stat) More... | |
#define RETURN | ( | x | ) |
must clear everything before returning in Overlap_Analysis...
Definition at line 860 of file o-analysis.c.
true if references are aligned or, for constants, on the same processor...
Definition at line 144 of file o-analysis.c.
References access_tag, aligned_constant, aligned_shift, array_to_template, CAR, DELTAV, entity_name, INT, NIL, not_aligned, pips_debug, POP, processor_number(), PVECTOR, reference_variable, template_dimension_of_array_dimension(), TEMPLATEV, TSHIFTV, VALUE_TO_INT, and vect_coeff().
Referenced by Overlap_Analysis().
true if there is no cyclic distribution for the array
distributed && (nd==is_hpf_newdecl_none)) ? ??? the case is not handled later on
array | rray |
Definition at line 44 of file o-analysis.c.
References array, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, new_declaration_tag(), and NumberOfDimension().
Referenced by message_manageable_p(), Overlap_Analysis(), and subarray_shift_assignment_p().
one of the syntax is chosen from the list.
The "larger one". and the list is given back, the chosen syntax as first element.
Definition at line 601 of file o-analysis.c.
References CAR, CDR, CONS, current, debug(), entity_name, gen_free_list(), MAP, NIL, number_of_distributed_dimensions(), reference_variable, SYNTAX, and syntax_reference.
Referenced by Overlap_Analysis().
|
static |
Definition at line 573 of file o-analysis.c.
References current_variable_used_statement, and statement_undefined.
Referenced by generate_optimized_code_for_loop_nest().
|
static |
new bounds to compute, and so on
constant new loop bounds are computed on entry in the subroutine.
??? there is a core dump on the second free, when executed, in test 37~; free_execution(loop_execution(l)); free_loop(l);
and now generates the code...
Definition at line 739 of file o-analysis.c.
References AddEntityToCurrentModule(), array, close_variable_used_map_for_statement(), CONS, copy_expression(), entity_to_expression(), expression_integer_constant_p(), gen_nconc(), hpfc_add_ahead_of_node_code(), hpfc_overlap_kill_unused_scalars(), initialize_variable_used_map_for_current_loop_nest(), is_basic_int, is_execution_sequential, ith_dim_distributed_p(), lblocks, lloop, load_hpf_number(), LOOP, loop_index, loop_label, loop_range, make_block_statement(), MAKE_ENTITY_MAPPING, make_execution(), make_loop(), make_loop_nest_for_overlap(), make_loop_skeleton(), make_new_scalar_variable(), MakeBasic(), MAP, NIL, node_module, range_lower, range_upper, reference_variable, SET_ENTITY_MAPPING, STATEMENT, statement_compute_bounds(), statement_undefined, syntax_reference, update_indices_for_local_computation(), UU, and which_array_dimension().
Referenced by Overlap_Analysis().
true if one statement was killed
Definition at line 350 of file o-analysis.c.
References gen_recurse, gen_true(), hpfc_killed_scalar, hpfc_overlap_kill_unused_scalars_rewrite(), message_assert, and statement_domain.
Referenced by generate_optimized_code_for_loop_nest().
|
static |
??? memory leak
Definition at line 313 of file o-analysis.c.
References assert, call_arguments, CAR, debug(), entity_integer_scalar_p(), entity_name, entity_undefined, EXPRESSION, expression_reference_p(), expression_syntax, expression_undefined, hpfc_killed_scalar, instruction_assign_p(), instruction_call, make_continue_instruction(), reference_variable, statement_instruction, and syntax_reference.
Referenced by hpfc_overlap_kill_unused_scalars().
|
static |
Definition at line 542 of file o-analysis.c.
References CAR, CDR, CONSP, current_variable_used_statement, ENDP, gen_recurse, gen_true(), inner_body, instruction_loop, instruction_loop_p, lblocks, lloop, LOOP, MAP, reference_domain, STATEMENT, statement_instruction, and variable_used_rewrite().
Referenced by generate_optimized_code_for_loop_nest().
Definition at line 507 of file o-analysis.c.
References entity_intrinsic(), entity_to_expression(), int_to_expression(), make_assign_statement(), MakeBinaryCall(), and PLUS_OPERATOR_NAME.
Referenced by make_loop_nest_for_overlap().
|
static |
??? should also look in lbl
if the index value is needed, the increment is added
i = initial_old_value DO i' = ... i = i + 1 body ENDDO
copy the non perfectly nested parts if needed
switch from pre to post.
the swith must have been encountered
Definition at line 639 of file o-analysis.c.
References assert, CAR, CDR, CONS, CONSP, copy_statement(), ENDP, entity_to_expression(), gen_nconc(), gen_nreverse(), GET_ENTITY_MAPPING, HASH_UNDEFINED_VALUE, instruction_loop, instruction_loop_p, instruction_to_statement(), is_instruction_loop, LOOP, loop_body, loop_index, make_assign_statement(), make_block_statement(), make_increment_statement(), make_instruction(), NIL, STATEMENT, statement_instruction, and variable_used_in_statement_p().
Referenced by generate_optimized_code_for_loop_nest().
|
static |
statement is not yet defined
Definition at line 388 of file o-analysis.c.
References entity_empty_label(), int_to_expression(), is_execution_sequential, make_execution(), make_loop(), make_range(), NIL, statement_undefined, and UU.
Referenced by generate_optimized_code_for_loop_nest().
every thing should be manageable, i.e.
??? removed: no star in the dimensions , and the width has to be accepted...
ta==local_star) ||
accepted!
Definition at line 202 of file o-analysis.c.
References abs, access_tag, aligned_constant, aligned_shift, aligned_star, array, array_to_template, block_distributed_p(), CAR, CDR, debug(), DELTAV, DistributionParameterOfArrayDim(), entity_name, INT, NIL, not_aligned, on_same_proc_p(), PVECTOR, set_overlap(), template_dimension_of_array_dimension(), TEMPLATEV, TSHIFTV, VALUE_TO_INT, and vect_coeff().
Referenced by Overlap_Analysis().
Definition at line 587 of file o-analysis.c.
References ith_dim_distributed_p(), and NumberOfDimension().
Referenced by choose_one_syntax_in_references_list().
true if the given template elements on the specified dimension are mapped on the same processor.
Definition at line 187 of file o-analysis.c.
References processor_number().
Referenced by message_manageable_p().
check conditions and compile...
keeps only written references of which dimensions are block distributed, and indices simple enough (=> normalization of loops may be usefull). ??? bug: should also search for A(i,i) things that are forbidden...
ok distributed variable written !
must chose the computer among read references!
??? what about loop splitting
??? memory leak
??? memory leak
Now, we have the following situation: Wa: set of aligned written refs, the first of which is `‘the’' ref.
here is the situation now:
Wa set of aligned references written, Ra set of aligned references read, Ro set of nearly aligned references that suits the overlap analysis
messages handling
generate the local loop for every processor, given the global loop bounds. The former indexes have to be computed, and the loops are based upon new indexes, of which names have to be propagated in the body of the loop. This generation is to be based on the normalized form computed for every references of Ro, but it is direct for Ra and Wa, since new declarations implied that the alignment is performed for distributed indices. Not distributed dimensions indices have not to be touched, (at least if no new declarations are the common case)
stat | tat |
pstat | stat |
Definition at line 870 of file o-analysis.c.
References align_check(), aligned_p(), array, block_distributed_p(), CAR, CDR, choose_one_syntax_in_references_list(), CONS, CONSP, debug(), DEBUG_STAT, entity_empty_label(), entity_name, FindRefToDistArrayInStatement(), fprintf(), gen_free_list(), gen_length(), gen_nconc(), generate_optimized_code_for_loop_nest(), ifdebug, lblocks, LIST, lloop, loop_nest_guard(), lvect, make_block_statement(), make_continue_statement(), MAP, message_manageable_p(), messages_handling(), NIL, node_module, parallel_loop_nest_to_body(), pips_debug, pips_internal_error, print_reference(), reference_undefined, reference_variable, replicated_p(), RETURN, set_current_loops(), set_hpfc_current_statement(), simple_indices_p(), STATEMENT, SYNTAX, syntax_reference, and syntax_undefined.
Referenced by hpf_compile_loop().
true if indices are constants or index
cannot decide, so it is supposed to be false
??? checks that there is a shift alignment, what shouldn't be necessary...
Definition at line 64 of file o-analysis.c.
References alignment_rate, alignment_undefined, array, b1, b2, entity_loop_index_p(), entity_name, EXPRESSION, expression_normalized, FindArrayDimAlignmentOfArray, fprintf(), HpfcExpressionToInt(), ifdebug, ith_dim_distributed_p(), local_integer_constant_expression(), MAP, normalized_complex_p, normalized_linear, pips_debug, print_reference(), reference_indices, reference_variable, TCST, value_zero_p, Svecteur::var, vect_coeff(), vect_debug(), and vect_size().
Referenced by Overlap_Analysis().
|
static |
generate the call to the dynamic loop bounds computation
Definition at line 286 of file o-analysis.c.
References CONS, entity_to_expression(), EXPRESSION, hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), LOOP_BOUNDS, and NIL.
Referenced by generate_optimized_code_for_loop_nest().
|
static |
caution: only distributed dimensions indexes are modified other have to remain untouched... ??? aligned star is missing
find the new index of the loop
compute the local indice
??? nothing is changed
Definition at line 404 of file o-analysis.c.
References access, access_tag, aligned_affine, aligned_constant, aligned_shift, aligned_star, array, CAR, CDR, CONS, CONSP, entity_intrinsic(), entity_to_expression(), EXPRESSION, fprintf(), gen_nconc(), GET_ENTITY_MAPPING, ifdebug, INT, int_to_expression(), MakeBinaryCall(), MINUS_OPERATOR_NAME, NIL, pips_internal_error, PLUS_OPERATOR_NAME, POP, print_reference(), PVECTOR, Ref, reference_indices, reference_variable, SYNTAX, syntax_reference, template_cell_local_mapping(), TEMPLATEV, the_index_of_vect(), TSHIFTV, value_abs, value_pos_p, Value_to_expression(), VALUE_TO_INT, value_zero_p, var_of, and vect_coeff().
Referenced by generate_optimized_code_for_loop_nest().
Definition at line 579 of file o-analysis.c.
References current_variable_used_statement, and message_assert.
Referenced by make_loop_nest_for_overlap().
|
static |
Definition at line 530 of file o-analysis.c.
References reference_variable.
Referenced by initialize_variable_used_map_for_current_loop_nest().
returns the dimension of reference on which index entity e is used
Definition at line 364 of file o-analysis.c.
References EXPRESSION, expression_normalized, MAP, normalized_linear, normalized_linear_p, reference_indices, and vect_coeff().
Referenced by generate_optimized_code_for_loop_nest().
|
static |
bool variable_used_in_statement_p(ent, stat)
not 0 if ent is referenced in statement stat. yes, I know, proper effects may be called several times for the same statement...
??? I should have used cumulated/proper effects to be computed on the statement being generated, but It would not have been as easy to compute and to use.
Definition at line 528 of file o-analysis.c.
Referenced by close_variable_used_map_for_statement(), initialize_variable_used_map_for_current_loop_nest(), and variable_used_in_statement_p().
|
static |
To Kill scalar definitions within the generated code recognize if only one reference.
Definition at line 311 of file o-analysis.c.
Referenced by hpfc_overlap_kill_unused_scalars(), and hpfc_overlap_kill_unused_scalars_rewrite().
Overlap Analysis Module for HPFC.
Fabien Coelho, August 1993
Definition at line 38 of file o-analysis.c.
Referenced by generate_optimized_code_for_loop_nest(), initialize_variable_used_map_for_current_loop_nest(), and Overlap_Analysis().
Definition at line 38 of file o-analysis.c.
Referenced by generate_optimized_code_for_loop_nest(), initialize_variable_used_map_for_current_loop_nest(), and Overlap_Analysis().