isl_basic_map_simplify: eliminate integral integer divisions
commitc7f00bececf9b73e27c76eecfa290bb324dd11ef
authorSven Verdoolaege <sven@cerebras.net>
Fri, 17 Mar 2023 11:28:39 +0000 (17 12:28 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 25 Feb 2024 10:09:32 +0000 (25 11:09 +0100)
treec34d533519563859b8184fcf79c6934dae7900d1
parent9b293250961d87f643d9f868bdef18c809eca16d
isl_basic_map_simplify: eliminate integral integer divisions

That is, replace integer divisions with denominator 1
by their argument expressions.
Such integer divisions are usually eliminated already
because the pair of constraints that define such an integer division
form an equality constraint that is used for the elimination.
However, one or both of these constraints may have been eliminated
themselves for being redundant with respect to some other constraints or
the integer division may have undergone simplifications
that may not be directly reflected in those constraints.
It is therefore possible for such integer divisions to remain
after simplification.  This is confusing to the user and
also fairly inefficient.  Remove them.

The integral integer divisions are eliminated from first to last
because earlier integer divisions may appear in later ones and
eliminating an earlier one could therefore cause some later one
to become integral.

It is difficult to add a test to check that such integer divisions
are indeed eliminated because they occur only rarely and
because testing for a specific representation of a set
risks becoming invalid through other changes to that representation.

Signed-off-by: Sven Verdoolaege <sven@cerebras.net>
isl_map_simplify.c