isl_mat_variable_compression: only set *T2 to NULL on error
commitcff79d10cda2a77ead49e18a86333a107a99f6c5
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 19 Jul 2015 15:57:07 +0000 (19 17:57 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 20 Jul 2015 08:45:46 +0000 (20 10:45 +0200)
tree6fb19470eb7acf0366c5a44f22039f533e4a80e1
parent4446cc0da947cb19650a94df233e4ec063301707
isl_mat_variable_compression: only set *T2 to NULL on error

When isl_mat_variable_compression figures out that the input equalities
do not allow for any integer solutions, it returns a zero-column matrix
and clears the inverse transformation, assigning it the value NULL.
The inverse transformation is useless in such cases, but some callers
of isl_mat_variable_compression treat a NULL value for the inverse
transformation as an error.  This happens in particular in
isl_basic_map_reduce_coefficients and also in normalize_divs in
isl_map_simplify.c.  This can result in a spurious coalesce operation
failure.  The other callers test for a zero-column transformation first,
but free the returned inverse transformation anyway.

Since the inverse transformation cannot be used in case of a zero-column
transformation, it would not hurt to simply return the current value
of the inverse transformation, whatever it is.
Still, it seems cleaner to return a matching zero-row matrix instead,
which is what this commit does.

Reported-by: antoine.morvan.pro@gmail.com
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_equalities.c
isl_test.c