PIPS
|
This file holds transformations on OpenMP pragmas store in the RI as extension expression. More...
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "pipsdbm.h"
#include "properties.h"
#include "ri.h"
#include "ri-util.h"
#include "text-util.h"
#include "prettyprint.h"
#include "control.h"
#include "accel-util.h"
#include "callgraph.h"
#include "effects-generic.h"
#include "semantics.h"
#include "effects-convex.h"
Go to the source code of this file.
Data Structures | |
struct | context |
Macros | |
#define | statement_has_this_pragma_string_p(stmt, str) (get_extension_from_statement_with_pragma(stmt,str)!=NULL) |
Functions | |
bool | statement_has_omp_parallel_directive_p (statement s) |
manage_pragma.c More... | |
bool | pragma_omp_p (pragma p) |
Check that a pragma is an "omp" one. More... | |
static void | build_omp_pragma_list (extensions exts, list *l_pragma) |
Callback for gen_recurse that build a list of OpenMP pragma to be merged. More... | |
static bool | inner_filter (loop l, bool *inner_flag) |
static void | inner_rewrite (loop l, bool *inner_flag) |
static bool | build_outer (loop l, list *l_outer) |
static void | merge_on_outer (list l_outer) |
merge the omp pragma on the most outer parallel loop More... | |
static void | build_iteration_list (range r, list *l_iters) |
static void | add_loop_parallel_threshold (pragma pr) |
add a if condition to the omp pragma More... | |
bool | omp_merge_pragma (const char *module_name) |
merge the pragma on the outer loop More... | |
bool | omp_loop_parallel_threshold_set (const char *module_name) |
void | clear_pragma_on_statement (statement s) |
Remove all pragma attached to a given statement. More... | |
bool | clear_pragma (const char *module_name) |
Clear all pragma This should be done on any input with unhandled pragma, we don't what semantic we might break... More... | |
bool | outline_stmts_between_pragmas_in_sequence (sequence s, void *_ctx) |
bool | pragma_outliner (char *module_name) |
This file holds transformations on OpenMP pragmas store in the RI as extension expression.
Here is the list of transformations: 1- add an OpenMP if clause 2- Merge nested OpenMP clause
Definition in file manage_pragma.c.
#define statement_has_this_pragma_string_p | ( | stmt, | |
str | |||
) | (get_extension_from_statement_with_pragma(stmt,str)!=NULL) |
Definition at line 439 of file manage_pragma.c.
|
static |
add a if condition to the omp pragma
pr,the | pragma to process |
Definition at line 249 of file manage_pragma.c.
References add_expr_to_pragma_expr_list(), build_iteration_list(), CreateIntrinsic(), expressions_to_operation(), gen_context_recurse, gen_expression_cons(), gen_free_list(), gen_get_ancestor(), gen_true2(), get_bool_property(), get_prettyprint_language(), instruction_loop, instruction_loop_p, loop_range, MULTIPLY_OPERATOR_NAME, NIL, pl, pragma_build_if_condition(), pragma_expression_p, pragma_if_as_expr(), range_domain, range_to_expression(), range_to_nbiter, statement_domain, and statement_instruction.
Referenced by omp_loop_parallel_threshold_set().
Definition at line 241 of file manage_pragma.c.
References gen_expression_cons(), range_to_expression(), and range_to_nbiter.
Referenced by add_loop_parallel_threshold().
|
static |
Callback for gen_recurse that build a list of OpenMP pragma to be merged.
Also remove them from the list they currently belongs to. It'll ignore string pragma (at that time, all that aren't generated by PIPS). A pragma that begin with "omp" in the original code will lead to a warning It'll ignore all pragma that are not begining with "omp".
Definition at line 108 of file manage_pragma.c.
References EXTENSION, extension_pragma, extensions_extension, FOREACH, gen_extension_cons(), gen_list_and_not(), gen_pragma_cons(), NIL, pips_debug, pips_user_warning, pragma_expression_p, pragma_omp_p(), and pragma_to_string().
Referenced by merge_on_outer().
Definition at line 183 of file manage_pragma.c.
References EXTENSION, extension_pragma, extensions_extension, FOREACH, gen_get_ancestor(), gen_statement_cons(), pips_debug, pragma_expression_p, pragma_to_string(), statement_domain, and statement_extensions.
Referenced by omp_merge_pragma().
bool clear_pragma | ( | const char * | module_name | ) |
Clear all pragma This should be done on any input with unhandled pragma, we don't what semantic we might break...
Put the new CODE ressource into PIPS:
module_name | odule_name |
Definition at line 403 of file manage_pragma.c.
References clear_pragma_on_statement(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_recurse, gen_true(), module_name(), module_name_to_entity(), pips_debug, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), statement_domain, and statement_undefined.
void clear_pragma_on_statement | ( | statement | s | ) |
Remove all pragma attached to a given statement.
Definition at line 388 of file manage_pragma.c.
References CONS, EXTENSION, extension_pragma_p, extensions_extension, FOREACH, gen_free_list(), NIL, and statement_extensions.
Referenced by clear_pragma(), is_SCOP_rich(), and outline_stmts_between_pragmas_in_sequence().
Definition at line 141 of file manage_pragma.c.
References pips_debug.
Referenced by omp_merge_pragma().
Definition at line 149 of file manage_pragma.c.
References EXTENSION, extension_pragma, extensions_extension, FOREACH, gen_extension_cons(), gen_get_ancestor(), gen_list_and_not(), NIL, pips_debug, pragma_to_string(), statement_domain, and statement_extensions.
Referenced by omp_merge_pragma().
|
static |
merge the omp pragma on the most outer parallel loop
Definition at line 205 of file manage_pragma.c.
References add_pragma_expr_to_statement(), build_omp_pragma_list(), extensions_domain, extensions_extension, filter_variables_in_pragma_expr(), FOREACH, fprintf(), gen_context_recurse, gen_copy_seq(), gen_free_list(), gen_true2(), get_prettyprint_language(), ifdebug, NIL, pips_debug, pragma_omp_merge_expr(), print_entities(), STATEMENT, statement_extensions, and statement_to_declarations().
Referenced by omp_merge_pragma().
bool omp_loop_parallel_threshold_set | ( | const char * | module_name | ) |
Should never arise
Put the new CODE ressource into PIPS:
module_name | odule_name |
Definition at line 351 of file manage_pragma.c.
References add_loop_parallel_threshold(), code_language, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, entity_initial, gen_recurse, gen_true(), is_language_fortran, language_tag, module_name(), module_name_to_entity(), pips_debug, pragma_domain, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), set_prettyprint_language_from_property(), statement_undefined, value_code, and value_code_p.
bool omp_merge_pragma | ( | const char * | module_name | ) |
merge the pragma on the outer loop
Should never arise
module_name | odule_name |
Definition at line 297 of file manage_pragma.c.
References build_outer(), code_language, entity_initial, FOREACH, gen_context_recurse, gen_free_list(), gen_null2(), get_string_property(), inner_filter(), inner_rewrite(), is_language_fortran, language_tag, loop_domain, merge_on_outer(), module_name(), module_name_to_entity(), NIL, pips_debug, PIPS_PHASE_POSTLUDE, PIPS_PHASE_PRELUDE, set_prettyprint_language_from_property(), value_code, and value_code_p.
_ctx | ctx |
Definition at line 454 of file manage_pragma.c.
References build_new_top_level_module_name(), clear_pragma_on_statement(), CONS, ENDP, FOREACH, gen_free_list(), gen_nreverse(), NIL, context::outline_done, outliner(), pips_user_warning, context::pragma_begin, context::pragma_end, context::prefix, sequence_statements, STATEMENT, and statement_has_this_pragma_string_p.
Referenced by pragma_outliner().
Check that a pragma is an "omp" one.
Definition at line 78 of file manage_pragma.c.
References call_function, CAR, entity_local_name(), EXPRESSION, expression_call(), expression_call_p(), gen_last(), OMP_OMP_FUNCTION_NAME, pips_internal_error, pragma_expression, pragma_expression_p, pragma_string, pragma_string_p, and same_string_p.
Referenced by build_omp_pragma_list().
bool pragma_outliner | ( | char * | module_name | ) |
module_name | odule_name |
Definition at line 512 of file manage_pragma.c.
References compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, free_value_mappings(), gen_context_recurse, gen_null2(), generic_effects_reset_all_methods(), get_current_module_entity(), get_current_module_statement(), get_string_property(), local_name_to_top_level_entity(), module_name(), module_to_value_mappings(), context::outline_done, outline_stmts_between_pragmas_in_sequence(), context::pragma_begin, context::pragma_end, context::prefix, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_precondition_map(), reset_proper_rw_effects(), reset_rw_effects(), reset_transformer_map(), sequence_domain, set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_methods_for_convex_effects(), set_precondition_map(), set_proper_rw_effects(), set_rw_effects(), and set_transformer_map().
Definition at line 52 of file manage_pragma.c.
References call_function, CreateIntrinsic(), EXPRESSION, expression_call(), expression_call_p(), EXTENSION, extension_pragma, extensions_extension, FOREACH, OMP_OMP_FUNCTION_NAME, pragma_expression, pragma_expression_p, pragma_string, pragma_string_p, same_entity_p(), and statement_extensions.