26 #include "pips_config.h"
42 #include "resources.h"
181 fcs_ctx ctx = { 0, 0, 0,
false };
263 bool changed =
false;
366 entity previous_variable = NULL;
378 if (previous_reduction &&
assignment && red==previous_variable)
383 hash_put(replacements, previous_variable, assigned);
397 previous_reduction = s;
398 previous_variable = red;
422 previous_reduction = NULL;
423 previous_variable = NULL;
442 bool changed =
false;
510 string what =
"unknown";
522 pips_debug(8,
"called=%p %s\n", called, called?
542 what=
"already defined";
555 pips_debug(8,
"upper=%p first=%p %s\n", upper, first, upper?
558 if (upper && first &&
568 what=
"not *var = ...";
579 what=
"not candidate";
630 bool changed =
false;
634 pips_debug(2,
"considering entity %s inv=%d dr=%d def=%d pt=%d\n",
702 #define starts_with(s1, s2) (strncmp(s1, s2, strlen(s2))==0)
704 #define entity_update_p(e) \
705 (ENTITY_MULTIPLY_UPDATE_P(e) || ENTITY_DIVIDE_UPDATE_P(e) || \
706 ENTITY_MODULO_UPDATE_P(e) || ENTITY_PLUS_UPDATE_P(e) || \
707 ENTITY_MINUS_UPDATE_P(e) || ENTITY_LEFT_SHIFT_UPDATE_P(e) || \
708 ENTITY_RIGHT_SHIFT_UPDATE_P(e) || ENTITY_BITWISE_AND_UPDATE_P(e) || \
709 ENTITY_BITWISE_XOR_UPDATE_P(e) || ENTITY_BITWISE_OR_UPDATE_P(e))
int get_int_property(const string)
statement copy_statement(statement p)
STATEMENT.
reference make_reference(entity a1, list a2)
void free_instruction(instruction p)
syntax make_syntax_reference(reference _field_)
struct _newgen_struct_expression_ * expression
struct _newgen_struct_statement_ * statement
effects delete_cumulated_rw_effects(statement)
void store_cumulated_rw_effects_list(statement, list)
const freia_api_t * hwac_freia_api(const char *function)
freia-utils.c
bool freia_image_variable_p(const entity var)
rather approximative?
call freia_statement_to_call(const statement s)
return the actual function call from a statement, dealing with assign and returns....
bool freia_statement_aipo_call_p(const statement s)
returns whether the statement is a FREIA call.
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
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.
void replace_entities(void *s, hash_table ht)
Recursively substitute a set of entities in a statement.
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_false(__attribute__((unused)) gen_chunk *unused)
Return false and ignore the argument.
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_continue_instruction()
Creates a CONTINUE instruction, that is the FORTRAN nop, the ";" in C or the "pass" in Python for exa...
bool instruction_assign_p(instruction i)
Test if an instruction is an assignment.
void gen_remove_once(list *pl, const void *o)
Remove the first occurence of o in list pl:
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
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
list gen_last(list l)
Return the last element of a list.
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
list gen_full_copy_list(list l)
Copy a list structure with element copy.
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.
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
call statement_call(statement)
Get the call of a statement.
bool statement_call_p(statement)
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
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_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
void * hash_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
void hash_table_clear(hash_table htp)
Clears all entries of a hash table HTP.
static statement mod_stat
We want to keep track of the current statement inside the recurse.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define HASH_FOREACH(key_type, k, value_type, v, ht)
#define same_string_p(s1, s2)
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_belong_p(const set, const void *)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define ENTITY_ASSIGN_P(e)
#define ENTITY_DEREFERENCING_P(e)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define entity_declarations(e)
MISC: newgen shorthands.
#define ENTITY_ADDRESS_OF_P(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 module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
bool entity_pointer_p(entity e)
bool expression_address_of_p(expression e)
bool expression_call_p(expression e)
call expression_call(expression e)
bool expression_reference_p(expression e)
Test if an expression is a reference.
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
entity expression_variable(expression e)
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
#define qualifier_register_p(x)
#define syntax_reference_p(x)
#define expression_domain
newgen_execution_domain_defined
#define instruction_sequence_p(x)
#define reference_variable(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define reference_domain
newgen_range_domain_defined
#define sizeofexpression_domain
newgen_sequence_domain_defined
struct _newgen_struct_call_ * call
#define sequence_statements(x)
#define reference_indices(x)
#define variable_qualifiers(x)
#define whileloop_body(x)
#define whileloop_domain
newgen_variable_domain_defined
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define statement_number(x)
#define value_expression_p(x)
#define expression_syntax(x)
#define sequence_domain
newgen_reference_domain_defined
#define value_expression(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
util defined somewhere ??????