PIPS
|
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "effects.h"
#include "misc.h"
#include "local.h"
#include "prettyprint.h"
Go to the source code of this file.
Functions | |
void | rice_unstructured (unstructured u, int l, statement(*codegen_fun)(statement, graph, set, int, bool)) |
statement | rice_statement (statement stat, int l, statement(*codegen_fun)(statement, graph, set, int, bool)) |
statement | rice_loop (statement stat, int l, statement(*codegen_fun)(statement, graph, set, int, bool)) |
Eventually parallelize a do-loop with à la Rice algorithm. More... | |
bool | do_it (string mod_name, bool distribute_p, string what, statement(*codegen_fun)(statement, graph, set, int, bool)) |
bool | distributer (string mod_name) |
static bool | rice (string mod_name) |
bool | rice_all_dependence (string mod_name) |
bool | rice_data_dependence (string mod_name) |
bool | rice_cray (string mod_name) |
Variables | |
graph | dg = graph_undefined |
Remi Triolet. More... | |
bool | rice_distribute_only |
to know if do loop parallelization must be done More... | |
int | enclosing = 0 |
This is an horrendous hack. More... | |
mod_name | od_name |
Definition at line 354 of file rice.c.
References c_module_p(), CodeGenerate(), debug_off, debug_on, do_it(), get_bool_property(), local_name_to_top_level_entity(), module, and pips_user_warning.
bool do_it | ( | string | mod_name, |
bool | distribute_p, | ||
string | what, | ||
statement(*)(statement, graph, set, int, bool) | codegen_fun | ||
) |
In spite of its name, the new statement "mod_parallel_stat" may be sequential if distribute_p is true
Make sure the dependence graph points towards the code copy
Regenerate statement_ordering for the parallel code
FI: This may be parallel or sequential code
mod_name | od_name |
distribute_p | istribute_p |
what | hat |
Definition at line 261 of file rice.c.
References clean_up_sequences(), copy_statement(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug(), debug_off, debug_on, dg, enclosing, fprintf(), get_current_module_statement(), graph_undefined, graph_undefined_p, ifdebug, local_name_to_top_level_entity(), mod_stat, module, module_body_reorder(), pips_debug, pips_internal_error, print_parallel_statement(), print_parallelization_statistics(), print_statement(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), rice_distribute_only, rice_statement(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), statement_consistent_p(), statement_undefined, and update_loops_locals().
Referenced by distributer(), and rice().
Definition at line 380 of file rice.c.
References c_module_p(), CodeGenerate(), do_it(), get_bool_property(), local_name_to_top_level_entity(), module, and pips_user_error.
Referenced by rice_all_dependence(), rice_cray(), and rice_data_dependence().
mod_name | od_name |
Definition at line 400 of file rice.c.
References rice(), and set_bool_property().
mod_name | od_name |
Definition at line 413 of file rice.c.
References rice(), and set_bool_property().
mod_name | od_name |
Definition at line 406 of file rice.c.
References pips_user_warning, rice(), and set_bool_property().
statement rice_loop | ( | statement | stat, |
int | l, | ||
statement(*)(statement, graph, set, int, bool) | codegen_fun | ||
) |
Eventually parallelize a do-loop with à la Rice algorithm.
Well the loop is already parallel and we are asked not to do the job again that may lead to less optimal code for the target:
The code generation did not generate anything, probably because the loop body was empty ("CONTINUE"/";", "{ }"), so no loop is generated:
FI: I'd rather not return a block when a unique loop statement has to be wrapped.
try to keep label
Do not forget to move forbidden information associated with block:
StatementToContext should be freed here. but it is not easy.
Skip the parallelization of this loop but go on recursion for eventual loops in this loop body:
stat | tat |
Definition at line 160 of file rice.c.
References clean_enclosing_loops(), debug(), dg, distributable_loop(), enclosing, entity_local_name(), fix_statement_attributes_if_sequence(), FOREACH, fprintf(), get_bool_property(), ifdebug, instruction_block_p, instruction_loop, instruction_loop_p, label_local_name(), loop_body, loop_index, loop_label, loops_mapping_of_statement(), make_empty_statement, ORDERING_NUMBER, ORDERING_STATEMENT, parallel_loop_statement_p(), pips_assert, pips_debug, print_parallel_statement(), print_statement(), print_statement_set(), region, rice_statement(), set_enclosing_loops_map(), set_free(), set_undefined, STATEMENT, statement_block(), statement_block_p, statement_comments, statement_consistent_p(), statement_instruction, statement_label, statement_loop_p(), statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, statement_undefined, and user_warning.
Referenced by rice_statement().
statement rice_statement | ( | statement | stat, |
int | l, | ||
statement(*)(statement, graph, set, int, bool) | codegen_fun | ||
) |
stat | tat |
Definition at line 82 of file rice.c.
References CAR, execution_sequential_p, forloop_body, fprintf(), ifdebug, instruction_block, instruction_forloop, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_block, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_execution, MAPL, pips_debug, pips_internal_error, print_parallel_statement(), rice_loop(), rice_unstructured(), STATEMENT, STATEMENT_, statement_consistent_p(), statement_instruction, statement_loop_p(), test_false, test_true, and whileloop_body.
Referenced by do_it(), invariant_code_motion(), rice_loop(), and rice_unstructured().
void rice_unstructured | ( | unstructured | u, |
int | l, | ||
statement(*)(statement, graph, set, int, bool) | codegen_fun | ||
) |
Definition at line 69 of file rice.c.
References CONTROL_MAP, control_statement, gen_free_list(), NIL, rice_statement(), and unstructured_control.
Referenced by rice_statement().
graph dg = graph_undefined |
Remi Triolet.
external variables.
Modifications:
Definition at line 59 of file rice.c.
Referenced by do_it(), and rice_loop().
int enclosing = 0 |
This is an horrendous hack.
ENCLOSING should be passed as an argument, but I don't have the courage to make the changes .
Definition at line 67 of file rice.c.
Referenced by ConnectedStatements(), do_it(), glc_call(), glc_cast(), glc_ref(), ignore_this_conflict(), invariant_code_motion(), IsolatedStatement(), MakeNestOfStatementList(), and rice_loop().
bool rice_distribute_only |
to know if do loop parallelization must be done
Definition at line 62 of file rice.c.
Referenced by do_it(), and MakeLoopAs().