From ff272a49f904b7dd04c3d0c5ab595c02c2bb0318 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 23 Nov 2019 08:46:16 +0100 Subject: [PATCH] isl_qpolynomial_move_dims: use isl_qpolynomial_domain_dim This reduces the dependence on the internal representation. Signed-off-by: Sven Verdoolaege --- isl_polynomial.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/isl_polynomial.c b/isl_polynomial.c index 7d9387c1..d1a6130e 100644 --- a/isl_polynomial.c +++ b/isl_polynomial.c @@ -3428,6 +3428,7 @@ __isl_give isl_qpolynomial *isl_qpolynomial_move_dims( isl_ctx *ctx; unsigned g_dst_pos; unsigned g_src_pos; + isl_size total; int *reordering; if (!qp) @@ -3463,11 +3464,11 @@ __isl_give isl_qpolynomial *isl_qpolynomial_move_dims( if (!qp->div) goto error; qp = sort_divs(qp); - if (!qp) - goto error; - reordering = reordering_move(ctx, - qp->div->n_col - 2, g_dst_pos, g_src_pos, n); + total = isl_qpolynomial_domain_dim(qp, isl_dim_all); + if (total < 0) + return isl_qpolynomial_free(qp); + reordering = reordering_move(ctx, total, g_dst_pos, g_src_pos, n); if (!reordering) goto error; -- 2.11.4.GIT