PIPS
|
Go to the source code of this file.
Functions | |
static void | set_generic_effects_as_needed (void) |
for CONTROL_MAP() More... | |
reductions | load_summary_reductions (entity f) |
Fortran 77 anti aliasing rules implies that sg that looks like a reduction within a subroutine can be perceived as so from outside because no aliasing may cause the accumulator to be linked to the rhs of the accumulation... More... | |
static reduction | compute_one_summary_reduction (reduction model, list le) |
static reductions | compute_summary_reductions (entity f) |
bool | summary_reductions (const char *module_name) |
handler for pipsmake input: module name output: TRUE side effects: stores the summary reductions to pipsdbm More... | |
static list | add_reduced_variables (list le, reductions rs) |
Function storing Proper Reductions. More... | |
static list | list_of_reduced_variables (statement node, list ls) |
of entity More... | |
static reduction | compatible_reduction_of_var (entity var, reductions rs) |
Returns NULL if not ok. More... | |
static list | list_of_compatible_reductions (reductions rs) |
returns NIL on any problem More... | |
static list | list_of_trusted_references (reductions rs) |
static bool | safe_effects_for_reductions (statement s, reductions rs) |
argh... More... | |
static void | check_proper_reductions (statement s) |
must check that the found reductions are (1) without side effects (no W on any other than accumulators), MA: why? If the W doesn't conflict with the accumulators it should be safe ! safe_effects_for_reductions seems overkill to me (2) compatible one with respect to the other. More... | |
static bool | pr_statement_flt (statement s) |
static void | pr_statement_wrt (statement s) |
static bool | pr_call_flt (call c) |
static void | compute_proper_reductions (statement s) |
performs the computation of proper reductions for statement s. More... | |
bool | proper_reductions (const char *module_name) |
handler for pipsmake input: module name output: TRUE side effects: some More... | |
static bool | build_reduction_of_variable (entity var, statement node, list ls, reduction *pr) |
Function storing Cumulated Reductions. More... | |
static void | build_creductions_of_statement (statement node, list ls) |
builds cumulated reductions for node, depending on node and list of statement ls. More... | |
static void | compute_cumulated_reductions (instruction i) |
Cumulated Reduction propagation functions for each possible instructions. More... | |
bool | cumulated_reductions (const char *module_name) |
handler for pipsmake input: the module name output: TRUE side effects: some More... | |
entity | reduction_operator_entity (reduction_operator op) |
match a reduction operator against operator entity More... | |
bool | same_reduction_p (reduction r1, reduction r2) |
Variables | |
static call | last_translated_module_call = call_undefined |
hack: no check for direct translations ("call foo") thus in this case effects reductions will be okay... More... | |
|
static |
Function storing Proper Reductions.
list of entities that may be reduced of entity
le | of entity |
Definition at line 144 of file reductions.c.
References FOREACH, gen_once(), REDUCTION, reduction_variable, and reductions_list.
Referenced by list_of_compatible_reductions(), and list_of_reduced_variables().
builds cumulated reductions for node, depending on node and list of statement ls.
of entity
of reduction
list of candidate entities
for each candidate, extract the reduction if any
store the result
ls | of statement |
Definition at line 451 of file reductions.c.
References build_reduction_of_variable(), CONS, ENTITY, FOREACH, gen_free_list(), gen_length(), list_of_reduced_variables(), make_reductions(), NIL, node(), note_for_statement(), pips_debug, REDUCTION, and store_cumulated_reductions().
Referenced by compute_cumulated_reductions().
|
static |
Function storing Cumulated Reductions.
returns a r reduction of any compatible with { node } u ls input: var, node and ls output: true and some *pr, or FALSE
ls | of statement |
Definition at line 410 of file reductions.c.
References bound_cumulated_reductions_p(), effects_effects, FOREACH, free_reduction(), load_cumulated_reductions(), load_proper_reductions(), load_proper_references(), load_rw_effects_list(), make_reduction(), make_reduction_operator_none(), NIL, node(), note_for_statement(), pips_assert, pips_debug, reference_undefined, STATEMENT, and update_compatible_reduction().
Referenced by build_creductions_of_statement().
|
static |
must check that the found reductions are (1) without side effects (no W on any other than accumulators), MA: why? If the W doesn't conflict with the accumulators it should be safe ! safe_effects_for_reductions seems overkill to me (2) compatible one with respect to the other.
(3) not killed by other proper effects on accumulators. to avoid these checks, I can stop on expressions...
of reduction
all must be compatible, otherwise some side effect!
checks (2)
now lnr is the new list of reductions.
checks (1) and (3)
Definition at line 250 of file reductions.c.
References ENDP, gen_full_free_list(), list_of_compatible_reductions(), load_proper_reductions(), NIL, reductions_list, and safe_effects_for_reductions().
Referenced by pr_statement_wrt().
|
static |
Returns NULL if not ok.
Definition at line 174 of file reductions.c.
References FOREACH, free_reduction(), make_none_reduction, REDUCTION, reductions_list, and update_compatible_reduction_with().
Referenced by list_of_compatible_reductions().
|
static |
Cumulated Reduction propagation functions for each possible instructions.
Statement s cumulated reduction computation involves :
of control
it is important to return here
Definition at line 486 of file reductions.c.
References build_creductions_of_statement(), CONS, CONTROL, control_list_to_statement_list(), CONTROL_MAP, copy_reductions(), forloop_body, gen_free_list(), gen_get_ancestor(), instruction_block, instruction_forloop, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_loop, is_instruction_sequence, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, load_proper_reductions(), loop_body, make_statement_list, NIL, note_for_statement(), pips_debug, pips_internal_error, return(), statement_domain, store_cumulated_reductions(), test_false, test_true, unstructured_control, and whileloop_body.
Referenced by cumulated_reductions().
keep the entities that are exported...
le | of effect |
Definition at line 63 of file reductions.c.
References copy_reduction(), DEBUG_REDUCTION, effects_may_read_or_write_memory_paths_from_entity_p(), ENTITY, FOREACH, gen_free_list(), NIL, reduction_dependences, and remove_variable_from_reduction().
Referenced by compute_summary_reductions().
|
static |
performs the computation of proper reductions for statement s.
this is a direct computation, throught gen_multi_recurse.
Definition at line 342 of file reductions.c.
References call_domain, gen_multi_recurse(), gen_null(), pr_call_flt(), pr_statement_flt(), pr_statement_wrt(), and statement_domain.
Referenced by proper_reductions().
|
static |
of effect
of reduction
Definition at line 81 of file reductions.c.
References compute_one_summary_reduction(), CONS, DEBUG_REDUCTION, effects_may_read_or_write_memory_paths_from_entity_p(), entity_name, f(), FOREACH, gen_length(), get_current_module_statement(), load_cumulated_reductions(), load_summary_effects(), make_reductions(), NIL, pips_debug, REDUCTION, reduction_variable, and reductions_list.
Referenced by summary_reductions().
bool cumulated_reductions | ( | const char * | module_name | ) |
handler for pipsmake input: the module name output: TRUE side effects: some
gets what is needed from PIPS DBM
do the job here
returns the result to the DBM...
module_name | odule_name |
Definition at line 529 of file reductions.c.
References compute_cumulated_reductions(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_recurse, gen_true(), generic_effects_reset_all_methods(), get_cumulated_reductions(), get_current_module_statement(), init_cumulated_reductions(), instruction_domain, local_name_to_top_level_entity(), module_name(), pips_debug, reset_cumulated_reductions(), reset_current_module_entity(), reset_current_module_statement(), reset_proper_reductions(), reset_proper_references(), reset_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_generic_effects_as_needed(), set_proper_reductions(), set_proper_references(), and set_rw_effects().
|
static |
returns NIL on any problem
Definition at line 187 of file reductions.c.
References add_reduced_variables(), compatible_reduction_of_var(), CONS, ENTITY, FOREACH, gen_free_list(), gen_full_free_list(), NIL, and REDUCTION.
Referenced by check_proper_reductions().
of entity
of entity
ls | of statement |
Definition at line 155 of file reductions.c.
References add_reduced_variables(), bound_cumulated_reductions_p(), FOREACH, load_cumulated_reductions(), load_proper_reductions(), NIL, node(), note_for_statement(), pips_assert, pips_debug, and STATEMENT.
Referenced by build_creductions_of_statement().
|
static |
???
Definition at line 205 of file reductions.c.
References CONS, FOREACH, NIL, PREFERENCE, preference_reference, REDUCTION, reduction_reference, reduction_trusted, reductions_list, and REFERENCE.
Referenced by safe_effects_for_reductions().
reductions load_summary_reductions | ( | entity | f | ) |
Fortran 77 anti aliasing rules implies that sg that looks like a reduction within a subroutine can be perceived as so from outside because no aliasing may cause the accumulator to be linked to the rhs of the accumulation...
reductions.c
thus summary reductions can be propagated with no harm... just the usual conditions must be checked (no other effect on the variable)
Definition at line 55 of file reductions.c.
References db_get_memory_resource(), entity_module_p(), f(), module_local_name(), and pips_assert.
Referenced by translate_reductions().
Definition at line 309 of file reductions.c.
References call_function, call_proper_reduction_p(), CONS, DEBUG_REDUCTION, entity_module_p(), entity_name, FOREACH, gen_nconc(), ifdebug, last_translated_module_call, load_proper_reductions(), pips_debug, REDUCTION, reductions_list, and translate_reductions().
Referenced by compute_proper_reductions().
Definition at line 288 of file reductions.c.
References make_reductions(), NIL, and store_proper_reductions().
Referenced by compute_proper_reductions().
|
static |
Definition at line 298 of file reductions.c.
References check_proper_reductions(), instruction_call, instruction_call_p, last_translated_module_call, and statement_instruction.
Referenced by compute_proper_reductions().
bool proper_reductions | ( | const char * | module_name | ) |
handler for pipsmake input: module name output: TRUE side effects: some
gets what is needed from PIPS DBM
do the job
returns the result to the DBM...
module_name | odule_name |
Definition at line 359 of file reductions.c.
References compute_proper_reductions(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, generic_effects_reset_all_methods(), get_current_module_statement(), get_proper_reductions(), init_proper_reductions(), local_name_to_top_level_entity(), module, module_name(), pips_debug, reset_current_module_entity(), reset_current_module_statement(), reset_proper_reductions(), reset_proper_references(), set_current_module_entity(), set_current_module_statement(), set_generic_effects_as_needed(), and set_proper_references().
entity reduction_operator_entity | ( | reduction_operator | op | ) |
match a reduction operator against operator entity
op | reduction operator |
op | p |
Definition at line 577 of file reductions.c.
References AND_OPERATOR_NAME, BITWISE_AND_OPERATOR_NAME, BITWISE_OR_OPERATOR_NAME, BITWISE_XOR_OPERATOR_NAME, entity_intrinsic(), EQUIV_OPERATOR_NAME, is_reduction_operator_and, is_reduction_operator_bitwise_and, is_reduction_operator_bitwise_or, is_reduction_operator_bitwise_xor, is_reduction_operator_csum, is_reduction_operator_eqv, is_reduction_operator_max, is_reduction_operator_min, is_reduction_operator_neqv, is_reduction_operator_or, is_reduction_operator_prod, is_reduction_operator_sum, MAX_OPERATOR_NAME, MIN_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, NON_EQUIV_OPERATOR_NAME, opname(), OR_OPERATOR_NAME, pips_internal_error, PLUS_C_OPERATOR_NAME, PLUS_OPERATOR_NAME, reduction_operator_tag, and string_undefined.
Referenced by do_expression_reduction(), do_reduction_atomization(), and do_reduction_propagation().
|
static |
argh...
what about side effect related reductions ??? There are no relevant pointer to trust in such a case... What I can do as a (temporary) fix is not to check direct side effects (that is "call foo" ones) because they do not need to be checked...
of effect
of reference
Definition at line 222 of file reductions.c.
References EFFECT, effect_any_reference, effect_variable, effect_write_p, effects_effects, entity_name, FOREACH, gen_free_list(), gen_in_list_p(), io_effect_entity_p(), list_of_trusted_references(), load_proper_references(), pips_debug, and store_effect_p().
Referenced by check_proper_reductions().
r1 | 1 |
r2 | 2 |
Definition at line 611 of file reductions.c.
References reduction_op, reduction_operator_tag, reduction_reference, and reference_equal_p().
Referenced by add_reduction().
|
static |
for CONTROL_MAP()
Definition at line 41 of file reductions.c.
References effect_dup_func, and simple_effect_dup().
Referenced by cumulated_reductions(), proper_reductions(), and summary_reductions().
bool summary_reductions | ( | const char * | module_name | ) |
handler for pipsmake input: module name output: TRUE side effects: stores the summary reductions to pipsdbm
module_name | odule_name |
Definition at line 106 of file reductions.c.
References compute_summary_reductions(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, generic_effects_reset_all_methods(), get_current_module_entity(), local_name_to_top_level_entity(), module_name(), pips_debug, reset_cumulated_reductions(), reset_current_module_entity(), reset_current_module_statement(), set_cumulated_reductions(), set_current_module_entity(), set_current_module_statement(), and set_generic_effects_as_needed().
|
static |
hack: no check for direct translations ("call foo") thus in this case effects reductions will be okay...
the reason for the patch is that I do not know how to preserve easily such "invisible" reductions against proper effects. FC.
Definition at line 279 of file reductions.c.
Referenced by pr_call_flt(), and pr_statement_wrt().