make isl_aff_private.h more self-contained

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
split scheduler code from schedule object code

Although the scheduler still has some intimate knowledge
about the current isl_schedule representation, this will
be much less the case after we switch to a schedule tree
representation.  Furthermore, the isl_schedule object will
also become useful to represent schedules not produced by
the scheduler, so it does not really belong in a file that
mainly contains the scheduler code.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
add isl_map_n_basic_map

In analogy with isl_set_n_basic_set.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_schedule_constraints_compute_schedule: allow partial carrying schedule rows

When we resort to carrying dependence (or when the user has specifically
requested the use of the Feautrier scheduler), we would hope to obtain
a schedule row that is non-trivial on all the full-dimensional iteration
domains.  However, in certain cases this may not be possible.
This may especially happen after schedule domain compression since
that may cause some iteration domains to have lower dimension.

Accept anything the Feautrier scheduler returns, as long as at least
some dependences are carried.  This may result in a final schedule
with a higher dimension that expected, but it should be better than
simply refusing to produce a schedule.  Since we are still carrying
at least one basic map of dependences, termination is still guaranteed.

Reported-by: antoine.morvan.pro@gmail.com
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map_convex_hull: detect equalities before checking number of basic maps

While detecting equalities, we may discover that some (or even all)
basic maps are empty, so we cannot assume that the number of basic
maps remains the same.  Since the body of isl_map_convex_hull assumes
that there is at least one basic map, we need to detect equalities
before checking the number of basic maps.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Merge branch 'maint'
doc: fix typos

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
update AUTHORS

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl 0.14

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
mark isl_space_tuple_match as deprecated

This function was replaced by isl_space_tuple_is_equal in c73f000
(document isl_space_tuple_match as isl_space_tuple_is_equal,
Thu Jun 5 18:40:01 2014 +0200).

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
add isl_val_abs_eq

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
add isl_aff_coefficient_sgn

In some cases, only the sign of a coefficient is relevant.
This function allows users to obtain this sign without first
having to obtain the coefficient value itself and then later freeing
that value again.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
add isl_ast_op_zdiv_r

We currently only extract modulo expressions of type isl_ast_op_pdiv_r
where the argument is known to be non-negative because these can
safely be translated into a C %-operator.  There are however also
some other cases where a mathematical module operation can be replaced
by the C %-operator.  In particular, if we are only interested
in the remainder being zero or not, then the rounding that C performs
does not matter.

We introduce a new isl_ast_op_zdiv_r operation type for such cases.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_expr_from_constraint: detect stride constraints

In particular, if an equality is of the form

    e - d floor(e/d) = 0

then directly convert it into

    e % d == 0

with '%' the isl_ast_op_zdiv_r operator.
Do this rather than the default procedure of
checking if (some variation of) e is non-negative and replacing
d floor(e/d) by e - (e mod d).

This saves some needless processing, but more importantly,
it allows us to detect stride conditions even when e cannot
be proven to be non-negative.

For example, we can now write

    if (n % 2 == 0)

instead of

    if (2 * floord(n, 2) == n)

even when nothing is known about n.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_pw_*: rename "dim" field to "space"

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_pw_*_extract_*: rename "dim" variable to "space"

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
only allow a single isl_pw_* object with given domain space in isl_union_pw_*

Currently, an isl_union_pw_multi_aff can contain multiple
isl_pw_multi_aff objects with the same domain space.
In particular, the domains of these objects may intersect,
meaning that the isl_union_pw_multi_aff object is not a function,
even though it is supposed to be one.

It would be possible to add checks to ensure that such domains
do not intersect, but it is more transparent to simply not allow
two or more isl_pw_multi_aff objects with the same domain space
in an isl_union_pw_multi_aff object.

Originally, the space of an isl_pw_* object was that of the domain
of this function.  It was therefore impossible for and isl_union_pw_*
object to contain more than one isl_pw_* object defined over the
same domain space.
This was changed in 3280c05 (make isl_pw_* object live in a map space,
Tue Aug 30 16:47:59 2011 +0200) to prepare for the isl_pw_multi_aff
object type introduced in 6f87cea (add isl_pw_multi_aff,
Thu Sep 1 11:58:50 2011 +0200).
Still, even after this change in space, an isl_pw_* object
defined over a given domain space could only live in a single
space since the target space was predefined.

At present, the only isl_union_pw_* object type that allows for multiple
target spaces is the isl_union_pw_multi_aff type, which was
introduced in f068f30 (add isl_union_pw_multi_aff,
Tue Mar 20 14:24:15 2012 +0100).

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_pw_*_extract: ignore parameters in space argument

This is similar to the change in 3c1f9ef (isl_union_map_extract_map:
ignore parameters in space argument, Thu Apr 12 14:08:39 2012 +0200).

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc: move isl_space operations to unary/binary operations sections

This is a continuation of the change in 4d45b72 (doc: move isl_local_space
operations to unary/binary operations sections, Tue Jan 28 14:36:14 2014 +0100).

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc: group dimension and tuple identifier functions

This further reorganizes the documentation along the same lines
as the previous commit.

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