X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_equalities.c;h=bf9dc26f160f00750400cd8bafea0de87be19062;hb=1815b1f908799391d4e87c2f73350885a693726b;hp=68d2c89a6cdaa8aead8580b9ee0ac6bede0e4622;hpb=8c24c4106f28b02a178989408ef46fe917b10764;p=platform%2Fupstream%2Fisl.git diff --git a/isl_equalities.c b/isl_equalities.c index 68d2c89..bf9dc26 100644 --- a/isl_equalities.c +++ b/isl_equalities.c @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * - * 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, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium @@ -413,8 +413,8 @@ error: * * x2' = Q2 x */ -struct isl_mat *isl_mat_variable_compression(struct isl_mat *B, - struct isl_mat **T2) +__isl_give isl_mat *isl_mat_variable_compression(__isl_take isl_mat *B, + __isl_give isl_mat **T2) { int i; struct isl_mat *H = NULL, *C = NULL, *H1, *U = NULL, *U1, *U2, *TC; @@ -670,20 +670,15 @@ int isl_set_dim_residue_class(struct isl_set *set, isl_int_init(r); for (i = 1; i < set->n; ++i) { - if (isl_basic_set_dim_residue_class(set->p[0], pos, &m, &r) < 0) + if (isl_basic_set_dim_residue_class(set->p[i], pos, &m, &r) < 0) goto error; isl_int_gcd(*modulo, *modulo, m); + isl_int_sub(m, *residue, r); + isl_int_gcd(*modulo, *modulo, m); if (!isl_int_is_zero(*modulo)) isl_int_fdiv_r(*residue, *residue, *modulo); if (isl_int_is_one(*modulo)) break; - if (!isl_int_is_zero(*modulo)) - isl_int_fdiv_r(r, r, *modulo); - if (isl_int_ne(*residue, r)) { - isl_int_set_si(*modulo, 1); - isl_int_set_si(*residue, 0); - break; - } } isl_int_clear(m);