25 #include "pips_config.h"
35 #include "resources.h"
159 &lSupportedRef, &lUnSupportedRef);
280 #define ALL_DECLS "PRETTYPRINT_ALL_DECLARATIONS"
281 #define STAT_ORDER "PRETTYPRINT_STATEMENT_NUMBER"
296 const char* new_name;
300 bool saved_b1, saved_b2;
305 new_name = new_module_name;
333 "// PIPS: please caution!\n"
335 "// this routine has been generated as a clone of ", name,
"\n"
336 "// the code may change significantly with respect to the original\n"
337 "// version, especially after program transformations such as dead\n"
338 "// code elimination and partial evaluation, hence the function may\n"
339 "// not have the initial behavior, if called under some other context.\n"
364 string function_name,
399 printf(
"distribution can be done\n");
403 printf(
"distribution cannot be done\n");
407 int hreMemSize = 512;
413 printf(
"mapping is successful\n");
417 printf(
"mapping is not successful\n");
425 l_in, l_out, l_params, l_priv,
428 printf(
"mapping is not successful 1\n");
430 printf(
"comEngine_distribute_code 2\n");
433 printf(
"comEngine_distribute_code 3\n");
434 printf(
"comEngine_distribute_code 4\n");
438 printf(
"comEngine_distribute_code 5\n");
446 printf(
"comEngine_distribute_code 8\n");
497 hash_get(ht_in_regions,function_name),
498 hash_get(ht_out_regions,function_name),
545 debug_on(
"PHRASE_COMENGINE_DISTRIBUTOR_DEBUG_LEVEL");
557 pips_debug(2,
"BEGIN of PHRASE_DISTRIBUTOR\n");
563 pips_assert(
"Statement structure is consistent after PHRASE_DISTRIBUTOR",
566 pips_assert(
"Statement is consistent after PHRASE_DISTRIBUTOR",
constant make_constant(enum constant_utype tag, void *val)
basic make_basic(enum basic_utype tag, void *val)
storage make_storage(enum storage_utype tag, void *val)
value make_value(enum value_utype tag, void *val)
bool statement_consistent_p(statement p)
variable make_variable(basic a1, list a2, list a3)
void free_expression(expression p)
void free_instruction(instruction p)
void free_statement(statement p)
type make_type(enum type_utype tag, void *val)
sentence make_sentence(enum sentence_utype tag, void *val)
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
struct _newgen_struct_statement_ * statement
static void give_value_to_symbolic_entity(entity ent, intptr_t val)
hash_table gLoopToToggleEnt
static void do_HRE_memory_mapping(statement stat)
expression gBufferSizeEnt
hash_table gLoopToRef
comEngine_distribute.c
static entity make_new_symbolic_entity(string inName)
bool phrase_comEngine_distributor(const char *module_name)
static bool compute_HRE_memory_mapping(statement stat, int hreMemSize)
hash_table gRefToBuffSize
void comEngine_distribute(const char *module_name, statement module_stat, entity module)
hash_table gStatToHtOffset
static void update_HRE_mapping_from_list(list lRef, bool supRef, int inc)
static void do_HRE_memory_mapping_loop(statement stat)
static void move_declarations(entity new_fun, statement stat)
static void comEngine_distribute_code(const char *module_name, string function_name, statement externalized_code, list l_in, list l_out, list l_params, list l_priv, graph dg)
tatic void create_HRE_modules(statement externalized_code, string new_module_name,...
void create_HRE_module(const char *new_module_name, const char *module_name, statement stat, entity new_fun)
static void do_HRE_memory_mapping_stat(statement stat)
hash_table gLoopToUnSupRef
bool comEngine_feasability(statement externalized_code, graph dg)
statement comEngine_generate_HRECode(statement externalized_code, string new_module_name, _UNUSED_ list l_in, _UNUSED_ list l_out, _UNUSED_ list l_params, _UNUSED_ list l_priv, const char *module_name, _UNUSED_ int hreMemSize)
statement comEngine_generate_procCode(statement externalized_code, _UNUSED_ list l_in, _UNUSED_ list l_out)
void get_supportedRef_proc(statement stat, hash_table htOffset, list *lSupportedRef, list *lUnSupportedRef)
bool compute_distribution_context(list l_stats, statement module_stat, entity module, hash_table *ht_stats, hash_table *ht_params, hash_table *ht_private, hash_table *ht_in_regions, hash_table *ht_out_regions)
This function is called during PHRASE distribution.
void get_regions_properties(void)
void set_rw_effects(statement_effects)
void reset_out_effects(void)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void set_out_effects(statement_effects)
void set_in_effects(statement_effects)
void reset_in_effects(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.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
int gen_consistent_p(gen_chunk *obj)
GEN_CONSISTENT_P dynamically checks the type correctness of OBJ.
struct _newgen_struct_graph_ * graph
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.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
#define NIL
The empty list (nil in Lisp)
#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
void gen_free_list(list l)
free the spine of the list
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
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.
loop statement_loop(statement)
Get the loop of a statement.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
#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 DYNAMIC_AREA_LOCAL_NAME
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MODULE_SEP_STRING
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_MAP(k, v, code, ht)
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
list identify_analyzed_statements_to_distribute(statement)
This function return a list of statements that were previously marked for externalization during phas...
static entity dynamic_area
text text_named_module(entity, entity, statement)
bool make_text_resource_and_free(const char *, const char *, const char *, text)
void set_bool_property(const char *, bool)
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define make_entity(n, t, s, i)
#define STATEMENT_NUMBER_UNDEFINED
default values
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 FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_empty_label(void)
const char * module_local_name(entity e)
Returns the module local user name.
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
#define REFERENCE(x)
REFERENCE.
#define type_statement_p(x)
#define code_declarations(x)
#define statement_label(x)
#define entity_undefined_p(x)
@ is_instruction_sequence
#define instruction_tag(x)
#define sequence_statements(x)
#define instruction_sequence(x)
#define type_varargs_p(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define statement_comments(x)
#define statement_number(x)
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
The structure used to build lists in NewGen.
#define SENTENCE(x)
newgen_unformatted_domain_defined
#define text_sentences(x)
A gen_chunk is used to store every object.