25 #include "pips_config.h"
52 #include "constants.h"
109 filename =
"proj_param_op_stat";
111 mod_name,
".",
prefix, filename, NULL));
120 filename =
"proj_var_op_stat";
122 mod_name,
".",
prefix, filename, NULL));
161 bool *normalized_regions_p,
bool sc_loop_p,
188 *normalized_regions_p =
192 *normalized_regions_p?
"yes" :
"no");
194 if (*normalized_regions_p)
242 sc_projection_along_variable_ofl_ctrl(&sc_tmp,(
Variable) index,
265 bool projection_of_index_safe =
false;
268 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
275 &projection_of_index_safe,
false,&sc_tmp);
310 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
340 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
387 list l_var_not_proj,
bool backward_p)
394 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
400 pips_debug(3,
"elimination of variables: \n");
415 fprintf(stderr,
"transformer:\n");
510 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
535 debug_on(
"REGIONS_OPERATORS_DEBUG_LEVEL");
543 bool ignore_this_region =
false;
558 ignore_this_region =
true;
569 ignore_this_region =
true;
577 ignore_this_region =
true;
585 if (! ignore_this_region)
656 for(; !
ENDP(l_psi) && *exact_p; l_psi =
CDR(l_psi))
659 bool exact_projection;
661 *exact_p = *exact_p && exact_projection;
664 if (!
ENDP(l_psi) && !SC_UNDEFINED_P(ps))
714 for(; !
ENDP(l_rho) && *exact_p; l_rho =
CDR(l_rho))
717 bool exact_projection;
719 *exact_p = *exact_p && exact_projection;
722 if (!
ENDP(l_rho) && !SC_UNDEFINED_P(ps))
823 debug(6,
"",
"parameters along which the projection must be performed:\n");
879 debug(6,
"",
"parameters along which the projection must be performed:\n");
920 if (!
ENDP(l_not_phi_param))
923 (ps, l_not_phi_param);
928 if(!
ENDP(l_phi_param))
993 pips_debug(6,
"variables along which the projection must be performed:\n");
1045 debug(6,
"",
"variables along which the projection must be performed:\n");
1065 volatile list ll_var = l_var;
1067 for(; !
ENDP(ll_var) &&
1069 ll_var =
CDR(ll_var))
1096 return SC_UNDEFINED;
1104 sc_projection_along_variable_ofl_ctrl(psc,(
Variable) var,
1115 ps = sc_projection_ofl_along_variables_with_test
1116 (ps, pv_var, exact_p);
1187 pips_debug(8,
"system before projection (1): \n");
1192 sc_projection_along_variable_ofl_ctrl(psc,(
Variable) var,
1198 pips_debug(8,
"system before normalization: \n");
1203 pips_debug(8,
"system after normalization: \n");
1215 bool is_proj_exact =
true;
1220 pips_debug(8,
"system before projection (2): \n");
1224 sc = sc_projection_ofl_along_variables_with_test
1225 (sc, pv_var, &is_proj_exact);
1230 pips_debug(8,
"system before normalization: \n");
1235 pips_debug(8,
"system after normalization: \n");
1291 for(; (*p_exact ==
true) && !
VECTEUR_NUL_P(pv_param); pv_param = pv_param->
succ)
1346 sc = sc_projection_ofl_with_eq(sc,
eq,
param);
1348 debug(8,
"region_sc_projection_ofl_along_parameter",
1349 "explicit equation found.\n");
1365 sc = sc_projection_ofl_with_eq(sc,
eq,
param);
1381 sc = sc_projection_ofl_with_eq(sc,
eq,
param);
1383 pips_debug(8,
"equation with PHI and param found -> projection not exact.\n");
1399 if (!combiner_ofl(sc,
param))
1494 Pmatrix A, C, A_phi, A_phi_t, H, P,
Q, Q_t, A_min, C_min;
1498 *p_sc_changed_p =
false;
1507 *p_sc_changed_p =
true;
1596 bool projection_of_index_safe =
false;
1615 projection_of_index_safe =
1618 return(projection_of_index_safe);
1641 ps_base = ps_reg->
base;
1643 pips_assert(
"region_dynamic_var_elim", ! SC_UNDEFINED_P(ps_reg));
1654 debug(5,
"region_dynamic_var_elim",
"Test upon var : %s\n",
1666 debug(5,
"region_dynamic_var_elim",
1738 sc_projection_along_variable_ofl_ctrl(psc,
vecteur_var(pv1), ofl_ctrl);
1751 if (!SC_UNDEFINED_P(*psc)) {
1758 if (SC_UNDEFINED_P(*psc)){
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
void free_effect(effect p)
struct _newgen_struct_entity_ * entity
static reference ref
Current stmt (an integer)
cons * arguments_difference(cons *a1, cons *a2)
set difference: a1 - a2 ; similar to set intersection
list arguments_intersection(list a1, list a2)
Build a new list with all entities occuring in both a1 and a2.
#define value_absolute(ref)
#define value_notzero_p(val)
#define value_uminus(val)
unary operators on values
#define value_notone_p(val)
#define value_zero_p(val)
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
#define A(i, j)
comp_matrice.c
void sc_syst_debug(Psysteme s)
constraint_to_text.c
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
int nb_elems_list(Pcontrainte)
int nb_elems_list(Pcontrainte list): nombre de contraintes se trouvant dans une liste de contraintes
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
#define region_any_reference(reg)
To be avoided.
#define region_action(reg)
#define debug_regions_consistency(l_reg)
consistency checking
#define debug_region_consistency(reg)
#define region_system_(reg)
#define region_entity(reg)
#define region_system(reg)
#define region_empty_p(reg)
#define region_approximation_tag(reg)
#define region
simulation of the type region
list region_add_to_regions(effect, list)
Psysteme sc_list_variables_rename(Psysteme, list, list)
bool must_regions_p(void)
list rho_entities_list(int, int)
list variables_to_int_variables(list)
list phi_entities_list(int, int)
void region_sc_append_and_normalize(effect, Psysteme, int)
list region_phi_cfc_variables(effect)
void phi_first_sort_base(Pbase *)
list beta_entities_list(int, int)
effect reference_whole_region(reference, action)
list cell_reference_phi_cfc_variables(reference, Psysteme)
list psi_entities_list(int, int)
Psysteme region_sc_normalize(Psysteme, int)
entity make_beta_entity(int)
utils.c
effect region_dup(effect)
bool op_statistics_p(void)
list variables_to_old_variables(list)
#define pips_debug_effects(level, message, l_eff)
#define pips_debug_effect(level, message, eff)
for debug
bool store_effect_p(effect)
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
bool vect_contains_phi_p(Pvecteur)
bool vect_contains_phi_p(Pvecteur v) input : a vector output : true if v contains a PHI variable,...
#define cell_reference(x)
#define cell_preference(x)
#define cell_reference_p(x)
#define cell_preference_p(x)
#define newgen_Psysteme(p)
FILE * safe_fopen(const char *filename, const char *what)
int safe_fclose(FILE *stream, const char *filename)
#define chunk_undefined
obsolete
#define ENDP(l)
Test if a list is empty.
#define NIL
The empty list (nil in Lisp)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#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.
#define CDR(pcons)
Get the list less its first element.
void * gen_find_eq(const void *item, const list seq)
#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 matrix_free(m)
Allocation et desallocation d'une matrice.
Pmatrix matrix_new(int m, int n)
package matrix
void matrix_hermite(Pmatrix MAT, Pmatrix P, Pmatrix H, Pmatrix Q, Value *det_p, Value *det_q)
package matrix
void matrix_multiply(const Pmatrix a, const Pmatrix b, Pmatrix c)
void matrix_multiply(Pmatrix a, Pmatrix b, Pmatrix c): multiply rational matrix a by rational matrix ...
void matrix_transpose(const Pmatrix A, Pmatrix At)
void matrix_transpose(Pmatrix a, Pmatrix a_t): transpose an (nxm) rational matrix a into a (mxn) rati...
void ordinary_sub_matrix(Pmatrix, Pmatrix, int, int, int, int)
void ordinary_sub_matrix(Pmatrix A, A_sub, int i1, i2, j1, j2) input : a initialized matrix A,...
#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
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
string concatenate(const char *,...)
Return the concatenation of the given strings.
static Psysteme region_sc_projection_ofl_along_parameters(Psysteme sc, Pvecteur pv_param, bool *p_exact)
OPE'RATEURS CONCERNANT LES RE'GIONS INDIVIDUELLES.
list regions_dynamic_elim(list l_reg)
list regions_dynamic_elim(list l_reg) input : a list of regions.
void region_remove_psi_variables(region reg)
void region_remove_psi_variables(effect reg, int phi_max) input : a PHI region in which psi variables...
void region_exact_projection_along_parameters(region reg, list l_param)
void region_exact_projection_along_parameters(effect reg, list l_param) input : a regions reg and a l...
void region_remove_rho_variables(region reg)
void region_remove_rho_variables(effect reg, int phi_max) input : a PHI region in which rho variables...
Psysteme cell_reference_system_remove_psi_variables(reference ref, Psysteme sc, bool *exact_p)
void project_regions_with_transformer_inverse(list l_reg, transformer trans, list l_var_not_proj)
static int nb_proj_param_hermite
void region_sc_projection_along_variables_ofl_ctrl(Psysteme *psc, Pvecteur pv, int ofl_ctrl)
void region_sc_projection_ofl_along_variables(Psysteme *psc, Pvecteur pv) input : a system of constra...
static int nb_proj_var_ofl
void project_regions_along_parameters(list l_reg, list l_param)
void project_regions_along_parameters(list l_reg, list l_param) input : a list of regions to project,...
bool region_projection_along_index_safe_p(entity __attribute__((unused)) index, range l_range)
bool region_projection_along_index_safe_p(entity index, range l_range) input : an loop index and its ...
static Psysteme region_sc_projection_ofl_along_parameter(Psysteme sc, Variable param, bool *p_exact)
Psysteme region_sc_projection_ofl_along_parameter(Psysteme sc, Variable param, bool *p_exact) input :...
static Pcontrainte eq_var_nophi_min_coeff(Pcontrainte contraintes, Variable var)
Ope'rateurs concernant les syste`mes de contraintes, mais propres au
void regions_transformer_apply(list l_reg, transformer trans, list l_var_not_proj, bool backward_p)
void regions_transformer_apply(l_reg, trans, l_var_not_proj) input : a list of regions,...
void project_regions_along_variables(list l_reg, list l_var)
void project_regions_along_variables(list l_reg, list l_param) input : a list of regions to project,...
entity loop_regions_normalize(list l_reg, entity index, range l_range, bool *normalized_regions_p, bool sc_loop_p, Psysteme *psc_loop)
FONCTIONS D'INTERFACE
void region_non_exact_projection_along_parameters(region reg, list l_param)
void region_non_exact_projection_along_parameters(effect reg, list l_param) input : a region and a li...
void region_dynamic_var_elim(region reg)
void region_dynamic_var_elim(effect reg) input : a region .
Psysteme cell_reference_sc_exact_projection_along_variable(reference ref, Psysteme sc, entity var, bool *exact_p)
static int nb_proj_var_pot_must
Psysteme sc_projection_ofl_along_list_of_variables(Psysteme ps, list l_var)
MISC
static int nb_proj_param_ofl
void region_remove_phi_variables(region reg)
void region_remove_phi_variables(effect reg, int phi_max) input : a PSI region in which phi variables...
void region_remove_beta_variables(region reg)
void region_remove_variables(effect reg, int beta_max) input : a PSI region in which beta variables m...
static int nb_proj_param_hermite_success
static int nb_proj_var_must
void print_proj_op_statistics(char *mod_name, char *prefix)
void region_non_exact_projection_along_variables(region reg, list l_var)
void region_non_exact_projection_along_variables(effect reg, list l_var) input : a region and a list ...
static Psysteme region_sc_minimal(Psysteme sc, bool *p_sc_changed_p)
Psysteme region_sc_minimal(Psysteme sc, bool p_sc_changed_p) input : a polyhedron output : an equival...
void reset_proj_op_statistics()
old_projection.c
static int constraints_nb_phi_eq(Pcontrainte eqs)
static int constraints_nb_phi_eq(Pcontrainte eqs) input : a list of contraints.
void regions_remove_phi_variables(list l_reg)
void regions_remove_phi_variables(list l_reg) input : a list of regions, and an integer,...
static int nb_proj_param_must
void project_regions_along_loop_index(list l_reg, entity index, range l_range)
void project_regions_along_loop_index(list l_reg, entity index, l_range) input : a list l_reg of regi...
static int nb_proj_param_pot_must
void region_exact_projection_along_variables(effect reg, list l_var)
void region_exact_projection_along_variables(effect reg, list l_var) input : a region and a list of v...
static Pcontrainte eq_var_phi(Pcontrainte contraintes, Variable var)
Pcontrainte eq_var_nophi_min_coeff(Pcontrainte contraintes, Variable var) input : output : la contrai...
void project_regions_with_transformer(list l_reg, transformer trans, list l_var_not_proj)
void region_exact_projection_along_variable(region reg, entity var)
void region_exact_projection_along_variable(effect reg, entity var) input : a region and a variable (...
Psysteme cell_reference_system_remove_rho_variables(reference ref, Psysteme sc, bool *exact_p)
static int nb_proj_param
STATISTICS FOR PROJECTION OPERATORS
string db_get_current_workspace_directory(void)
static const char * prefix
#define NORMALIZE_EXPRESSION(e)
bool dynamic_area_p(entity aire)
bool stack_area_p(entity aire)
bool entity_special_area_p(entity e)
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...
void print_entities(list l)
#define reference_undefined
#define normalized_linear_p(x)
#define entity_storage(x)
#define range_increment(x)
#define transformer_relation(x)
#define transformer_arguments(x)
#define preference_reference(x)
#define normalized_linear(x)
#define predicate_system(x)
#define storage_undefined
void sc_base_remove_variable(Psysteme sc, Variable v)
bool sc_rn_p(Psysteme sc)
bool sc_rn_p(Psysteme sc): check if the set associated to sc is the whole space, rn
Psysteme sc_empty(Pbase b)
Psysteme sc_empty(Pbase b): build a Psysteme with one unfeasible constraint to define the empty subsp...
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_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
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_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Psysteme sc_safe_append(Psysteme s1, Psysteme s2)
Psysteme sc_safe_append(Psysteme s1, Psysteme s2) input : output : calcul de l'intersection des polye...
void sc_print(Psysteme ps, get_variable_name_t nom_var)
void sc_print()
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void matrices_to_constraints(Pcontrainte *, Pbase, Pmatrix, Pmatrix)
=======================================================================
void constraints_to_matrices(Pcontrainte, Pbase, Pmatrix, Pmatrix)
=======================================================================
struct Scontrainte * succ
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.
char *(* get_variable_name_t)(Variable)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define base_dimension(b)
Pbase base_dup(Pbase b)
Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Pbase base_copy(Pbase b)
Direct duplication.
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_cl_ofl_ctrl(Pvecteur v, Value lambda, Pvecteur u, int ofl_ctrl)
Pvecteur vect_cl_ofl_ctrl(Pvecteur v, Value lambda, Pvecteur u, int ofl_ctrl): etape d'acculumulation...
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...