PIPS
|
#include <stdio.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "ri-util.h"
Go to the source code of this file.
Functions | |
int | bound_generation_compare_vector_component (Pvecteur *pv1, Pvecteur *pv2) |
Generation of bound expressions from constraint systems of the Linear library. More... | |
void | make_bound_expression (Variable index, Pbase base, Psysteme sc, expression *lower, expression *upper) |
void make_bound_expression(variable index, Pbase base, Psysteme sc, expression *lower, expression *upper) More... | |
Generation of bound expressions from constraint systems of the Linear library.
bound_generation.c
Used for sorting each constraint and in between constraints, hopefully
pv1 | v1 |
pv2 | v2 |
Definition at line 40 of file bound_generation.c.
References entity_user_name(), value_gt, value_lt, vecteur_val, and vecteur_var.
Referenced by make_bound_expression().
void make_bound_expression | ( | Variable | index, |
Pbase | base, | ||
Psysteme | sc, | ||
expression * | lower, | ||
expression * | upper | ||
) |
void make_bound_expression(variable index, Pbase base, Psysteme sc, expression *lower, expression *upper)
build the expressions "lower" and "upper" for the lower and upper bounds of variable "index". Variable "index" must appear in "base" and have lower and upper bounds in "sc"
Beware of degenerated cases where constraints are reduced to equations because the upper and lower bounds are identical.
The constraints are sorted according to the lexicographic order using bound_generation_compare_vector_component().
see also constraints_to_loop_bound (in conversion system_to_code.c)
compute the rank d of the index in the basis
The constraints should be lexicographically sorted to avoid secondary variations in linear
search constraints referencing "index" among inequalities and create the list of expressions for lower and upper bounds
found
fprintf(stderr, "\n expression after :");
print_expression(ex);
}
add the expression to the list of lower bounds or to the list of upper bounds
search equation constraints referencing "index" and create the list of expressions for lower and upper bounds. We may have to generate useless loops with only one iteration.
found
fprintf(stderr, "\n expression after :");
print_expression(ex);
}
add the expression to the list of lower bounds and to the list of upper bounds
Reverse the expression order
build expressions for the lower and upper bounds
To avoid clash with Fortran intrinsics
pips_min and pips_max are supposed to be part of PIPS run-time. They are varargs and their first argument is the count of arguments
and memory leak... (cons lost)
idem...
print_expression(*lower);
print_expression(*upper);
index | ndex |
base | ase |
sc | c |
lower | ower |
upper | pper |
Definition at line 91 of file bound_generation.c.
References ABS, base, base_find_variable_rank(), bound_generation_compare_vector_component(), c_language_module_p(), CAR, CONS, contrainte_fprint(), Ssysteme::egalites, entity_intrinsic(), entity_name_or_TCST(), entity_undefined, EXPRESSION, fprintf(), gen_free_list(), gen_length(), gen_nreverse(), get_current_module_entity(), ifdebug, Ssysteme::inegalites, int_to_expression(), is_syntax_call, level_contrainte(), make_call(), make_constraint_expression(), make_expression(), make_syntax(), max, MAX_OPERATOR_NAME, min, MIN_OPERATOR_NAME, NIL, normalized_undefined, pips_assert, PIPS_C_MAX_OPERATOR_NAME, PIPS_C_MIN_OPERATOR_NAME, pips_debug, sc_dump(), sc_lexicographic_sort(), Scontrainte::succ, VALUE_MONE, vect_copy(), vect_multiply(), vect_rm(), and Scontrainte::vecteur.
Referenced by code_generation(), hyperplane(), make_scanning_over_one_tile(), make_scanning_over_tiles(), parallel_tiling(), tiling_transformation(), and unimodular().