25 #include "pips_config.h"
47 #define REGION_TYPE EFFECT_TYPE
102 if (s!=1)
return false;
139 fprintf(stderr,
"[affine_expression_of_loop_index_p]\nexpression:\n");
157 if (s!=1)
return(
false);
196 int procdim, i, ne2dim;
211 pips_debug(7,
"with references to %s[DIM=%zd] and %s[DIM=%zd]\n",
220 for (i=1 ; i<=ne2dim ; i++)
239 fprintf(stderr,
"[align_check] references are: ");
246 for (i=1 ; i<=ne2dim ; i++)
267 &index2, &shft2, &affr2);
270 if (!(baffin2 || bshift2 || bconst2))
288 ((dim1==0) && (!bconst2)))
290 pips_debug(8,
"%s[DIM=%d] not aligned aff %d shi %d cst %d\n",
298 if ((dim1==0) && (bconst2))
307 t2 = rate2*shft2+cnst2;
337 (indice1, &index1, &shft1, &affr1);
339 (indice1, &index1, &shft1);
347 if (!((baffin1 || bshift1 || bconst1) &&
348 (baffin2 || bshift2 || bconst2)))
355 if (baffin1 || baffin2)
358 r1 = ((bconst1)?(0):(rate1*affr1)),
359 r2 = ((bconst2)?(0):(rate2*affr2)),
360 c1 = rate1*shft1+cnst1,
361 c2 = rate2*shft2+cnst2;
364 if ((index1!=index2) ||
365 (r1!=r2) || (c1!=c2))
385 if (bconst1 && bconst2)
388 t1 = (rate1*shft1+cnst1),
389 t2 = (rate2*shft2+cnst2),
409 if ((rate1!=1) || (rate2!=1) || (index1!=index2))
417 if (bshift1 && bshift2)
450 if (!(baffin2 || bshift2 || bconst2 || blcnst2))
505 fprintf(stderr,
"[align_check] returning: ");
506 for (l=*plkind; l;
POP(l))
535 bool result = (s==0);
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...
static bool affine_expression_of_loop_index_p(expression e, entity *pe, int *pi1, int *pi2)
true if the expression is an affine function of a loop nest index.
static bool write_on_entity_p(entity e)
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,...
bool hpfc_integer_constant_expression_p(expression e, int *pi)
static bool shift_expression_of_loop_index_p(expression e, entity *pe, int *pi)
true if the expression is shift function of a loop nest index.
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define VALUE_TO_INT(val)
#define value_notone_p(val)
bool entity_loop_index_p(entity e)
bool conformant_templates_p(entity t1, entity t2)
#define region_write_p(reg)
#define region_entity(reg)
list load_statement_local_regions(statement)
#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.
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 alignment_constant(x)
#define align_template(x)
#define alignment_rate(x)
#define alignment_arraydim(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.
#define FindArrayDimAlignmentOfArray(array, dim)
#define FindTemplateDimAlignmentOfArray(array, dim)
#define DELTAV
??? very beurk!
statement get_hpfc_current_statement(void)
align load_hpf_alignment(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_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define GENERIC_STATIC_OBJECT(PREFIX, name, type)
Add the attribute ((unused)) for gcc to avoid warning if the functions are not used.
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
void print_reference(reference r)
#define NORMALIZE_EXPRESSION(e)
int NumberOfDimension(entity)
#define syntax_reference_p(x)
#define syntax_reference(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define EXPRESSION(x)
EXPRESSION.
#define normalized_tag(x)
#define expression_normalized(x)
#define reference_indices(x)
#define normalized_undefined_p(x)
#define normalized_linear(x)
#define expression_syntax(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
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.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
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...
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...