2 #include "pips_config.h"
106 return first_directive_stmt;
169 assert(bound_step_interlaced_p(reg));
170 return load_step_interlaced(reg);
175 assert(bound_step_partial_p(reg));
176 return load_step_partial(reg);
201 reset_step_effect_path();
202 reset_step_interlaced();
203 reset_step_partial();
216 reset_step_effect_path();
217 reset_step_interlaced();
218 reset_step_partial();
232 store_step_effect_path(new_eff, point);
265 effect current_eff = start_eff ;
268 while(bound_step_effect_path_p(current_eff))
270 step_point point = load_step_effect_path(current_eff);
291 effect directive_statement_region;
299 return directive_statement_region;
313 effect directive_statement_send;
320 store_or_update_step_partial(directive_statement_send,
false);
321 else if(!bound_step_partial_p(directive_statement_send))
322 store_step_partial(directive_statement_send,
true);
340 bool property_prettyprint_scalar_regions =
get_bool_property(
"PRETTYPRINT_SCALAR_REGIONS");
348 set_bool_property(
"PRETTYPRINT_SCALAR_REGIONS", property_prettyprint_scalar_regions);
372 static struct intrin {
375 } step_intrinsics [] = {
379 for(
struct intrin *p = step_intrinsics;p->name;++p)
456 regions_final =
CONS(
REGION, r, regions_final);
461 return regions_final;
481 bool is_anymodule_anywhere =
false;
487 is_anymodule_anywhere =
true;
492 return is_anymodule_anywhere;
600 pips_debug(2,
"drop ANYMODULE ANYWHERE RECV regions\n");
668 if (!bound_step_send_regions_p(s))
671 effects e = load_step_send_regions(s);
682 store_step_send_regions(s, e);
689 if (bound_step_send_regions_p(s))
691 effects e = load_step_send_regions(s);
693 update_step_send_regions(s, e);
705 update_step_send_regions(
stmt, e);
713 if (!bound_step_recv_regions_p(s))
716 effects e = load_step_recv_regions(s);
728 store_step_recv_regions(s, e);
735 if (bound_step_recv_regions_p(s))
737 effects e = load_step_recv_regions(s);
739 update_step_recv_regions(s, e);
752 update_step_recv_regions(
stmt, e);
770 bool property_prettyprint_scalar_regions =
get_bool_property(
"PRETTYPRINT_SCALAR_REGIONS");
780 set_bool_property(
"PRETTYPRINT_SCALAR_REGIONS", property_prettyprint_scalar_regions);
791 pips_assert(
"interlaced defined", bound_step_interlaced_p(r));
809 pips_debug(4,
"tmp summarize eff = %p new_eff = %p\n", eff, new_eff);
811 summarized_l =
CONS(
EFFECT, new_eff, summarized_l);
848 list summarized_send_l, summarized_recv_l;
851 pips_assert(
"statement with step regions", bound_step_send_regions_p(
stmt) && bound_step_recv_regions_p(
stmt));
881 store_step_interlaced(reg, interlaced_p);
936 return !(
ENDP(recv_l) &&
ENDP(send_l));
957 setenv(
"REGION_TRANSLATION_DEBUG_LEVEL",
"0", 0);
958 debug_on(
"REGION_TRANSLATION_DEBUG_LEVEL");
999 pips_debug(2,
"translate called_eff = %p, translated_eff = %p\n", called_eff, translated_eff);
1001 translated_l =
gen_nconc(translated_l, caller_l);
1015 return translated_l;
1024 list caller_l, called_l;
1026 bool new_region_p =
false;
1050 new_region_p |= !
ENDP(caller_l);
1065 new_region_p |= !
ENDP(caller_l);
1075 return new_region_p;
1112 pips_debug(2,
"no STEP region to compute\n");
1159 pips_debug(2,
"Conflict source_eff sink_eff\n");
1163 pips_debug(2,
"not WRITE->READ dependence (ignored)\n");
1169 pips_debug(2,
"Dependence :\n\t\t%s from\t%s\t\t%s to \t%s",
1180 pips_debug(2,
"optimizable SEND, SEND and RECV are already summarized at the module level\n");
1184 pips_debug(2,
"unoptimizable SEND (no matching RECV)\n");
1194 pips_debug(2,
"no corresponding SEND, remove RECV from summarized list at the module level\n");
1210 list suffix_sp1, suffix_sp2;
1225 pips_debug(3,
"no directive on statement path suffix_sp1\n");
1227 if (bound_step_send_regions_p(
s1))
1239 pips_debug(3,
"no directive on statement path suffix_sp2\n");
1241 if (bound_step_recv_regions_p(s2))
1320 assert(bound_step_effect_path_p(summ_eff));
1322 step_point point = load_step_effect_path(summ_eff);
1331 if(!
set_belong_p(remove_from_summary_regions, from_region))
1332 *final_summary_regions_l =
CONS(
EFFECT, summ_eff, *final_summary_regions_l);
1343 list tmp_summary_send;
1344 list tmp_summary_recv;
1345 list final_summary_send =
NIL;
1346 list final_summary_recv =
NIL;
1378 *full_send_l =
set_to_list(remove_from_summary_send);
1379 *partial_send_l = final_summary_send;
1399 pips_debug(1,
"################ COMM ###############\n");
1402 step_point point = load_step_effect_path(eff);
1407 }, get_step_partial());
1415 bool exist_regions_p =
false;
1424 pips_debug(2,
"end exist_regions_p = %d\n", exist_regions_p);
1425 return exist_regions_p;
1431 debug_on(
"STEP_ANALYSE_DEBUG_LEVEL");
1432 bool exist_regions_p;
1455 init_step_send_regions();
1456 init_step_recv_regions();
1460 pips_debug(2,
"exist_regions_p = %d\n", exist_regions_p);
1464 set remove_from_summary_send, remove_from_summary_recv;
1465 list full_send_l, partial_send_l;
1485 reset_step_send_regions();
1486 reset_step_recv_regions();
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
bool effects_consistent_p(effects p)
effects make_effects(list a)
effects apply_statement_effects(statement_effects f, statement k)
approximation make_approximation_exact(void)
void free_action(action p)
effect copy_effect(effect p)
EFFECT.
void free_approximation(approximation p)
map_effect_bool make_map_effect_bool(void)
step_point make_step_point(entity a1, statement a2, effect a3)
step_comm make_step_comm(map_effect_step_point a1, map_effect_bool a2, map_effect_bool a3)
map_effect_step_point make_map_effect_step_point(void)
bool db_resource_required_or_available_p(const char *rname, const char *oname)
from now on we must not know about the database internals?
static list step_statement_path_get(statement stmt)
bool step_interlaced_p(region reg)
static list step_send_regions_list_load(statement s)
static void step_recv_regions_list_add(statement stmt, list l_regions)
static void step_print_directives_regions(step_directive d, list send_l, list recv_l)
static void step_set_step_partial(effect send_region, bool partial_p)
static void update_SUMMARY_SENDRECV_regions(set remove_from_summary_regions, list tmp_summary_regions_l, list *final_summary_regions_l)
bool step_analysed_module_p(const char *module_name)
static void step_recv_regions_list_update(statement s, list l_regions)
static void step_initialize_step_partial(list send_l)
bool step_analyse(const char *module_name)
static bool concerned_entity_p(effect eff, list regions)
static list step_statement_path_factorise(statement s1, statement s2, list *suffix_sp1, list *suffix_sp2)
static void step_init_effect_path(entity module, statement stmt, list regions_l)
static void step_compute_CHAINS_DG_SENDRECV_regions(statement s1, statement s2, list *s1_send_l, list *s2_recv_l)
static void step_set_communication_type_partial(effect send_region)
static void step_set_communication_type_full(effect send_region)
bool step_partial_p(region reg)
static bool step_translate_and_map_step_regions(statement stmt)
static void step_analyse_CHAINS_DG(const char *module_name, set *remove_from_summary_send, set *remove_from_summary_recv)
dg_vertex_label vertex_label
static void step_update_SUMMARY_SENDRECV_regions(set remove_from_summary_send, set remove_from_summary_recv, list *full_send_l, list *partial_send_l)
static list step_recv_regions_list_load(statement s)
static effect get_directive_statement_region(effect reg)
static bool interlaced_basic_workchunk_regions_p(region reg, list index_l)
static bool anymodule_anywhere_region_p(list regions_l)
static void step_summarize_and_map_step_regions(statement stmt)
static bool compute_directive_regions(step_directive drt)
void debug_print_effects_list(list l, string txt)
static void step_statement_path_init(statement body)
static bool step_statement_path_build(statement stmt, list *sp_current)
static bool step_compute_SENDRECV_regions(entity module, statement body)
static void step_send_regions_list_add(statement stmt, list l_regions)
static void step_statement_path_unbuild(statement stmt, list *sp_current)
static list step_translate_and_map(statement stmt, list effects_called_l)
static void step_add_point_into_effect_path(effect new_eff, entity module, statement stmt, effect previous_eff)
static void step_get_comparable_effects(list eff_list, effect eff, set *effects_set)
static void step_compute_CHAINS_DG_remove_summary_regions(successor su, list source_send_l, list sink_recv_l, set *remove_from_summary_send, set *remove_from_summary_recv)
static void step_recv_regions_list_store(statement s, list l_regions)
static void step_statement_path_finalize(void)
region rectangularization_region(region reg)
static void step_print_effect_path(list path)
static void step_compute_step_interlaced(list send_l, step_directive d)
static list compute_send_regions(list write_l, list out_l, statement stmt)
static void step_send_regions_list_update(statement s, list l_regions)
static list create_step_regions(statement stmt, list regions_l, enum action_utype action_tag)
bool step_analyse_init(const string module_name)
static statement step_statement_path_first_directive_statement(statement stmt)
static bool compute_SENDRECV_regions(statement stmt, bool *exist_regions_p)
static list compute_recv_regions(list send_l, list in_l, statement stmt)
static void step_update_comm(list full_send_l, list partial_send_l)
static list step_get_effect_path(effect start_eff)
static void step_send_regions_list_store(statement s, list l_regions)
static list summarize_and_map_step_regions(list effect_l, entity module, statement body)
static hash_table step_statement_path
The step_analyse phase computes three main resources:
void register_intrinsic_type_descriptor(IntrinsicDescriptor *p)
This function is called one time (at the very beginning) to create all intrinsic functions.
struct _newgen_struct_statement_ * statement
int compare_effect_reference(effect *e1, effect *e2)
int compare_effect_reference(e1, e2):
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define conflict_source(x)
#define region_any_reference(reg)
To be avoided.
#define region_action(reg)
#define region_entity(reg)
#define region_system(reg)
#define region_may_p(reg)
#define region
simulation of the type region
#define region_approximation(reg)
list RegionsMustUnion(list l1, list l2, bool(*union_combinable_p)(effect, effect))
list RegionsMustUnion(list l1, list l2, union_combinable_p) input : two lists of regions output : a l...
list RegionsIntersection(list l1, list l2, bool(*intersection_combinable_p)(effect, effect))
list RegionsIntersection(list l1,l2, bool (*intersection_combinable_p)(effect, effect)) input : outpu...
list regions_write_regions(list)
void init_convex_rw_regions(const char *)
void set_methods_for_convex_effects(void)
methods.c
void reset_convex_rw_regions(const char *)
text text_rw_array_regions(list)
effect region_dup(effect)
void free_effects_private_current_context_stack(void)
void set_rw_effects(statement_effects)
void make_effects_private_current_context_stack(void)
list load_out_effects_list(statement)
void reset_out_effects(void)
list generic_effects_backward_translation(entity, list, list, transformer)
list load_in_effects_list(statement)
void set_out_effects(statement_effects)
void set_in_effects(statement_effects)
void reset_in_effects(void)
bool w_w_combinable_p(effect, effect)
list load_rw_effects_list(statement)
void generic_effects_reset_all_methods(void)
bool r_w_combinable_p(effect, effect)
void reset_rw_effects(void)
string effect_to_string(effect)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
#define effect_action_tag(eff)
entity effect_entity(effect)
cproto-generated files
action make_action_write_memory(void)
To ease the extension of action with action_kind.
bool FILE_star_effect_reference_p(reference)
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
bool std_file_effect_p(effect)
action make_action_read_memory(void)
bool effect_comparable_p(effect, effect)
Can we merge these two effects because they are equal or because they only differ by their approximat...
struct _newgen_struct_statement_effects_ * statement_effects
#define effects_effects(x)
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....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
void gen_full_free_list(list l)
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
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_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
void * gen_chunk_identity(gen_chunk x)
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define POP(l)
Modify a list pointer to point on the next element of the list.
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
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
void * gen_find_if(gen_filter_func_t test, const list l, gen_extract_func_t extract)
void gen_sort_list(list l, gen_cmp_func_t compare)
Sorts a list of gen_chunks in place, to avoid allocations...
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.
call statement_call(statement)
Get the call of a statement.
bool statement_call_p(statement)
string safe_statement_identification(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.
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
#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
Pbase list_to_base(list l)
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l",...
#define HASH_MAP(k, v, code, ht)
#define hash_table_undefined_p(h)
#define hash_table_undefined
Value of an undefined hash_table.
#define HASH_DEFAULT_SIZE
list set_to_list(const set)
create a list from a set the set is not freed
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 *)
bool(* gen_filter_func_t)(const void *)
int(* gen_cmp_func_t)(const void *, const void *)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Psysteme sc_rectangular_hull(Psysteme, Pbase)
take the rectangular bounding box of the systeme sc, by projecting each constraint of the systeme aga...
string pips_srcpath_append(string)
returns an allocated pointer to the old value
void register_intrinsic_handler(const char *name, intrinsic_desc_t *desc)
after this call, name and desc are owned by intrinsic_handlers, but will never be deallocated they mu...
void print_statement(statement)
Print a statement on stderr.
void set_bool_property(const char *, bool)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool entity_array_p(entity e)
Is e a variable with an array type?
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
bool entity_main_module_p(entity e)
bool entity_module_p(entity e)
list expressions_to_entities(list expressions)
map expression_to_entity on expressions
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
#define reference_variable(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define transformer_relation(x)
#define reference_indices(x)
#define call_arguments(x)
#define statement_undefined_p(x)
#define predicate_system(x)
#define STATEMENT(x)
STATEMENT.
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new)
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new): reecriture du systeme s remp...
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Psysteme sc_copy(Psysteme ps)
Psysteme sc_copy(Psysteme ps): duplication d'un systeme (allocation et copie complete des champs sans...
Psysteme extract_nredund_subsystem(Psysteme s1, Psysteme s2)
Psysteme extract_nredund_subsystem(s1, s2) Psysteme s1, s2;.
bool sc_integer_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
transformer load_statement_precondition(statement)
#define STEP_DEBUG_STATEMENT(D, W, S)
#define STEP_DEFAULT_RT_H
bool step_directives_bound_p(statement stmt)
GENERIC_LOCAL_FUNCTION(directives, step_directives)
Copyright 2007, 2008, 2009 Alain Muller, Frederique Silber-Chaussumier.
bool step_private_p(statement stmt, entity e)
void step_directives_reset()
void step_directive_print(step_directive d)
step_directive step_directives_load(statement stmt)
void step_directives_init(bool first_p)
list step_directive_basic_workchunk_index(step_directive d)
statement step_directive_basic_workchunk(step_directive d)
#define step_point_data(x)
#define step_point_module(x)
#define STEP_POINT(x)
STEP_POINT.
#define step_point_stmt(x)
#define step_comm_partial(x)
#define step_comm_path(x)
#define step_directive_block(x)
struct _newgen_struct_step_comm_ * step_comm
#define step_comm_interlaced(x)
#define MAP_EFFECT_BOOL_MAP(k, v, c, f)
The following data structure describes an intrinsic function: its name and its arity and its type,...
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
for intrinsic registration
string text_to_string(text t)
SG: moved here from ricedg.
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define BASE_NULLE
MACROS SUR LES BASES.
Pvecteur vect_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...