summaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-06 21:53:29 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-06 21:53:29 +0000
commit2d6fe479ffe67598e38a1b89be0913544cf2f549 (patch)
tree139fa3121690e6edcefc6c130c481df1d4f69810 /gcc/graphite-sese-to-poly.c
parent6fe110773dc4e0ff861a8e05ab53ead156686b35 (diff)
downloadgcc-2d6fe479ffe67598e38a1b89be0913544cf2f549.tar.gz
Resolve CLooG's value_* macros to their respective mpz_* counterparts.
2010-04-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de> * graphite-blocking.c (pbb_strip_mine_profitable_p): Resolve CLooG's value_* macros to their respective mpz_* counterparts. * graphite-clast-to-gimple.c (clast_to_gcc_expression): 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. (1st_interchange_profitable_p): Same. * graphite-poly.c (extend_scattering): Same. (psct_scattering_dim_for_loop_depth): Same. (pbb_number_of_iterations): Same. (pbb_number_of_iterations_at_time): Same. * graphite-poly.h (new_1st_loop): Same. * graphite-ppl.c (cloog_matrix_to_ppl_constraint): Same. (oppose_constraint): Same. (insert_constraint_into_matrix): Same. (ppl_set_inhomogeneous_gmp): Same. (ppl_set_coef_gmp): Same. (ppl_strip_loop): Same. (ppl_lexico_compare_linear_expressions): Same. (ppl_max_for_le_pointset): Same. (ppl_min_for_le_pointset): Same. (ppl_build_realtion): Same. * graphite-ppl.h (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. (add_value_to_dim): Same. (scan_tree_for_params_right_scev): Same. (scan_tree_for_params_int): 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. (create_linear_expr_from_tree): Same. (add_condition_to_domain): Same. (pdr_add_memory_accesses): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 5c004f4abfc..9f5ee8a8e5a 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -519,7 +519,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
gcc_assert (scattering_dimensions >= used_scattering_dimensions);
- value_init (v);
+ mpz_init (v);
ppl_new_Coefficient (&c);
PBB_TRANSFORMED (pbb) = poly_scattering_new ();
ppl_new_C_Polyhedron_from_space_dimension
@@ -533,7 +533,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
ppl_Linear_Expression_t expr;
ppl_new_Linear_Expression_with_dimension (&expr, dim);
- value_set_si (v, 1);
+ mpz_set_si (v, 1);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_coefficient (expr, i, c);
@@ -542,7 +542,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
{
ppl_Linear_Expression_coefficient (static_schedule, i / 2, c);
ppl_Coefficient_to_mpz_t (c, v);
- value_oppose (v, v);
+ mpz_neg (v, v);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_inhomogeneous (expr, c);
}
@@ -552,7 +552,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
{
int loop = (i - 1) / 2;
- value_set_si (v, -1);
+ mpz_set_si (v, -1);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_coefficient
(expr, scattering_dimensions + loop, c);
@@ -564,7 +564,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
ppl_delete_Constraint (cstr);
}
- value_clear (v);
+ mpz_clear (v);
ppl_delete_Coefficient (c);
PBB_ORIGINAL (pbb) = poly_scattering_copy (PBB_TRANSFORMED (pbb));
@@ -616,7 +616,7 @@ build_scop_scattering (scop_p scop)
ppl_Coefficient_t c;
Value v;
- value_init (v);
+ mpz_init (v);
ppl_new_Coefficient (&c);
ppl_new_Linear_Expression (&static_schedule);
@@ -624,7 +624,7 @@ build_scop_scattering (scop_p scop)
because we cannot compare_prefix_loops against a previous loop,
prefix will be equal to zero, and that index will be
incremented before copying. */
- value_set_si (v, -1);
+ mpz_set_si (v, -1);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_coefficient (static_schedule, 0, c);
@@ -645,7 +645,7 @@ build_scop_scattering (scop_p scop)
ppl_assign_Linear_Expression_from_Linear_Expression (common,
static_schedule);
- value_set_si (v, 1);
+ mpz_set_si (v, 1);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_coefficient (common, prefix, c);
ppl_assign_Linear_Expression_from_Linear_Expression (static_schedule,
@@ -656,7 +656,7 @@ build_scop_scattering (scop_p scop)
ppl_delete_Linear_Expression (common);
}
- value_clear (v);
+ mpz_clear (v);
ppl_delete_Coefficient (c);
ppl_delete_Linear_Expression (static_schedule);
}
@@ -672,14 +672,14 @@ add_value_to_dim (ppl_dimension_type d, ppl_Linear_Expression_t expr,
ppl_new_Coefficient (&coef);
ppl_Linear_Expression_coefficient (expr, d, coef);
- value_init (val);
+ mpz_init (val);
ppl_Coefficient_to_mpz_t (coef, val);
- value_addto (val, val, k);
+ mpz_add (val, val, k);
ppl_assign_Coefficient_from_mpz_t (coef, val);
ppl_Linear_Expression_add_to_coefficient (expr, d, coef);
- value_clear (val);
+ mpz_clear (val);
ppl_delete_Coefficient (coef);
}
@@ -708,10 +708,10 @@ scan_tree_for_params_right_scev (sese s, tree e, int var,
| a [i * p] = ... */
gcc_assert (TREE_CODE (e) == INTEGER_CST);
- value_init (val);
- value_set_si (val, int_cst_value (e));
+ mpz_init (val);
+ mpz_set_si (val, int_cst_value (e));
add_value_to_dim (l, expr, val);
- value_clear (val);
+ mpz_clear (val);
}
}
@@ -725,20 +725,20 @@ scan_tree_for_params_int (tree cst, ppl_Linear_Expression_t expr, Value k)
ppl_Coefficient_t coef;
int v = int_cst_value (cst);
- value_init (val);
- value_set_si (val, 0);
+ mpz_init (val);
+ mpz_set_si (val, 0);
/* Necessary to not get "-1 = 2^n - 1". */
if (v < 0)
- value_sub_int (val, val, -v);
+ mpz_sub_ui (val, val, -v);
else
- value_add_int (val, val, v);
+ mpz_add_ui (val, val, v);
- value_multiply (val, val, k);
+ mpz_mul (val, val, k);
ppl_new_Coefficient (&coef);
ppl_assign_Coefficient_from_mpz_t (coef, val);
ppl_Linear_Expression_add_to_inhomogeneous (expr, coef);
- value_clear (val);
+ mpz_clear (val);
ppl_delete_Coefficient (coef);
}
@@ -809,11 +809,11 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
{
Value val;
gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
- value_init (val);
- value_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
- value_multiply (val, val, k);
+ mpz_init (val);
+ mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
+ mpz_mul (val, val, k);
scan_tree_for_params (s, TREE_OPERAND (e, 0), c, val);
- value_clear (val);
+ mpz_clear (val);
}
else
scan_tree_for_params (s, TREE_OPERAND (e, 0), c, k);
@@ -824,11 +824,11 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
{
Value val;
gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
- value_init (val);
- value_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
- value_multiply (val, val, k);
+ mpz_init (val);
+ mpz_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
+ mpz_mul (val, val, k);
scan_tree_for_params (s, TREE_OPERAND (e, 1), c, val);
- value_clear (val);
+ mpz_clear (val);
}
else
scan_tree_for_params (s, TREE_OPERAND (e, 1), c, k);
@@ -909,11 +909,11 @@ scan_tree_for_params (sese s, tree e, ppl_Linear_Expression_t c,
ppl_subtract_Linear_Expression_from_Linear_Expression (c,
tmp_expr);
ppl_delete_Linear_Expression (tmp_expr);
- value_init (minus_one);
- value_set_si (minus_one, -1);
+ mpz_init (minus_one);
+ mpz_set_si (minus_one, -1);
ppl_new_Coefficient_from_mpz_t (&coef, minus_one);
ppl_Linear_Expression_add_to_inhomogeneous (c, coef);
- value_clear (minus_one);
+ mpz_clear (minus_one);
ppl_delete_Coefficient (coef);
}
@@ -963,8 +963,8 @@ find_params_in_bb (sese region, gimple_bb_p gbb)
loop_p loop = GBB_BB (gbb)->loop_father;
Value one;
- value_init (one);
- value_set_si (one, 1);
+ mpz_init (one);
+ mpz_set_si (one, 1);
/* Find parameters in the access functions of data references. */
for (i = 0; VEC_iterate (data_reference_p, GBB_DATA_REFS (gbb), i, dr); i++)
@@ -983,7 +983,7 @@ find_params_in_bb (sese region, gimple_bb_p gbb)
scan_tree_for_params (region, rhs, NULL, one);
}
- value_clear (one);
+ mpz_clear (one);
}
/* Record the parameters used in the SCOP. A variable is a parameter
@@ -998,8 +998,8 @@ find_scop_parameters (scop_p scop)
struct loop *loop;
Value one;
- value_init (one);
- value_set_si (one, 1);
+ mpz_init (one);
+ mpz_set_si (one, 1);
/* Find the parameters used in the loop bounds. */
for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop); i++)
@@ -1013,7 +1013,7 @@ find_scop_parameters (scop_p scop)
scan_tree_for_params (region, nb_iters, NULL, one);
}
- value_clear (one);
+ mpz_clear (one);
/* Find the parameters used in data accesses. */
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
@@ -1056,10 +1056,10 @@ add_upper_bounds_from_estimated_nit (scop_p scop, double_int nit,
ub_expr);
/* Construct the negated number of last iteration in VAL. */
- value_init (val);
+ mpz_init (val);
mpz_set_double_int (val, nit, false);
- value_sub_int (val, val, 1);
- value_oppose (val, val);
+ mpz_sub_ui (val, val, 1);
+ mpz_neg (val, val);
/* NB_ITERS_LE holds the number of last iteration in
parametrical form. Subtract estimated number of last
@@ -1099,7 +1099,7 @@ add_upper_bounds_from_estimated_nit (scop_p scop, double_int nit,
ppl_delete_Polyhedron (pol);
ppl_delete_Linear_Expression (nb_iters_le);
ppl_delete_Constraint (ub);
- value_clear (val);
+ mpz_clear (val);
}
/* Builds the constraint polyhedra for LOOP in SCOP. OUTER_PH gives
@@ -1170,12 +1170,12 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
ppl_Linear_Expression_t ub_expr;
double_int nit;
- value_init (one);
- value_set_si (one, 1);
+ mpz_init (one);
+ mpz_set_si (one, 1);
ppl_new_Linear_Expression_with_dimension (&ub_expr, dim);
nb_iters = scalar_evolution_in_region (region, loop, nb_iters);
scan_tree_for_params (SCOP_REGION (scop), nb_iters, ub_expr, one);
- value_clear (one);
+ mpz_clear (one);
if (estimated_loop_iterations (loop, true, &nit))
add_upper_bounds_from_estimated_nit (scop, nit, dim, ub_expr);
@@ -1221,10 +1221,10 @@ create_linear_expr_from_tree (poly_bb_p pbb, tree t)
t = scalar_evolution_in_region (region, loop, t);
gcc_assert (!automatically_generated_chrec_p (t));
- value_init (one);
- value_set_si (one, 1);
+ mpz_init (one);
+ mpz_set_si (one, 1);
scan_tree_for_params (region, t, res, one);
- value_clear (one);
+ mpz_clear (one);
return res;
}
@@ -1278,25 +1278,25 @@ add_condition_to_domain (ppl_Pointset_Powerset_C_Polyhedron_t ps, gimple stmt,
the left or the right side of the expression. */
if (code == LT_EXPR)
{
- value_init (v);
- value_set_si (v, 1);
+ mpz_init (v);
+ mpz_set_si (v, 1);
ppl_new_Coefficient (&c);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_inhomogeneous (left, c);
ppl_delete_Coefficient (c);
- value_clear (v);
+ mpz_clear (v);
code = LE_EXPR;
}
else if (code == GT_EXPR)
{
- value_init (v);
- value_set_si (v, 1);
+ mpz_init (v);
+ mpz_set_si (v, 1);
ppl_new_Coefficient (&c);
ppl_assign_Coefficient_from_mpz_t (c, v);
ppl_Linear_Expression_add_to_inhomogeneous (right, c);
ppl_delete_Coefficient (c);
- value_clear (v);
+ mpz_clear (v);
code = GE_EXPR;
}
@@ -1655,7 +1655,7 @@ pdr_add_memory_accesses (ppl_Polyhedron_t accesses, data_reference_p dr,
scop_p scop = PBB_SCOP (pbb);
sese region = SCOP_REGION (scop);
- value_init (v);
+ mpz_init (v);
for (i = 0; i < nb_subscripts; i++)
{
@@ -1667,7 +1667,7 @@ pdr_add_memory_accesses (ppl_Polyhedron_t accesses, data_reference_p dr,
ppl_new_Linear_Expression_with_dimension (&fn, dom_nb_dims);
ppl_new_Linear_Expression_with_dimension (&access, accessp_nb_dims);
- value_set_si (v, 1);
+ mpz_set_si (v, 1);
scan_tree_for_params (region, afn, fn, v);
ppl_assign_Linear_Expression_from_Linear_Expression (access, fn);
@@ -1680,7 +1680,7 @@ pdr_add_memory_accesses (ppl_Polyhedron_t accesses, data_reference_p dr,
ppl_delete_Constraint (cstr);
}
- value_clear (v);
+ mpz_clear (v);
}
/* Add constrains representing the size of the accessed data to the