25 #include "pips_config.h"
46 #define STATIC_LIST_OF_HPF_OBJECTS(name, set_name, pred_name)\
47 static list name = NIL;\
48 int number_of_##name(){return(gen_length(name));}\
49 list list_of_##name(){return(name);}\
50 bool pred_name(entity e){return(gen_in_list_p(e, name));}\
51 void set_name(entity e){ if (!gen_in_list_p(e, name)){\
52 name = CONS(ENTITY, e, name); normalize_hpf_object(e);}}
67 return(distributed && in_common);
93 distributed_arrays =
NIL,
235 pips_assert(
"valid dimension and distributed array",
259 for(; ndim>0; ndim--)
273 pips_assert(
"valid dimension and distributed array",
276 if (!bound_new_declaration_p(
array))
302 init_new_declaration();
322 reset_new_declaration();
341 close_new_declaration();
355 int *templdimp, *procsdimp;
391 int minvalue =
iceil(szoftempldim, szofprocsdim);
393 if (paramvalue<minvalue)
414 int tdim = 1, pdim = 1;
447 #define normalized_dimension_p(dim) \
448 (HpfcExpressionToInt(dimension_lower(dim))==1)
466 int rate,
param, pdim = 1, asize = 0;
619 int ithdim = 1, newsz, p;
631 pips_debug(6,
"considering array %s, new %s\n",
644 pips_debug(8,
"dimension %d new size: %d\n", ithdim, newsz);
656 pips_debug(8,
"dimension %d isn't touched\n", ithdim);
680 if (!bound_new_declaration_p(
array))
715 int dim, side, width;
784 int ndim, i, lower_overlap, upper_overlap;
798 for (i=1 ; i<=ndim ; i++)
812 for (i=1 ; i<=ndim ; i++)
819 entity_name(ent), i, lower_overlap, upper_overlap);
821 if (lower_overlap!=0)
825 if (upper_overlap!=0)
853 for(; ndim>0; ndim--)
869 for (i=1; i<=len; i++,
POP(le))
hpf_newdecl make_hpf_newdecl(enum hpf_newdecl_utype tag, void *val)
numbers_status make_numbers_status(entity_int a1, intptr_t a2, intptr_t a3, intptr_t a4)
hpf_newdecls make_hpf_newdecls(list a)
overlap make_overlap(intptr_t a1, intptr_t a2)
data_status make_data_status(newdeclmap a1, alignmap a2, distributemap a3, list a4, list a5, list a6)
dimension make_dimension(expression a1, expression a2, list a3)
dimension copy_dimension(dimension p)
DIMENSION.
void free_expression(expression p)
expression MakeCharacterConstantExpression(string s)
END_EOLE.
void print_align(align a)
this is a set of functions to help hpfc debugging
void print_distribute(distribute d)
#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
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
#define alignment_templatedim(x)
#define alignment_undefined
#define DISTRIBUTION(x)
DISTRIBUTION.
#define distribution_style(x)
#define align_template(x)
#define align_alignment(x)
#define distribute_distribution(x)
#define alignment_rate(x)
#define distribute_processors(x)
#define distribution_parameter(x)
#define style_cyclic_p(x)
#define distribution_undefined
#define hpf_newdecls_dimensions(x)
#define hpf_newdecl_tag(x)
#define data_status_templates(x)
#define numbers_status_arrays(x)
#define numbers_status_processors(x)
#define OVERLAP(x)
OVERLAP.
#define data_status_alignmap(x)
#define numbers_status_templates(x)
#define data_status_processors(x)
#define data_status_distributemap(x)
#define numbers_status_numbermap(x)
#define HPF_NEWDECL(x)
HPF_NEWDECL.
#define data_status_newdeclmap(x)
#define data_status_arrays(x)
int HpfcExpressionToInt(expression e)
HpfcExpressionToInt(e)
bool ith_dim_distributed_p(entity array, int i, int *pprocdim)
whether a dimension is distributed or not.
alignment FindAlignmentOfDim(list lal, int dim)
distribution FindDistributionOfDim(list ldi, int dim, int *pdim)
bool ith_dim_overlapable_p(entity array, int i)
void normalize_hpf_object(entity v)
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
void reset_hpf_number_status()
void GiveToHpfObjectsTheirNumber()
give to hpf objects listed in distributedarrays, templates and processors their number for the code g...
static int ComputeNewSizeOfIthDimension(dimension dim, int i, entity array, tag *newdeclp)
here the new size of the ith dimension of the given array is computed.
static void init_currents()
#define normalized_dimension_p(dim)
local macros...
void set_hpf_number_status(numbers_status s)
static void NewDeclarationOfDistributedArray(entity array)
for node this are reformated, and for host these variables are deleted.
void close_hpf_number_status()
static void create_new_declaration(entity e)
tag new_declaration_tag(entity array, int dim)
static void declaration_with_overlaps(list l)
int get_overlap(entity ent, int dim, int side)
returns the overlap for a given entity, dimension and side, to be used in the declaration modificatio...
void get_ith_dim_new_declaration(entity array, int i, int *pmin, int *pmax)
numbers_status get_hpf_number_status()
static int current_template_index
static int current_array_index
list list_of_distributed_arrays_for_module(entity module)
returns the list of entities that are 'local' to module
void normalize_align(_UNUSED_ entity e, align a)
static void overlap_redefine_expression(expression *pexpr, int ov)
redefines the bound given the overlap which is to be included
expression entity_hpf_number(entity e)
returns the hpf_number parameter as a string not really needed ??? ??? never called
void NormalizeHpfDeclarations()
void normalize_distribute(entity t, distribute d)
static void store_a_new_declaration(entity array, int dim, tag what)
void reset_hpf_object_lists()
static int current_processors_index
void init_hpf_number_status()
STANDARS STATIC MANAGEMENT.
static void create_overlaps(entity e)
void declaration_with_overlaps_for_module(entity module)
void NewDeclarationsOfDistributedArrays()
this procedure generate the new declarations of every distributed arrays of the program,...
#define STATIC_LIST_OF_HPF_OBJECTS(name, set_name, pred_name)
in static_controlize
static void NormalizeOneTemplateDistribution(distribution d, entity templ, int *templdimp, entity procs, int *procsdimp)
NormalizeOneTemplateDistribution.
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...
data_status get_data_status()
void set_data_status(data_status s)
void free_hpf_object_lists()
void update_overlaps_in_caller(entity fun, list le)
the overlaps of the actual parameters are updated according to the formal requirements.
static void update_overlaps_of(entity u, entity v)
#define iceil(a, b)
integer ceiling function
void init_hpf_alignment(void)
entity load_old_node(entity)
bool declaration_delayed_p(entity)
entity load_new_node(entity)
void init_hpf_distribution(void)
void reset_hpf_alignment(void)
void reset_hpf_distribution(void)
bool entity_template_p(entity)
void set_template(entity)
list load_overlap_status(entity)
list list_of_processors(void)
bool bound_hpf_number_p(entity)
expression hpfc_array_bound(entity, bool, int)
entity hpfc_main_entity(entity)
returns the entity to which e is attached, that is first a common, then a function....
list list_of_templates(void)
distribute load_hpf_distribution(entity)
void close_hpf_distribution(void)
alignmap get_hpf_alignment(void)
void reset_hpf_number(void)
distributemap get_hpf_distribution(void)
void set_hpf_distribution(distributemap)
bool bound_new_node_p(entity)
void store_hpf_number(entity, intptr_t)
bool entity_processor_p(entity)
void store_overlap_status(entity, list)
align load_hpf_alignment(entity)
bool bound_overlap_status_p(entity)
void close_hpf_number(void)
void set_hpf_number(entity_int)
void close_hpf_alignment(void)
void set_hpf_alignment(alignmap)
list list_of_distributed_arrays(void)
void set_array_as_distributed(entity)
void init_hpf_number(void)
entity load_old_host(entity)
bool array_distributed_p(entity)
void set_processor(entity)
entity_int get_hpf_number(void)
#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 TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define GENERIC_GLOBAL_FUNCTION(name, type)
void normalize_first_expressions_of(void *obj)
static const char * prefix
#define PLUS_OPERATOR_NAME
#define entity_variable_p(e)
An entity_variable_p(e) may hide a typedef and hence a functional type.
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 FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
bool entity_in_common_p(entity e)
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...
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
dimension entity_ith_dimension(entity, int)
Another semantics would be: is this reference r to e a kill for e? In general, this cannot be answere...
int dimension_size(dimension)
this function computes the size of a dimension.
int SizeOfIthDimension(entity, int)
this function returns the size of the ith dimension of a variable e.
int NumberOfDimension(entity)
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
entity find_ith_parameter(entity, int)
#define storage_formal_p(x)
#define dimension_lower(x)
#define entity_storage(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
#define dimension_upper(x)
#define variable_dimensions(x)
#define type_variable_p(x)
GENERIC_LOCAL_FUNCTION(directives, step_directives)
Copyright 2007, 2008, 2009 Alain Muller, Frederique Silber-Chaussumier.
The structure used to build lists in NewGen.