25 #include "pips_config.h"
89 pips_debug(3,
"module %s: %td cumulated reductions\n",
166 pips_assert (
"should not happen, all statements should have been visited for reduction",
false);
229 pips_debug(8,
"effect on %s (ref %p) not trusted\n",
292 return crt_stat_filter(s);
329 pips_debug(4,
"Reductions for statement are:\n");
344 make_crt_stat_stack();
349 free_crt_stat_stack();
440 pips_assert (
"should not happen, all statements should have been visited for reduction",
false);
462 pips_debug(5,
"stat %s %p: %td candidate(s)\n",
471 pips_debug(5,
"stat %s %p -> %td reductions\n",
static void node(FILE *out, string name)
Build for module name a node and link to its successors.
reduction copy_reduction(reduction p)
REDUCTION.
void free_reduction(reduction p)
reductions copy_reductions(reductions p)
REDUCTIONS.
reduction make_reduction(reference a1, reduction_operator a2, list a3, list a4)
reduction_operator make_reduction_operator_none(void)
reductions make_reductions(list a)
list translate_reductions(call c)
of reduction
struct _newgen_struct_statement_ * statement
list control_list_to_statement_list(list)
of statement
list load_summary_effects(entity e)
FI->FI, FI->BC: these two functions should be moved into effects-util or effects-simple.
void set_rw_effects(statement_effects)
void set_proper_references(statement_effects)
void reset_proper_references(void)
effects load_proper_references(statement)
list load_rw_effects_list(statement)
effect(* effect_dup_func)(effect eff)
void generic_effects_reset_all_methods(void)
void reset_rw_effects(void)
effect simple_effect_dup(effect)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define effect_variable(e)
For COMPATIBILITY purpose only - DO NOT USE anymore.
bool store_effect_p(effect)
bool io_effect_entity_p(entity)
#define effects_effects(x)
const char * module_name(const char *s)
Return the module part of an entity name.
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
bool effects_may_read_or_write_memory_paths_from_entity_p(list l_eff, entity e)
tests whether the input effects list may contain effects with a memory path from the input entity e; ...
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
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.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define ENDP(l)
Test if a list is empty.
#define NIL
The empty list (nil in Lisp)
list gen_once(const void *vo, list l)
Prepend an item to a list only if it is not already in the list.
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
void gen_free_list(list l)
free the spine of the list
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements 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.
#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 GENERIC_GLOBAL_FUNCTION(name, type)
#define DEFINE_LOCAL_STACK(name, type)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
bool same_reduction_p(reduction r1, reduction r2)
static void check_proper_reductions(statement s)
must check that the found reductions are (1) without side effects (no W on any other than accumulator...
bool cumulated_reductions(const char *module_name)
handler for pipsmake input: the module name output: TRUE side effects: some
static call last_translated_module_call
hack: no check for direct translations ("call foo") thus in this case effects reductions will be okay...
static void compute_cumulated_reductions(instruction i)
Cumulated Reduction propagation functions for each possible instructions.
reductions load_summary_reductions(entity f)
Fortran 77 anti aliasing rules implies that sg that looks like a reduction within a subroutine can be...
static void set_generic_effects_as_needed(void)
for CONTROL_MAP()
static list list_of_compatible_reductions(reductions rs)
returns NIL on any problem
static void compute_proper_reductions(statement s)
performs the computation of proper reductions for statement s.
bool proper_reductions(const char *module_name)
handler for pipsmake input: module name output: TRUE side effects: some
static reduction compute_one_summary_reduction(reduction model, list le)
static list add_reduced_variables(list le, reductions rs)
Function storing Proper Reductions.
static bool pr_call_flt(call c)
static bool build_reduction_of_variable(entity var, statement node, list ls, reduction *pr)
Function storing Cumulated Reductions.
static void pr_statement_wrt(statement s)
static void build_creductions_of_statement(statement node, list ls)
builds cumulated reductions for node, depending on node and list of statement ls.
static reduction compatible_reduction_of_var(entity var, reductions rs)
Returns NULL if not ok.
static bool safe_effects_for_reductions(statement s, reductions rs)
argh...
bool summary_reductions(const char *module_name)
handler for pipsmake input: module name output: TRUE side effects: stores the summary reductions to p...
static list list_of_trusted_references(reductions rs)
static list list_of_reduced_variables(statement node, list ls)
of entity
static bool pr_statement_flt(statement s)
entity reduction_operator_entity(reduction_operator op)
match a reduction operator against operator entity
static reductions compute_summary_reductions(entity f)
#define reduction_variable(r)
shorthands for REDUCTION:
#define make_none_reduction(var)
#define DEBUG_REDUCTION(level, msg, red)
quick debug macros
string note_for_statement(statement s)
generates a short note to tell about the type of the statement being decorated.
void reset_cumulated_reductions(void)
void init_proper_reductions(void)
void remove_variable_from_reduction(reduction, entity)
void set_cumulated_reductions(pstatement_reductions)
void init_cumulated_reductions(void)
bool update_compatible_reduction(reduction *, entity, list, reductions)
what to do with reduction *pr for variable var under effects le and reductions reds.
pstatement_reductions get_proper_reductions(void)
bool bound_cumulated_reductions_p(statement)
bool call_proper_reduction_p(statement, call, reduction *)
This function look for a reduction and return it if found mallocs are avoided if nothing is found....
reductions load_cumulated_reductions(statement)
reductions load_proper_reductions(statement)
void reset_proper_reductions(void)
pstatement_reductions get_cumulated_reductions(void)
void store_proper_reductions(statement, reductions)
bool update_compatible_reduction_with(reduction *, entity, reduction)
update *pr according to r for variable var r is not touched.
void set_proper_reductions(pstatement_reductions)
void store_cumulated_reductions(statement, reductions)
@ is_reduction_operator_bitwise_xor
@ is_reduction_operator_min
@ is_reduction_operator_bitwise_and
@ is_reduction_operator_neqv
@ is_reduction_operator_max
@ is_reduction_operator_bitwise_or
@ is_reduction_operator_csum
@ is_reduction_operator_eqv
@ is_reduction_operator_prod
@ is_reduction_operator_or
@ is_reduction_operator_and
@ is_reduction_operator_sum
#define REDUCTION(x)
REDUCTION.
#define reduction_operator_tag(x)
#define reduction_dependences(x)
#define reduction_reference(x)
#define reduction_trusted(x)
#define reductions_list(x)
static const char * opname(const char *s)
#define BITWISE_OR_OPERATOR_NAME
#define MAX_OPERATOR_NAME
#define BITWISE_XOR_OPERATOR_NAME
#define EQUIV_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define NON_EQUIV_OPERATOR_NAME
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define instruction_block(i)
#define make_statement_list(stats...)
easy list constructor
#define MULTIPLY_OPERATOR_NAME
#define BITWISE_AND_OPERATOR_NAME
#define PLUS_C_OPERATOR_NAME
#define MIN_OPERATOR_NAME
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
const char * module_local_name(entity e)
Returns the module local user name.
bool entity_module_p(entity e)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool reference_equal_p(reference r1, reference r2)
#define PREFERENCE(x)
PREFERENCE.
#define REFERENCE(x)
REFERENCE.
#define reference_undefined
#define instruction_loop(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define CONTROL(x)
CONTROL.
#define instruction_domain
newgen_functional_domain_defined
#define call_domain
newgen_callees_domain_defined
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_expression
@ is_instruction_sequence
#define instruction_tag(x)
#define instruction_forloop(x)
#define preference_reference(x)
#define instruction_call_p(x)
#define instruction_whileloop(x)
#define whileloop_body(x)
#define statement_instruction(x)
#define instruction_call(x)
#define instruction_test(x)
#define instruction_unstructured(x)
#define STATEMENT(x)
STATEMENT.
The structure used to build lists in NewGen.