isl_printer_print_aff: detect (obvious) modulo expressions
commit5d73b0f5725efd761d39a78b1464d41dd05535f8
authorSven Verdoolaege <sven@cerebras.net>
Fri, 5 Apr 2019 11:51:58 +0000 (5 13:51 +0200)
committerSven Verdoolaege <sven@cerebras.net>
Sat, 7 Sep 2019 13:16:41 +0000 (7 15:16 +0200)
tree143929b2195441cb969881691e5248c25e6e53ab
parenta840dcd3754b2fce254d5ebc8a6df76e20721150
isl_printer_print_aff: detect (obvious) modulo expressions

That is, look for modulo expressions in the affine expression and
print them as such.  For example, print

(x) mod 2

instead of

x - 2*floor((x)/2)

As was the case in isl-0.18-894-gbd8b89077f (isl_printer_print_map:
try and print equality constraints as modulo constraints,
Thu Aug 10 10:33:51 2017 +0200), the first version
is easier to read.

Start from the last integer division to increase the chances
of detecting further integer divisions in the remainder.
The detection mechanism is just a heuristic, however, and
is not guaranteed to find all possible hidden modulo expressions.

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