PIPS
|
#include "reductions_private.h"
Go to the source code of this file.
Macros | |
#define | reduction_variable(r) reference_variable(reduction_reference(r)) |
Warning! Do not modify this file that is automatically generated! More... | |
#define | reduction_none_p(r) reduction_operator_none_p(reduction_op(r)) |
#define | reduction_tag(r) reduction_operator_tag(reduction_op(r)) |
#define | make_none_reduction(var) |
#define | DEBUG_REDUCTION(level, msg, red) ifdebug(level){pips_debug(level, msg); print_reduction(red);} |
quick debug macros More... | |
#define | DEBUG_REDUCTIONS(level, msg, reds) |
#define DEBUG_REDUCTION | ( | level, | |
msg, | |||
red | |||
) | ifdebug(level){pips_debug(level, msg); print_reduction(red);} |
quick debug macros
Definition at line 45 of file reductions.h.
#define DEBUG_REDUCTIONS | ( | level, | |
msg, | |||
reds | |||
) |
Definition at line 47 of file reductions.h.
#define make_none_reduction | ( | var | ) |
Definition at line 38 of file reductions.h.
#define reduction_none_p | ( | r | ) | reduction_operator_none_p(reduction_op(r)) |
Definition at line 36 of file reductions.h.
#define reduction_tag | ( | r | ) | reduction_operator_tag(reduction_op(r)) |
Definition at line 37 of file reductions.h.
#define reduction_variable | ( | r | ) | reference_variable(reduction_reference(r)) |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/reductions/reductions-local.h instead, to add your own modifications. header file built by cproto reductions-local.h shorthands for REDUCTION:
Definition at line 35 of file reductions.h.
Referenced by build_reduction_of_variable(), and list_of_reduced_variables().
Referenced by statement_is_reduction(), and text_reductions().
This function look for a reduction and return it if found mallocs are avoided if nothing is found...
looks for v = v OP y or v OP= y, where y is independent of v.
s |
c | needed to query about proper effects |
red | the call of interest |
Definition at line 633 of file utils.c.
References call_arguments, call_function, CAR, CDR, CONS, copy_reference(), DEBUG_REDUCTION, ENTITY_ASSIGN_P, entity_name, equal_reference_in_expression_p(), EXPRESSION, expression_syntax, expression_undefined, extract_reduction_operator(), extract_reduction_unary_update_operator(), extract_reduction_update_operator(), FOREACH, functional_object_p(), gen_free_list(), make_preference(), make_reduction(), make_reduction_operator(), NIL, no_other_effects_on_references(), pips_debug, pips_user_warning, PREFERENCE, reduction_operator_tag_name(), REFERENCE, reference_undefined, referenced_variables(), syntax_reference, syntax_reference_p, update_op(), and UU.
Referenced by pr_call_flt().
void close_cumulated_reductions | ( | void | ) |
void close_printed_reductions | ( | void | ) |
void close_proper_reductions | ( | void | ) |
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().
bool cumulated_reductions_undefined_p | ( | void | ) |
reductions delete_cumulated_reductions | ( | statement | ) |
reductions delete_printed_reductions | ( | statement | ) |
reductions delete_proper_reductions | ( | statement | ) |
void error_reset_cumulated_reductions | ( | void | ) |
void error_reset_printed_reductions | ( | void | ) |
void error_reset_proper_reductions | ( | void | ) |
Flag loop as parallel when replacement with atomic is possible without doing the replacement.
mod_name | od_name |
Definition at line 411 of file atomic.c.
References debug_off, debug_on, DO_NOT_REPLACE, and process_reduced_loops().
bool flag_parallel_reduced_loops_with_openmp_directives | ( | const char * | mod_name | ) |
expression get_complement_expression | ( | statement | s, |
reference | reduced | ||
) |
Return the "other part" of the reduction.
If the statement is : sum = sum + a[i]; then we'll return a[i]
try to find out which of the two expression corresponds to the reduced reference. We'll return the other...
reduced | educed |
Definition at line 743 of file utils.c.
References call_arguments, call_function, CAR, CDR, ENTITY_ASSIGN_P, EXPRESSION, expression_call(), expression_call_p(), expression_reference(), expression_reference_p(), expression_undefined, extract_reduction_unary_update_operator(), extract_reduction_update_operator(), gen_length(), int_to_expression(), pips_assert, pips_debug, pips_internal_error, pips_user_warning, same_ref_name_p(), statement_call(), and statement_call_p().
Referenced by replace_reductions_in_statement().
pstatement_reductions get_cumulated_reductions | ( | void | ) |
pstatement_reductions get_printed_reductions | ( | void | ) |
pstatement_reductions get_proper_reductions | ( | void | ) |
void init_cumulated_reductions | ( | void | ) |
void init_printed_reductions | ( | void | ) |
void init_proper_reductions | ( | void | ) |
reductions load_cumulated_reductions | ( | statement | ) |
Referenced by build_reduction_of_variable(), compute_summary_reductions(), do_expression_reduction(), do_reduction_atomization(), list_of_reduced_variables(), and reductions_rewrite().
reductions load_printed_reductions | ( | statement | ) |
Referenced by reductions_get_omp_pragma_expr(), reductions_get_omp_pragma_str(), statement_is_reduction(), and text_reductions().
reductions load_proper_reductions | ( | statement | ) |
Referenced by build_reduction_of_variable(), check_proper_reductions(), compute_cumulated_reductions(), do_reduction_propagation(), list_of_reduced_variables(), and pr_call_flt().
reductions load_summary_reductions | ( | entity | f | ) |
reductions.c
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().
module | odule |
Definition at line 35 of file transformation.c.
References debug_off, debug_on, module, pips_assert, and pips_debug.
checks that the references are the only touched within this statement.
I trust the proper effects to store all references...
of effect
lr | of reference on the same variable |
Definition at line 596 of file utils.c.
References CAR, EFFECT, effect_any_reference, effects_effects, ENDP, entities_may_conflict_p(), entity_name, FOREACH, gen_in_list_p(), load_proper_references(), pips_debug, print_effect, REFERENCE, reference_variable, and store_effect_p().
Referenced by call_proper_reduction_p().
generates a short note to tell about the type of the statement being decorated.
Definition at line 55 of file prettyprint.c.
References instruction_tag, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_sequence, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, pips_internal_error, and statement_instruction.
Referenced by build_creductions_of_statement(), build_reduction_of_variable(), compute_cumulated_reductions(), list_of_reduced_variables(), and text_reductions().
true or FALSE? After all, it's just a user warning, not an error
mod_name | od_name |
Definition at line 63 of file stub.c.
References asprintf, buf, db_close_workspace(), db_get_current_workspace_name(), db_get_memory_resource(), db_open_workspace(), DB_PUT_MEMORY_RESOURCE, debug(), debug_off, debug_on, free(), get_debug_level(), LISP, mod_stat, module_reorder(), pips_internal_error, REDUCTIONS_SOURCE_DIRECTORY, strdup(), and user_warning.
generate "pragma omp for" as a list of expressions
l,the | loop to analyze for omp for |
stmt,the | statament where the pragma should be attached |
stmt | tmt |
Definition at line 366 of file pragma.c.
References add_pragma_expr_to_statement(), execution_parallel_p, loop_execution, omp_append_private_clause(), pips_debug, and pragma_omp_parallel_for_as_exprs().
Referenced by process_reductions_in_openmp_loop().
generate pragma for a reduction as a list of expressions
l,the | loop to analyze for omp reduction |
stmt,the | statament where the pragma should be attached |
strict,if | set to true, only one-liner statements with reductions are handled |
stmt | tmt |
strict | trict |
Definition at line 346 of file pragma.c.
References add_pragma_expr_to_statement(), omp_append_private_clause(), pips_debug, reductions_get_omp_pragma_expr(), and statement_remove_omp_clauses().
Referenced by process_reductions_in_openmp_loop().
bool print_code_cumulated_reductions | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 258 of file prettyprint.c.
References CUMU_DECO, CUMU_SUFFIX, module_name(), and print_any_reductions().
bool print_code_proper_reductions | ( | const char * | module_name | ) |
Handlers for PIPSMAKE.
module_name | odule_name |
Definition at line 249 of file prettyprint.c.
References module_name(), print_any_reductions(), PROP_DECO, and PROP_SUFFIX.
void print_reduction | ( | reduction | r | ) |
Definition at line 137 of file prettyprint.c.
References fprintf(), print_reference(), reduction_op, reduction_operator_tag, reduction_operator_tag_name(), reduction_reference, ref, and reference_undefined_p.
Referenced by replace_reductions_in_statement().
bool printed_reductions_undefined_p | ( | void | ) |
prettyprint.c
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().
bool proper_reductions_undefined_p | ( | void | ) |
extract the proper reduction of a call (instruction) if any.
I trust intrinsics (operations?) and summary effects...
else
a side effect!?
LUNS
Definition at line 343 of file utils.c.
References EFFECT, effect_variable, effect_write_p, entity_initial, entity_module_p(), f(), FOREACH, io_effect_entity_p(), load_summary_effects(), store_effect_p(), value_constant_p, value_intrinsic_p, and value_symbolic_p.
Referenced by call_flt().
bool reduction_detection | ( | const char * | mod_name | ) |
get the resources
do the job
validate computation
update/release resources
mod_name | od_name |
Definition at line 245 of file propagation.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dependence_graph, do_reduction_detection(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), set_current_module_entity(), set_current_module_statement(), and set_ordering_to_statement().
returns the name of the reduction (!!! not allocated)
Definition at line 110 of file prettyprint.c.
References reduction_operator_tag_name(), and reduction_tag.
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().
string reduction_operator_name | ( | reduction_operator | o | ) |
allocates and returns the name of the operator
Definition at line 103 of file prettyprint.c.
References reduction_operator_tag, reduction_operator_tag_name(), and strdup().
Referenced by words_reduction().
returns a (static) string describing the tag t reduction
Definition at line 78 of file prettyprint.c.
References 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_none, is_reduction_operator_or, is_reduction_operator_prod, is_reduction_operator_sum, and pips_internal_error.
Referenced by call_proper_reduction_p(), print_reduction(), reduction_name(), reduction_operator_name(), remove_variable_from_reduction(), and update_reduction_under_effect().
bool reduction_propagation | ( | const char * | mod_name | ) |
the pattern checked is a = b + c; r = r + a; which should become r = r +b ; r = r +c ;
get the resources
do the job
validate computation
update/release resources
mod_name | od_name |
Definition at line 125 of file propagation.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, dependence_graph, do_reduction_propagation(), get_current_module_statement(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_reductions(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_reductions(), and simplify_c_operator().
utils.c
Definition at line 46 of file utils.c.
References exp, EXPRESSION, expression_syntax, expression_undefined_p, FOREACH, range_upper, reduction_reference, ref, reference_indices, syntax_range, and syntax_range_p.
Referenced by rename_statement_reductions().
pragma.c
stmt | tmt |
strict | trict |
Definition at line 227 of file pragma.c.
References all_reduction, compute_all_reduction(), FOREACH, gen_expression_cons(), gen_nconc(), gen_recurse, gen_true(), load_printed_reductions(), NIL, pips_debug, pragma_omp_parallel_for_as_exprs(), REDUCTION, reduction_as_expr(), reductions_list, reductions_on_scalar(), reset_all_reduction(), statement_domain, and statement_is_reduction().
Referenced by omp_pragma_expr_for_reduction().
l,the | loop associated with the statement |
stmt,the | statement to analyzed for reductions, must be a loop |
stmt | tmt |
Definition at line 259 of file pragma.c.
References all_reduction, buf, compute_all_reduction(), FOREACH, gen_recurse, gen_true(), load_printed_reductions(), OMP_PRAGMA_FOR_HEADER_C, OMP_PRAGMA_FOR_HEADER_F, pips_debug, prettyprint_language_is_fortran_p(), REDUCTION, reduction_as_str(), reductions_list, reductions_on_scalar(), reset_all_reduction(), statement_domain, statement_is_reduction(), strdup(), string_buffer_append(), string_buffer_free_all(), string_buffer_make(), and string_buffer_to_string().
red | ed |
var | ar |
Definition at line 130 of file utils.c.
References dead_expressions, entity_name, expr_flt(), expr_rwt(), expression_domain, first_encountered_call, gen_free_list(), gen_multi_recurse(), gen_null(), NIL, pips_debug, reduction_op, reduction_operator_tag, reduction_operator_tag_name(), reduction_reference, reduction_variable, ref_flt(), reference_domain, and variable_to_remove.
Referenced by compute_one_summary_reduction(), update_compatible_reduction(), and update_reduction_under_effect().
end of it
cproto-generated files atomic.c
end of it
mod_name | od_name |
Definition at line 397 of file atomic.c.
References debug_off, debug_on, DO_REPLACE, and process_reduced_loops().
void reset_cumulated_reductions | ( | void | ) |
Referenced by cumulated_reductions(), reduction_atomization(), simd_remove_reductions(), and summary_reductions().
void reset_printed_reductions | ( | void | ) |
Referenced by print_any_reductions(), and process_reduced_loops().
void reset_proper_reductions | ( | void | ) |
Referenced by cumulated_reductions(), proper_reductions(), and reduction_propagation().
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().
void set_cumulated_reductions | ( | pstatement_reductions | ) |
Referenced by reduction_atomization(), simd_remove_reductions(), and summary_reductions().
void set_printed_reductions | ( | pstatement_reductions | ) |
Referenced by print_any_reductions(), and process_reduced_loops().
void set_proper_reductions | ( | pstatement_reductions | ) |
Referenced by cumulated_reductions(), and reduction_propagation().
void store_cumulated_reductions | ( | statement | , |
reductions | |||
) |
Referenced by build_creductions_of_statement(), compute_cumulated_reductions(), and do_expression_reduction().
void store_or_update_cumulated_reductions | ( | statement | , |
reductions | |||
) |
void store_or_update_printed_reductions | ( | statement | , |
reductions | |||
) |
void store_or_update_proper_reductions | ( | statement | , |
reductions | |||
) |
void store_printed_reductions | ( | statement | , |
reductions | |||
) |
void store_proper_reductions | ( | statement | , |
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().
thus it is similar to summary effects call translations. I do reuse some functions there by generating fake effects... I think they should be cleaned so as to offer reference plus predicate translations, and then would be used by reductions and effects. Fabien. translation of a reference, based on effect translations... such an interface should be available? of reference
persistent!
of effect
of reference
Definition at line 45 of file call.c.
References CONS, EFFECT, effect_any_reference, entity_name, FOREACH, gen_free(), gen_free_list(), gen_map(), is_approximation_exact, make_action_write_memory(), make_approximation(), make_simple_effect, NIL, pips_debug, REFERENCE, reference_variable, summary_effect_to_proper_effect(), and UU.
Referenced by translate_reduction().
of reduction
c,the | call to check for proper reductions |
of reduction
Definition at line 112 of file call.c.
References call_function, entity_module_p(), FOREACH, gen_nconc(), load_summary_reductions(), NIL, REDUCTION, reductions_list, and translate_reduction().
Referenced by pr_call_flt().
bool update_compatible_reduction | ( | reduction * | pr, |
entity | var, | ||
list | le, | ||
reductions | reds | ||
) |
what to do with reduction *pr for variable var under effects le and reductions reds.
returns whether worth to go on. conditions:
some reduction already available
must update the reduction with the encountered effects
else now no new reduction waas found, must check *pr against effects
some reduction
stores for latter cleaning
pr | r |
var | ar |
le | of effect |
reds | eds |
Definition at line 285 of file utils.c.
References DEBUG_REDUCTION, EFFECT, effect_variable, effect_write_p, entities_may_conflict_p(), ENTITY, entity_name, find_reduction_of_var(), FOREACH, free_reduction(), gen_once(), merge_two_reductions(), pips_debug, reduction_dependences, reduction_none_p, remove_variable_from_reduction(), store_effect_p(), and update_reduction_under_effect().
Referenced by build_reduction_of_variable().
update *pr according to r for variable var r is not touched.
else same var and no conflict
else are they compatible?
ok, let us merge them
pr | r |
var | ar |
Definition at line 260 of file utils.c.
References copy_reduction(), entities_may_conflict_p(), free_reduction(), merge_two_reductions(), reduction_none_p, reduction_tag, and reduction_variable.
Referenced by compatible_reduction_of_var().
void update_cumulated_reductions | ( | statement | , |
reductions | |||
) |
void update_printed_reductions | ( | statement | , |
reductions | |||
) |
void update_proper_reductions | ( | statement | , |
reductions | |||
) |
REDUCTION is dead if the reduction variable is affected
else
now var is written
red | ed |
eff | ff |
Definition at line 155 of file utils.c.
References effect_read_p, effect_variable, effect_write_p, entities_may_conflict_p(), ENTITY, entity_name, FOREACH, gen_free_list(), is_reduction_operator_none, pips_debug, reduction_dependences, reduction_op, reduction_operator_tag, reduction_operator_tag_name(), reduction_reference, reduction_variable, referenced_variables(), remove_variable_from_reduction(), and store_effect_p().
Referenced by update_compatible_reduction().