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>