gpu.c: add_bounded_parameters_dynamic: compute simple hull of bounds
commit47bfbac688609f5e1ee0f65eaf082573b4473992
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 28 Mar 2014 10:36:01 +0000 (28 11:36 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 9 Apr 2014 11:02:11 +0000 (9 13:02 +0200)
tree029df04e0ac08ba94aaa92d7a5da37cf5ceae215
parente57e6794b7dcd0922a7d0862d4ff7e89a1a94c8a
gpu.c: add_bounded_parameters_dynamic: compute simple hull of bounds

The function add_bounded_parameters_dynamic is used to compute
bounds on the block identifiers that can be used to simplify
the AST generated by the AST generator.
The set of possible values (or an overapproximation thereof)
is derived from block size.  The block size is typically
an (implicit) max expression.  Since isl may not realize
that the size is in fact a max expression, the set of possible
values may end up being described by more than one disjunct.
This in turn may confuse the AST generator, resulting in redundant
conditions in the generated AST.  We may be able to improve
the AST generator to not get confused by these disjuncts,
but we might as well replace the set of possible values
by its simple hull.  When the size is indeed a max expression,
this simple hull is equal to the original set, but described
using a single disjunct.  Otherwise, the result may be
an overapproximation but since the set is only used to simplify
expressions, this overapproximation should not have any adverse effects.

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