scheduler: simplify schedule constraints with respect to context
commit5d5b77e2369434a95d2d66824409b46d2155ba5b
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 12 Feb 2023 19:29:56 +0000 (12 20:29 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 12 Feb 2023 20:55:21 +0000 (12 21:55 +0100)
tree53e4c71af5acc86f413d608b4204a921eab63c11
parentd219a7dc776837763e3080aa6e8f37a47f08635a
scheduler: simplify schedule constraints with respect to context

Before this commit, computing a schedule for the constraints

    [N] -> { A[] -> C[] : N <= 0;
     A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 }

would not combine the three statements into a single band,
even if N is known to be non-negative (as specified by the context),
while specializing the constraints to a specific value of N
would result in such a single band.
The reason is that the context was essentially being ignored and
it is then impossible to shift C with respect to B because
N is not known to be non-negative at the point where
the shift is needed.

This commit also does not use the context at that point,
but it does do so at the point where the schedule constraints
are extracted.  In particular, every schedule constraint
is simplified with respect to the context.
This turns the constraint { A[] -> C[] : N <= 0 }
into { A[] -> C[] : N == 0 } and then a shift that is valid
across all constraints can be computed.

For other cases, it may be required to also take into account
the context elsewhere.

Reported-by: le yin <mooongle@gmail.com>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_scheduler.c
test_inputs/schedule/leyin1.sc [new file with mode: 0644]
test_inputs/schedule/leyin1.st [new file with mode: 0644]
test_inputs/schedule/leyin2a.sc [new file with mode: 0644]
test_inputs/schedule/leyin2a.st [new file with mode: 0644]
test_inputs/schedule/leyin2b.sc [new file with mode: 0644]
test_inputs/schedule/leyin2b.st [new file with mode: 0644]