PIPS
|
#include "defines-local.h"
#include "semantics.h"
#include "conversion.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
Go to the source code of this file.
Functions | |
static bool | current_entity_is_used_later_p (statement stat, entity current_entity) |
HPFC module by Fabien COELHO. More... | |
static bool | current_entity_is_updated_before_p (statement stat, entity current_entity) |
IN Regions(effects) are used to verify if the entity current_entity is initialized before it's used in the io statement. More... | |
static Psysteme | statement_context (statement stat, tag move) |
void | hpfc_algorithm_row_echelon (Psysteme syst, list scanners, Psysteme *pcond, Psysteme *penum) |
io-compile.c More... | |
list | make_list_of_dummy_variables (entity(*creation)(), int number) |
of entity More... | |
static Psysteme | generate_shared_io_system (entity array, statement stat, tag move, tag act) |
static Psysteme | generate_distributed_io_system (entity array, statement stat, tag move, tag act) |
void | remove_variables_if_possible (Psysteme *psyst, list *plvars) |
static Psysteme | clean_shared_io_system (Psysteme syst, entity array, tag move) |
void | remove_variables_from_system (Psysteme *ps, list *plv) |
void | clean_the_system (Psysteme *ps, list *plrm, list *pltry) |
static Psysteme | clean_distributed_io_system (Psysteme syst, entity array, tag move) |
collect or update More... | |
static void | put_variables_in_ordered_lists (Psysteme *psyst, entity array, list *plparam, list *plproc, list *plscan, list *plrebuild) |
Variables of Psysteme syst are ordered and put in different lists. More... | |
list | simplify_deducable_variables (Psysteme syst, list vars, list *pleftvars) |
list simplify_deducable_variables(syst, vars, pleftvars) Psysteme syst; list vars, *pleftvars; More... | |
static list | hpfc_order_specific_variables (list le, entity(*creation)()) |
output 7 entities created by creation if in list le More... | |
list | hpfc_order_variables (list le, bool number_first) |
list hpfc_order_variables(list) More... | |
void | hpfc_algorithm_tiling (Psysteme syst, list processors, list scanners, Psysteme *pcondition, Psysteme *pproc_echelon, Psysteme *ptile_echelon) |
void | hpfc_simplify_condition (Psysteme *psc, statement stat, tag move) |
void hpfc_simplify_condition(psc, stat, move) More... | |
static Psysteme | generate_io_system (entity array, statement stat, tag move, tag act) |
generates the Psystem for IOs inside the statement stat, that use entity ent which should be a variable. More... | |
static void | generate_io_collect_or_update (entity array, statement stat, tag move, tag act, statement *psh, statement *psn) |
static void | add_declaration_to_host_and_link (entity array) |
add a local declaration for entity array on the host. More... | |
void | io_efficient_compile (statement stat, statement *hp, statement *np) |
compile an io statement More... | |
|
static |
add a local declaration for entity array on the host.
if entity array is dynamic, then declaration based on the primary.
already exists, just add the link
create the host entity
second link if needed
local, not passed as an argument
Definition at line 876 of file io-compile.c.
References AddEntityToModule(), array, bound_new_host_p(), dynamic_entity_p, entity_storage, formal_offset, host_module, load_new_host(), load_primary_entity(), storage_formal, storage_formal_p, and store_new_host_variable().
Referenced by io_efficient_compile().
collect or update
??? what about the variables? some are usefull, some are constants, and others should be discarded. This selection and projection may be done here.
to be removed: PHIi... THETAi... some GAMMAi... some others coming from the *conditions
loop generation on: PSIi... some GAMMAi... some DELTAi... complementary ALPHAi... (LALPHAi?)
THETA_i's PHI_i's PSI_i's ALPHA_i's LALPHA_i's
Keep parameters !
should try to remove only variables that can be eliminated using the preconditions. Otherwise: ph1=old, 1<=old<=2, projecting old loses the right dimension...
try_remove = CONS(ENTITY, e, try_remove);
others
array | system to be cleaned |
move | io on array |
Definition at line 373 of file io-compile.c.
References add_to_list_of_vars, array, array_distributed_p(), array_to_template, base_to_list(), clean_the_system(), CONS, DEBUG_ELST, DEBUG_SYST, ENTITY, entity_local_name(), entity_module_name(), entity_name, gen_free_list(), gen_remove(), get_ith_array_dummy(), get_ith_local_dummy(), get_ith_processor_dummy(), get_ith_region_dummy(), get_ith_template_dummy(), HPFC_PACKAGE, keep, MAP, movement_collect_p, NIL, NumberOfDimension(), pips_assert, pips_debug, REGIONS_MODULE_NAME, TCST, and template_to_processors.
Referenced by generate_io_system().
ALPHA_i's PHI_i's
keep parameters !
others
remove variables that have to be removed
Try to remove other unusefull variables
the noisy system is cleaned some variables are not used, they are removed here.
Definition at line 285 of file io-compile.c.
References add_to_list_of_vars, array, BASE_NULLE, base_rm, base_to_list(), build_sc_nredund_2pass(), CONS, DEBUG_SYST, ENTITY, entity_local_name(), entity_module_name(), entity_name, gen_remove(), get_ith_array_dummy(), get_ith_region_dummy(), HPFC_PACKAGE, keep, MAP, movement_collect_p, NIL, NO_OFL_CTRL, NumberOfDimension(), pips_debug, REGIONS_MODULE_NAME, remove_variables_if_possible(), sc_creer_base(), and TCST.
Referenced by generate_io_system().
ps | s |
plrm | of entities |
pltry | ltry |
Definition at line 360 of file io-compile.c.
References base_rm, build_sc_nredund_2pass(), remove_variables_from_system(), remove_variables_if_possible(), and sc_creer_base().
Referenced by clean_distributed_io_system(), and hpf_remapping().
IN Regions(effects) are used to verify if the entity current_entity is initialized before it's used in the io statement.
& OUT Regions are not used
get IN Regions(Effects) list for the io statement
list_in = load_statement_in_regions(stat);
for all IN Regions (Effects) for the statement stat, test if reference in current_effect is egal to current_entity
Definition at line 84 of file io-compile.c.
References current_entity, EFFECT, effect_variable, get_bool_property(), ifdebug, load_in_effects_list(), MAP, pips_debug, and print_regions().
Referenced by io_efficient_compile().
HPFC module by Fabien COELHO.
OUT Regions(effects) are used to verify if the entity current_entity is read in another statement later (note that we don't need to know which statement is reading current_entity)
N & OUT Regions are not used
get OUT Regions(Effects) list for the io statement
list_out = load_statement_out_regions(stat);
for all OUT Regions (Effects) for the statement stat, test if reference in current_effect is egal to current_entity
Definition at line 47 of file io-compile.c.
References current_entity, EFFECT, effect_variable, get_bool_property(), ifdebug, load_out_effects_list(), MAP, pips_debug, and print_regions().
Referenced by io_efficient_compile().
|
static |
??? bug: the preconditions may be in the regions. To update, I should have the postconditions instead, that is the statement transformer should be applied to the system.
???
??? massive memory leak polyhedron intersections
the noisy system is cleaned some variables are not used, they are removed here.
Definition at line 197 of file io-compile.c.
References array, base_rm, build_sc_nredund_2pass(), concatenate(), DEBUG_SYST, effect_system, entity_name, entity_to_region(), generate_system_for_distributed_variable(), hpfc_compute_unicity_constraints(), hpfc_unstutter_dummies(), region, sc_append(), sc_creer_base(), sc_rn(), and statement_context().
Referenced by generate_io_system().
|
static |
SCANNING: Variables must be classified as:
Now we have a set of equations and inequations, and we are going to organise a scanning of the data and the communications that are needed
the sorting is done again at the code generation, but this phase will ensure more determinism in the debug messages
sc_vect_sort(condition, compare_Pvecteur);
array not distributed
the sorting is done again at the code generation, but this phase will ensure more determinism in the debug messages
sc_vect_sort(condition, compare_Pvecteur);
Definition at line 769 of file io-compile.c.
References array, array_distributed_p(), compare_Pvecteur(), DEBUG_STAT, ENDP, entity_name, entity_undefined, entity_variable_p, generate_io_statements_for_distributed_arrays(), generate_io_statements_for_shared_arrays(), generate_io_system(), hpfc_algorithm_row_echelon(), hpfc_algorithm_tiling(), hpfc_simplify_condition(), hpfc_warning, make_continue_statement(), movement_update_p, NIL, pips_assert, put_variables_in_ordered_lists(), reset_information_for_code_optimizations(), sc_empty_p(), sc_sort(), sc_vect_sort(), and set_information_for_code_optimizations().
Referenced by io_efficient_compile().
generates the Psystem for IOs inside the statement stat, that use entity ent which should be a variable.
Definition at line 740 of file io-compile.c.
References array, array_distributed_p(), clean_distributed_io_system(), clean_shared_io_system(), compare_Pvecteur(), concatenate(), DEBUG_SYST, entity_name, entity_variable_p, generate_distributed_io_system(), generate_shared_io_system(), pips_assert, and sc_vect_sort().
Referenced by generate_io_collect_or_update().
|
static |
??? bug post with region
the noisy system is cleaned some variables are not used, they are removed here.
Definition at line 156 of file io-compile.c.
References array, array_distributed_p(), base_rm, concatenate(), DEBUG_SYST, effect_system, entity_name, entity_to_declaration_constraints(), entity_to_region(), hpfc_unstutter_dummies(), pips_assert, region, sc_append(), sc_creer_base(), sc_rn(), and statement_context().
Referenced by generate_io_system().
void hpfc_algorithm_row_echelon | ( | Psysteme | syst, |
list | scanners, | ||
Psysteme * | pcond, | ||
Psysteme * | penum | ||
) |
this should improve conditions?
syst | yst |
scanners | canners |
pcond | cond |
penum | enum |
Definition at line 127 of file io-compile.c.
References algorithm_row_echelon_generic(), base, base_rm, entity_list_to_base(), get_bool_property(), and sc_find_equalities().
Referenced by generate_io_collect_or_update(), hpf_remapping(), and processor_loop().
void hpfc_algorithm_tiling | ( | Psysteme | syst, |
list | processors, | ||
list | scanners, | ||
Psysteme * | pcondition, | ||
Psysteme * | pproc_echelon, | ||
Psysteme * | ptile_echelon | ||
) |
syst | yst |
processors | rocessors |
scanners | canners |
pcondition | condition |
pproc_echelon | proc_echelon |
ptile_echelon | tile_echelon |
Definition at line 689 of file io-compile.c.
References algorithm_tiling(), base_rm, DEBUG_BASE, DEBUG_SYST, and entity_list_to_base().
Referenced by generate_io_collect_or_update().
output 7 entities created by creation if in list le
of entity
Definition at line 605 of file io-compile.c.
References CONS, ENTITY, gen_in_list_p(), and NIL.
Referenced by hpfc_order_variables().
list hpfc_order_variables(list)
the input list of entities is ordered so that: PSI_i's, GAMMA_i's, DELTA_i's, IOTA_i's, ALPHA_i's, LALPHA_i's...
reverse!
le | e |
number_first | umber_first |
Definition at line 629 of file io-compile.c.
References CONS, ENTITY, gen_free_list(), gen_in_list_p(), gen_length(), gen_nconc(), get_ith_array_dummy(), get_ith_block_dummy(), get_ith_cycle_dummy(), get_ith_local_dummy(), get_ith_processor_dummy(), get_ith_shift_dummy(), hpfc_order_specific_variables(), MAP, NIL, and pips_assert.
Referenced by put_variables_in_ordered_lists().
void hpfc_simplify_condition(psc, stat, move)
remove conditions that are not usefull from *psc, i.e. that are redundent with pre/post conditions depending on when the movement is done
psc | sc |
stat | tat |
move | ove |
Definition at line 724 of file io-compile.c.
References extract_nredund_subsystem(), sc_rm(), and statement_context().
Referenced by generate_io_collect_or_update().
compile an io statement
returned Node code
of effect
not implemented
stat | tat |
hp | statement to compile |
np | returned Host code |
Definition at line 911 of file io-compile.c.
References _intFMT, action_read_p, action_tag, action_write_p, add_declaration_to_host_and_link(), approximation_may_p, array, array_distributed_p(), bound_new_host_p(), CONS, copy_statement(), current_entity_is_updated_before_p(), current_entity_is_used_later_p(), debug_off, debug_on, DEBUG_STAT, effect_action, effect_any_reference, effect_approximation, empty_code_p(), entity_name, FOREACH, gen_length(), gen_nconc(), generate_io_collect_or_update(), get_bool_property(), hpfc_make_call_statement(), hpfc_name_to_entity(), io_effect_entity_p(), is_movement_collect, is_movement_update, load_rw_effects_list(), make_block_statement(), NIL, pips_assert, pips_debug, reference_variable, replicated_p(), STATEMENT, statement_number, and SYNCHRO.
Referenced by hpf_compiler().
|
static |
Variables of Psysteme syst are ordered and put in different lists.
Especially, deducable variables are listed, the equalities that allow to rebuild them are also listed, and they are removed from the original system by exact integer projection.
Other variables are (should be) the parameters, the processors, and the variables to be used to scan polyhedron.
just in case
parameters: those variables that are not dummies...
processors
scanners and deducables
return results
lscan is implicitely ordered
Definition at line 470 of file io-compile.c.
References array, array_distributed_p(), array_to_processors, BASE_NULLE, base_rm, base_to_list(), build_sc_nredund_2pass(), CONS, contrainte_make(), DEBUG_ELST, DEBUG_SYST, egalite_fprint(), ENTITY, entity_hpfc_dummy_p(), entity_local_name(), entity_name, EXPRESSION, expression_normalized, expression_reference(), fprintf(), gen_free_list(), gen_length(), gen_nreverse(), gen_remove(), get_ith_processor_dummy(), hpfc_order_variables(), ifdebug, MAP, NIL, normalized_linear, NumberOfDimension(), pips_debug, reference_variable, sc_creer_base(), simplify_deducable_variables(), TCST, Scontrainte::vecteur, and VECTEUR_NUL.
Referenced by generate_io_collect_or_update().
ps | s |
plv | of entity (Variable) |
Definition at line 345 of file io-compile.c.
References ENTITY, entity_local_name(), gen_free_list(), MAP, NIL, NO_OFL_CTRL, and pips_debug.
Referenced by clean_the_system().
psyst | syst |
plvars | lvars |
Definition at line 245 of file io-compile.c.
References BASE_NULLE, base_rm, CONS, contrainte_var_min_coeff(), ENTITY, entity_local_name(), gen_free_list(), MAP, NIL, NO_OFL_CTRL, pips_assert, pips_debug, sc_creer_base(), VALUE_MONE, VALUE_ONE, value_one_p, vect_new(), and vect_rm().
Referenced by clean_shared_io_system(), and clean_the_system().
list simplify_deducable_variables(syst, vars, pleftvars) Psysteme syst; list vars, *pleftvars;
variables from entity list vars that can be rebuilt by the Psysteme syst are removed from it and stored as an expression list which is returned. The variables that are not removed are returned as another entity list, *pleftvars. of expression
syst | yst |
vars | ars |
pleftvars | leftvars |
Definition at line 562 of file io-compile.c.
References BASE_NULLE, base_rm, CONS, CONTRAINTE_UNDEFINED, ENTITY, eq, EXPRESSION, FWD_OFL_CTRL, is_normalized_linear, is_syntax_reference, make_expression(), make_normalized(), make_reference(), make_syntax(), MAP, NIL, sc_creer_base(), value_one_p, VALUE_ZERO, vect_dup(), and Scontrainte::vecteur.
Referenced by extract_lattice(), hpf_remapping(), and put_variables_in_ordered_lists().
Definition at line 116 of file io-compile.c.
References load_statement_postcondition(), load_statement_precondition(), movement_collect_p, predicate_system, and transformer_relation.
Referenced by generate_distributed_io_system(), generate_shared_io_system(), and hpfc_simplify_condition().