PIPS
|
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "constants.h"
#include "misc.h"
#include "text-util.h"
#include "text.h"
#include "sommet.h"
#include "ray_dte.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "matrix.h"
#include "matrice.h"
#include "transformer.h"
#include "sparse_sc.h"
#include "pipsdbm.h"
#include "effects-generic.h"
#include "effects-convex.h"
Go to the source code of this file.
Functions | |
void | reset_proj_op_statistics () |
old_projection.c More... | |
void | print_proj_op_statistics (char *mod_name, char *prefix) |
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 More... | |
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 regions, a variable which is a loop index. More... | |
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, and the list of variables along which the projection will be performed. More... | |
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, and the list of variables along which the projection will be performed. More... | |
void | project_regions_with_transformer (list l_reg, transformer trans, list l_var_not_proj) |
void | project_regions_with_transformer_inverse (list l_reg, transformer trans, list l_var_not_proj) |
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, the transformer corresponding to the current statement, and a list of variables along which the regions must not be projected (typically a loop index). More... | |
void | regions_remove_phi_variables (list l_reg) |
void regions_remove_phi_variables(list l_reg) input : a list of regions, and an integer, which is the highest rank of phi variables that will be kept. More... | |
list | regions_dynamic_elim (list l_reg) |
list regions_dynamic_elim(list l_reg) input : a list of regions. More... | |
static Psysteme | region_sc_projection_ofl_along_parameters (Psysteme sc, Pvecteur pv_param, bool *p_exact) |
OPE'RATEURS CONCERNANT LES RE'GIONS INDIVIDUELLES. More... | |
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 : a convex polyhedron sc to project along the variable param which is linked to the PHI variables; p_exact is a pointer to a bool indicating whether the projection is exact or not. More... | |
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 must be eliminated. More... | |
Psysteme | cell_reference_system_remove_psi_variables (reference ref, Psysteme sc, bool *exact_p) |
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 must be eliminated. More... | |
Psysteme | cell_reference_system_remove_rho_variables (reference ref, Psysteme sc, bool *exact_p) |
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 must be eliminated. More... | |
void | region_remove_beta_variables (region reg) |
void region_remove_variables(effect reg, int beta_max) input : a PSI region in which beta variables must be eliminated. More... | |
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 list of variables. More... | |
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 list of parameters l_param. More... | |
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 of variables. More... | |
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 variables. More... | |
Psysteme | cell_reference_sc_exact_projection_along_variable (reference ref, Psysteme sc, entity var, bool *exact_p) |
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 (a loop index for instance). More... | |
static Pcontrainte | eq_var_nophi_min_coeff (Pcontrainte contraintes, Variable var) |
Ope'rateurs concernant les syste`mes de contraintes, mais propres au More... | |
static Pcontrainte | eq_var_phi (Pcontrainte contraintes, Variable var) |
Pcontrainte eq_var_nophi_min_coeff(Pcontrainte contraintes, Variable var) input : output : la contrainte (egalite ou inegalite) de "contraintes" qui contient var, mais pas de variable de variables phis et ou` var a le coeff non nul le plus petit; modifies : nothing comment : la contrainte renvoye'e n'est pas enleve'e de la liste. More... | |
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 equivalent polyhedron, in which the number of equations containing phi variables is minimal (see report E/185). More... | |
static int | constraints_nb_phi_eq (Pcontrainte eqs) |
static int constraints_nb_phi_eq(Pcontrainte eqs) input : a list of contraints. More... | |
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 range output : true if its projection of regions along index is safe (see conditions in report E/185). More... | |
void | region_dynamic_var_elim (region reg) |
void region_dynamic_var_elim(effect reg) input : a region . More... | |
Psysteme | sc_projection_ofl_along_list_of_variables (Psysteme ps, list l_var) |
MISC More... | |
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 constraints, and a vector of variables. More... | |
Variables | |
static int | nb_proj_param = 0 |
STATISTICS FOR PROJECTION OPERATORS More... | |
static int | nb_proj_param_pot_must = 0 |
static int | nb_proj_param_must = 0 |
static int | nb_proj_param_ofl = 0 |
static int | nb_proj_param_hermite = 0 |
static int | nb_proj_param_hermite_success = 0 |
static int | nb_proj_var = 0 |
static int | nb_proj_var_pot_must = 0 |
static int | nb_proj_var_must = 0 |
static int | nb_proj_var_ofl = 0 |
Psysteme cell_reference_sc_exact_projection_along_variable | ( | reference | ref, |
Psysteme | sc, | ||
entity | var, | ||
bool * | exact_p | ||
) |
ref | ef |
sc | c |
var | ar |
exact_p | xact_p |
Definition at line 1084 of file old_projection.c.
References Ssysteme::base, base_contains_variable_p(), CATCH, cell_reference_phi_cfc_variables(), chunk_undefined, FWD_OFL_CTRL, gen_find_eq(), gen_free_list(), overflow_error, ref, region_sc_normalize(), sc_base_remove_variable(), sc_empty_p(), sc_rm(), sc_rn_p(), TRY, UNCATCH, VALUE_ONE, vect_add_elem(), and vect_rm().
Referenced by cell_reference_system_remove_psi_variables(), and cell_reference_system_remove_rho_variables().
ref | ef |
sc | c |
exact_p | xact_p |
Definition at line 651 of file old_projection.c.
References CAR, CATCH, CDR, cell_reference_sc_exact_projection_along_variable(), ENDP, ENTITY, NB_MAX_ARRAY_DIM, overflow_error, psi_entities_list(), ref, sc_projection_ofl_along_list_of_variables(), sc_rm(), TRY, and UNCATCH.
ref | ef |
sc | c |
exact_p | xact_p |
Definition at line 709 of file old_projection.c.
References CAR, CATCH, CDR, cell_reference_sc_exact_projection_along_variable(), ENDP, ENTITY, NB_MAX_ARRAY_DIM, overflow_error, ref, rho_entities_list(), sc_projection_ofl_along_list_of_variables(), sc_rm(), TRY, and UNCATCH.
|
static |
static int constraints_nb_phi_eq(Pcontrainte eqs) input : a list of contraints.
output : the number of contraints containing phi variables. modifies : nothing. comment :
Definition at line 1573 of file old_projection.c.
References CONTRAINTE_UNDEFINED_P, Scontrainte::succ, vect_contains_phi_p(), and Scontrainte::vecteur.
Referenced by region_sc_minimal().
|
static |
Ope'rateurs concernant les syste`mes de contraintes, mais propres au
Pcontrainte eq_var_nophi_min_coeff(Pcontrainte contraintes, Variable var) input : output : la contrainte (egalite ou inegalite) de "contraintes" qui contient var, mais pas de variable de variables phis et ou` var a le coeff non nul le plus petit; modifies : nothing comment : la contrainte renvoye'e n'est pas enleve'e de la liste.
des re'gions.
are there phi variables in this equation ?
if not, we search if the coeff of var is minimum
Definition at line 1421 of file old_projection.c.
References CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, eq, Scontrainte::succ, value_absolute, value_lt, value_notzero_p, VALUE_ZERO, value_zero_p, vect_coeff(), vect_contains_phi_p(), and Scontrainte::vecteur.
Referenced by region_sc_projection_ofl_along_parameter().
|
static |
Pcontrainte eq_var_nophi_min_coeff(Pcontrainte contraintes, Variable var) input : output : la contrainte (egalite ou inegalite) de "contraintes" qui contient var, mais pas de variable de variables phis et ou` var a le coeff non nul le plus petit; modifies : nothing comment : la contrainte renvoye'e n'est pas enleve'e de la liste.
Definition at line 1457 of file old_projection.c.
References CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, eq, Scontrainte::succ, value_notzero_p, vect_coeff(), vect_contains_phi_p(), and Scontrainte::vecteur.
Referenced by region_sc_projection_ofl_along_parameter().
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
entity loop_regions_normalize(list l_reg, entity index, range l_range, bool *normalized_regions_p, bool sc_loop_p, Psysteme *psc_loop) input : a list of regions, a loop index, its range, and a pointer on a bool to know if the loop is normalized, a bool to know if the loop precondition system sc_loop must be normalized.
output : an entity representing the new loop index to use; it may be index if the loop is already normalized. modifies : l_reg, and *normalized_regions_p. comment : Loops are not normalized in PIPS, but array region semantic functions are defined for normalized loops (incr = +/-1). So we perform here a virtual loop normalization. If the loop is not already normalized, a new loop index (beta) is introduced, and the following system is added to each region of l_reg: { index = lower_bound + beta * incr, 0 <= beta } Then the old index is eliminated as a parameter, and the beta variable is returned as the new loop index. If the loop was already normalized, or has been virtually normalized, then *normalized_regions_p is set to TRUE.
Is the loop increment numerically known ?
add to each region predicate the system: { index = lower_bound + beta * incr, 0 <= beta }
eliminate the old index (which is no more a variable, but a parameter)
update the loop preconditions
l_reg | _reg |
index | ndex |
l_range | _range |
normalized_regions_p | ormalized_regions_p |
sc_loop_p | c_loop_p |
psc_loop | sc_loop |
Definition at line 160 of file old_projection.c.
References CONS, contrainte_make(), debug_regions_consistency, EFFECT, ENTITY, FOREACH, FWD_OFL_CTRL, gen_free_list(), ifdebug, make_beta_entity(), must_regions_p(), NIL, NO_OFL_CTRL, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_debug, range_increment, range_lower, range_upper, region_empty_p, region_exact_projection_along_parameters(), region_rn_p, region_sc_append_and_normalize(), sc_add_egalite(), sc_add_inegalite(), sc_base_remove_variable(), sc_creer_base(), sc_new(), sc_rm(), sc_safe_append(), sc_syst_debug(), store_effect_p(), TCST, value_abs, VALUE_MONE, value_notone_p, value_notzero_p, VALUE_ONE, value_uminus, VALUE_ZERO, vect_add_elem(), vect_cl_ofl_ctrl(), vect_coeff(), vect_constant_p(), and vect_new().
Referenced by project_regions_along_loop_index().
void print_proj_op_statistics | ( | char * | mod_name, |
char * | prefix | ||
) |
mod_name | od_name |
prefix | refix |
Definition at line 104 of file old_projection.c.
References concatenate(), db_get_current_workspace_directory(), fprintf(), free(), nb_proj_param, nb_proj_param_hermite, nb_proj_param_hermite_success, nb_proj_param_must, nb_proj_param_ofl, nb_proj_param_pot_must, nb_proj_var, nb_proj_var_must, nb_proj_var_ofl, nb_proj_var_pot_must, prefix, safe_fclose(), safe_fopen(), and strdup().
void project_regions_along_loop_index(list l_reg, entity index, l_range) input : a list l_reg of regions, a variable which is a loop index.
output : nothing. modifies : l_reg and the regions it contains. comment : project each region in l_reg along the variable index.
Take care of loops with non-unit increment when must regions are required
l_reg | _reg |
index | ndex |
l_range | _range |
Definition at line 263 of file old_projection.c.
References CONS, debug_off, debug_on, debug_regions_consistency, EFFECT, ENTITY, FOREACH, gen_free_list(), loop_regions_normalize(), must_regions_p(), NIL, region_exact_projection_along_variable(), region_non_exact_projection_along_variables(), and store_effect_p().
Referenced by comp_regions_of_implied_do().
void project_regions_along_parameters(list l_reg, list l_param) input : a list of regions to project, and the list of variables along which the projection will be performed.
output : nothing. modifies : l_reg and the regions it contains. comment : project each region in l_reg along the variables in l_param
l_reg | _reg |
l_param | _param |
Definition at line 337 of file old_projection.c.
References debug_off, debug_on, debug_regions_consistency, EFFECT, FOREACH, must_regions_p(), region_exact_projection_along_parameters(), region_non_exact_projection_along_parameters(), and store_effect_p().
Referenced by comp_regions_of_unstructured(), and regions_transformer_apply().
void project_regions_along_variables(list l_reg, list l_param) input : a list of regions to project, and the list of variables along which the projection will be performed.
output : nothing. modifies : l_reg and the regions it contains. comment : project each region in l_reg along the variables in l_var
l_reg | _reg |
l_var | _var |
Definition at line 307 of file old_projection.c.
References debug_off, debug_on, debug_regions_consistency, EFFECT, MAP, must_regions_p(), region_exact_projection_along_variables(), and region_non_exact_projection_along_variables().
Referenced by convex_cell_reference_preceding_p(), loop_basic_workchunk_to_workchunk(), region_remove_beta_variables(), region_remove_phi_variables(), region_remove_psi_variables(), and region_remove_rho_variables().
void project_regions_with_transformer | ( | list | l_reg, |
transformer | trans, | ||
list | l_var_not_proj | ||
) |
l_reg | _reg |
trans | rans |
l_var_not_proj | _var_not_proj |
Definition at line 364 of file old_projection.c.
References regions_transformer_apply().
void project_regions_with_transformer_inverse | ( | list | l_reg, |
transformer | trans, | ||
list | l_var_not_proj | ||
) |
l_reg | _reg |
trans | rans |
l_var_not_proj | _var_not_proj |
Definition at line 370 of file old_projection.c.
References regions_transformer_apply().
void region_dynamic_var_elim | ( | region | reg | ) |
void region_dynamic_var_elim(effect reg) input : a region .
output : nothing modifies : comment : eliminates all dynamic variables contained in the system of constraints of the region.
First, it makes a list of all the dynamic variables present. And then, it projects the region along the hyperplane defined by the dynamic entities
TCST is not dynamic
An entity in a system that has an undefined storage is necesseraly a PHI entity, not dynamic !!
Definition at line 1634 of file old_projection.c.
References Ssysteme::base, CONS, debug(), dynamic_area_p(), ENTITY, entity_local_name(), entity_storage, gen_free_list(), if(), ifdebug, is_storage_ram, must_regions_p(), NIL, pips_assert, pips_debug, print_entities(), ram_section, region_exact_projection_along_parameters(), region_non_exact_projection_along_parameters(), region_system, storage_ram, storage_tag, storage_undefined, Svecteur::succ, Svecteur::var, and VECTEUR_NUL_P.
Referenced by regions_dynamic_elim().
void region_exact_projection_along_parameters(effect reg, list l_param) input : a regions reg and a list of parameters l_param.
output : nothing. modifies : the initial region is successively projected along each variable in l_param. its approximaiton becomes may if the projection is not "exact" in the sense given in report E/185. comment : overflow errors are trapped here. if it occurs, an empty region replaces the initial region.
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
if there is an overflow error, reg becomes a whole array may region
if the initial region is a may region, the resulting region is also a may region, even if the projection happens to be exact. so we do not need to know whether it is exact or not
if the initial region is a must region, much more work is necessary to preserve the must approximation
first, the projection along parameters that are not linked to PHI variables (l_not_phi_param) is exact
then, we must perform the projection along parameters that are linked to PHI variables (l_phi_param).
projection functions only work on vector of parameters, not on lists
Definition at line 863 of file old_projection.c.
References arguments_difference(), arguments_intersection(), Ssysteme::base, base_contains_variable_p(), CATCH, cell_reference_p, debug(), ENDP, ENTITY, free_effect(), gen_free_list(), ifdebug, is_approximation_may, MAP, nb_proj_param, nb_proj_param_must, nb_proj_param_ofl, nb_proj_param_pot_must, newgen_Psysteme, op_statistics_p(), overflow_error, pips_assert, pips_debug, print_entities(), print_region, reference_whole_region(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_phi_cfc_variables(), region_sc_projection_ofl_along_parameters(), region_system, region_system_, sc_empty_p(), sc_projection_ofl_along_list_of_variables(), sc_rm(), sc_rn_p(), TRY, UNCATCH, VALUE_ONE, vect_add_elem(), and vect_rm().
Referenced by loop_regions_normalize(), project_regions_along_parameters(), region_dynamic_var_elim(), and regions_transformer_apply().
void region_exact_projection_along_variable(effect reg, entity var) input : a region and a variable (a loop index for instance).
output : nothing. modifies : the initial region, which is projected along var. the approximation is not modified. comment : overflow errors are trapped here. if it occurs, an empty region replaces the initial region.
FI: it seems that a value rather than a variable is projected.
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
Definition at line 1138 of file old_projection.c.
References Ssysteme::base, base_contains_variable_p(), CATCH, cell_preference, cell_preference_p, cell_reference, chunk_undefined, entity_name, free_effect(), FWD_OFL_CTRL, gen_find_eq(), gen_free_list(), ifdebug, is_approximation_exact, is_approximation_may, nb_proj_var, nb_proj_var_must, nb_proj_var_ofl, nb_proj_var_pot_must, newgen_Psysteme, op_statistics_p(), overflow_error, pips_debug, preference_reference, print_region, reference_undefined, reference_whole_region(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_phi_cfc_variables(), region_sc_normalize(), region_system, region_system_, sc_base_remove_variable(), sc_empty_p(), sc_rm(), sc_rn_p(), sc_syst_debug(), store_effect_p(), TRY, UNCATCH, VALUE_ONE, vect_add_elem(), and vect_rm().
Referenced by project_regions_along_loop_index(), and region_exact_projection_along_variables().
void region_exact_projection_along_variables(effect reg, list l_var) input : a region and a list of variables.
output : nothing. modifies : the initial region is projected along the variables in l_param. its approximation is set to may if the projection is not exact. comment : overflow errors are trapped here. if it occurs, an empty region replaces the initial region.
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
reg | eg |
l_var | _var |
Definition at line 1032 of file old_projection.c.
References CAR, CATCH, CDR, cell_reference_p, debug(), ENDP, ENTITY, free_effect(), ifdebug, is_approximation_exact, nb_proj_var_ofl, newgen_Psysteme, op_statistics_p(), overflow_error, pips_assert, pips_debug, print_entities(), print_region, reference_whole_region(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_exact_projection_along_variable(), region_non_exact_projection_along_variables(), region_system, region_system_, sc_empty_p(), sc_rm(), sc_rn_p(), TRY, and UNCATCH.
Referenced by array_must_fully_written_by_regions_p(), and project_regions_along_variables().
void region_non_exact_projection_along_parameters(effect reg, list l_param) input : a region and a list of variables.
output : nothing. modifies : the initial region is projected along the variables in l_param. its approximation is systematically set to may. comment : overflow errors are trapped here. if it occurs, an empty region replaces the initial region.
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
if there is an overflow error, reg becomes a whole array may region
Definition at line 808 of file old_projection.c.
References CATCH, cell_reference_p, debug(), free_effect(), ifdebug, is_approximation_may, nb_proj_param, nb_proj_param_ofl, newgen_Psysteme, op_statistics_p(), overflow_error, pips_assert, pips_debug, print_entities(), print_region, reference_whole_region(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_system, region_system_, sc_empty_p(), sc_projection_ofl_along_list_of_variables(), sc_rm(), sc_rn_p(), TRY, and UNCATCH.
Referenced by project_regions_along_parameters(), and region_dynamic_var_elim().
void region_non_exact_projection_along_variables(effect reg, list l_var) input : a region and a list of variables.
output : nothing. modifies : the initial region is projected along the variables in l_param. its approximation is systematically set to may. comment : overflow errors are trapped here. if it occurs, a whole array region replaces the initial region.
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
if there is an overflow error, reg becomes a whole array may region
Definition at line 977 of file old_projection.c.
References CATCH, cell_reference_p, free_effect(), ifdebug, is_approximation_may, nb_proj_var, nb_proj_var_ofl, newgen_Psysteme, op_statistics_p(), overflow_error, pips_assert, pips_debug, print_entities(), print_region, reference_whole_region(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_system, region_system_, sc_empty_p(), sc_projection_ofl_along_list_of_variables(), sc_rm(), sc_rn_p(), TRY, and UNCATCH.
Referenced by project_regions_along_loop_index(), project_regions_along_variables(), and region_exact_projection_along_variables().
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 range output : true if its projection of regions along index is safe (see conditions in report E/185).
modifies : nothing comment :
Is the loop increment numerically known ?
Definition at line 1593 of file old_projection.c.
References NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_assert, range_increment, range_lower, range_upper, TCST, value_abs, value_one_p, VALUE_ZERO, vect_coeff(), vect_constant_p(), and VECTEUR_NUL_P.
void region_remove_beta_variables | ( | region | reg | ) |
void region_remove_variables(effect reg, int beta_max) input : a PSI region in which beta variables must be eliminated.
output : nothing. modifies : reg comment : if an overflow error occurs, the region becomes a MAY region..
Definition at line 775 of file old_projection.c.
References beta_entities_list(), CONS, EFFECT, gen_free_list(), ifdebug, NIL, pips_debug, print_region, and project_regions_along_variables().
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 must be eliminated.
output : nothing. modifies : reg comment : if an overflow error occurs, the region becomes a MAY region..
Definition at line 626 of file old_projection.c.
References CONS, EFFECT, gen_free_list(), ifdebug, NB_MAX_ARRAY_DIM, NIL, phi_entities_list(), pips_debug, print_region, and project_regions_along_variables().
Referenced by regions_remove_phi_variables().
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 must be eliminated.
output : nothing. modifies : reg comment : if an overflow error occurs, the region becomes a MAY region..
Definition at line 686 of file old_projection.c.
References CONS, EFFECT, gen_free_list(), ifdebug, NB_MAX_ARRAY_DIM, NIL, pips_debug, print_region, project_regions_along_variables(), and psi_entities_list().
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 must be eliminated.
output : nothing. modifies : reg comment : if an overflow error occurs, the region becomes a MAY region..
Definition at line 745 of file old_projection.c.
References CONS, EFFECT, gen_free_list(), ifdebug, NB_MAX_ARRAY_DIM, NIL, pips_debug, print_region, project_regions_along_variables(), and rho_entities_list().
Psysteme region_sc_minimal(Psysteme sc, bool p_sc_changed_p) input : a polyhedron output : an equivalent polyhedron, in which the number of equations containing phi variables is minimal (see report E/185).
modifies : sc and p_sc_changed_p. The pointed bool is set to true, if a new sc is calculated (with the hermite stuff). comment :
the number of equations containing phi variables must be greater than one, otherwise, the system is already minimal. Moreover, the number of phi variables must be greater than 0.
We first transform the equations of the initial system into a matrices equation.
We then compute the corresponding hermite form of the transpose of the A_phi matrice
and we deduce the minimal systeme
Definition at line 1488 of file old_projection.c.
References A, Ssysteme::base, base_dimension, base_dup(), base_nb_phi(), constraints_nb_phi_eq(), constraints_to_matrices(), contrainte_free(), Ssysteme::egalites, eq, ifdebug, matrices_to_constraints(), matrix_free, matrix_hermite(), matrix_multiply(), matrix_new(), matrix_transpose(), nb_elems_list(), ordinary_sub_matrix(), phi_first_sort_base(), pips_debug, Q, and sc_syst_debug().
Referenced by region_sc_projection_ofl_along_parameter().
void region_sc_projection_ofl_along_variables(Psysteme *psc, Pvecteur pv) input : a system of constraints, and a vector of variables.
output : a system of contraints, resulting of the successive projection of the initial system along each variable of pv. modifies : *psc. comment : it is very different from sc_projection_with_test_along_variables_ofl_ctrl. sc_empty is returned if the system is not feasible (BC). The base of *psc is updated. assert if one of the variable does not belong to the base. The case ofl_ctrl == OFL_CTRL is not handled, because the user may want an SC_UNDEFINED, or an sc_empty(sc->base) or an sc_rn(sc->base) as a result. It is not homogeneous. special implementation for regions: special choice for redudancy elimination. bc.
In case of big sc, we might consider a better order for the projection. Example: 2 phases of elimination (must-projection):
The non_exact projection: if the projection excat fails, then return the modified sc, without variable in base.
ne devrait plus arriver !
psc | sc |
pv | v |
ofl_ctrl | fl_ctrl |
Definition at line 1727 of file old_projection.c.
References base_copy(), base_rm, sc_base_remove_variable(), sc_empty(), Svecteur::succ, VECTEUR_NUL_P, and vecteur_var.
Referenced by region_sc_projection_ofl_along_parameters(), and sc_projection_ofl_along_list_of_variables().
|
static |
Psysteme region_sc_projection_ofl_along_parameter(Psysteme sc, Variable param, bool *p_exact) input : a convex polyhedron sc to project along the variable param which is linked to the PHI variables; p_exact is a pointer to a bool indicating whether the projection is exact or not.
output : the polyhedron resulting of the projection. modifies : sc, *p_exact. comment : first, we must search for an equation containing this variable, but no phi variables; if such an equation does not explicitly exists, it may be implicit, and we must find it using an hermitte form. if such an equation does not exist, we must search for the inequations containing this variable and one ore more phi variables. If it does not exist then the projection is exact, otherwise, it is not exact.
WARNING : the base and dimension of sc are not updated.
fisrt, we search for an explicit equation containing param, but no phi variables
if the last equation is not explicit, it may be implicit
we then search if there exist an equation linking param to the PHI variables.
if such an equation does not exist, we search for an inequation containing param and a phi variable
Definition at line 1329 of file old_projection.c.
References Ssysteme::base, base_dup(), base_rm, CONTRAINTE_UNDEFINED_P, debug(), Ssysteme::egalites, eq, eq_var_nophi_min_coeff(), eq_var_phi(), Ssysteme::inegalites, nb_proj_param_hermite, nb_proj_param_hermite_success, op_statistics_p(), pips_debug, region_sc_minimal(), sc_empty(), and sc_rm().
Referenced by region_sc_projection_ofl_along_parameters().
|
static |
OPE'RATEURS CONCERNANT LES RE'GIONS INDIVIDUELLES.
Psysteme region_sc_projection_ofl_along_parameters(Psysteme sc, Pvecteur pv_param, bool *p_exact) input : a convex polyhedron sc to project along the parameters contained in the vector pv_param, which are linked to the PHI variables; p_exact is a pointer to a bool indicating whether the projection is exact or not.
output : the polyhedron resulting of the projection. modifies : sc, *p_exact. comment :
c = sc_projection_ofl_along_variables(sc,pv_param);
Definition at line 1285 of file old_projection.c.
References FWD_OFL_CTRL, region_sc_normalize(), region_sc_projection_along_variables_ofl_ctrl(), region_sc_projection_ofl_along_parameter(), sc_base_remove_variable(), Svecteur::succ, VECTEUR_NUL_P, and vecteur_var.
Referenced by region_exact_projection_along_parameters().
list regions_dynamic_elim(list l_reg) input : a list of regions.
output : a list of regions in which regions of dynamic variables are removed, and in which dynamic integer scalar variables are eliminated from the predicate. modifies : nothing; the regions l_reg initially contains are copied if necessary. comment :
If the reference is a common variable (ie. with storage ram but not dynamic) or a formal parameter, the region is not ignored.
| heap_area_p(ram_section(r))
pips_internal_error("bad tag for %s (rom)", entity_name(reg_ent));
Eliminate dynamic variables.
l_reg | _reg |
Definition at line 531 of file old_projection.c.
References anywhere_effect_p(), debug_off, debug_on, debug_regions_consistency, dynamic_area_p(), EFFECT, entity_name, entity_special_area_p(), entity_storage, FOREACH, ifdebug, is_storage_formal, is_storage_ram, is_storage_return, is_storage_rom, NIL, pips_debug, pips_debug_effect, pips_internal_error, ram_section, region, region_add_to_regions(), region_dup(), region_dynamic_var_elim(), region_entity, stack_area_p(), storage_ram, storage_tag, and store_effect_p().
Referenced by set_methods_for_convex_effects(), and set_methods_for_convex_rw_pointer_effects().
void regions_remove_phi_variables | ( | list | l_reg | ) |
void regions_remove_phi_variables(list l_reg) input : a list of regions, and an integer, which is the highest rank of phi variables that will be kept.
output : nothing. modifies : project regions in l_reg along the phi variables which rank are higher (>) than phi_max. comment : An assumption is made : the projection is exact and the approximation are thus preserved, except if an overflow error occurs. This function is only used in the case of a forward interprocedural propagation : the assumption is then always true.
l_reg | _reg |
Definition at line 508 of file old_projection.c.
References debug_off, debug_on, debug_regions_consistency, EFFECT, FOREACH, and region_remove_phi_variables().
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, the transformer corresponding to the current statement, and a list of variables along which the regions must not be projected (typically a loop index).
output : nothing. modifies : l_reg and the regions it contains comment : project each region in l_reg along the variables in the arguments of trans which are not in l_var_not_proj, using the algorithm described in document E/185/CRI.
addition of the predicate of the transformer to the predicate of the regions and elimination of redundances; then, projection of regions along initial variables, and renaming of old variables corresponding to the eliminated variables into new variables.
first we store the names of the old and int variables
addition of the predicate of the transformer, and elimination of redundances
projection along intermediate variables
remove potential old values that may be found in transformer
no memory leaks
l_reg | _reg |
trans | rans |
l_var_not_proj | _var_not_proj |
backward_p | ackward_p |
Definition at line 386 of file old_projection.c.
References arguments_difference(), BASE_NULLE_P, CONS, debug_off, debug_on, debug_region_consistency, debug_regions_consistency, EFFECT, ENDP, ENTITY, entity_local_name(), FOREACH, fprintf(), gen_free_list(), ifdebug, local_old_value_entity_p(), must_regions_p(), NIL, pips_debug, pips_debug_effect, pips_debug_effects, predicate_system, print_entities(), project_regions_along_parameters(), region_exact_projection_along_parameters(), region_sc_append_and_normalize(), region_system, sc_dup(), sc_empty_p(), sc_list_variables_rename(), sc_print(), sc_rm(), sc_rn_p(), store_effect_p(), transformer_arguments, transformer_relation, variables_to_int_variables(), variables_to_old_variables(), vecteur_succ, and vecteur_var.
Referenced by project_regions_with_transformer(), and project_regions_with_transformer_inverse().
void reset_proj_op_statistics | ( | void | ) |
Definition at line 88 of file old_projection.c.
References nb_proj_param, nb_proj_param_hermite, nb_proj_param_hermite_success, nb_proj_param_must, nb_proj_param_ofl, nb_proj_param_pot_must, nb_proj_var, nb_proj_var_must, nb_proj_var_ofl, and nb_proj_var_pot_must.
MISC
converts the list into a Pvecteur
ps = sc_projection_ofl_along_variables(ps, pv_var);
ps | s |
l_var | _var |
Definition at line 1693 of file old_projection.c.
References Ssysteme::base, base_contains_variable_p(), ENTITY, FWD_OFL_CTRL, MAP, region_sc_projection_along_variables_ofl_ctrl(), VALUE_ONE, vect_add_elem(), and vect_rm().
Referenced by cell_reference_system_remove_psi_variables(), cell_reference_system_remove_rho_variables(), region_exact_projection_along_parameters(), region_non_exact_projection_along_parameters(), and region_non_exact_projection_along_variables().
|
static |
STATISTICS FOR PROJECTION OPERATORS
Definition at line 75 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_parameters(), region_non_exact_projection_along_parameters(), and reset_proj_op_statistics().
|
static |
Definition at line 79 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_sc_projection_ofl_along_parameter(), and reset_proj_op_statistics().
|
static |
Definition at line 80 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_sc_projection_ofl_along_parameter(), and reset_proj_op_statistics().
|
static |
Definition at line 77 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_parameters(), and reset_proj_op_statistics().
|
static |
Definition at line 78 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_parameters(), region_non_exact_projection_along_parameters(), and reset_proj_op_statistics().
|
static |
Definition at line 76 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_parameters(), and reset_proj_op_statistics().
|
static |
Definition at line 82 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_variable(), region_non_exact_projection_along_variables(), and reset_proj_op_statistics().
|
static |
Definition at line 84 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_variable(), and reset_proj_op_statistics().
|
static |
Definition at line 85 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_variable(), region_exact_projection_along_variables(), region_non_exact_projection_along_variables(), and reset_proj_op_statistics().
|
static |
Definition at line 83 of file old_projection.c.
Referenced by print_proj_op_statistics(), region_exact_projection_along_variable(), and reset_proj_op_statistics().