In this PR, we rewrite some of the basic scheduling functions. The idea is that now the IR changes everytime a scheduling function is applied. Specifically, we have added a new feature for loop splitting. Namely, now the if/else condition for non-trivial loop splitting will be inserted in a smart way. Following we show some examples.
No conditional statement is inserted if the factor is a divisor.
A = hcl.compute((10, 10), lambda x, y: ...)
xo, xi = s[A].split(A.axis[0], factor=2)
IR
for (xo, 0, 5)
for (xi, 0, 2)
for (y, 0, 10)
compute
2. A conditional statement is inserted otherwise. In addition, it will be inserted in the innermost loop if possible (a check is made to ensure that).
```python
xo, xi = s[A].split(A.axis[0], factor=3)
# IR
for (xo, 0, 4)
for (xi, 0, 3)
for (y, 0, 10)
if (xo*3 + xi < 10) # under innermost loop
# compute
In this PR, we rewrite some of the basic scheduling functions. The idea is that now the IR changes everytime a scheduling function is applied. Specifically, we have added a new feature for loop splitting. Namely, now the if/else condition for non-trivial loop splitting will be inserted in a smart way. Following we show some examples.
IR
for (xo, 0, 5) for (xi, 0, 2) for (y, 0, 10)
compute