27 #ifdef BUILDER_STRENGTH_REDUCTION
30 #include "pips_config.h"
64 list header_statements;
66 } strength_reduction_context_t;
76 static bool do_strength_reduction_gather(
expression exp, strength_reduction_context_t *ctxt) {
139 hash_put(ctxt->entity_to_entity,already_there,other);
143 ctxt->header_statements=
CONS(
155 ctxt->header_statements);
158 ctxt->incr_statements=
CONS(
171 ctxt->incr_statements);
192 static bool do_strength_reduction_in_loop(
loop l) {
196 strength_reduction_context_t ctxt = {
223 void do_strength_reduction(
call make_call(entity a1, list a2)
basic copy_basic(basic p)
BASIC.
expression copy_expression(expression p)
EXPRESSION.
void free_expression(expression p)
struct _newgen_struct_entity_ * entity
static statement module_statement
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
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.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get 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.
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
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#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)
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.
statement make_assign_statement(expression, expression)
void insert_statement(statement, statement, bool)
This is the normal entry point.
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 HASH_FOREACH(key_type, k, value_type, v, ht)
#define HASH_DEFAULT_SIZE
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define make_expression_list(stats...)
#define NORMALIZE_EXPRESSION(e)
#define call_to_statement(c)
#define MINUS_UPDATE_OPERATOR_NAME
#define PLUS_UPDATE_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
#define entity_constant_p(e)
#define PLUS_C_OPERATOR_NAME
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
static int init
Maximal value set for Fortran 77.
bool entity_pointer_p(entity e)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool expression_integer_value(expression e, intptr_t *pval)
expression Pvecteur_to_expression(Pvecteur vect)
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
void update_expression_syntax(expression e, syntax s)
frees expression syntax of e and replace it by the new syntax s
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
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.
#define expression_domain
newgen_execution_domain_defined
#define normalized_linear_p(x)
#define loop_domain
newgen_language_domain_defined
struct _newgen_struct_entity_to_entity_ * entity_to_entity
#define statement_domain
newgen_sizeofexpression_domain_defined
#define range_increment(x)
#define entity_undefined_p(x)
#define expression_normalized(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define STATEMENT(x)
STATEMENT.
void reset_semantic_map(void)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".
Pbase vect_copy(Pvecteur b)
direct duplication.
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
void vect_chg_var(Pvecteur *ppv, Variable v_old, Variable v_new)
void vect_chg_var(Pvecteur *ppv, Variable v_old, Variable v_new) replace the variable v_old by v_new
void vect_normalize(Pvecteur v)
void vect_normalize(Pvecteur v): division de tous les coefficients de v par leur pgcd; "normalisation...