isl_pw_*_normalize: sort pieces based on function value expressions
commit2f3a5f06bc0c40a95bc0b6953490c5cfa748bb2f
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 2 Mar 2016 17:07:39 +0000 (2 18:07 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 10 Mar 2016 13:29:32 +0000 (10 14:29 +0100)
tree325cca9c38998a964e335a64e4da4153c7c27a1f
parent396b50c7c598c80ede5a2331b2115f14aa6eb571
isl_pw_*_normalize: sort pieces based on function value expressions

The original implementation would sort the pieces based
on their domains and then combine successive pieces with
the same domain.  However, the domains are pairwise disjoint,
so such combination could never happen in practice.
Sort the pieces based on the function value expressions instead and
then combine successive pieces with the same such expression.
This can actually merge pairs of pieces together, resulting
in a better normalization.

The normalization of the domains itself used to be performed
before the sorting because they were used during the sorting.
Now, different pieces can be combined, so the normalization
of the domains needs to be postponed until after this possible
recombination.

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