Merge branch 'maint'
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 5 Feb 2011 20:05:07 +0000 (21:05 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 5 Feb 2011 20:05:07 +0000 (21:05 +0100)
1  2 
isl_tab.c
isl_tab_pip.c

diff --cc isl_tab.c
+++ b/isl_tab.c
@@@ -2060,7 -2057,35 +2060,35 @@@ error
        return -1;
  }
  
 -/* Add an extra div, prescrived by "div" to the tableau and
+ /* Check whether the div described by "div" is obviously non-negative.
+  * If we are using a big parameter, then we will encode the div
+  * as div' = M + div, which is always non-negative.
+  * Otherwise, we check whether div is a non-negative affine combination
+  * of non-negative variables.
+  */
+ static int div_is_nonneg(struct isl_tab *tab, __isl_keep isl_vec *div)
+ {
+       int i;
+       if (tab->M)
+               return 1;
+       if (isl_int_is_neg(div->el[1]))
+               return 0;
+       for (i = 0; i < tab->n_var; ++i) {
+               if (isl_int_is_neg(div->el[2 + i]))
+                       return 0;
+               if (isl_int_is_zero(div->el[2 + i]))
+                       continue;
+               if (!tab->var[i].is_nonneg)
+                       return 0;
+       }
+       return 1;
+ }
 +/* Add an extra div, prescribed by "div" to the tableau and
   * the associated bmap (which is assumed to be non-NULL).
   *
   * If add_ineq is not NULL, then this function is used instead
diff --cc isl_tab_pip.c
Simple merge