Commit e262fdda by Andreas Simbuerger Committed by Sebastian Pop

Replace Value with mpz_t

2010-04-12  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>

	* graphite-blocking.c
	(pbb_strip_mine_profitable_p): Replace Value with mpz_t.
	* graphite-clast-to-gimple.c
	(clast_to_gcc_expression): Same.
	(precision_for_value): Same.
	(precision_for_interval): Same.
	(gcc_type_for_interval): Same.
	(graphite_create_new_guard): Same.
	(compute_bounds_for_level): Same.
	(graphite_create_new_loop_guard): Same.
	* graphite-interchange.c
	(build_linearized_memory_access): Same.
	(pdr_stride_in_loop): Same.
	(memory_strides_in_loop_1): Same.
	(memory_strides_in_loop): Same.
	(extend_scattering): Same.
	(psct_scattering_dim_for_loop_depth): Same.
	(pbb_number_of_iterations): Same.
	* graphite-poly.h
	(debug_iteration_domains): Same.
	* graphite-ppl.c
	(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
	(ppl_set_inhomogeneous_gmp): Same.
	(ppl_strip_loop): Same.
	(ppl_lexico_compare_linear_expressions): Same.
	(ppl_read_polyhedron_matrix): Same.
	(ppl_max_for_le_pointset): Same.
	* graphite-ppl.h
	(ppl_read_polyhedron_matrix): Same.
	(tree_int_to_gmp): Same.
	(gmp_cst_to_tree): Same.
	(ppl_set_inhomogeneous): Same.
	(ppl_set_inhomogeneous_tree): Same.
	(ppl_set_coef): Same.
	(ppl_set_coef_tree): Same.
	* graphite-sese-to-poly.c
	(build_pbb_scattering_polyhedrons): Same.
	(build_scop_scattering): Same.
	(scan_tree_for_params_right_scev): Same.
	(scan_tree_for_params): Same.
	(find_params_in_bb): Same.
	(find_scop_parameters): Same.
	(add_upper_bounds_from_estimated_nit): Same.
	(build_loop_iteration_domains): Same.
	(add_condition_to_domain): Same.
	(pdr_add_memory_accesses): Same.

From-SVN: r159133
parent a0bb35c7
2010-04-12 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-blocking.c
(pbb_strip_mine_profitable_p): Replace Value with mpz_t.
* graphite-clast-to-gimple.c
(clast_to_gcc_expression): Same.
(precision_for_value): Same.
(precision_for_interval): Same.
(gcc_type_for_interval): Same.
(graphite_create_new_guard): Same.
(compute_bounds_for_level): Same.
(graphite_create_new_loop_guard): Same.
* graphite-interchange.c
(build_linearized_memory_access): Same.
(pdr_stride_in_loop): Same.
(memory_strides_in_loop_1): Same.
(memory_strides_in_loop): Same.
(extend_scattering): Same.
(psct_scattering_dim_for_loop_depth): Same.
(pbb_number_of_iterations): Same.
* graphite-poly.h
(debug_iteration_domains): Same.
* graphite-ppl.c
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
(ppl_set_inhomogeneous_gmp): Same.
(ppl_strip_loop): Same.
(ppl_lexico_compare_linear_expressions): Same.
(ppl_read_polyhedron_matrix): Same.
(ppl_max_for_le_pointset): Same.
* graphite-ppl.h
(ppl_read_polyhedron_matrix): Same.
(tree_int_to_gmp): Same.
(gmp_cst_to_tree): Same.
(ppl_set_inhomogeneous): Same.
(ppl_set_inhomogeneous_tree): Same.
(ppl_set_coef): Same.
(ppl_set_coef_tree): Same.
* graphite-sese-to-poly.c
(build_pbb_scattering_polyhedrons): Same.
(build_scop_scattering): Same.
(scan_tree_for_params_right_scev): Same.
(scan_tree_for_params): Same.
(find_params_in_bb): Same.
(find_scop_parameters): Same.
(add_upper_bounds_from_estimated_nit): Same.
(build_loop_iteration_domains): Same.
(add_condition_to_domain): Same.
(pdr_add_memory_accesses): Same.
2010-04-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-blocking.c (pbb_strip_mine_profitable_p): Resolve
......
......@@ -181,7 +181,7 @@ pbb_strip_mine_profitable_p (poly_bb_p pbb,
graphite_dim_t depth,
int stride)
{
Value niter, strip_stride;
mpz_t niter, strip_stride;
bool res;
mpz_init (strip_stride);
......
......@@ -421,9 +421,9 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
/* Return the precision needed to represent the value VAL. */
static int
precision_for_value (Value val)
precision_for_value (mpz_t val)
{
Value x, y, two;
mpz_t x, y, two;
int precision;
value_init (x);
......@@ -454,9 +454,9 @@ precision_for_value (Value val)
UP. */
static int
precision_for_interval (Value low, Value up)
precision_for_interval (mpz_t low, mpz_t up)
{
Value diff;
mpz_t diff;
int precision;
gcc_assert (value_le (low, up));
......@@ -473,7 +473,7 @@ precision_for_interval (Value low, Value up)
otherwise return NULL_TREE. */
static tree
gcc_type_for_interval (Value low, Value up, tree old_type)
gcc_type_for_interval (mpz_t low, mpz_t up, tree old_type)
{
bool unsigned_p = true;
int precision, prec_up, prec_int;
......@@ -504,7 +504,7 @@ gcc_type_for_interval (Value low, Value up, tree old_type)
otherwise return NULL_TREE. */
static tree
gcc_type_for_value (Value val)
gcc_type_for_value (mpz_t val)
{
return gcc_type_for_interval (val, val, NULL_TREE);
}
......@@ -694,7 +694,7 @@ graphite_create_new_guard (sese region, edge entry_edge,
the iteration domain, and G the context parameters. */
static void
compute_bounds_for_level (poly_bb_p pbb, int level, Value low, Value up)
compute_bounds_for_level (poly_bb_p pbb, int level, mpz_t low, mpz_t up)
{
ppl_Pointset_Powerset_C_Polyhedron_t ps;
ppl_Linear_Expression_t le;
......@@ -722,7 +722,7 @@ compute_bounds_for_level (poly_bb_p pbb, int level, Value low, Value up)
static tree
compute_type_for_level_1 (poly_bb_p pbb, int level, tree old_type)
{
Value low, up;
mpz_t low, up;
tree type;
value_init (low);
......@@ -1035,7 +1035,7 @@ graphite_create_new_loop_guard (sese region, edge entry_edge,
2^{32|64}, and the condition lb <= ub is true, even if we do not want this.
However lb < ub + 1 is false, as expected. */
tree one;
Value gmp_one;
mpz_t gmp_one;
mpz_init (gmp_one);
mpz_set_si (gmp_one, 1);
......
......@@ -78,7 +78,7 @@ build_linearized_memory_access (ppl_dimension_type offset, poly_dr_p pdr)
ppl_dimension_type i;
ppl_dimension_type first = pdr_subscript_dim (pdr, 0);
ppl_dimension_type last = pdr_subscript_dim (pdr, PDR_NB_SUBSCRIPTS (pdr));
Value size, sub_size;
mpz_t size, sub_size;
graphite_dim_t dim = offset + pdr_dim (pdr);
ppl_new_Linear_Expression_with_dimension (&res, dim);
......@@ -196,7 +196,7 @@ build_partial_difference (ppl_Pointset_Powerset_C_Polyhedron_t *p,
the loop at DEPTH. */
static void
pdr_stride_in_loop (Value stride, graphite_dim_t depth, poly_dr_p pdr)
pdr_stride_in_loop (mpz_t stride, graphite_dim_t depth, poly_dr_p pdr)
{
ppl_dimension_type time_depth;
ppl_Linear_Expression_t le, lma;
......@@ -340,12 +340,12 @@ pdr_stride_in_loop (Value stride, graphite_dim_t depth, poly_dr_p pdr)
accessed in LOOP at DEPTH. */
static void
memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, Value strides)
memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
int i, j;
lst_p l;
poly_dr_p pdr;
Value s, n;
mpz_t s, n;
mpz_init (s);
mpz_init (n);
......@@ -370,7 +370,7 @@ memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, Value strides)
accessed in LOOP at DEPTH. */
static void
memory_strides_in_loop (lst_p loop, graphite_dim_t depth, Value strides)
memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
if (mpz_cmp_si (loop->memory_strides, -1) == 0)
{
......@@ -465,7 +465,7 @@ memory_strides_in_loop (lst_p loop, graphite_dim_t depth, Value strides)
static bool
lst_interchange_profitable_p (lst_p loop1, lst_p loop2)
{
Value d1, d2;
mpz_t d1, d2;
bool res;
gcc_assert (loop1 && loop2
......
......@@ -80,7 +80,7 @@ extend_scattering (poly_bb_p pbb, int max_scattering)
ppl_dimension_type nb_old_dims, nb_new_dims;
int nb_added_dims, i;
ppl_Coefficient_t coef;
Value one;
mpz_t one;
nb_added_dims = max_scattering - pbb_nb_scattering_transform (pbb);
mpz_init (one);
......@@ -998,7 +998,7 @@ psct_scattering_dim_for_loop_depth (poly_bb_p pbb, graphite_dim_t loop_depth)
ppl_dimension_type iter = psct_iterator_dim (pbb, loop_depth);
ppl_Linear_Expression_t expr;
ppl_Coefficient_t coef;
Value val;
mpz_t val;
graphite_dim_t i;
mpz_init (val);
......@@ -1052,7 +1052,7 @@ psct_scattering_dim_for_loop_depth (poly_bb_p pbb, graphite_dim_t loop_depth)
void
pbb_number_of_iterations (poly_bb_p pbb,
graphite_dim_t loop_depth,
Value niter)
mpz_t niter)
{
ppl_Linear_Expression_t le;
ppl_dimension_type dim;
......@@ -1071,7 +1071,7 @@ pbb_number_of_iterations (poly_bb_p pbb,
void
pbb_number_of_iterations_at_time (poly_bb_p pbb,
graphite_dim_t time_depth,
Value niter)
mpz_t niter)
{
ppl_Pointset_Powerset_C_Polyhedron_t ext_domain, sctr;
ppl_Linear_Expression_t le;
......
......@@ -367,8 +367,8 @@ extern void debug_iteration_domains (scop_p, int);
extern bool scop_do_interchange (scop_p);
extern bool scop_do_strip_mine (scop_p);
extern bool scop_do_block (scop_p);
extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, Value);
extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, Value);
extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, mpz_t);
extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, mpz_t);
extern void pbb_remove_duplicate_pdrs (poly_bb_p);
/* Return the number of write data references in PBB. */
......@@ -648,7 +648,7 @@ struct lst {
lst_p loop_father;
/* The sum of all the memory strides for an LST loop. */
Value memory_strides;
mpz_t memory_strides;
/* Loop nodes contain a sequence SEQ of LST nodes, statements
contain a pointer to their polyhedral representation PBB. */
......
......@@ -276,9 +276,9 @@ new_Cloog_Domain_from_ppl_Pointset_Powerset (
/* Set the inhomogeneous term of E to X. */
void
ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t e, Value x)
ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t e, mpz_t x)
{
Value v0, v1;
mpz_t v0, v1;
ppl_Coefficient_t c;
mpz_init (v0);
......@@ -301,9 +301,9 @@ ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t e, Value x)
/* Set E[I] to X. */
void
ppl_set_coef_gmp (ppl_Linear_Expression_t e, ppl_dimension_type i, Value x)
ppl_set_coef_gmp (ppl_Linear_Expression_t e, ppl_dimension_type i, mpz_t x)
{
Value v0, v1;
mpz_t v0, v1;
ppl_Coefficient_t c;
mpz_init (v0);
......@@ -422,7 +422,7 @@ ppl_strip_loop (ppl_Polyhedron_t ph, ppl_dimension_type loop, int stride)
ppl_dimension_type dim;
ppl_Polyhedron_t res;
ppl_Coefficient_t c;
Value val;
mpz_t val;
mpz_init (val);
ppl_new_Coefficient (&c);
......@@ -516,7 +516,7 @@ ppl_lexico_compare_linear_expressions (ppl_Linear_Expression_t a,
ppl_dimension_type i;
ppl_Coefficient_t c;
int res;
Value va, vb;
mpz_t va, vb;
ppl_Linear_Expression_space_dimension (a, &length1);
ppl_Linear_Expression_space_dimension (b, &length2);
......@@ -648,10 +648,10 @@ ppl_read_polyhedron_matrix (ppl_Polyhedron_t *ph, FILE *file)
void
ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
ppl_Linear_Expression_t le, Value res)
ppl_Linear_Expression_t le, mpz_t res)
{
ppl_Coefficient_t num, denom;
Value dv, nv;
mpz_t dv, nv;
int maximum, err;
mpz_init (nv);
......@@ -679,10 +679,10 @@ ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
void
ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
ppl_Linear_Expression_t le, Value res)
ppl_Linear_Expression_t le, mpz_t res)
{
ppl_Coefficient_t num, denom;
Value dv, nv;
mpz_t dv, nv;
int minimum, err;
mpz_init (nv);
......@@ -715,7 +715,7 @@ ppl_build_relation (int dim, int pos1, int pos2, int c,
ppl_Linear_Expression_t expr;
ppl_Constraint_t cstr;
ppl_Coefficient_t coef;
Value v, v_op, v_c;
mpz_t v, v_op, v_c;
mpz_init (v);
mpz_init (v_op);
......
......@@ -44,19 +44,19 @@ void ppl_read_polyhedron_matrix (ppl_Polyhedron_t *, FILE *);
void ppl_insert_dimensions (ppl_Polyhedron_t, int, int);
void ppl_insert_dimensions_pointset (ppl_Pointset_Powerset_C_Polyhedron_t, int,
int);
void ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t, Value);
void ppl_set_coef_gmp (ppl_Linear_Expression_t, ppl_dimension_type, Value);
void ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t, mpz_t);
void ppl_set_coef_gmp (ppl_Linear_Expression_t, ppl_dimension_type, mpz_t);
void ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
ppl_Linear_Expression_t, Value);
ppl_Linear_Expression_t, mpz_t);
void ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
ppl_Linear_Expression_t, Value);
ppl_Linear_Expression_t, mpz_t);
ppl_Constraint_t ppl_build_relation (int, int, int, int,
enum ppl_enum_Constraint_Type);
/* Assigns to RES the value of the INTEGER_CST T. */
static inline void
tree_int_to_gmp (tree t, Value res)
tree_int_to_gmp (tree t, mpz_t res)
{
double_int di = tree_to_double_int (t);
mpz_set_double_int (res, di, TYPE_UNSIGNED (TREE_TYPE (t)));
......@@ -65,10 +65,10 @@ tree_int_to_gmp (tree t, Value res)
/* Converts a GMP constant VAL to a tree and returns it. */
static inline tree
gmp_cst_to_tree (tree type, Value val)
gmp_cst_to_tree (tree type, mpz_t val)
{
tree t = type ? type : integer_type_node;
Value tmp;
mpz_t tmp;
double_int di;
mpz_init (tmp);
......@@ -84,7 +84,7 @@ gmp_cst_to_tree (tree type, Value val)
static inline void
ppl_set_inhomogeneous (ppl_Linear_Expression_t e, int x)
{
Value v;
mpz_t v;
mpz_init (v);
mpz_set_si (v, x);
ppl_set_inhomogeneous_gmp (e, v);
......@@ -96,7 +96,7 @@ ppl_set_inhomogeneous (ppl_Linear_Expression_t e, int x)
static inline void
ppl_set_inhomogeneous_tree (ppl_Linear_Expression_t e, tree x)
{
Value v;
mpz_t v;
mpz_init (v);
tree_int_to_gmp (x, v);
ppl_set_inhomogeneous_gmp (e, v);
......@@ -108,7 +108,7 @@ ppl_set_inhomogeneous_tree (ppl_Linear_Expression_t e, tree x)
static inline void
ppl_set_coef (ppl_Linear_Expression_t e, ppl_dimension_type i, int x)
{
Value v;
mpz_t v;
mpz_init (v);
mpz_set_si (v, x);
ppl_set_coef_gmp (e, i, v);
......@@ -120,7 +120,7 @@ ppl_set_coef (ppl_Linear_Expression_t e, ppl_dimension_type i, int x)
static inline void
ppl_set_coef_tree (ppl_Linear_Expression_t e, ppl_dimension_type i, tree x)
{
Value v;
mpz_t v;
mpz_init (v);
tree_int_to_gmp (x, v);
ppl_set_coef_gmp (e, i, v);
......@@ -130,7 +130,7 @@ ppl_set_coef_tree (ppl_Linear_Expression_t e, ppl_dimension_type i, tree x)
/* Sets RES to the max of V1 and V2. */
static inline void
value_max (Value res, Value v1, Value v2)
value_max (mpz_t res, mpz_t v1, mpz_t v2)
{
if (mpz_cmp (v1, v2) < 0)
mpz_set (res, v2);
......
......@@ -515,7 +515,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
int nb_params = scop_nb_params (scop);
ppl_Coefficient_t c;
ppl_dimension_type dim = scattering_dimensions + nb_iterators + nb_params;
Value v;
mpz_t v;
gcc_assert (scattering_dimensions >= used_scattering_dimensions);
......@@ -614,7 +614,7 @@ build_scop_scattering (scop_p scop)
gimple_bb_p previous_gbb = NULL;
ppl_Linear_Expression_t static_schedule;
ppl_Coefficient_t c;
Value v;
mpz_t v;
mpz_init (v);
ppl_new_Coefficient (&c);
......@@ -665,9 +665,9 @@ build_scop_scattering (scop_p scop)
static void
add_value_to_dim (ppl_dimension_type d, ppl_Linear_Expression_t expr,
Value k)
mpz_t k)
{
Value val;
mpz_t val;
ppl_Coefficient_t coef;
ppl_new_Coefficient (&coef);
......@@ -695,7 +695,7 @@ scan_tree_for_params_right_scev (sese s, tree e, int var,
{
loop_p loop = get_loop (var);
ppl_dimension_type l = sese_loop_depth (s, loop) - 1;
Value val;
mpz_t val;
/* Scalar evolutions should happen in the sese region. */
gcc_assert (sese_loop_depth (s, loop) > 0);
......@@ -719,9 +719,9 @@ scan_tree_for_params_right_scev (sese s, tree e, int var,
linear expression EXPR. K is the multiplier of the constant. */
static void
scan_tree_for_params_int (tree cst, ppl_Linear_Expression_t expr, Value k)
scan_tree_for_params_int (tree cst, ppl_Linear_Expression_t expr, mpz_t k)
{
Value val;
mpz_t val;
ppl_Coefficient_t coef;
int v = int_cst_value (cst);
......@@ -789,7 +789,7 @@ parameter_index_in_region (tree name, sese region)
static void
scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
Value k)
mpz_t k)
{
if (e == chrec_dont_know)
return;
......@@ -807,7 +807,7 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
{
if (c)
{
Value val;
mpz_t val;
gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
mpz_init (val);
mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
......@@ -822,7 +822,7 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
{
if (c)
{
Value val;
mpz_t val;
gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
mpz_init (val);
mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
......@@ -904,7 +904,7 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
if (c)
{
ppl_Coefficient_t coef;
Value minus_one;
mpz_t minus_one;
ppl_subtract_Linear_Expression_from_Linear_Expression (c,
tmp_expr);
......@@ -961,7 +961,7 @@ find_params_in_bb (sese region, gimple_bb_p gbb)
data_reference_p dr;
gimple stmt;
loop_p loop = GBB_BB (gbb)->loop_father;
Value one;
mpz_t one;
mpz_init (one);
mpz_set_si (one, 1);
......@@ -996,7 +996,7 @@ find_scop_parameters (scop_p scop)
unsigned i;
sese region = SCOP_REGION (scop);
struct loop *loop;
Value one;
mpz_t one;
mpz_init (one);
mpz_set_si (one, 1);
......@@ -1044,7 +1044,7 @@ add_upper_bounds_from_estimated_nit (scop_p scop, double_int nit,
ppl_dimension_type dim,
ppl_Linear_Expression_t ub_expr)
{
Value val;
mpz_t val;
ppl_Linear_Expression_t nb_iters_le;
ppl_Polyhedron_t pol;
ppl_Coefficient_t coef;
......@@ -1165,7 +1165,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
}
else if (!chrec_contains_undetermined (nb_iters))
{
Value one;
mpz_t one;
ppl_Constraint_t ub;
ppl_Linear_Expression_t ub_expr;
double_int nit;
......@@ -1209,7 +1209,7 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
static ppl_Linear_Expression_t
create_linear_expr_from_tree (poly_bb_p pbb, tree t)
{
Value one;
mpz_t one;
ppl_Linear_Expression_t res;
ppl_dimension_type dim;
sese region = SCOP_REGION (PBB_SCOP (pbb));
......@@ -1265,7 +1265,7 @@ static void
add_condition_to_domain (ppl_Pointset_Powerset_C_Polyhedron_t ps, gimple stmt,
poly_bb_p pbb, enum tree_code code)
{
Value v;
mpz_t v;
ppl_Coefficient_t c;
ppl_Linear_Expression_t left, right;
ppl_Constraint_t cstr;
......@@ -1651,7 +1651,7 @@ pdr_add_memory_accesses (ppl_Polyhedron_t accesses, data_reference_p dr,
poly_bb_p pbb)
{
int i, nb_subscripts = DR_NUM_DIMENSIONS (dr);
Value v;
mpz_t v;
scop_p scop = PBB_SCOP (pbb);
sese region = SCOP_REGION (scop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment