From 94922c75189b7d97c66fef64425c61731a953187 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 16 Sep 2016 16:43:58 +0200 Subject: [PATCH] isl_local_space_divs_known: extract out isl_local_divs_known This function will be reused in isl_local_extend_point_vec, which will be added next. Signed-off-by: Sven Verdoolaege --- isl_local.c | 26 ++++++++++++++++++++++++-- isl_local.h | 2 ++ isl_local_space.c | 11 +---------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/isl_local.c b/isl_local.c index 7e194e27..f14d91a6 100644 --- a/isl_local.c +++ b/isl_local.c @@ -1,10 +1,13 @@ /* + * Copyright 2011 INRIA Saclay * Copyright 2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * - * Written by Sven Verdoolaege, - * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France + * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, + * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, + * 91893 Orsay, France + * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include @@ -109,6 +112,25 @@ isl_bool isl_local_div_is_known(__isl_keep isl_local *local, int pos) return isl_bool_true; } +/* Does "local" have an explicit representation for all local variables? + */ +isl_bool isl_local_divs_known(__isl_keep isl_local *local) +{ + int i, n; + + if (!local) + return isl_bool_error; + + n = isl_local_dim(local, isl_dim_div); + for (i = 0; i < n; ++i) { + isl_bool unknown = isl_local_div_is_marked_unknown(local, i); + if (unknown < 0 || unknown) + return isl_bool_not(unknown); + } + + return isl_bool_true; +} + /* Compare two sets of local variables, defined over * the same space. * diff --git a/isl_local.h b/isl_local.h index bb7752cb..71ade89c 100644 --- a/isl_local.h +++ b/isl_local.h @@ -7,6 +7,8 @@ typedef isl_mat isl_local; isl_bool isl_local_div_is_marked_unknown(__isl_keep isl_local *local, int pos); isl_bool isl_local_div_is_known(__isl_keep isl_local *local, int pos); +isl_bool isl_local_divs_known(__isl_keep isl_local *local); + int isl_local_cmp(__isl_keep isl_local *local1, __isl_keep isl_local *local2); #endif diff --git a/isl_local_space.c b/isl_local_space.c index bd672b3f..2e96bf7b 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -876,18 +876,9 @@ isl_bool isl_local_space_div_is_known(__isl_keep isl_local_space *ls, int div) */ isl_bool isl_local_space_divs_known(__isl_keep isl_local_space *ls) { - int i; - if (!ls) return isl_bool_error; - - for (i = 0; i < ls->div->n_row; ++i) { - isl_bool unknown = isl_local_space_div_is_marked_unknown(ls, i); - if (unknown < 0 || unknown) - return isl_bool_not(unknown); - } - - return isl_bool_true; + return isl_local_divs_known(ls->div); } __isl_give isl_local_space *isl_local_space_domain( -- 2.11.4.GIT