scheduler: solve Feautrier fallback as ILP to avoid large coefficients
The problem constructed by the Feautrier scheduler can be solved
as an LP problem and produce a valid solution because the variables
that drive the carrying of validity schedule constraints are guaranteed
to have an integral value.
However, the solutions for the schedule coefficients themselves
may still take on non-integral values, in which case the numerators
are used as the actual schedule coefficients.
Since the common denominator can be arbitrarily large, these numerators
can be very large as well.
In particular, as reported by Oleksandr Zinenko, computing a schedule
for PolyBench's cholesky benchmark with fixed loop bounds
(i.e., with -DPOLYBENCH_USE_SCALAR_LB) would result in large coefficients.
There used to be two causes for large coefficients in the Feautrier fallback,
coalescing schedules and these rational solutions with large denominators.
Now that coalescing has been tackled in
f8f45dff9e
(isl_schedule_constraints_compute_schedule: optionally avoid loop coalescing,
Tue Apr 12 17:20:31 2016 +0200), it makes sense to also handle
the large denominator case by forcing an integral solution.
No option is provided to turn this off as schedules with large coefficients
are generally not very useful. However, if needed, an option could
be added later. Obviously, computing an integral solution is more
costly than computing a rational solution.
If the initial solution is both non-integral and coalescing, then
the coalescing issue is tackled first since computing an integral
coalescing schedule would be wasted effort.
When the user has explicitly requested the use of the Feautrier scheduler,
i.e., when the Feautrier scheduler is not used as a fallback
for the Pluto-like scheduler, then a rational solution is still allowed.
It is not clear if such users would prefer an integral solution,
but if they do, it should be done in a separate commit.
Reported-by: Oleksandr Zinenko <oleksandr.zinenko@inria.fr>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>