25 #include "pips_config.h"
49 #define debug_print_control(c, w)\
51 "%s: ctr %p (stat %p) , %zd preds, %zd succs\n", w, \
52 c, control_statement(c), \
53 gen_length(control_predecessors(c)), \
54 gen_length(control_successors(c))); \
55 print_statement(control_statement(c));
92 s_true, s_hosttrue, s_nodetrue,
93 s_false, s_hostfalse, s_nodefalse;
140 for (; len>=1; len--)
157 for (; dim>=1; dim--)
220 pips_debug(7,
"no reference to distributed variable\n");
308 pips_debug(7,
"some references to distributed variable\n");
366 hoststatp, nodestatp);
426 pips_debug(9,
"host controls for [%p,%p]:\n", ct, ce);
451 DEBUG_STAT(7,
"host new stat (again)", *hoststatp);
651 pips_debug(5,
"condition results: aa %d, in %d\n", at_ac, in_in);
661 else if (at_ac && !in_in)
670 pips_debug(7,
"overlap analysis succeeded\n");
673 *nodestatp = overlapstat;
679 pips_debug(7,
"overlap analysis is not ok...\n");
689 pips_debug(7,
"compiling a parallel loop sequential...\n");
695 pips_debug(7,
"compiling a sequential loop\n");
719 pips_debug(9,
"only io %d, remapping %d, reduction %d\n",
unstructured make_unstructured(control a1, control a2)
execution make_execution(enum execution_utype tag, void *val)
call make_call(entity a1, list a2)
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
statement copy_statement(statement p)
STATEMENT.
test make_test(expression a1, statement a2, statement a3)
call copy_call(call p)
CALL.
control make_control(statement a1, list a2, list a3)
range make_range(expression a1, expression a2, expression a3)
static list blocks
lisp of loops
bool indirections_inside_statement_p(_UNUSED_ statement stat)
indirections_inside_statement_p
list lIndicesOfRef(list lsyn)
computes the list of indices of the list of ref that are variables...
void FindRefToDistArrayInStatement(statement obj, list *lwp, list *lrp)
list FindDefinitionsOf(statement stat, list lsyn)
bool atomic_accesses_only_p(_UNUSED_ statement stat)
atomic_accesses_only_p
void update_control_lists(control c, control_mapping map)
Compiler Utilities.
list AddOnceToIndicesList(list l, list lsyn)
static void hpf_compile_loop(statement stat, statement *hoststatp, statement *nodestatp)
void hpf_compiler(statement stat, statement *hoststatp, statement *nodestatp)
what: compile a statement into a host and SPMD node code.
entity host_module
HPFC - Fabien Coelho, May 1993 and later...
#define debug_print_control(c, w)
static void hpf_compile_call(statement stat, statement *hoststatp, statement *nodestatp)
returned node version
static void hpf_compile_parallel_body(statement body, statement *hoststatp, statement *nodestatp)
static bool loop_flt(loop l)
static void hpf_compile_unstructured(statement stat, statement *hoststatp, statement *nodestatp)
static list caller_list_of_bounds(_UNUSED_ entity fun, list le)
return the list of bounds
static void hpf_compile_test(statement s, statement *hoststatp, statement *nodestatp)
static void hpf_compile_sequential_loop(statement stat, statement *hoststatp, statement *nodestatp)
static bool parallel_loop_in_stat_p(statement s)
static void hpf_compile_parallel_loop(statement stat, statement *hoststatp, statement *nodestatp)
static bool parallel_loop_found
is there a parallel loop down s?
static void compile_control(control c, statement_mapping maph, statement_mapping mapn)
static void hpf_compile_block(statement stat, statement *hoststatp, statement *nodestatp)
#define gen_recurse(start, domain_number, flt, rwt)
void generate_c1_beta(statement stat, list *lhp, list *lnp)
??? this should work (but that is not the case yet), with every call with no write to distributed arr...
void generate_c1_alpha(statement stat, list *lhp, list *lnp)
generate_c1_alpha
void generate_parallel_body(statement body, list *lstatp, list lw, list lr)
statement make_block_statement(list)
Make a block statement from a list of statement.
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
statement get_current_module_statement(void)
Get the current module statement.
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#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
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define CDR(pcons)
Get the list less its first element.
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
loop statement_loop(statement)
Get the loop of a statement.
bool statement_loop_p(statement)
void insert_comments_to_statement(statement, const char *)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
bool empty_code_p(statement)
statement.c
statement make_continue_statement(entity)
void update_object_for_module(void *obj, entity module)
list lNewVariableForModule(entity module, list le)
entity NewVariableForModule(entity module, entity e)
list lUpdateExpr(entity module, list l)
list lUpdateExpr_but_distributed(entity module, list l)
used for compiling calls.
expression UpdateExpressionForModule(entity module, expression ex)
this function creates a new expression using the mapping of old to new variables map.
statement MakeStatementLike(statement stat, int the_tag)
creates a new statement for the given module that looks like the stat one, i.e.
bool ref_to_dist_array_p(void *obj)
this file describe a few functions usefull to the compiler to manage the hpfc data structures.
bool ith_dim_overlapable_p(entity array, int i)
void update_overlaps_in_caller(entity fun, list le)
the overlaps of the actual parameters are updated according to the formal requirements.
#define one_statement_unstructured(u)
#define DEBUG_STAT(D, W, S)
void remapping_compile(statement, statement *, statement *)
void remapping_compile(s, hsp, nsp) statement s, *hsp, *nsp;
bool bound_hpf_reductions_p(statement)
bool bound_renamings_p(statement)
entity load_new_node(entity)
statement root_statement_remapping_inits(statement)
returns the initialization statement: must initialize the status and liveness of arrays
bool full_copy_p(statement, reference *, reference *)
bool Overlap_Analysis(statement, statement *)
check conditions and compile...
void io_efficient_compile(statement, statement *, statement *)
compile an io statement
expression hpfc_array_bound(entity, bool, int)
list compile_hpf_reduction(list, bool, bool)
of statement
list handle_hpf_reduction(statement)
of hpfc_reductions
bool subarray_shift_p(statement, entity *, list *)
statement generate_full_copy(reference, reference)
statement generate_full_copy(reference left, reference right)
bool compile_reduction(statement, statement *, statement *)
bool compile_reduction(initial, phost, pnode)
statement generate_all_liveness(entity, bool)
bool load_statement_only_io(statement)
statement generate_subarray_shift(statement, entity, list)
statement generate_subarray_shift(s, var, lshift) statement s; entity var; list lshift;
bool call_reduction_p(call)
bool array_distributed_p(entity)
struct _newgen_struct_control_ * control
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define MAKE_CONTROL_MAPPING()
#define GET_CONTROL_MAPPING(map, cont)
#define FREE_CONTROL_MAPPING(map)
#define SET_CONTROL_MAPPING(map, cont, val)
#define string_undefined_p(s)
#define instruction_block_p(i)
#define ENTITY_ASSIGN_P(e)
#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.
entity entity_empty_label(void)
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
bool dead_fcd_directive_p(entity f)
int NumberOfDimension(entity)
#define syntax_reference_p(x)
#define loop_execution(x)
#define syntax_reference(x)
#define instruction_loop_p(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define instruction_loop(x)
#define CONTROL(x)
CONTROL.
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
@ is_instruction_unstructured
#define instruction_tag(x)
#define control_undefined_p(x)
#define unstructured_exit(x)
#define instruction_unstructured_p(x)
#define instruction_call_p(x)
#define test_condition(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_call(x)
@ is_execution_sequential
#define instruction_test_p(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define expression_syntax(x)
#define execution_parallel_p(x)
#define instruction_unstructured(x)
#define STATEMENT(x)
STATEMENT.
The structure used to build lists in NewGen.