PIPS
|
#include "defines-local.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
Go to the source code of this file.
Data Structures | |
struct | RunTimeSupportDescriptor |
Macros | |
#define | is_end 0 |
this file stores the table that describes run time functions and variables that may be called or referenced by the generated code. More... | |
#define | is_sub 1 |
#define | is_fun 2 |
#define | is_var 3 |
#define | is_int 4 |
#define | is_ifn 5 /**intrinsic like function */ |
#define | is_iof 6 /**I/O like function */ |
#define | no_basic is_basic_overloaded |
#define | no_entity entity_undefined |
Functions | |
entity | MakeRunTimeSupportSubroutine (string local_name, _UNUSED_ int number_of_arguments) |
Runtime Support Functions Management. More... | |
entity | MakeRunTimeSupportFunction (string local_name, _UNUSED_ int number_of_arguments, tag return_type) |
entity MakeRunTimeSupportFunction (local_name, number_of_arguments, return_type) More... | |
expression | pvm_what_option_expression (entity v) |
string | pvm_what_options (basic b) |
string pvm_what_options(b) More... | |
statement | st_call_send_or_receive (entity f, reference r) |
Sends. More... | |
statement | st_compute_current_computer (reference ref) |
Computes. More... | |
statement | st_compute_current_owners (reference ref) |
expression | expr_compute_local_index (entity array, int dim, expression expr) |
new index computation formula, derived from the new declarations made for the given dimension. More... | |
statement | hpfc_make_call_statement (entity e, list l) |
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression list l as an argument. More... | |
static void | rwt (call c) |
static void | srwt (statement s) |
static void | substitute_return (entity o, entity n, statement s) |
void | add_pvm_init_and_end (statement *phs, statement *pns) |
this is for the main. More... | |
statement | st_compute_neighbour (int d) |
call to the runtime support function HPFC_CMPNEIGHBOUR(d) More... | |
static entity | make_packing_function (int ndim, bool kind, basic base, int nargs) |
find or create an entity for the packing function... More... | |
statement | st_generate_packing (entity array, list content, bool bsend) |
statement st_generate_packing_and_passing(array, content, bsend) More... | |
entity | hpfc_main_entity (entity e) |
returns the entity to which e is attached, that is first a common, then a function... More... | |
const char * | hpfc_main_entity_name (entity e) |
returns the name of the entity e belongs too (common, function...) More... | |
string | bound_parameter_name (entity array, string side, int dim) |
returns a name for the bound of the declaration of array array, side side and dimension dim. More... | |
entity | argument_bound_entity (entity module, entity array, bool upper, int dim) |
expression | hpfc_array_bound (entity array, bool upper, int dim) |
static list | array_bounds_list (entity array, bool upper) |
of expressions More... | |
list | array_lower_upper_bounds_list (entity array) |
of expressions More... | |
void | hpfc_init_run_time_entities () |
to be seen from outside of this file More... | |
static RunTimeSupportDescriptor * | find_entry_by_name (const char *name) |
entity | hpfc_name_to_entity (const char *name) |
bool | hpfc_intrinsic_like_function (entity e) |
bool | hpfc_io_like_function (entity e) |
Variables | |
static entity | sub_call_o = entity_undefined |
static entity | sub_call_n = entity_undefined |
static entity | sub_ret_label = entity_undefined |
static bool | RTSTable_initialized_p = false |
static RunTimeSupportDescriptor | RTSTable [] |
#define is_end 0 |
this file stores the table that describes run time functions and variables that may be called or referenced by the generated code.
the information needed (name, arity, type...) is stored in a static table here. The table is scanned to create the corresponding entities for once. Then the entities are quickly returned on demand thru the hpfc_name_to_entity function. It was inspired to me by some static table here around in PIPS, that deal with intrinsics for instance. local defines
Definition at line 570 of file run-time.c.
#define is_fun 2 |
Definition at line 572 of file run-time.c.
#define is_ifn 5 /**intrinsic like function */ |
Definition at line 575 of file run-time.c.
#define is_int 4 |
Definition at line 574 of file run-time.c.
#define is_iof 6 /**I/O like function */ |
Definition at line 576 of file run-time.c.
#define is_sub 1 |
Definition at line 571 of file run-time.c.
#define is_var 3 |
Definition at line 573 of file run-time.c.
#define no_basic is_basic_overloaded |
Definition at line 578 of file run-time.c.
#define no_entity entity_undefined |
Definition at line 579 of file run-time.c.
this is for the main.
also subs CALL RETURN -> CALL HPFC {HOST|NONE} END...
phs | hs |
pns | ns |
Definition at line 364 of file run-time.c.
References CONS, copy_statement(), entity_intrinsic(), entity_undefined, HOST_END, hpfc_make_call_statement(), hpfc_name_to_entity(), make_block_statement(), NIL, NODE_END, ret, st_init_host, st_init_node, STATEMENT, statement_label, sub_ret_label, and substitute_return().
Referenced by compile_module().
module | odule |
array | rray |
upper | pper |
dim | im |
Definition at line 499 of file run-time.c.
References array, bound_parameter_name(), find_or_create_typed_entity(), free(), is_basic_int, LOWER, module, module_local_name(), and UPPER.
Referenced by create_bound_entity().
of expressions
Definition at line 527 of file run-time.c.
References array, CONS, EXPRESSION, hpfc_array_bound(), NIL, and NumberOfDimension().
Referenced by array_lower_upper_bounds_list().
of expressions
of expression
interleave both lists (just for fun:-)
array | rray |
Definition at line 539 of file run-time.c.
References array, array_bounds_list(), CDR, and NIL.
Referenced by compile_reduction(), generate_subarray_shift(), and st_generate_packing().
returns a name for the bound of the declaration of array array, side side and dimension dim.
array | rray |
side | ide |
dim | im |
Definition at line 488 of file run-time.c.
References array, concatenate(), entity_local_name(), hpfc_main_entity_name(), int2a(), and strdup().
Referenced by argument_bound_entity(), create_parameters_h(), and hpfc_array_bound().
expression expr_compute_local_index | ( | entity | array, |
int | dim, | ||
expression | expr | ||
) |
new index computation formula, derived from the new declarations made for the given dimension.
just to avoid a gcc warning
array | rray |
dim | im |
expr | xpr |
Definition at line 198 of file run-time.c.
References abs, align_alignment, align_template, alignment_constant, alignment_rate, alignment_templatedim, array, dimension_lower, distribute_distribution, distribution_parameter, DIVIDE_OPERATOR_NAME, entity_intrinsic(), entity_ith_dimension(), expression_undefined, FindAlignmentOfDim(), FindDistributionOfDim(), FindIthDimension(), get_bool_property(), hpfc_name_to_entity(), HpfcExpressionToInt(), int_to_expression(), is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, load_hpf_alignment(), load_hpf_distribution(), load_hpf_number(), LOCAL_IND, LOCAL_IND_DELTA, LOCAL_IND_GAMMA, MakeBinaryCall(), MakeTernaryCall(), MakeUnaryCall(), MINUS_OPERATOR_NAME, MOD_INTRINSIC_NAME, MULTIPLY_OPERATOR_NAME, new_declaration_tag(), pips_internal_error, PLUS_OPERATOR_NAME, and UNARY_MINUS_OPERATOR_NAME.
Referenced by st_compute_ith_local_index().
|
static |
Definition at line 806 of file run-time.c.
References current, is_end, and RTSTable.
Referenced by hpfc_intrinsic_like_function(), hpfc_io_like_function(), and hpfc_name_to_entity().
expression hpfc_array_bound | ( | entity | array, |
bool | upper, | ||
int | dim | ||
) |
array | rray |
upper | pper |
dim | im |
Definition at line 516 of file run-time.c.
References array, bound_parameter_name(), LOWER, MakeCharacterConstantExpression(), and UPPER.
Referenced by array_bounds_list(), caller_list_of_bounds(), and declaration_with_overlaps().
void hpfc_init_run_time_entities | ( | void | ) |
to be seen from outside of this file
they are declared as variables to avoid redefinitions ??? this fools pips typing (functions/variables and so) just okay for the pretty printer...
why not
dimensions are updated
Definition at line 751 of file run-time.c.
References CONS, current, DIMENSION, entity_type, find_or_create_typed_entity(), HPFC_PACKAGE, int_to_expression(), is_end, is_fun, is_ifn, is_iof, is_sub, is_var, make_dimension(), MakeRunTimeSupportFunction(), MakeRunTimeSupportSubroutine(), NIL, pips_debug, pips_internal_error, RTSTable, RTSTable_initialized_p, type_variable, and variable_dimensions.
Referenced by hpfc_directives_handler(), and set_resources_for_module().
Definition at line 828 of file run-time.c.
References entity_local_name(), find_entry_by_name(), is_ifn, and RunTimeSupportDescriptor::what.
Definition at line 836 of file run-time.c.
References entity_local_name(), find_entry_by_name(), is_iof, and RunTimeSupportDescriptor::what.
Referenced by only_io_call().
returns the entity to which e is attached, that is first a common, then a function...
Definition at line 462 of file run-time.c.
References entity_in_common_p(), entity_storage, entity_undefined, formal_function, pips_assert, ram_function, ram_section, ram_undefined, storage_formal, storage_formal_p, storage_ram, storage_ram_p, storage_return, storage_return_p, and storage_rom_p.
Referenced by hpfc_main_entity_name(), and list_of_distributed_arrays_for_module().
const char* hpfc_main_entity_name | ( | entity | e | ) |
returns the name of the entity e belongs too (common, function...)
Definition at line 479 of file run-time.c.
References hpfc_main_entity(), and module_local_name().
Referenced by bound_parameter_name().
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression list l as an argument.
Definition at line 318 of file run-time.c.
References entity_undefined_p, instruction_to_statement(), is_instruction_call, make_call(), make_instruction(), and pips_assert.
Referenced by add_pvm_init_and_end(), generate_subarray_shift(), hpfc_hcast(), hpfc_hmessage(), hpfc_initsend(), hpfc_message(), hpfc_nrecv(), hpfc_nsend(), hpfc_packing_of_current__buffer(), io_efficient_compile(), st_call_send_or_receive(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), st_generate_packing(), and statement_compute_bounds().
entity hpfc_name_to_entity | ( | const char * | name | ) |
just to avoid a gcc warning
name | ame |
Definition at line 817 of file run-time.c.
References entity_undefined, find_entry_by_name(), RunTimeSupportDescriptor::object, and pips_internal_error.
Referenced by add_pvm_init_and_end(), broadcast(), buffer_full_condition(), define_node_processor_id(), elements_loop(), expr_compute_local_index(), gen(), generate_io_statements_for_shared_arrays(), generate_remapping_code(), generate_remapping_guard(), GENERATION(), hpfc_broadcast_if_necessary(), hpfc_buffer_entity(), hpfc_buffer_initialization(), hpfc_buffer_packing(), hpfc_compute_lid(), hpfc_generate_message(), hpfc_hcast(), hpfc_hmessage(), hpfc_initsend(), hpfc_lazy_buffer_packing(), hpfc_lazy_guard(), hpfc_lazy_message(), hpfc_lazy_packing(), hpfc_message(), hpfc_nrecv(), hpfc_nsend(), hpfc_translate_call_with_distributed_args(), if_different_pe_and_not_twin(), io_efficient_compile(), live_mapping_expression(), make_mypos_expression(), make_rectangular_area(), mylid_ne_lid(), processor_loop(), set_array_status_to_target(), set_resources_for_module(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), and statement_compute_bounds().
find or create an entity for the packing function...
Definition at line 403 of file run-time.c.
References base, buf, buffer, MakeRunTimeSupportSubroutine(), and pvm_what_options().
Referenced by st_generate_packing().
entity MakeRunTimeSupportFunction | ( | string | local_name, |
_UNUSED_ int | number_of_arguments, | ||
tag | return_type | ||
) |
entity MakeRunTimeSupportFunction (local_name, number_of_arguments, return_type)
this function can be used even if the function is already declared ??? an integer shouldn't always be returned
??? rough
Definition at line 61 of file run-time.c.
References f(), is_basic_int, local_name(), make_empty_function(), make_language_fortran(), MakeIntegerResult(), and MakeOverloadedResult().
Referenced by hpfc_init_run_time_entities().
Runtime Support Functions Management.
Fabien Coelho, May and June 1993 entity MakeRunTimeSupportSubroutine(local_name, number_of_arguments)
modify 27/09/93, in order not to attempt to redeclare an already declared subroutine.
Definition at line 44 of file run-time.c.
References entity_undefined_p, local_name(), make_empty_subroutine(), make_language_fortran(), and module_name_to_entity().
Referenced by hpfc_init_run_time_entities(), and make_packing_function().
expression pvm_what_option_expression | ( | entity | v | ) |
Definition at line 74 of file run-time.c.
References entity_basic(), entity_variable_p, MakeCharacterConstantExpression(), pips_assert, pvm_what_options(), and strdup().
Referenced by st_call_send_or_receive().
string pvm_what_options(b)
the pvm what option is given back as a string, fellowing the basic given.
Definition at line 86 of file run-time.c.
References basic_complex, basic_float, basic_int, basic_logical, basic_tag, is_basic_complex, is_basic_float, is_basic_int, is_basic_logical, is_basic_overloaded, is_basic_string, pips_internal_error, PVM_COMPLEX16, PVM_COMPLEX8, PVM_INTEGER2, PVM_INTEGER4, PVM_REAL4, PVM_REAL8, and PVM_STRING.
Referenced by hpfc_buffer_entity(), make_new_reduction_function(), make_packing_function(), make_reduction_function(), make_shift_subroutine(), and pvm_what_option_expression().
|
static |
Definition at line 332 of file run-time.c.
References call_function, sub_call_n, and sub_call_o.
Referenced by substitute_return().
|
static |
Definition at line 337 of file run-time.c.
References entity_empty_label(), entity_return_label_p(), statement_label, and sub_ret_label.
Referenced by substitute_return().
Sends.
Definition at line 138 of file run-time.c.
References CONS, EXPRESSION, f(), hpfc_make_call_statement(), NIL, pvm_what_option_expression(), reference_to_expression(), and reference_variable.
Computes.
ref | ef |
Definition at line 151 of file run-time.c.
References CMP_COMPUTER, CONS, EXPRESSION, gen_length(), gen_nconc(), get_bool_property(), hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), load_hpf_number(), lUpdateExpr(), make_list_of_constant(), NIL, node_module, ref, reference_indices, reference_to_expression(), and reference_variable.
Referenced by generate_c1_alpha(), and generate_parallel_body().
ref | ef |
Definition at line 173 of file run-time.c.
References CMP_OWNERS, CONS, EXPRESSION, gen_length(), gen_nconc(), get_bool_property(), hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), load_hpf_number(), lUpdateExpr(), make_list_of_constant(), NIL, node_module, ref, reference_indices, reference_to_expression(), and reference_variable.
Referenced by generate_read_of_ref_for_all(), generate_read_of_ref_for_computer(), generate_update_distributed_value_from_host(), generate_update_values_on_computer_and_nodes(), and generate_update_values_on_nodes().
call to the runtime support function HPFC_CMPNEIGHBOUR(d)
Definition at line 394 of file run-time.c.
References CMP_NEIGHBOUR, CONS, EXPRESSION, hpfc_make_call_statement(), hpfc_name_to_entity(), int_to_expression(), and NIL.
Referenced by st_one_message().
statement st_generate_packing_and_passing(array, content, bsend)
dimension bounds are refered to as parameters, since we do not know yet what is the lower and upper of each dimension...
larg content:
array, dim [lower, upper]*len, range [lower, upper, increment]*len
array | rray |
content | ontent |
bsend | send |
Definition at line 422 of file run-time.c.
References array, array_lower_upper_bounds_list(), CONS, entity_basic(), entity_to_expression(), EXPRESSION, gen_length(), gen_nconc(), hpfc_make_call_statement(), make_packing_function(), MAP, NIL, NumberOfDimension(), pips_assert, RANGE, range_increment, range_lower, and range_upper.
Referenced by st_one_message().
Definition at line 345 of file run-time.c.
References call_domain, entity_undefined, expression_domain, gen_false(), gen_multi_recurse(), gen_null(), gen_true(), rwt(), srwt(), statement_domain, sub_call_n, and sub_call_o.
Referenced by add_pvm_init_and_end().
|
static |
Definition at line 592 of file run-time.c.
Referenced by find_entry_by_name(), and hpfc_init_run_time_entities().
Definition at line 590 of file run-time.c.
Referenced by hpfc_init_run_time_entities().
|
static |
Definition at line 329 of file run-time.c.
Referenced by rwt(), and substitute_return().
|
static |
Definition at line 328 of file run-time.c.
Referenced by rwt(), and substitute_return().
|
static |
Definition at line 330 of file run-time.c.
Referenced by add_pvm_init_and_end(), and srwt().