25 #include "pips_config.h"
82 pips_debug(7,
"%s(DIM=%d), distributed %d, locally constant %d\n",
101 pips_debug(7,
"returning false, vect size %d>1\n", s);
111 pips_debug(7,
"returning false (not simple)\n");
124 if (rate!=0 && rate!=1)
151 list lv = lvref, lk = lkref;
210 for(i=1, lk=lkref, lp=lpref ; lk!=
NIL ; lk=
CDR(lk), lp=
CDR(lp))
232 debug(5,
"message_manageable_p",
233 "returning false for %s, dim %d, access %d\n",
252 for(i=1, lk=lkref, lp=lpref ; lk!=
NIL ; lk=
CDR(lk), lp=
CDR(lp))
331 debug(5,
"hpfc_overlap_kill_unused_scalars_rewrite",
332 "considering definition of %s (statement 0x%x)\n",
336 load_entity_variable_used(var)==1)
338 debug(3,
"hpfc_overlap_kill_unused_scalars_rewrite",
339 "killing definition of %s (statement 0x%x)\n",
411 for ( ; (lr!=
NIL) ; lr=
CDR(lr), lkv=
CDR(lkv))
498 "[update_indices_for_local_computation]\nnew reference is:\n");
535 if (bound_entity_variable_used_p(v))
536 update_entity_variable_used(v, load_entity_variable_used(v)+1);
538 store_entity_variable_used(v, 1);
549 init_entity_variable_used();
575 close_entity_variable_used();
584 return bound_entity_variable_used_p(ent);
592 for (i=1 ; i<=ndim ; i++)
606 int chosen_distribution =
612 int current_distribution =
616 if (current_distribution > chosen_distribution)
620 chosen_distribution = current_distribution;
630 debug(7,
"choose_one_syntax_in_references_list",
631 "reference to %s chosen, %d dimensions\n",
633 chosen_distribution);
647 entity index, oldindexvalue;
648 loop oldloop, newloop;
650 bool compute_index =
false;
662 new_indexes, old_indexes,
742 syntax the_computer_syntax,
760 entity index, newindex, newlobnd, newupbnd, oldidxvl;
792 (newlobnd, newupbnd, oldidxvl, lb, ub, an, p);
846 new_indexes, old_indexes,
861 { pips_debug(9, "returning %d from line %d\n", x, __LINE__);\
862 gen_free_list(Wa); gen_free_list(lWa); gen_free_list(Ra);\
863 gen_free_list(lRa); gen_free_list(Ro); gen_free_list(lRo);\
864 gen_free_list(Rrt); gen_free_list(lblocks); gen_free_list(lloop);\
865 gen_free_list(W); gen_free_list(R); gen_free_list(lw); gen_free_list(lr);\
866 reset_hpfc_current_statement(); reset_current_loops(); return x;}
878 statement innerbody, messages_stat, newloopnest;
879 bool computer_is_written =
true;
919 computer_is_written =
false;
943 the_computer_reference, &
lvect, &lkind))
946 if (computer_is_written)
956 if (the_computer_reference==r)
984 pips_debug(5,
"Wa length is %zd (%zd), Wrt lenght is %zd\n",
1000 if (the_computer_reference==r)
continue;
1002 pips_debug(6,
"dealing with reference of array %s\n",
1007 fprintf(stderr,
"[Overlap_Analysis]\nreference is:\n");
1047 debug(5,
"Overlap_Analysis",
1048 "Ra length is %d, Ro length is %d, Rrt lenght is %d\n",
1078 (innerbody, &newloopnest, the_computer_syntax,
1079 Wa, Ra, Ro, lWa, lRa, lRo))
1089 the_computer_reference,
execution make_execution(enum execution_utype tag, void *val)
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
expression copy_expression(expression p)
EXPRESSION.
statement copy_statement(statement p)
STATEMENT.
instruction make_instruction(enum instruction_utype tag, void *val)
range make_range(expression a1, expression a2, expression a3)
struct _newgen_struct_entity_ * entity
bool local_integer_constant_expression(expression e)
true is the expression is locally constant, that is in the whole loop nest, the reference is not writ...
bool align_check(reference r1, reference r2, list *plvect, list *plkind)
computes the shift vector that links the two references, true if every thing is ok,...
#define VALUE_TO_INT(val)
#define value_zero_p(val)
static hash_table Ref
Refs maps each statement to the effects it references.
statement parallel_loop_nest_to_body(statement loop_nest, list *pblocks, list *ploops)
bool entity_loop_index_p(entity e)
void set_current_loops(statement obj)
void FindRefToDistArrayInStatement(statement obj, list *lwp, list *lrp)
static statement inner_body
void vect_debug(Pvecteur v)
constraint.c
#define gen_recurse(start, domain_number, flt, rwt)
statement make_block_statement(list)
Make a block statement from a list of statement.
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
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.
#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.
#define NIL
The empty list (nil in Lisp)
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 CDR(pcons)
Get the list less its first element.
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
statement make_assign_statement(expression, expression)
statement make_continue_statement(entity)
#define alignment_undefined
#define alignment_rate(x)
int template_cell_local_mapping(entity array, int dim, int tc)
int template_cell_local_mapping(array, dim, tc)
int DistributionParameterOfArrayDim(entity array, int dim, int *pprocdim)
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
bool ith_dim_distributed_p(entity array, int i, int *pprocdim)
whether a dimension is distributed or not.
bool replicated_p(entity e)
replicated_p
int processor_number(entity template, int tdim, int tcell, int *pprocdim)
int processor_number(template, tdim, tcell, pprocdim)
int template_dimension_of_array_dimension(entity array, int dim)
tag new_declaration_tag(entity array, int dim)
void set_overlap(entity ent, int dim, int side, int width)
set the overlap value for entity ent, on dimension dim, dans side side to width, which must be a posi...
#define FindArrayDimAlignmentOfArray(array, dim)
#define array_to_template(array)
#define DELTAV
??? very beurk!
#define DEBUG_STAT(D, W, S)
void hpfc_add_ahead_of_node_code(statement s)
entity hpfc_name_to_entity(const char *)
void set_hpfc_current_statement(statement)
Pvecteur the_index_of_vect(Pvecteur)
message-utils.c
statement hpfc_make_call_statement(entity, list)
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression lis...
statement messages_handling(list, list)
messages.c
statement loop_nest_guard(statement, reference, list, list)
intptr_t load_hpf_number(entity)
int vect_size(Pvecteur v)
package vecteur - reductions
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_internal_error
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define GET_ENTITY_MAPPING(map, ent)
#define MAKE_ENTITY_MAPPING()
#define SET_ENTITY_MAPPING(map, ent, val)
#define message_assert(msg, ex)
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
int bool
we cannot use an enum or stdbool because we need to be compatible with newgen, thus boolean need to h...
static int number_of_distributed_dimensions(entity a)
static syntax choose_one_syntax_in_references_list(list *pls)
one of the syntax is chosen from the list.
static statement make_increment_statement(entity index)
static int which_array_dimension(reference r, entity e)
returns the dimension of reference on which index entity e is used
static bool generate_optimized_code_for_loop_nest(statement innerbody, statement *pstat, syntax the_computer_syntax, list Wa, list Ra, list Ro, list lWa, list lRa, list lRo)
static loop make_loop_skeleton(entity newindex, expression lower_expression, expression upper_expression)
static list lblocks
Overlap Analysis Module for HPFC.
static statement statement_compute_bounds(entity newlobnd, entity newupbnd, entity oldidxvl, expression lb, expression ub, int an, int dp)
generate the call to the dynamic loop bounds computation
static bool message_manageable_p(entity array, list lpref, list lkref)
every thing should be manageable, i.e.
static bool simple_indices_p(reference r)
true if indices are constants or index
#define RETURN(x)
must clear everything before returning in Overlap_Analysis...
static void initialize_variable_used_map_for_current_loop_nest(statement inner_body)
static bool on_same_proc_p(int t1, int t2, entity template, int dim)
true if the given template elements on the specified dimension are mapped on the same processor.
bool Overlap_Analysis(statement stat, statement *pstat)
check conditions and compile...
static void close_variable_used_map_for_statement()
bool block_distributed_p(entity array)
true if there is no cyclic distribution for the array
static bool variable_used_in_statement_p(entity ent, statement stat)
static statement make_loop_nest_for_overlap(list lold, list lnew, list lbl, entity_mapping new_indexes, entity_mapping old_indexes, statement innerbody)
static void update_indices_for_local_computation(entity_mapping new_indexes, list Ref, list lRef)
static void hpfc_overlap_kill_unused_scalars_rewrite(statement stat)
static bool aligned_p(reference r1, reference r2, list lvref, list lkref)
true if references are aligned or, for constants, on the same processor...
static void variable_used_rewrite(reference r)
static bool hpfc_overlap_kill_unused_scalars(statement stat)
true if one statement was killed
static bool hpfc_killed_scalar
To Kill scalar definitions within the generated code recognize if only one reference.
static statement current_variable_used_statement
bool variable_used_in_statement_p(ent, stat)
void print_reference(reference r)
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
entity entity_empty_label(void)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool expression_integer_constant_p(expression e)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression Value_to_expression(Value v)
added interface for linear stuff.
bool expression_reference_p(expression e)
Test if an expression is a reference.
basic MakeBasic(int)
END_EOLE.
entity make_new_scalar_variable(entity, basic)
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
int NumberOfDimension(entity)
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
#define syntax_reference(x)
#define reference_undefined
#define normalized_complex_p(x)
#define normalized_linear_p(x)
#define instruction_loop_p(x)
#define reference_variable(x)
#define instruction_loop(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define reference_domain
newgen_range_domain_defined
#define expression_undefined
#define expression_normalized(x)
#define reference_indices(x)
#define statement_instruction(x)
#define instruction_call(x)
@ is_execution_sequential
#define call_arguments(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
Value b1
booleen indiquant quel membre est en cours d'analyse
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
GENERIC_LOCAL_FUNCTION(directives, step_directives)
Copyright 2007, 2008, 2009 Alain Muller, Frederique Silber-Chaussumier.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...