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>