add isl_union_pw_aff_{min,max}_val
The function isl_union_pw_aff_min_val performs an operation
that is similar to that of isl_union_set_min_multi_union_pw_aff.
In fact, it performs the same operation that is performed
on each of the base expressions in the isl_multi_union_pw_aff
argument. However, the interface chosen for isl_union_pw_aff_min_val
is different from that of isl_union_set_min_multi_union_pw_aff.
In particular, it only takes a single argument.
It is not clear why isl_union_set_min_multi_union_pw_aff takes
an explicit domain argument since an isl_multi_union_pw_aff
already has a definition domain. In fact, each base expression
has its own definition domain. The extra argument may have
been introduced in analogy with the functions taking an isl_aff
function, but an isl_aff is always total, so there it makes
sense for the user to need to specify a domain.
Taking only a single argument should be more convenient and
less confusing. A further restriction of the domain can
always be achieved by intersecting the domain prior
to the call to isl_union_pw_aff_min_val.
This should not have a dramatic effect on the performance,
since isl_union_set_min_multi_union_pw_aff also performs
this intersection, be it that it does so in pieces and that
the intersected pieces do not need to be kept throughout the call.
The function isl_union_pw_aff_max_val performs
the same operation but computes the maximum instead of the minimum.
The functions take their argument rather than keeping it
like isl_set_min_val does because most operations that return
a new object take their arguments.
The "val" suffix reflects the fact that an isl_val
is returned, emphasizing that the result is not a parametric
expression computed over the domain, but a fixed value
computed over all possible parameter values.
It would have been possible to implement these functions
in terms of the original internals of isl_union_set_min_multi_union_pw_aff,
but the modified internals will also be useful
for implementing isl_multi_union_pw_aff_{min,max}_multi_val,
which cannot easily be implemented in terms of
isl_union_set_min_multi_union_pw_aff.
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>