27 #if defined(BUILDER_LOOP_BOUND_MINIMIZATION_WITH_OUT_REGIONS) || \
28 defined(BUILDER_DEAD_CODE_ELIMINATION)
31 #include "pips_config.h"
69 typedef struct ctx_lbm {
111 sc_useful =
sc_free(sc_useful);
125 pips_debug(3,
"before projection local_sc_useful:\n");
127 pips_debug(3,
"Nb_eq %d , Nb_ineq %d, dimension %d\n",
128 (local_sc_useful)->nb_eq, (local_sc_useful)->nb_ineq,
140 "Need some normalization?\nDon't do any minimization");
141 sc_useful =
sc_free(sc_useful);
150 sc_and_base_projection_along_variable_ofl_ctrl(&local_sc_useful, indexent,
FWD_OFL_CTRL);
156 pips_debug(3,
"after projection local_sc_useful:\n");
158 pips_debug(3,
"Nb_eq %d , Nb_ineq %d, dimension %d\n",
159 (local_sc_useful)->nb_eq, (local_sc_useful)->nb_ineq,
180 pips_debug(2,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (sc_useful)->nb_eq, (sc_useful)->nb_ineq, (sc_useful)->
dimension);
184 pips_debug(2,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (loop_sc)->nb_eq, (loop_sc)->nb_ineq, (loop_sc)->
dimension);
192 "lower=%s, upper=%s, inc=%s\n",
197 sc_useful =
sc_free(sc_useful);
201 bool feasible =
true;
206 pips_debug(3,
"after sc_safe_append and normalization of sc_useful:\n");
208 pips_debug(3,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (sc_useful)->nb_eq, (sc_useful)->nb_ineq, (sc_useful)->
dimension);
214 sc_useful =
sc_free(sc_useful);
231 pips_debug(1,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (sc_useful)->nb_eq, (sc_useful)->nb_ineq, (sc_useful)->
dimension);
235 pips_debug(1,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (loop_sc)->nb_eq, (loop_sc)->nb_ineq, (loop_sc)->
dimension);
237 sc_useful =
sc_free(sc_useful);
243 pips_debug(2,
"after check feasibility sc_useful:\n");
245 pips_debug(2,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (sc_useful)->nb_eq, (sc_useful)->nb_ineq, (sc_useful)->
dimension);
250 if (sc_useful != loop_sc && !
sc_equal_p(sc_useful, loop_sc)) {
255 enumeration = SC_UNDEFINED;
257 pips_debug(5,
"algorithm_row_echelon_generic start\n");
259 &condition, &enumeration);
260 pips_debug(5,
"algorithm_row_echelon_generic end\n");
263 pips_debug(5,
"result of algorithm_row_echelon_generic:\n");
269 pips_debug(5,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (sc_useful)->nb_eq, (sc_useful)->nb_ineq, (sc_useful)->
dimension);
273 pips_debug(5,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (condition)->nb_eq, (condition)->nb_ineq, (condition)->
dimension);
277 pips_debug(5,
"Nb_eq %d , Nb_ineq %d, dimension %d\n", (enumeration)->nb_eq, (enumeration)->nb_ineq, (enumeration)->
dimension);
286 c = sc_inegalites(enumeration);
287 pips_assert(
"no equalities, now", sc_nbre_egalites(enumeration)==0);
290 sc_inegalites(enumeration) = c;
320 sc_useful =
sc_free(sc_useful);
321 enumeration =
sc_free(enumeration);
322 condition =
sc_free(condition);
328 static void statement_loop_bound_minimization(
statement s, ctx_lbm_t *ctx) {
331 loop_bound_minimization(s, *ctx);
333 else if (!ctx->do_loop_only_p &&
341 bool good_result_p =
true;
349 return good_result_p;
358 bool good_result_p =
true;
360 debug_on(
"LOOP_BOUND_MINIMIZATION_DEBUG_LEVEL");
403 return (good_result_p);
bool statement_consistent_p(statement p)
void free_expression(expression p)
static reference ref
Current stmt (an integer)
static statement module_statement
Pbase base_add_variable(Pbase b, Variable var)
Pbase base_add_variable(Pbase b, Variable v): add variable v as a new dimension to basis b at the end...
#define CONTRAINTE_UNDEFINED_P(c)
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
void constraints_for_bounds(Variable, Pcontrainte *, Pcontrainte *, Pcontrainte *)
void constraints_for_bounds(var, pinit, plower, pupper) Variable var; Pcontrainte *pinit,...
expression constraints_to_loop_bound(Pcontrainte, Variable, bool, entity)
expression constraints_to_loop_bound(c, var, is_lower)
void print_inout_regions(list)
void reset_out_effects(void)
void set_out_effects(statement_effects)
list load_statement_out_regions(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
const char * pips_region_user_name(entity)
char * pips_region_user_name(entity ent) output : the name of entity.
bool anywhere_effect_p(effect)
Is it an anywhere effect? ANYMMODULE:ANYWHERE
#define descriptor_tag(x)
#define descriptor_convex_p(x)
#define effect_descriptor(x)
#define descriptor_convexunion_p(x)
#define descriptor_convex(x)
#define descriptor_none_p(x)
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
#define VOLATILE_FOREACH(_fe_CASTER, _fe_item, _fe_list)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
loop statement_loop(statement)
Get the loop of a statement.
void base_fprint(FILE *f, Pbase b, get_variable_name_t variable_name)
void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier ...
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Psysteme sc_cute_convex_hull(Psysteme, Psysteme)
returns s1 v s2.
void print_entity_variable(entity e)
print_entity_variable(e)
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
string expression_to_string(expression e)
void print_statement(statement)
Print a statement on stderr.
#define DIVIDE_OPERATOR_NAME
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
#define instruction_loop_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
#define instruction_forloop_p(x)
#define transformer_relation(x)
#define reference_indices(x)
#define statement_instruction(x)
#define instruction_whileloop_p(x)
#define predicate_system(x)
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...
Psysteme sc_rn(Pbase b)
Psysteme sc_rn(Pbase b): build a Psysteme without constraints to define R^n, where n is b's dimension...
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.
bool sc_integer_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
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()
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
void algorithm_row_echelon(Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration)
see comments above.
Psysteme sc_safe_normalize(Psysteme ps)
Psysteme sc_safe_normalize(Psysteme ps) output : ps, normalized.
transformer load_statement_precondition(statement)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define sc_equal_p(ps1, ps2)
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_NULLE
MACROS SUR LES BASES.
Pbase base_copy(Pbase b)
Direct duplication.