PIPS
|
#include "local-header.h"
#include "prettyprint.h"
#include "properties.h"
#include "reductions.h"
#include "reduction.h"
#include "callgraph.h"
Go to the source code of this file.
Data Structures | |
struct | atomic_operation |
Define an atomic operation FIXME : should be moved under newgen management. More... | |
struct | atomic_profile |
Stucture that define the list of atomic_operations. More... | |
struct | replace_ctx |
Keep track of what is done in replace recursion. More... | |
Typedefs | |
typedef struct atomic_operation | atomic_operation |
Define an atomic operation FIXME : should be moved under newgen management. More... | |
typedef struct atomic_profile | atomic_profile |
Stucture that define the list of atomic_operations. More... | |
Enumerations | |
enum | atomic_op { UNKNOWN_OP , ADD , SUB , INC , DEC , AND , OR , XOR } |
Profiles for supported atomic operations FIXME should be newgen tag. More... | |
enum | atomic_type { UNKNOWN_TYPE , DOUBLE , FLOAT , INT , LONG_INT } |
enum | process_reductions_mode { DO_REPLACE , DO_NOT_REPLACE , USE_OPENMP } |
Functions | |
static atomic_profile | load_atomic_profile () |
static entity | atomic_function_of_operation (atomic_operation op) |
Get an atomic function that replace a reduction operator. More... | |
static atomic_operation | reduction_to_atomic_operation (reduction r) |
static bool | supported_atomic_operator_p (atomic_operation op, atomic_profile *profile) |
static bool | replace_reductions_in_statement (statement s, struct replace_ctx *ctx) |
Replace a reduction in a statement by a pattern matching way. More... | |
static bool | process_reductions_in_loop (statement loop_stat, atomic_profile *profile, list *replaced_statements, bool replace) |
static bool | process_reductions_in_openmp_loop (statement st) |
static bool | process_reduced_loops (const char *mod_name, process_reductions_mode mode) |
bool | replace_reduction_with_atomic (string mod_name) |
Replace reduction with atomic operations. More... | |
bool | flag_parallel_reduced_loops_with_atomic (string mod_name) |
Flag loop as parallel when replacement with atomic is possible without doing the replacement. More... | |
bool | flag_parallel_reduced_loops_with_openmp_directives (const char *mod_name) |
Flag loop as parallel with OpenMP directives taking reductions into account. More... | |
Variables | |
static atomic_operation | cuda [] |
typedef struct atomic_operation atomic_operation |
Define an atomic operation FIXME : should be moved under newgen management.
typedef struct atomic_profile atomic_profile |
Stucture that define the list of atomic_operations.
enum atomic_op |
enum atomic_type |
|
static |
Get an atomic function that replace a reduction operator.
Definition at line 116 of file atomic.c.
References ADD, AND, concatenate(), DEC, DOUBLE, FLOAT, free(), INC, INT, LONG_INT, make_empty_function(), make_language_c(), MakeDoubleprecisionResult(), MakeIntegerResult(), MakeLongIntegerResult(), MakeRealResult(), atomic_operation::op, OR, pips_internal_error, prefix, strdup(), string_undefined, SUB, atomic_operation::type, type_undefined, and XOR.
Referenced by replace_reductions_in_statement().
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 | ) |
|
static |
Definition at line 84 of file atomic.c.
References cuda, get_string_property(), pips_user_error, atomic_profile::profile, and same_string_p.
Referenced by process_reduced_loops().
|
static |
Definition at line 331 of file atomic.c.
References compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, DO_NOT_REPLACE, DO_REPLACE, FOREACH, get_current_module_statement(), load_atomic_profile(), local_name_to_top_level_entity(), loops, NIL, ordering_to_statement(), pips_internal_error, process_reductions_in_loop(), process_reductions_in_openmp_loop(), atomic_profile::profile, atomic_profile::profile_size, reduced_loops_ordering, replace_ctx::replaced_statements, reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_printed_reductions(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_printed_reductions(), statement_consistent_p(), and USE_OPENMP.
Referenced by flag_parallel_reduced_loops_with_atomic(), and replace_reduction_with_atomic().
|
static |
Definition at line 284 of file atomic.c.
References ENDP, execution_tag, gen_context_recurse, gen_null2(), is_execution_parallel, is_execution_sequential, loop_execution, loop_parallel_p(), pips_debug, replace_ctx::profile, reductions_list, replace_ctx::replace, replace_reductions_in_statement(), replace_ctx::replaced, replace_ctx::replaced_statements, ret, statement_domain, statement_loop(), statement_loop_p(), and replace_ctx::unsupported.
Referenced by process_reduced_loops().
Definition at line 319 of file atomic.c.
References execution_tag, is_execution_parallel, loop_execution, omp_pragma_expr_for(), omp_pragma_expr_for_reduction(), pips_assert, ret, statement_loop(), and statement_loop_p().
Referenced by process_reduced_loops().
|
static |
Definition at line 177 of file atomic.c.
References ADD, AND, INT, 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, atomic_operation::op, OR, pips_user_warning, reduction_op, reduction_operator_tag, atomic_operation::type, UNKNOWN_OP, and UNKNOWN_TYPE.
Referenced by replace_reductions_in_statement().
Replace reduction with atomic operations.
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().
|
static |
Replace a reduction in a statement by a pattern matching way.
Definition at line 222 of file atomic.c.
References ADDRESS_OF_OPERATOR_NAME, atomic_function_of_operation(), CAR, CONS, copy_reference(), entity_intrinsic(), entity_undefined_p, EXPRESSION, expression_undefined_p, fprintf(), gen_in_list_p(), gen_length(), get_complement_expression(), ifdebug, int_to_expression(), make_call_instruction(), MakeUnaryCall(), pips_assert, pips_debug, pips_user_warning, print_reduction(), print_statement(), replace_ctx::profile, REDUCTION_CAST, reduction_reference, reduction_to_atomic_operation(), reductions_list, ref, reference_to_expression(), replace_ctx::replace, replace_ctx::replaced, replace_ctx::replaced_statements, statement_call_p(), statement_instruction, and supported_atomic_operator_p().
Referenced by process_reductions_in_loop().
|
static |
Definition at line 207 of file atomic.c.
References atomic_operation::op, atomic_profile::profile, atomic_profile::profile_size, and atomic_operation::type.
Referenced by replace_reductions_in_statement().
|
static |