aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-isl-ast-to-gimple.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-02-16 07:53:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-02-16 07:53:53 +0000
commitcc46a51d4ff8bc1c42b7e6ae472494733bed5c49 (patch)
tree36c76e273c9bed8a827d4ee9eb7843e603f726de /gcc/graphite-isl-ast-to-gimple.c
parent2c2d5d00f8f01da6610d23517c53adca824796e5 (diff)
downloadgcc-cc46a51d4ff8bc1c42b7e6ae472494733bed5c49.zip
gcc-cc46a51d4ff8bc1c42b7e6ae472494733bed5c49.tar.gz
gcc-cc46a51d4ff8bc1c42b7e6ae472494733bed5c49.tar.bz2
graphite.h: Do not include isl/isl_val_gmp.h, instead include isl/isl_val.h.
2017-02-16 Richard Biener <rguenther@suse.de> * graphite.h: Do not include isl/isl_val_gmp.h, instead include isl/isl_val.h. * graphite-isl-ast-to-gimple.c (gmp_cst_to_tree): Remove. (gcc_expression_from_isl_expr_int): Use generic isl_val interface. * graphite-sese-to-poly.c: Do not include isl/isl_val_gmp.h. (isl_val_int_from_wi): New function. (extract_affine_gmp): Rename to ... (extract_affine_wi): ... this, take a widest_int. (extract_affine_int): Just wrap extract_affine_wi. (add_param_constraints): Use isl_val_int_from_wi. (add_loop_constraints): Likewise, and extract_affine_wi. From-SVN: r245501
Diffstat (limited to 'gcc/graphite-isl-ast-to-gimple.c')
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index dbdae7a..ec5fb73 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -73,22 +73,6 @@ struct ast_build_info
bool is_parallelizable;
};
-/* Converts a GMP constant VAL to a tree and returns it. */
-
-static tree
-gmp_cst_to_tree (tree type, mpz_t val)
-{
- tree t = type ? type : integer_type_node;
- mpz_t tmp;
-
- mpz_init (tmp);
- mpz_set (tmp, val);
- wide_int wi = wi::from_mpz (t, tmp, true);
- mpz_clear (tmp);
-
- return wide_int_to_tree (t, wi);
-}
-
/* Verifies properties that GRAPHITE should maintain during translation. */
static inline void
@@ -325,16 +309,20 @@ gcc_expression_from_isl_expr_int (tree type, __isl_take isl_ast_expr *expr)
{
gcc_assert (isl_ast_expr_get_type (expr) == isl_ast_expr_int);
isl_val *val = isl_ast_expr_get_val (expr);
- mpz_t val_mpz_t;
- mpz_init (val_mpz_t);
+ size_t n = isl_val_n_abs_num_chunks (val, sizeof (HOST_WIDE_INT));
+ HOST_WIDE_INT *chunks = XALLOCAVEC (HOST_WIDE_INT, n);
tree res;
- if (isl_val_get_num_gmp (val, val_mpz_t) == -1)
+ if (isl_val_get_abs_num_chunks (val, sizeof (HOST_WIDE_INT), chunks) == -1)
res = NULL_TREE;
else
- res = gmp_cst_to_tree (type, val_mpz_t);
+ {
+ widest_int wi = widest_int::from_array (chunks, n, true);
+ if (isl_val_is_neg (val))
+ wi = -wi;
+ res = wide_int_to_tree (type, wi);
+ }
isl_val_free (val);
isl_ast_expr_free (expr);
- mpz_clear (val_mpz_t);
return res;
}