isl_ast_build_expr_from_pw_aff: combine pieces with equal affine functions
commit2d7a5089acaad2d7ee70c3337db9e5a60c0c5b8e
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 31 Mar 2016 10:21:39 +0000 (31 12:21 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 1 Apr 2016 10:09:40 +0000 (1 12:09 +0200)
tree44afb4c26bc4fc340dac144442d189584a4c449f
parent89be6edec4f203278228e6d07f4baf35ea3e5135
isl_ast_build_expr_from_pw_aff: combine pieces with equal affine functions

In particular, combine two pieces if their affine functions are equal
to each other on either of the two domains.  This can happen if one
of the affine functions is a special case of the other.  For example,
in { [0] -> [0]; [x] -> [x] : x >= 1 }, 0 is equal to x on the domain
of 0, i.e., { [0] }.  Ideally, such cases should already be discovered
at the level of isl_pw_aff_coalesce, but that currently only combines
pieces with identical expressions.

The mechanism implemented by this commit does not catch all cases.
In particular, it only considers pairs of adjacent pieces.

Requested-by: Tobias Grosser <tobias.grosser@inf.ethz.ch>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_build_expr.c