isl_basic_map_remove_divs_involving_dims: insert bounds before removing divs
commit1b60e160f68beb1a84a0d6afee0118ea61422c00
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 17 May 2012 08:22:23 +0000 (17 10:22 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Aug 2012 10:20:07 +0000 (2 12:20 +0200)
tree61d647f3d1d97d7ae89e8c8086c3d27a57e93879
parent7c513a3bc2033ec87934c7287262ba0ec65c9adb
isl_basic_map_remove_divs_involving_dims: insert bounds before removing divs

The div will be removed using Fourier-Motzkin elimination and the extra
bounds can be used to improve accuracy of the result.

For example, eliminating the div from the following set

{ [i,j,k] : 3 + i + 2j >= 0 and 2 * [(i+2j)/4] <= k }

we now first use the first constraint to derive a lower bound
on the div:

[(i + 2j)/4] >= [-3/4] = -1

During the elimination, this bound can be combined with the upper bound
to result in the additional constraint

k >= -2

Although this technique can be applied in general, it is especially
useful after the next commit, where we will eliminate divs
that appear with a unit coefficient.  If the same div also appears
in other constraints with a non-unit coefficient, and we later
decide to eliminate the div, then this technique can be used to
recover some of those constraints so that we can avoid losing accuracy.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c
isl_test.c