25 #include "pips_config.h"
109 new_stat =
rice_loop(stat, l, codegen_fun);
114 "sequential" :
"parallel");
118 fprintf(stderr,
" consistent\n");
176 "Cannot apply Allen & Kennedy's algorithm on "
177 "loop %s with index %s at Statement %d (%d, %d)"
178 " because it contains either tests or goto statements"
179 " which prohibit loop distribution. You could activate the"
180 " coarse_grain_parallelization rule.\n",
186 goto skip_parallelization_of_this_loop;
193 goto skip_parallelization_of_this_loop;
196 debug(2,
"rice_loop",
"applied on region:\n");
201 nstat = codegen_fun(stat,
dg,
region, l,
true);
204 pips_debug(7,
"consistency checking for CodeGenerate output: ");
206 fprintf(stderr,
" gen consistent\n");
239 fprintf(stderr,
"final nest of loops:\n\n");
252 skip_parallelization_of_this_loop:
enclosing++;
284 pips_debug(7,
"\nTesting NewGen consistency for initial code %s:\n",
287 fprintf(stderr,
" NewGen consistent statement\n");
291 debug(1,
"do_it",
"original sequential code:\n\n");
300 "\nTesting NewGen consistency for copy code %s:",
303 fprintf(stderr,
" NewGen consistent statement copy\n");
307 debug(1,
"do_it",
"copy of sequential code:\n\n");
324 mod_parallel_stat =
rice_statement(mod_parallel_stat, 1, codegen_fun);
334 pips_debug(7,
"\nparallelized code for module %s:", mod_name);
336 fprintf(stderr,
" gen consistent\n");
369 "MEMORY_EFFECTS_ONLY set to FALSE.");
380 static bool rice(
string mod_name)
393 "MEMORY_EFFECTS_ONLY set to FALSE.\n");
403 return rice(mod_name);
409 pips_user_warning(
"This phase is designed for experimental purposes only. The generated code is most likely to be illegal, especially if a privatization phase was performed before.\n");
410 return rice(mod_name);
416 return rice(mod_name);
statement copy_statement(statement p)
STATEMENT.
bool statement_consistent_p(statement p)
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
#define region
simulation of the type region
bool update_loops_locals(const char *, statement)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
struct _newgen_struct_graph_ * graph
#define graph_undefined_p(x)
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
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
set distributable_loop(statement l)
this functions checks if Kennedy's algorithm can be applied on the loop passed as argument.
bool parallel_loop_statement_p(statement s)
Test if a statement is a parallel loop.
void clean_enclosing_loops(void)
void print_parallelization_statistics(const char *module, const char *msg, statement s)
Print out the number of sequential versus parallel loops.
statement_mapping loops_mapping_of_statement(statement stat)
#define NIL
The empty list (nil in Lisp)
#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
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
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_block(statement)
Get the list of block statements of a statement sequence.
bool statement_loop_p(statement)
void fix_statement_attributes_if_sequence(statement)
Apply fix_sequence_statement_attributes() on the statement only if it really a sequence.
static statement mod_stat
We want to keep track of the current statement inside the recurse.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define user_warning(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
void print_statement_set(FILE *, set)
statement.c
void print_parallel_statement(statement)
void print_statement(statement)
Print a statement on stderr.
void set_bool_property(const char *, bool)
bool module_body_reorder(statement body)
Reorder a module.
#define instruction_block_p(i)
#define ORDERING_NUMBER(o)
#define ORDERING_STATEMENT(o)
#define statement_block_p(stat)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
#define make_empty_statement
An alias for make_empty_block_statement.
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...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool c_module_p(entity m)
Test if a module "m" is written in C.
const char * label_local_name(entity e)
END_EOLE.
void set_enclosing_loops_map(statement_mapping)
#define loop_execution(x)
#define instruction_loop_p(x)
#define instruction_loop(x)
#define statement_ordering(x)
#define statement_label(x)
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_expression
#define instruction_tag(x)
#define execution_sequential_p(x)
#define instruction_forloop(x)
#define instruction_whileloop(x)
#define whileloop_body(x)
#define statement_instruction(x)
#define statement_comments(x)
#define control_statement(x)
#define instruction_test(x)
#define statement_number(x)
#define instruction_unstructured(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
statement CodeGenerate(statement __attribute__((unused)) stat, graph g, set region, int l, bool task_parallelize_p)
This function implements Allen & Kennedy's algorithm.
bool rice_distribute_only
to know if do loop parallelization must be done
int enclosing
This is an horrendous hack.
statement rice_loop(statement stat, int l, statement(*codegen_fun)(statement, graph, set, int, bool))
Eventually parallelize a do-loop with à la Rice algorithm.
statement rice_statement(statement stat, int l, statement(*codegen_fun)(statement, graph, set, int, bool))
bool rice_data_dependence(string mod_name)
void rice_unstructured(unstructured u, int l, statement(*codegen_fun)(statement, graph, set, int, bool))
bool rice_cray(string mod_name)
bool do_it(string mod_name, bool distribute_p, string what, statement(*codegen_fun)(statement, graph, set, int, bool))
bool rice_all_dependence(string mod_name)
bool distributer(string mod_name)
static bool rice(string mod_name)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.