25 #include "pips_config.h"
40 #include "resources.h"
108 bool alreadyDone =
false;
192 pips_assert(
"lUnSupportedRef != HASH_UNDEFINED_VALUE",
198 (lUnSupportedRef ==
NIL))
352 bool innerInd =
false;
433 list * lReadStats,
list * lWriteStats)
450 bool alreadyDone =
false;
480 bool alreadyDone =
false;
525 printf(
"replace_array_ref_with_fifos2\n");
527 printf(
"replace_array_ref_with_fifos2 1\n");
530 printf(
"replace_array_ref %p\n", curRef);
600 printf(
"generate_code\n");
618 printf(
"newStat aft 1\n");
668 static int number = 0;
710 static void create_loop_HRE_module()
901 printf(
"HRE_distribute_stat\n");
923 if(calledFromLoop && (
gIfCount == 0))
934 if(calledFromLoop && (
gIfCount == 0))
947 printf(
"HRE_distribute_stat end\n");
957 printf(
"stat bef HRE_distribute\n");
instruction make_instruction_loop(loop _field_)
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)
basic copy_basic(basic p)
BASIC.
language make_language_unknown(void)
expression copy_expression(expression p)
EXPRESSION.
statement copy_statement(statement p)
STATEMENT.
reference make_reference(entity a1, list a2)
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
synchronization make_synchronization_none(void)
range make_range(expression a1, expression a2, expression a3)
static statement generate_code()
static const char * g_module_name
static statement HRE_distribute_test(statement stat)
statement generate_fifo_stat2(reference curRef, bool bRead)
static void make_HRE_empty_module()
static void fill_HRE_module(statement stat)
static statement HRE_distribute_loop(statement stat)
static hash_table gOldIndToNewInd
void generate_fifo_stats2(list lRef, list *lReadStats, list *lWriteStats)
static statement HRE_distribute_call(statement stat)
static const char * g_new_module_name
static hash_table gIsIndex
static entity find_or_create_newInd(entity ind, bool bIsInd)
static statement HRE_distribute_stat(statement stat, bool calledFromLoop)
expression get_fifoExp_from_ref(reference curRef, expression buffExp, hash_table ht)
comEngine_HRE_distribute.c
static expression get_indExp_from_ref(reference curRef, hash_table ht, bool *innerInd)
static statement add_index_statements(statement stat)
static void replace_array_ref_with_fifos2(list lRef, statement *newStat)
static void generate_scalar_variables_from_list(list lRef)
statement HRE_distribute(statement stat, string new_module_name, const char *module_name)
static statement make_read_write_fifo_stat(string name, expression fifoExp, expression indExp, expression hreBuffExp)
statement generate_ind_fifo_stat2(entity oldInd, entity newInd, bool bRead)
static statement HRE_distribute_seq(statement stat)
expression gBufferSizeEnt
void create_HRE_module(const char *new_module_name, const char *module_name, statement stat, entity new_fun)
hash_table gLoopToUnSupRef
list comEngine_expression_to_reference_list(expression e, list lr)
conversion of an expression into a list of references; references are appended to list lr as they are...
expression get_fifo_from_ref(reference ref)
hash_table gRefToHREVar
comEngine_generate_HRECode.c
entity get_HRE_buff_ent_from_ref(reference ref)
void comEngine_replace_reference_in_stat(statement stat, reference ref, expression new)
const char * module_name(const char *s)
Return the module part of an entity name.
statement make_block_statement(list)
Make a block statement from a list of statement.
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
list gen_make_list(int domain,...)
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define NIL
The empty list (nil in Lisp)
list gen_concatenate(const list l1x, const list l2x)
concatenate two lists.
#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
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a 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)
loop statement_loop(statement)
Get the loop of a statement.
test statement_test(statement)
Get the test of a statement.
statement make_assign_statement(expression, expression)
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_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
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,...
void print_reference(reference r)
void print_statement(statement)
Print a statement on stderr.
static const char * prefix
#define PLUS_OPERATOR_NAME
#define STATEMENT_NUMBER_UNDEFINED
default values
#define call_to_statement(c)
#define empty_comments
Empty comments (i.e.
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 make_empty_subroutine(const char *name, language l)
entity entity_empty_label(void)
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
entity module_name_to_runtime_entity(const char *name)
similar to module_name_to_entity but generates a warning and a stub if the entity is not found
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression reference_to_expression(reference r)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool reference_equal_p(reference r1, reference r2)
expression call_to_expression(call c)
Build an expression that call a function or procedure.
extensions empty_extensions(void)
extension.c
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
entity make_new_scalar_variable_with_prefix(const char *, entity, basic)
Create a new scalar variable of type b in the given module.
basic basic_of_reference(reference)
Retrieves the basic of a reference in a newly allocated basic object.
#define expression_domain
newgen_execution_domain_defined
#define REFERENCE(x)
REFERENCE.
#define reference_undefined
#define reference_variable(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
@ is_instruction_sequence
#define instruction_tag(x)
#define sequence_statements(x)
#define instruction_sequence(x)
#define test_condition(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_call(x)
@ is_execution_sequential
#define call_arguments(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".