34 #include "pips_config.h"
58 if((found = (strstr(ps,
"omp parallel") || strstr(ps,
"OMP PARALLEL"))))
79 bool pragma_omp =
false;
119 "parse it and thus it'll be ignored.\n");
129 "Ignore pragma : %s, it's not an openmp one !\n",
142 pips_debug(5,
"processing loop : %p.\n", (
void*) l);
159 if(*inner_flag ==
true) {
163 "keeping pragma : %s from extensions %p.\n",
171 "removing pragma : %s from extensions %p.\n",
196 pips_debug(5,
"outer pragma as expression found\n");
215 list outer_extensions =
227 pips_debug(4,
"Filter out local variables from pragma : ");
300 "OPMIFY_CODE_DEBUG_LEVEL");
314 bool outer = (strcmp(merge_policy,
"outer") == 0);
331 bool inner_flag =
true;
352 debug_on(
"OPMIFY_CODE_DEBUG_LEVEL");
404 debug_on(
"CLEAR_PRAGMA_DEBUG_LEVEL");
439 #define statement_has_this_pragma_string_p(stmt,str) \
440 (get_extension_from_statement_with_pragma(stmt,str)!=NULL)
458 bool in_scop =
false;
465 bool has_to_outline_p =
false;
476 has_to_outline_p =
true;
484 if(has_to_outline_p && !
ENDP(stmts_to_outline)) {
489 outliner(func_name, stmts_to_outline);
492 stmts_to_outline =
NIL;
500 "(%s) but did not encountered any pragma end (%s)\n",
list gen_expression_cons(expression p, list l)
list gen_pragma_cons(pragma p, list l)
list gen_extension_cons(extension p, list l)
list gen_statement_cons(statement p, list l)
statement outliner(const char *, list)
outline the statements in statements_to_outline into a module named outline_module_name the outlined ...
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
struct _newgen_struct_statement_ * statement
void set_methods_for_convex_effects(void)
methods.c
void set_rw_effects(statement_effects)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void generic_effects_reset_all_methods(void)
void reset_cumulated_rw_effects(void)
void reset_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
list gen_last(list l)
Return the last element of a list.
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define PIPS_PHASE_POSTLUDE(new_module_statement)
End a transformation phase by putting back into PIPS the (possibly) modified statement.
#define PIPS_PHASE_PRELUDE(module_name, debug_env_var)
Start a phase that use a module CODE.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
list statement_to_declarations(void *)
Get a list of all variables declared recursively within a statement.
void set_prettyprint_language_from_property(enum language_utype native)
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the prope...
language get_prettyprint_language()
please avoid using this function directly, use predicate instead (see below)
static void inner_rewrite(loop l, bool *inner_flag)
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.
bool omp_merge_pragma(const char *module_name)
merge the pragma on the outer loop
static void merge_on_outer(list l_outer)
merge the omp pragma on the most outer parallel loop
bool outline_stmts_between_pragmas_in_sequence(sequence s, void *_ctx)
bool statement_has_omp_parallel_directive_p(statement s)
manage_pragma.c
bool pragma_outliner(char *module_name)
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 mi...
static void build_iteration_list(range r, list *l_iters)
void clear_pragma_on_statement(statement s)
Remove all pragma attached to a given statement.
static void add_loop_parallel_threshold(pragma pr)
add a if condition to the omp pragma
static bool inner_filter(loop l, bool *inner_flag)
static bool build_outer(loop l, list *l_outer)
bool pragma_omp_p(pragma p)
Check that a pragma is an "omp" one.
#define statement_has_this_pragma_string_p(stmt, str)
bool omp_loop_parallel_threshold_set(const char *module_name)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_internal_error
#define same_string_p(s1, s2)
void add_expr_to_pragma_expr_list(pragma pr, expression ex)
Add an expression to the pragma current expression list.
string pragma_to_string(pragma p)
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
#define OMP_OMP_FUNCTION_NAME
#define MULTIPLY_OPERATOR_NAME
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
void print_entities(list l)
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
expression range_to_expression(range r, enum range_to_expression_mode mode)
computes the distance between the lower bound and the upper bound of the range
expression expressions_to_operation(const list l_exprs, entity op)
take a list of expression and apply a binary operator between all of them and return it as an express...
bool expression_call_p(expression e)
call expression_call(expression e)
string build_new_top_level_module_name(const char *prefix, bool prevent_suffix)
Get a new name for a module built from a prefix.
list pragma_omp_merge_expr(list outer_extensions, list l_pragma, language l)
merge omp pragma.
expression pragma_if_as_expr(expression arg)
list filter_variables_in_pragma_expr(list l_expr, list to_filter)
filter out a pragma (expression list) removing all requested variables @params l_expr is the list of ...
void add_pragma_expr_to_statement(statement st, list l)
Add a pragma as a list of expression to a statement.
expression pragma_build_if_condition(expression cond, language l)
build the expression to be put in the if clause.
#define pragma_expression_p(x)
#define extension_pragma_p(x)
#define instruction_loop_p(x)
#define loop_domain
newgen_language_domain_defined
#define pragma_domain
newgen_persistant_statement_to_statement_domain_defined
#define instruction_loop(x)
#define pragma_string_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define extension_pragma(x)
#define EXTENSION(x)
EXTENSION.
#define pragma_expression(x)
#define sequence_statements(x)
#define statement_extensions(x)
#define statement_instruction(x)
#define extensions_extension(x)
#define sequence_domain
newgen_reference_domain_defined
#define range_domain
newgen_ram_domain_defined
#define extensions_domain
newgen_extension_domain_defined
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
void set_transformer_map(statement_mapping)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
void reset_transformer_map(void)
The structure used to build lists in NewGen.