isl_ast_build_expr_from_set: return valid result on empty set

When presented with an empty set, isl_ast_build_expr_from_set would
simply return the value NULL, indicating a failure.
Although there should be no need to call isl_ast_build_expr_from_set
on an empty set, we should not fail silently.
We choose to return a valid expression rather than requiring
a non-empty input.

Although it is currently possible for the isl_ast_build_expr_from_set
to get called on an empty set, the only known test cases that reach
this point only do so due to another bug that will be fixed in the
next commit.  We therefore test the low-level function instead
just in case it ever gets exported.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
AST generator: detect partial executed relations that become empty

In particular, detect those cases where they become empty
when intersected with the context at the innermost level.
At outer levels a similar test is already performed after
the call to isl_ast_build_compute_gist from add_node.

It may be better to detect these situations at an earlier stage,
but for now we just fix the immediate problem.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_local_space_intersect: add missing isl_local_space_cow when divs change

Reported-by: Michael Kruse <meinersbur@googlemail.com>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Merge branch 'maint'