On Fri, Dec 11, 2015 at 05:41:54PM -0800,
jakob...@gmail.com wrote:
> D := {
> d[0];
> a[i0] : i0 >= 0;
> main1[i0] : i0 >= 1;
> main0[0];
> };
>
> R := {
> a[i0] -> main1[i0] : i0 >= 1;
> a[0] -> main0[0];
> d[0] -> a[o0] : o0 >= 0;
> main0[0] -> main1[1];
> main1[i0] -> main1[1 + i0] : i0 >= 1
> };
>
> S := schedule D respecting R minimizing R;
> map S;
>
> *Result:* { main1[i0] -> [3, i0]; d[i0] -> [0, 0]; main0[i0] -> [2, 0];
> a[i0] -> [1, i0] }
>
> These are two significantly different schedules.
>
> Note that the domains are unbounded - perhaps this is a property unexpected
> by ISL?
Sort of. First note that the scheduler typically has some freedom and
so the schedule that you get may indeed depend (in unpredictable ways)
on the internal representation of the input.
In your case, you're imposing an infinite number of proximity dependences
that cannot be optimized. In particular, you want "d[0]" to be close
to an infinite number of distinct instances of "a".
The proximity dependences are therefore ignored and you just get
a schedule that satisfies the validity dependences.
See the second paragraph of 1.5.3 Scheduling for details:
The default algorithm tries to ensure that the dependence distances over coinci-
dence constraints are zero and to minimize the dependence distances over proximity
dependences. Moreover, it tries to obtain sequences (bands) of schedule dimensions
for groups of domains where the dependence distances over validity dependences have
only non-negative values. Note that when minimizing the maximal dependence dis-
tance over proximity dependences, a single affine expression in the parameters is con-
structed that bounds all dependence distances. If no such expression exists, then the
algorithm will fail and resort to an alternative scheduling algorithm. In particular, this
means that adding proximity dependences may eliminate valid solutions. A typical ex-
ample where this phenomenon may occur is when some subset of the proximity depen-
dences has no restriction on some parameter, forcing the coefficient of that parameter
to be zero, while some other subset forces the dependence distance to depend on that
parameter, requiring the same coefficient to be non-zero. When using Feautrier's algo-
rithm, the coincidence and proximity constraints are only taken into account during the
extension to a full-dimensional schedule.
skimo