On Sun, Apr 26, 2026 at 04:05:08PM +0530, Vimal Patel wrote:
> Hi,
>
> I have two schedule maps:
>
> [N] -> { S[i0] -> [i0] : exists (e0 : i0 = N + 6*e0 and 0 <= e0 <= 1) }
> and,
> [N] -> { S[i0] -> [i0] : exists (e0 : i0 = floor(N/2) + 6*e0 and 0 <= e0 <= 1) }
>
> I'm trying to generate ASTs for these maps, but stride detection fails
> to detect the stride of i0. The generated ASTs with ISL version
> 01147343-GMP are as follows:
I'm guessing this is a local version of yours because I don't have that.
> for (int c0 = N; c0 <= N + 6; c0 += 6)
> S(c0);
>
> for (int c0 = floord(N, 2); c0 <= floord(N, 2) + 6; c0 += 1)
> if ((-N + 2 * c0 + 11) % 12 >= 10)
> S(c0);
>
> I want to avoid the `if` condition in the second AST. Is there any
> transformation that can be applied to the schedule so that the stride
> gets detected, so that the if condition in the AST could be avoided?
If you somehow now in advance that this is going to happen,
then you could an extra parameter, say T, with constraint T = floor(N/2)
in the context and then the loop should get generated in terms of T,
at which point you can just plug in T = floor(N/2) in the generated AST.
However, isl should be able to detect such cases with some modifications.
I'll see if I can do that next weekend.
skimo