X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fgraphite-ppl.h;h=5820e19927dc024b492eb10f08d49eccae61bdc0;hb=02be8f84f05bae942940b9eae1ae1f74d7a6610c;hp=cfa31ec08037aee9945d8c3306fda904d8970579;hpb=80020e9d6bb1ddd0897a520f1ade531332ab1421;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/graphite-ppl.h b/gcc/graphite-ppl.h index cfa31ec0803..5820e19927d 100644 --- a/gcc/graphite-ppl.h +++ b/gcc/graphite-ppl.h @@ -1,5 +1,5 @@ /* Gimple Represented as Polyhedra. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. Contributed by Sebastian Pop and Tobias Grosser . @@ -24,12 +24,6 @@ along with GCC; see the file COPYING3. If not see #include "double-int.h" #include "tree.h" -CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t); -CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t); -CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset ( - ppl_Pointset_Powerset_C_Polyhedron_t); -void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *); -void insert_constraint_into_matrix (CloogMatrix *, int, ppl_const_Constraint_t); ppl_Polyhedron_t ppl_strip_loop (ppl_Polyhedron_t, ppl_dimension_type, int); int ppl_lexico_compare_linear_expressions (ppl_Linear_Expression_t, ppl_Linear_Expression_t); @@ -38,17 +32,28 @@ void ppl_print_polyhedron_matrix (FILE *, ppl_const_Polyhedron_t); void ppl_print_powerset_matrix (FILE *, ppl_Pointset_Powerset_C_Polyhedron_t); void debug_ppl_polyhedron_matrix (ppl_Polyhedron_t); void debug_ppl_powerset_matrix (ppl_Pointset_Powerset_C_Polyhedron_t); +void ppl_print_linear_expr (FILE *, ppl_Linear_Expression_t); +void debug_ppl_linear_expr (ppl_Linear_Expression_t); 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, mpz_t); +void ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t, + ppl_Linear_Expression_t, mpz_t); +ppl_Constraint_t ppl_build_relation (int, int, int, int, + enum ppl_enum_Constraint_Type); +void debug_gmp_value (mpz_t); +bool ppl_powerset_is_empty (ppl_Pointset_Powerset_C_Polyhedron_t); + /* 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))); @@ -57,16 +62,16 @@ 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; - value_init (tmp); - value_assign (tmp, val); + mpz_init (tmp); + mpz_set (tmp, val); di = mpz_get_double_int (t, tmp, true); - value_clear (tmp); + mpz_clear (tmp); return double_int_to_tree (t, di); } @@ -76,11 +81,11 @@ gmp_cst_to_tree (tree type, Value val) static inline void ppl_set_inhomogeneous (ppl_Linear_Expression_t e, int x) { - Value v; - value_init (v); - value_set_si (v, x); + mpz_t v; + mpz_init (v); + mpz_set_si (v, x); ppl_set_inhomogeneous_gmp (e, v); - value_clear (v); + mpz_clear (v); } /* Set the inhomogeneous term of E to the tree X. */ @@ -88,11 +93,11 @@ 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; - value_init (v); + mpz_t v; + mpz_init (v); tree_int_to_gmp (x, v); ppl_set_inhomogeneous_gmp (e, v); - value_clear (v); + mpz_clear (v); } /* Set E[I] to integer X. */ @@ -100,11 +105,11 @@ 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; - value_init (v); - value_set_si (v, x); + mpz_t v; + mpz_init (v); + mpz_set_si (v, x); ppl_set_coef_gmp (e, i, v); - value_clear (v); + mpz_clear (v); } /* Set E[I] to tree X. */ @@ -112,21 +117,33 @@ 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; - value_init (v); + mpz_t v; + mpz_init (v); tree_int_to_gmp (x, v); ppl_set_coef_gmp (e, i, v); - value_clear (v); + mpz_clear (v); +} + +/* Sets RES to the min of V1 and V2. */ + +static inline void +value_min (mpz_t res, mpz_t v1, mpz_t v2) +{ + if (mpz_cmp (v1, v2) < 0) + mpz_set (res, v1); + else + mpz_set (res, v2); } /* 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 (value_compare (v1, v2) < 0) - value_assign (res, v2); - value_assign (res, v1); + if (mpz_cmp (v1, v2) < 0) + mpz_set (res, v2); + else + mpz_set (res, v1); } /* Builds a new identity map for dimension DIM. */