X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_flow.c;h=68fa0d9ac1f688a0599b857068eb4d0834620c31;hb=fdb480f065676f2358ea1178f9464a0cdb9bcaa5;hp=db4a7582e378753367d2b641a7350102fcb90508;hpb=79e5f558e5f9bb9a559da4eef8d181dcf053f60d;p=platform%2Fupstream%2Fisl.git diff --git a/isl_flow.c b/isl_flow.c index db4a758..68fa0d9 100644 --- a/isl_flow.c +++ b/isl_flow.c @@ -4,7 +4,7 @@ * Copyright 2010 INRIA Saclay * Copyright 2012 Universiteit Leiden * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, Leiden Institute of Advanced Computer Science, * Universiteit Leiden, Niels Bohrweg 1, 2333 CA Leiden, The Netherlands @@ -1127,7 +1127,6 @@ static __isl_give struct isl_sched_info *sched_info_alloc( isl_space *dim; struct isl_sched_info *info; int i, n; - isl_int v; if (!map) return NULL; @@ -1147,13 +1146,18 @@ static __isl_give struct isl_sched_info *sched_info_alloc( if (!info->is_cst || !info->cst) goto error; - isl_int_init(v); for (i = 0; i < n; ++i) { - info->is_cst[i] = isl_map_plain_is_fixed(map, isl_dim_in, i, - &v); - info->cst = isl_vec_set_element(info->cst, i, v); + isl_val *v; + + v = isl_map_plain_get_val_if_fixed(map, isl_dim_in, i); + if (!v) + goto error; + info->is_cst[i] = !isl_val_is_nan(v); + if (info->is_cst[i]) + info->cst = isl_vec_set_element_val(info->cst, i, v); + else + isl_val_free(v); } - isl_int_clear(v); return info; error: @@ -1254,7 +1258,6 @@ static int before(void *first, void *second) struct isl_sched_info *info2 = second; int n1, n2; int i; - isl_int v1, v2; n1 = isl_vec_size(info1->cst); n2 = isl_vec_size(info2->cst); @@ -1262,28 +1265,22 @@ static int before(void *first, void *second) if (n2 < n1) n1 = n2; - isl_int_init(v1); - isl_int_init(v2); for (i = 0; i < n1; ++i) { int r; + int cmp; if (!info1->is_cst[i]) continue; if (!info2->is_cst[i]) continue; - isl_vec_get_element(info1->cst, i, &v1); - isl_vec_get_element(info2->cst, i, &v2); - if (isl_int_eq(v1, v2)) + cmp = isl_vec_cmp_element(info1->cst, info2->cst, i); + if (cmp == 0) continue; - r = 2 * i + isl_int_lt(v1, v2); + r = 2 * i + (cmp < 0); - isl_int_clear(v1); - isl_int_clear(v2); return r; } - isl_int_clear(v1); - isl_int_clear(v2); return 2 * n1; }