From: Sven Verdoolaege Date: Thu, 7 Mar 2013 12:48:18 +0000 (+0100) Subject: isl_basic_set_sort_constraints: take into account all coefficients X-Git-Tag: isl-0.11.2~18 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/9e01482d12e48c160f18cdee75508abcf195788e isl_basic_set_sort_constraints: take into account all coefficients The comparison function was mistakenly not taking into account the coefficient of the last variable. By ignoring this last coefficient, the comparison could not guarantee the property required by uset_gist. Moreover, since constraints that only differ in this last coefficient would compare equal to each other, the order of such constraints could depend on the implementation of qsort, resulting in failing test cases on Solaris 10. We fix this problem by ignoring the constant term instead of the last coefficient. If two constraints only differ in the constant term, then one of them should have been eliminated already. Reported-by: Amos Tested-by: Marc Girod Signed-off-by: Sven Verdoolaege --- diff --git a/isl_map.c b/isl_map.c index b833b987..d3c42255 100644 --- a/isl_map.c +++ b/isl_map.c @@ -8193,13 +8193,13 @@ static int qsort_constraint_cmp(const void *p1, const void *p2) int l1, l2; unsigned size = isl_min(c1->size, c2->size); - l1 = isl_seq_last_non_zero(c1->c, size); - l2 = isl_seq_last_non_zero(c2->c, size); + l1 = isl_seq_last_non_zero(c1->c + 1, size); + l2 = isl_seq_last_non_zero(c2->c + 1, size); if (l1 != l2) return l1 - l2; - return isl_seq_cmp(c1->c, c2->c, size); + return isl_seq_cmp(c1->c + 1, c2->c + 1, size); } static struct isl_basic_map *isl_basic_map_sort_constraints( diff --git a/test_inputs/codegen/cloog/4-param.c b/test_inputs/codegen/cloog/4-param.c index 598c9942..0e0e254b 100644 --- a/test_inputs/codegen/cloog/4-param.c +++ b/test_inputs/codegen/cloog/4-param.c @@ -1,14 +1,14 @@ { for (int c0 = m; c0 <= min(p - 1, n); c0 += 1) S1(c0); - for (int c0 = p; c0 <= min(m - 1, q); c0 += 1) + for (int c0 = p; c0 <= min(q, m - 1); c0 += 1) S2(c0); for (int c0 = max(m, p); c0 <= min(q, n); c0 += 1) { S1(c0); S2(c0); } - for (int c0 = max(max(q + 1, m), p); c0 <= n; c0 += 1) + for (int c0 = max(max(m, p), q + 1); c0 <= n; c0 += 1) S1(c0); - for (int c0 = max(max(n + 1, m), p); c0 <= q; c0 += 1) + for (int c0 = max(max(m, n + 1), p); c0 <= q; c0 += 1) S2(c0); } diff --git a/test_inputs/codegen/cloog/christian.c b/test_inputs/codegen/cloog/christian.c index 4b4d5a33..3faa319e 100644 --- a/test_inputs/codegen/cloog/christian.c +++ b/test_inputs/codegen/cloog/christian.c @@ -1,6 +1,6 @@ for (int c0 = -N + 1; c0 <= N; c0 += 1) { for (int c1 = max(c0 - 1, 0); c1 < min(N + c0 - 1, N); c1 += 1) S2(c1, -c0 + c1 + 1); - for (int c1 = max(0, c0); c1 < min(N, N + c0); c1 += 1) + for (int c1 = max(c0, 0); c1 < min(N + c0, N); c1 += 1) S1(c1, -c0 + c1); } diff --git a/test_inputs/codegen/cloog/classen.c b/test_inputs/codegen/cloog/classen.c index fb12b9d6..17296bf7 100644 --- a/test_inputs/codegen/cloog/classen.c +++ b/test_inputs/codegen/cloog/classen.c @@ -26,7 +26,7 @@ S4(c0, 1, c0 + 2, 2, c0 + 1, 1, c0 + 2, 2); S2(c0, 1, c0 + 1, 1, c0 + 1, 1, c0 + 2, 1); } - for (int c2 = max(-m + c0 + 3, 2); c2 <= min(c0, m - 1); c2 += 1) { + for (int c2 = max(2, -m + c0 + 3); c2 <= min(c0, m - 1); c2 += 1) { S5(c0 - 1, c2, c0, c2, c0 - c2 + 1, c2, c0 - c2 + 2, c2); S7(c0 - 1, c2 - 1, c0 + 1, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 3, c2); S6(c0 - 1, c2 - 1, c0, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 2, c2); @@ -54,7 +54,7 @@ S4(c0, c0 + 1, c0 + 2, c0 + 2, 1, c0 + 1, 2, c0 + 2); S2(c0, c0 + 1, c0 + 1, c0 + 1, 1, c0 + 1, 2, c0 + 1); } - for (int c8 = max(-m + c0 + 2, 1); c8 <= min(c0 + 1, m); c8 += 1) + for (int c8 = max(1, -m + c0 + 2); c8 <= min(c0 + 1, m); c8 += 1) S8(c0, c8); } if (m >= 2) { diff --git a/test_inputs/codegen/cloog/classen2.c b/test_inputs/codegen/cloog/classen2.c dissimilarity index 85% index 0b9ca0e8..2f2e518e 100644 --- a/test_inputs/codegen/cloog/classen2.c +++ b/test_inputs/codegen/cloog/classen2.c @@ -1,4 +1,4 @@ -for (int c0 = max(max(max(max(max(max(4, 10 * outerProcTileScatter1 - 2 * N + 2), 10 * outerProcTileScatter2 - N + 1), 5 * outerProcTileScatter2 + 1), 5 * outerTimeTileScatter), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 - N), 5 * outerProcTileScatter1); c0 <= min(min(min(min(min(min(2 * M + 2 * N - 6, 5 * outerProcTileScatter2 + M + N), 5 * outerProcTileScatter1 + M + 2), 10 * outerProcTileScatter2 + N + 3), 10 * outerProcTileScatter1 + 4), 5 * outerTimeTileScatter + 4), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 + 5); c0 += 1) - for (int c1 = max(max(max(max(-5 * outerProcTileScatter2 + c0 - 1, 5 * outerProcTileScatter1), 5 * outerProcTileScatter2 + 1), -M + c0 + 2), (c0 + 1) / 2 + 2); c1 <= min(min(min(min(5 * outerProcTileScatter1 + 4, 5 * outerProcTileScatter2 + N + 2), c0), -5 * outerProcTileScatter2 + N + c0), N + c0 / 2 - 1); c1 += 1) - for (int c2 = max(max(5 * outerProcTileScatter2, -N + c1 + 2), c0 - c1 + 3); c2 <= min(min(5 * outerProcTileScatter2 + 4, N + c0 - c1), c1 - 1); c2 += 1) - S1(c0 - c1 + 1, -c0 + c1 + c2 - 2, c1 - c2, c0, c1, c2); +for (int c0 = max(max(max(max(max(max(5 * outerTimeTileScatter, 10 * outerProcTileScatter1 - 2 * N + 2), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 - N), 5 * outerProcTileScatter1), 10 * outerProcTileScatter2 - N + 1), 5 * outerProcTileScatter2 + 1), 4); c0 <= min(min(min(min(min(min(2 * M + 2 * N - 6, 5 * outerProcTileScatter2 + M + N), 10 * outerProcTileScatter2 + N + 3), 5 * outerProcTileScatter1 + M + 2), 5 * outerProcTileScatter1 + 5 * outerProcTileScatter2 + 5), 10 * outerProcTileScatter1 + 4), 5 * outerTimeTileScatter + 4); c0 += 1) + for (int c1 = max(max(max(max(-5 * outerProcTileScatter2 + c0 - 1, -M + c0 + 2), (c0 + 1) / 2 + 2), 5 * outerProcTileScatter2 + 1), 5 * outerProcTileScatter1); c1 <= min(min(min(min(5 * outerProcTileScatter1 + 4, 5 * outerProcTileScatter2 + N + 2), N + c0 / 2 - 1), c0), -5 * outerProcTileScatter2 + N + c0); c1 += 1) + for (int c2 = max(max(-N + c1 + 2, c0 - c1 + 3), 5 * outerProcTileScatter2); c2 <= min(min(5 * outerProcTileScatter2 + 4, N + c0 - c1), c1 - 1); c2 += 1) + S1(c0 - c1 + 1, -c0 + c1 + c2 - 2, c1 - c2, c0, c1, c2); diff --git a/test_inputs/codegen/cloog/darte.c b/test_inputs/codegen/cloog/darte.c index 208aafba..3799f41e 100644 --- a/test_inputs/codegen/cloog/darte.c +++ b/test_inputs/codegen/cloog/darte.c @@ -2,7 +2,7 @@ for (int c0 = -n + 1; c0 <= n; c0 += 1) { if (c0 <= 0) for (int c2 = -c0 + 4; c2 <= 2 * n - c0 + 2; c2 += 2) S1(1, -c0 + 1, (c0 + c2 - 2) / 2); - for (int c1 = max(-c0 + 4, c0 + 2); c1 <= min(2 * n + c0, 2 * n - c0); c1 += 2) { + for (int c1 = max(c0 + 2, -c0 + 4); c1 <= min(2 * n + c0, 2 * n - c0); c1 += 2) { for (int c2 = c1 + 2; c2 <= 2 * n + c1; c2 += 2) S1((c0 + c1) / 2, (-c0 + c1) / 2, (-c1 + c2) / 2); for (int c2 = 1; c2 <= n; c2 += 1) diff --git a/test_inputs/codegen/cloog/dealII.c b/test_inputs/codegen/cloog/dealII.c index 0ae7bfac..be4d92f0 100644 --- a/test_inputs/codegen/cloog/dealII.c +++ b/test_inputs/codegen/cloog/dealII.c @@ -1,11 +1,11 @@ { - for (int c0 = 0; c0 <= min(T_2 - 1, T_66); c0 += 1) { + for (int c0 = 0; c0 <= min(T_66, T_2 - 1); c0 += 1) { S1(c0); S2(c0); } - for (int c0 = T_2; c0 <= min(T_66, T_67 - 1); c0 += 1) + for (int c0 = T_2; c0 <= min(T_67 - 1, T_66); c0 += 1) S2(c0); - for (int c0 = max(T_66 + 1, 0); c0 < T_2; c0 += 1) + for (int c0 = max(0, T_66 + 1); c0 < T_2; c0 += 1) S1(c0); if (T_67 == 0 && T_2 == 0) S1(0); diff --git a/test_inputs/codegen/cloog/gesced2.c b/test_inputs/codegen/cloog/gesced2.c index 4b0efdb5..0baf706e 100644 --- a/test_inputs/codegen/cloog/gesced2.c +++ b/test_inputs/codegen/cloog/gesced2.c @@ -5,7 +5,7 @@ for (int c0 = 5; c0 < M - 9; c0 += 1) { for (int c1 = -c0 + 1; c1 <= 4; c1 += 1) S2(c0 + c1, c0); - for (int c1 = 5; c1 <= min(M - c0, M - 10); c1 += 1) { + for (int c1 = 5; c1 <= min(M - 10, M - c0); c1 += 1) { S1(c0, c1); S2(c0 + c1, c0); } diff --git a/test_inputs/codegen/cloog/lineality-2-1-2.c b/test_inputs/codegen/cloog/lineality-2-1-2.c index 2c97b94a..23f50d24 100644 --- a/test_inputs/codegen/cloog/lineality-2-1-2.c +++ b/test_inputs/codegen/cloog/lineality-2-1-2.c @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= M; c0 += 1) { - for (int c1 = 1; c1 <= min(c0 + 1, M); c1 += 1) + for (int c1 = 1; c1 <= min(M, c0 + 1); c1 += 1) S1(c0, c1); if (c0 + 1 >= M) { S2(c0, c0 + 2); diff --git a/test_inputs/codegen/cloog/min-3-1.c b/test_inputs/codegen/cloog/min-3-1.c index b50649e8..fbfc7a81 100644 --- a/test_inputs/codegen/cloog/min-3-1.c +++ b/test_inputs/codegen/cloog/min-3-1.c @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= min(M, 10); c0 += 1) - for (int c1 = 0; c1 <= min(10, M); c1 += 1) + for (int c1 = 0; c1 <= min(M, 10); c1 += 1) S1(c0, c1); diff --git a/test_inputs/codegen/cloog/mod3.c b/test_inputs/codegen/cloog/mod3.c index 996272da..04e6b3ed 100644 --- a/test_inputs/codegen/cloog/mod3.c +++ b/test_inputs/codegen/cloog/mod3.c @@ -1,4 +1,4 @@ -for (int c0 = max(0, 32 * h0 - 1991); c0 <= min(32 * h0 + 31, 999); c0 += 1) +for (int c0 = max(32 * h0 - 1991, 0); c0 <= min(999, 32 * h0 + 31); c0 += 1) if ((32 * h0 - c0 + 32) % 64 >= 1) for (int c1 = 0; c1 <= 999; c1 += 1) S1(c0, c1); diff --git a/test_inputs/codegen/cloog/mxm-shared.c b/test_inputs/codegen/cloog/mxm-shared.c index d98b6998..f2b7e459 100644 --- a/test_inputs/codegen/cloog/mxm-shared.c +++ b/test_inputs/codegen/cloog/mxm-shared.c @@ -1,6 +1,6 @@ -if (g4 == 0 && N >= g0 + t1 + 1 && t1 <= 7) { - for (int c0 = t0; c0 <= min(127, N - g1 - 1); c0 += 16) +if (g4 == 0 && t1 <= 7 && N >= g0 + t1 + 1) { + for (int c0 = t0; c0 <= min(N - g1 - 1, 127); c0 += 16) S1(g0 + t1, g1 + c0); -} else if (g4 % 4 == 0 && t1 <= 7 && N >= g0 + t1 + 1 && g4 >= 4) - for (int c0 = t0; c0 <= min(127, N - g1 - 1); c0 += 16) +} else if (g4 % 4 == 0 && N >= g0 + t1 + 1 && t1 <= 7 && g4 >= 4) + for (int c0 = t0; c0 <= min(N - g1 - 1, 127); c0 += 16) S1(g0 + t1, g1 + c0); diff --git a/test_inputs/codegen/cloog/nul_complex1.c b/test_inputs/codegen/cloog/nul_complex1.c index 8dbd63fd..ddea3b00 100644 --- a/test_inputs/codegen/cloog/nul_complex1.c +++ b/test_inputs/codegen/cloog/nul_complex1.c @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= 5 * n; c0 += 1) - for (int c1 = max(-((n + c0 + 1) % 2) - n + c0 + 1, 2 * floord(c0 - 1, 3) + 2); c1 <= min(n + c0 - (n + c0 + 2) / 3, c0); c1 += 2) + for (int c1 = max(2 * floord(c0 - 1, 3) + 2, -((n + c0 + 1) % 2) - n + c0 + 1); c1 <= min(c0, n + c0 - (n + c0 + 2) / 3); c1 += 2) S1((-2 * c0 + 3 * c1) / 2, c0 - c1); diff --git a/test_inputs/codegen/cloog/otl.c b/test_inputs/codegen/cloog/otl.c dissimilarity index 82% index b84006b9..499451ae 100644 --- a/test_inputs/codegen/cloog/otl.c +++ b/test_inputs/codegen/cloog/otl.c @@ -1,7 +1,7 @@ -if (M >= 3 && N >= 4) - for (int c0 = 1; c0 < (2 * M + 2 * N - 2) / 5; c0 += 1) - for (int c1 = max((c0 + 1) / 2, c0 - (M + 2) / 5); c1 <= min(min((2 * N + 5 * c0 + 1) / 10, c0), (M + 2 * N) / 5 - 1); c1 += 1) - for (int c2 = max(max(max(max(floord(-N + 5 * c0 - 3, 10) + 1, c1 - (N + 6) / 5 + 1), c0 - c1 - 1), 0), c0 - (M + N + 4) / 5 + 1); c2 <= min(min(min(c0 - c1 + (N - 1) / 5 + 1, (N + 5 * c0 + 3) / 10), c1), (M + N - 2) / 5); c2 += 1) - for (int c3 = max(max(max(c1 + c2 - (N + 3) / 5, 2 * c2 - (N + 2) / 5), 2 * c1 - (2 * N + 5) / 5 + 1), c0); c3 <= min(min(min(min(min(c0 + 1, c1 + c2 + 1), c2 + (M + N) / 5), (2 * M + 2 * N - 1) / 5 - 1), c1 + (M - 2) / 5 + 1), 2 * c2 + (N - 2) / 5 + 1); c3 += 1) - for (int c4 = max(max(max(max(c1, c0 - c2), c3 - (M + 2) / 5), c0 - (M + 6) / 5 + 1), (c3 + 1) / 2); c4 <= min(min(min(min(min(min(min(c0 - c2 + N / 5 + 1, -c2 + c3 + (N - 1) / 5 + 1), (2 * N + 5 * c0 + 3) / 10), (M + 2 * N + 1) / 5 - 1), (2 * N + 5 * c3 + 2) / 10), c2 + (N + 2) / 5), c1 + 1), c0); c4 += 1) - S1(c0, c1, c2, c3, c4, c2); +if (M >= 3 && N >= 4) + for (int c0 = 1; c0 < (2 * M + 2 * N - 2) / 5; c0 += 1) + for (int c1 = max(c0 - (M + 2) / 5, (c0 + 1) / 2); c1 <= min(min((2 * N + 5 * c0 + 1) / 10, c0), (M + 2 * N) / 5 - 1); c1 += 1) + for (int c2 = max(max(max(max(c0 - (M + N + 4) / 5 + 1, c1 - (N + 6) / 5 + 1), floord(-N + 5 * c0 - 3, 10) + 1), 0), c0 - c1 - 1); c2 <= min(min(min((M + N - 2) / 5, (N + 5 * c0 + 3) / 10), c0 - c1 + (N - 1) / 5 + 1), c1); c2 += 1) + for (int c3 = max(max(max(2 * c1 - (2 * N + 5) / 5 + 1, 2 * c2 - (N + 2) / 5), c1 + c2 - (N + 3) / 5), c0); c3 <= min(min(min(min(min(c1 + (M - 2) / 5 + 1, 2 * c2 + (N - 2) / 5 + 1), c0 + 1), c1 + c2 + 1), (2 * M + 2 * N - 1) / 5 - 1), c2 + (M + N) / 5); c3 += 1) + for (int c4 = max(max(max(max(c0 - c2, c3 - (M + 2) / 5), c0 - (M + 6) / 5 + 1), (c3 + 1) / 2), c1); c4 <= min(min(min(min(min(min(min((M + 2 * N + 1) / 5 - 1, (2 * N + 5 * c0 + 3) / 10), (2 * N + 5 * c3 + 2) / 10), c0 - c2 + N / 5 + 1), c2 + (N + 2) / 5), -c2 + c3 + (N - 1) / 5 + 1), c0), c1 + 1); c4 += 1) + S1(c0, c1, c2, c3, c4, c2); diff --git a/test_inputs/codegen/cloog/pouchet.c b/test_inputs/codegen/cloog/pouchet.c index c602e1fa..55bb2863 100644 --- a/test_inputs/codegen/cloog/pouchet.c +++ b/test_inputs/codegen/cloog/pouchet.c @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= floord(Ny, 2) + 2; c0 += 1) - for (int c1 = max(c0 / 2 + 1, c0 - 1); c1 <= min((Ny + 2 * c0) / 4, c0); c1 += 1) + for (int c1 = max(c0 / 2 + 1, c0 - 1); c1 <= min(c0, (Ny + 2 * c0) / 4); c1 += 1) if (Ny + 2 * c0 >= 4 * c1 + 1) { for (int c2 = 1; c2 <= 2; c2 += 1) { S1(c0 - c1, c1, 2 * c0 - 2 * c1, -2 * c0 + 4 * c1, c2); diff --git a/test_inputs/codegen/cloog/reservoir-bastoul3.c b/test_inputs/codegen/cloog/reservoir-bastoul3.c index b59b93d3..6d82ce4a 100644 --- a/test_inputs/codegen/cloog/reservoir-bastoul3.c +++ b/test_inputs/codegen/cloog/reservoir-bastoul3.c @@ -1,3 +1,3 @@ for (int c0 = 3; c0 <= 9; c0 += 1) - for (int c1 = max(-(c0 % 2) + 2, c0 - 6); c1 <= min(c0 - 2, 3); c1 += 2) + for (int c1 = max(c0 - 6, -(c0 % 2) + 2); c1 <= min(3, c0 - 2); c1 += 2) S1(c0, c1, (c0 - c1) / 2); diff --git a/test_inputs/codegen/cloog/reservoir-lim-lam1.c b/test_inputs/codegen/cloog/reservoir-lim-lam1.c index ae9848be..19442d6f 100644 --- a/test_inputs/codegen/cloog/reservoir-lim-lam1.c +++ b/test_inputs/codegen/cloog/reservoir-lim-lam1.c @@ -1,7 +1,7 @@ for (int c1 = -99; c1 <= 100; c1 += 1) { if (c1 <= 0) S1(1, -c1 + 1); - for (int c3 = max(-2 * c1 + 3, 1); c3 <= min(199, -2 * c1 + 199); c3 += 2) { + for (int c3 = max(-2 * c1 + 3, 1); c3 <= min(-2 * c1 + 199, 199); c3 += 2) { S2((2 * c1 + c3 - 1) / 2, (c3 + 1) / 2); S1((2 * c1 + c3 + 1) / 2, (c3 + 1) / 2); } diff --git a/test_inputs/codegen/cloog/reservoir-lim-lam3.c b/test_inputs/codegen/cloog/reservoir-lim-lam3.c index d011975f..894c2414 100644 --- a/test_inputs/codegen/cloog/reservoir-lim-lam3.c +++ b/test_inputs/codegen/cloog/reservoir-lim-lam3.c @@ -1,6 +1,6 @@ for (int c1 = 5; c1 <= 5 * M; c1 += 1) { for (int c3 = max(2, floord(-M + c1, 4)); c3 < min((c1 + 1) / 3 - 2, M); c3 += 1) - for (int c5 = max(-M - c3 + (M + c1) / 2 - 2, 1); c5 < min(c3, -2 * c3 + (c1 + c3) / 2 - 2); c5 += 1) + for (int c5 = max(-M - c3 + (M + c1) / 2 - 2, 1); c5 < min(-2 * c3 + (c1 + c3) / 2 - 2, c3); c5 += 1) S1(c1 - 2 * c3 - 2 * c5 - 5, c3, c5); for (int c3 = max(1, floord(-M + c1, 4)); c3 < (c1 + 1) / 5; c3 += 1) S2(c1 - 4 * c3 - 3, c3); diff --git a/test_inputs/codegen/cloog/reservoir-lim-lam4.c b/test_inputs/codegen/cloog/reservoir-lim-lam4.c index 84278864..4793f6ae 100644 --- a/test_inputs/codegen/cloog/reservoir-lim-lam4.c +++ b/test_inputs/codegen/cloog/reservoir-lim-lam4.c @@ -1,8 +1,8 @@ for (int c1 = 1; c1 < 2 * M - 1; c1 += 1) { for (int c3 = max(-c1 + 1, -M + 1); c3 < 0; c3 += 1) { - for (int c7 = max(-M + c1 + 1, 1); c7 <= min(c1 + c3, M - 1); c7 += 1) + for (int c7 = max(-M + c1 + 1, 1); c7 <= min(M - 1, c1 + c3); c7 += 1) S1(c7, c1 + c3 - c7, -c3); - for (int c5 = max(-c3, -M + c1 + 1); c5 < min(M, c1); c5 += 1) + for (int c5 = max(-M + c1 + 1, -c3); c5 < min(M, c1); c5 += 1) S2(c1 - c5, c3 + c5, c5); } for (int c7 = max(1, -M + c1 + 1); c7 <= min(c1, M - 1); c7 += 1) diff --git a/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c b/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c index c693da28..eb78c94a 100644 --- a/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c +++ b/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c @@ -2,13 +2,13 @@ if (N >= 0 && M >= 0) for (int c1 = -4; c1 <= 3 * M + N; c1 += 1) { if (c1 >= 3 * M) { S2(M, -3 * M + c1); - } else if (3 * floord(c1 - 2, 3) + 2 == c1 && 3 * M >= c1 + 4 && c1 + 1 >= 0) + } else if (3 * floord(c1 - 2, 3) + 2 == c1 && c1 + 1 >= 0 && 3 * M >= c1 + 4) S1((c1 + 4) / 3, 0); - for (int c3 = max(c1 + 3 * floord(-c1 - 1, 3) + 3, -3 * M + c1 + 3); c3 <= min(c1, N - 1); c3 += 3) { + for (int c3 = max(-3 * M + c1 + 3, c1 + 3 * floord(-c1 - 1, 3) + 3); c3 <= min(N - 1, c1); c3 += 3) { S2((c1 - c3) / 3, c3); S1((c1 - c3 + 3) / 3, c3 + 1); } - if (N + 3 * floord(-N + c1, 3) == c1 && c1 >= N && 3 * M + N >= c1 + 3) { + if (N + 3 * floord(-N + c1, 3) == c1 && 3 * M + N >= c1 + 3 && c1 >= N) { S2((-N + c1) / 3, N); } else if (N >= c1 + 4) S1(0, c1 + 4); diff --git a/test_inputs/codegen/cloog/reservoir-tang-xue1.c b/test_inputs/codegen/cloog/reservoir-tang-xue1.c index 230665a8..03d2dde8 100644 --- a/test_inputs/codegen/cloog/reservoir-tang-xue1.c +++ b/test_inputs/codegen/cloog/reservoir-tang-xue1.c @@ -1,5 +1,5 @@ for (int c1 = 0; c1 <= 9; c1 += 2) - for (int c3 = 0; c3 <= min(c1 + 3, 4); c3 += 2) - for (int c5 = max(1, c1); c5 <= min(c1 - c3 + 4, c1 + 1); c5 += 1) + for (int c3 = 0; c3 <= min(4, c1 + 3); c3 += 2) + for (int c5 = max(c1, 1); c5 <= min(c1 + 1, c1 - c3 + 4); c5 += 1) for (int c7 = max(-c1 + c3 + c5, 1); c7 <= min(4, -c1 + c3 + c5 + 1); c7 += 1) S1(c1 / 2, (-c1 + c3) / 2, -c1 + c5, -c3 + c7); diff --git a/test_inputs/codegen/cloog/stride3.c b/test_inputs/codegen/cloog/stride3.c index d145938b..23d921f1 100644 --- a/test_inputs/codegen/cloog/stride3.c +++ b/test_inputs/codegen/cloog/stride3.c @@ -1,2 +1,2 @@ -for (int c0 = max(1, m); c0 <= n; c0 += 1) +for (int c0 = max(m, 1); c0 <= n; c0 += 1) S1(c0); diff --git a/test_inputs/codegen/cloog/stride4.c b/test_inputs/codegen/cloog/stride4.c index d65e4b1b..03908e60 100644 --- a/test_inputs/codegen/cloog/stride4.c +++ b/test_inputs/codegen/cloog/stride4.c @@ -1,3 +1,3 @@ -if (t <= 15 && t >= 0) +if (t >= 0 && t <= 15) for (int c0 = t; c0 <= 99; c0 += 16) S1(c0, t); diff --git a/test_inputs/codegen/cloog/thomasset.c b/test_inputs/codegen/cloog/thomasset.c index 15552ae5..02678f40 100644 --- a/test_inputs/codegen/cloog/thomasset.c +++ b/test_inputs/codegen/cloog/thomasset.c @@ -1,9 +1,9 @@ { for (int c0 = 0; c0 <= floord(n - 1, 3); c0 += 1) - for (int c2 = 3 * c0 + 1; c2 <= min(n, 3 * c0 + 3); c2 += 1) + for (int c2 = 3 * c0 + 1; c2 <= min(3 * c0 + 3, n); c2 += 1) S1(c2, c0); for (int c0 = floord(n, 3); c0 <= 2 * floord(n, 3); c0 += 1) for (int c1 = 0; c1 < n; c1 += 1) - for (int c3 = max((n % 3) - n + 3 * c0, 1); c3 <= min((n % 3) - n + 3 * c0 + 2, n); c3 += 1) - S2(c1 + 1, c3, 0, n / 3, c0 - n / 3); + for (int c3 = max(1, (n % 3) - n + 3 * c0); c3 <= min(n, (n % 3) - n + 3 * c0 + 2); c3 += 1) + S2(c1 + 1, c3, 0, (n + 3) / 3 - 1, c0 - (n + 3) / 3 + 1); } diff --git a/test_inputs/codegen/cloog/tiling.c b/test_inputs/codegen/cloog/tiling.c index 971b988a..8cbaf8c4 100644 --- a/test_inputs/codegen/cloog/tiling.c +++ b/test_inputs/codegen/cloog/tiling.c @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= n / 10; c0 += 1) - for (int c1 = 10 * c0; c1 <= min(n, 10 * c0 + 9); c1 += 1) + for (int c1 = 10 * c0; c1 <= min(10 * c0 + 9, n); c1 += 1) S1(c0, c1); diff --git a/test_inputs/codegen/cloog/vasilache.c b/test_inputs/codegen/cloog/vasilache.c index d2e5c460..567e41f4 100644 --- a/test_inputs/codegen/cloog/vasilache.c +++ b/test_inputs/codegen/cloog/vasilache.c @@ -10,7 +10,7 @@ for (int c3 = 0; c3 < N; c3 += 1) for (int c5 = 0; c5 <= (N - 1) / 32; c5 += 1) { S7(c1, c3, c5, 32 * c5); - for (int c7 = 32 * c5 + 1; c7 <= min(32 * c5 + 31, N - 1); c7 += 1) { + for (int c7 = 32 * c5 + 1; c7 <= min(N - 1, 32 * c5 + 31); c7 += 1) { S6(c1, c3, c5, c7 - 1); S7(c1, c3, c5, c7); } diff --git a/test_inputs/codegen/cloog/vivien.c b/test_inputs/codegen/cloog/vivien.c index 55c1d790..77255586 100644 --- a/test_inputs/codegen/cloog/vivien.c +++ b/test_inputs/codegen/cloog/vivien.c @@ -1,7 +1,7 @@ { for (int c0 = -27 * n + 2; c0 <= 1; c0 += 1) S1(c0 - 1); - for (int c0 = 2; c0 <= min(2 * n, n + 29); c0 += 1) { + for (int c0 = 2; c0 <= min(n + 29, 2 * n); c0 += 1) { if (2 * n >= c0 + 1 && c0 >= 3) S4(c0 - c0 / 2 - 1, c0 / 2 + 1); if (2 * n >= c0 + 1 && c0 + 2 >= 2 * n) { @@ -18,7 +18,7 @@ for (int c2 = 1; c2 <= -c1; c2 += 1) S5(-c1 + 1, c0 + c1 - 1, c2); } - if (c0 >= n + 2 && 2 * n >= c0 + 3) { + if (2 * n >= c0 + 3 && c0 >= n + 2) { S6(-n + c0 + 1, n - 1); for (int c2 = 1; c2 < -n + c0; c2 += 1) S5(-n + c0, n, c2); @@ -29,7 +29,7 @@ if (n + 1 >= c0 && c0 >= 5) { S6(2, c0 - 2); S1(c0 - 1); - } else if (c0 >= 3 && c0 <= 4 && n + 1 >= c0) + } else if (c0 <= 4 && c0 >= 3 && n + 1 >= c0) S1(c0 - 1); if (n + 1 >= c0 && c0 >= 3) S6(1, c0 - 1); @@ -78,6 +78,6 @@ for (int c1 = -n + c0; c1 < (c0 + 1) / 2; c1 += 1) S2(c0 - c1, c1); } - for (int c0 = max(-27 * n + 2, 2 * n + 1); c0 <= n + 29; c0 += 1) + for (int c0 = max(2 * n + 1, -27 * n + 2); c0 <= n + 29; c0 += 1) S1(c0 - 1); } diff --git a/test_inputs/codegen/cloog/vivien2.c b/test_inputs/codegen/cloog/vivien2.c index b39b943f..440f54f8 100644 --- a/test_inputs/codegen/cloog/vivien2.c +++ b/test_inputs/codegen/cloog/vivien2.c @@ -19,7 +19,7 @@ for (int c2 = 1; c2 <= -c1; c2 += 1) S5(-c1 + 1, c0 + c1 - 1, c2); } - if (2 * n >= c0 + 3 && c0 >= n + 2) { + if (c0 >= n + 2 && 2 * n >= c0 + 3) { S6(-n + c0 + 1, n - 1); for (int c2 = 1; c2 < -n + c0; c2 += 1) S5(-n + c0, n, c2); @@ -31,7 +31,7 @@ if (c0 >= 5 && n + 1 >= c0) { S6(2, c0 - 2); S1(c0 - 1); - } else if (c0 >= 3 && c0 <= 4) + } else if (c0 <= 4 && c0 >= 3) S1(c0 - 1); if (c0 >= 3 && n + 1 >= c0) S6(1, c0 - 1); diff --git a/test_inputs/codegen/cloog/wavefront.c b/test_inputs/codegen/cloog/wavefront.c index 7db0788f..cfb4e11f 100644 --- a/test_inputs/codegen/cloog/wavefront.c +++ b/test_inputs/codegen/cloog/wavefront.c @@ -1,3 +1,3 @@ for (int c0 = 2; c0 <= n + m; c0 += 1) - for (int c1 = max(1, -m + c0); c1 <= min(n, c0 - 1); c1 += 1) + for (int c1 = max(-m + c0, 1); c1 <= min(n, c0 - 1); c1 += 1) S1(c1, c0 - c1); diff --git a/test_inputs/codegen/dwt.c b/test_inputs/codegen/dwt.c index 5a634a94..daec6f79 100644 --- a/test_inputs/codegen/dwt.c +++ b/test_inputs/codegen/dwt.c @@ -1,5 +1,5 @@ for (int c0 = 0; c0 < Ncl; c0 += 1) - if (c0 >= 1 && Ncl >= c0 + 2) { + if (Ncl >= c0 + 2 && c0 >= 1) { S(c0, 28); } else if (c0 == 0) { S(0, 26); diff --git a/test_inputs/codegen/hoist.c b/test_inputs/codegen/hoist.c index ba8e4147..40cf1a3a 100644 --- a/test_inputs/codegen/hoist.c +++ b/test_inputs/codegen/hoist.c @@ -1,5 +1,5 @@ -if (ni >= t0 + 1 && nj >= t1 + 1) - for (int c2 = 0; c2 <= min(nk - 1, 15); c2 += 1) { +if (nj >= t1 + 1 && ni >= t0 + 1) + for (int c2 = 0; c2 <= min(15, nk - 1); c2 += 1) { S_1(t0, t1, c2); if (nj >= t1 + 17) { S_1(t0, t1 + 16, c2); diff --git a/test_inputs/codegen/omega/code_gen-0.c b/test_inputs/codegen/omega/code_gen-0.c index 6340134f..9e0f809e 100644 --- a/test_inputs/codegen/omega/code_gen-0.c +++ b/test_inputs/codegen/omega/code_gen-0.c @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= 8; c0 += 1) for (int c1 = 0; c1 <= 7; c1 += 1) { - if (c0 >= 2 && c0 <= 6 && c1 <= 4) + if (c1 <= 4 && c0 <= 6 && c0 >= 2) s1(c0, c1); if (c1 + 1 >= c0) s0(c0, c1); diff --git a/test_inputs/codegen/omega/hpf-0.c b/test_inputs/codegen/omega/hpf-0.c index c8fecaa8..be015bc6 100644 --- a/test_inputs/codegen/omega/hpf-0.c +++ b/test_inputs/codegen/omega/hpf-0.c @@ -1,4 +1,4 @@ -if (P1 == P2 && P2 <= 3 && P2 >= 0) - for (int c0 = 0; c0 <= min(2, -P2 + 4); c0 += 1) +if (P1 == P2 && P2 >= 0 && P2 <= 3) + for (int c0 = 0; c0 <= min(-P2 + 4, 2); c0 += 1) for (int c2 = -P2 - c0 + 3 * floord(P2 + c0 - 1, 3) + 3; c2 <= 3; c2 += 3) s0(c0, c0, c2, c2); diff --git a/test_inputs/codegen/omega/if_then-4.c b/test_inputs/codegen/omega/if_then-4.c index fa81628a..f1b3840d 100644 --- a/test_inputs/codegen/omega/if_then-4.c +++ b/test_inputs/codegen/omega/if_then-4.c @@ -1,7 +1,7 @@ for (int c0 = 4; c0 <= 100; c0 += 4) { for (int c1 = 1; c1 <= 100; c1 += 1) s0(c0, c1); - if (c0 >= 8 && c0 <= 96) + if (c0 <= 96 && c0 >= 8) for (int c1 = 10; c1 <= 100; c1 += 1) s1(c0 + 2, c1); } diff --git a/test_inputs/codegen/omega/if_then-5.c b/test_inputs/codegen/omega/if_then-5.c index fa81628a..f1b3840d 100644 --- a/test_inputs/codegen/omega/if_then-5.c +++ b/test_inputs/codegen/omega/if_then-5.c @@ -1,7 +1,7 @@ for (int c0 = 4; c0 <= 100; c0 += 4) { for (int c1 = 1; c1 <= 100; c1 += 1) s0(c0, c1); - if (c0 >= 8 && c0 <= 96) + if (c0 <= 96 && c0 >= 8) for (int c1 = 10; c1 <= 100; c1 += 1) s1(c0 + 2, c1); } diff --git a/test_inputs/codegen/omega/iter5-0.c b/test_inputs/codegen/omega/iter5-0.c index d7566d6e..66c7c097 100644 --- a/test_inputs/codegen/omega/iter5-0.c +++ b/test_inputs/codegen/omega/iter5-0.c @@ -1,3 +1,3 @@ for (int c0 = 2; c0 <= 9; c0 += 1) - for (int c1 = c0 + 1; c1 <= min(2 * c0, 16); c1 += 1) + for (int c1 = c0 + 1; c1 <= min(16, 2 * c0); c1 += 1) s0(c0, c1); diff --git a/test_inputs/codegen/omega/lefur00-0.c b/test_inputs/codegen/omega/lefur00-0.c dissimilarity index 85% index 1cd7fc35..18bd3033 100644 --- a/test_inputs/codegen/omega/lefur00-0.c +++ b/test_inputs/codegen/omega/lefur00-0.c @@ -1,5 +1,5 @@ -for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(c0 / 2, 2 * c0 - 15); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66), 67 * c1 - (c1 + 2) / 3), 1); c2 <= min(min(133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133, 100 * c0 + 99), 1000); c2 += 1) - for (int c3 = max(max(200 * c0 - c2, 100 * c1 + (c2 + 1) / 2), c2); c3 <= min(min(100 * c1 + (c2 + 1) / 2 + 99, 2 * c2 + 1), 200 * c0 - c2 + 199); c3 += 1) - s0(c0, c1, c2, c3); +for (int c0 = 0; c0 <= 15; c0 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) + for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 1), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) + for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + s0(c0, c1, c2, c3); diff --git a/test_inputs/codegen/omega/lefur01-0.c b/test_inputs/codegen/omega/lefur01-0.c dissimilarity index 85% index 1cd7fc35..18bd3033 100644 --- a/test_inputs/codegen/omega/lefur01-0.c +++ b/test_inputs/codegen/omega/lefur01-0.c @@ -1,5 +1,5 @@ -for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(c0 / 2, 2 * c0 - 15); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66), 67 * c1 - (c1 + 2) / 3), 1); c2 <= min(min(133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133, 100 * c0 + 99), 1000); c2 += 1) - for (int c3 = max(max(200 * c0 - c2, 100 * c1 + (c2 + 1) / 2), c2); c3 <= min(min(100 * c1 + (c2 + 1) / 2 + 99, 2 * c2 + 1), 200 * c0 - c2 + 199); c3 += 1) - s0(c0, c1, c2, c3); +for (int c0 = 0; c0 <= 15; c0 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) + for (int c2 = max(max(max(67 * c0 - (c0 + 1) / 3, 1), 67 * c1 - (c1 + 2) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) + for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + s0(c0, c1, c2, c3); diff --git a/test_inputs/codegen/omega/lefur01-1.c b/test_inputs/codegen/omega/lefur01-1.c dissimilarity index 85% index c10688a4..175f17f8 100644 --- a/test_inputs/codegen/omega/lefur01-1.c +++ b/test_inputs/codegen/omega/lefur01-1.c @@ -1,5 +1,5 @@ -for (int c0 = 0; c0 <= 15; c0 += 1) - for (int c1 = max(c0 / 2, 2 * c0 - 15); c1 <= min(c0 + 1, 15); c1 += 1) - for (int c2 = max(max(max(133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66, 67 * c1 - (c1 + 2) / 3), 67 * c0 - (c0 + 1) / 3), 1); c2 <= min(min(133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133, 100 * c0 + 99), 1000); c2 += 1) - for (int c3 = max(max(200 * c0 - c2, 100 * c1 + (c2 + 1) / 2), c2); c3 <= min(min(100 * c1 + (c2 + 1) / 2 + 99, 2 * c2 + 1), 200 * c0 - c2 + 199); c3 += 1) - s0(c0, c1, c2, c3); +for (int c0 = 0; c0 <= 15; c0 += 1) + for (int c1 = max(2 * c0 - 15, c0 / 2); c1 <= min(c0 + 1, 15); c1 += 1) + for (int c2 = max(max(max(1, 67 * c1 - (c1 + 2) / 3), 67 * c0 - (c0 + 1) / 3), 133 * c0 - 67 * c1 + (c0 + c1 + 1) / 3 - 66); c2 <= min(min(100 * c0 + 99, 1000), 133 * c0 - 67 * c1 + floord(c0 + c1 - 1, 3) + 133); c2 += 1) + for (int c3 = max(max(100 * c1 + (c2 + 1) / 2, 200 * c0 - c2), c2); c3 <= min(min(200 * c0 - c2 + 199, 100 * c1 + (c2 + 1) / 2 + 99), 2 * c2 + 1); c3 += 1) + s0(c0, c1, c2, c3); diff --git a/test_inputs/codegen/omega/lefur03-0.c b/test_inputs/codegen/omega/lefur03-0.c dissimilarity index 90% index 2b6d7b28..94fc83d0 100644 --- a/test_inputs/codegen/omega/lefur03-0.c +++ b/test_inputs/codegen/omega/lefur03-0.c @@ -1,7 +1,7 @@ -for (int c0 = 0; c0 <= 3; c0 += 1) - for (int c1 = max(0, 2 * c0 - 3); c1 <= min(c0 + c0 / 2 + 1, 3); c1 += 1) - for (int c2 = c0; c2 <= min(min(3, 3 * c1 + 2), 2 * c0 - c1 + 1); c2 += 1) - for (int c3 = max(max(max(c1 - (-c1 + 3) / 3, 0), c2 + floord(3 * c1 - c2 - 1, 6)), 2 * c0 - (c0 + c1 + 1) / 3 - 1); c3 <= min(c0 + 1, 3); c3 += 1) - for (int c4 = max(max(max(max(-200 * c1 + 400 * c3 - 199, 333 * c1 + c1 / 3), 333 * c2 + (c2 + 1) / 3), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332), 250 * c3 + 1); c4 <= min(min(min(min(500 * c0 + 499, -200 * c1 + 400 * c3 + 400), 333 * c3 - (-c3 + 3) / 3 + 334), 1000), 333 * c2 - (-c2 + 3) / 3 + 333); c4 += 1) - for (int c5 = max(max(max(1000 * c3 - 2 * c4 + 2, 1000 * c0 - c4), 500 * c1 + (c4 + 1) / 2), c4); c5 <= min(min(min(1000 * c3 - 2 * c4 + 1001, 1000 * c0 - c4 + 999), 500 * c1 + (c4 + 1) / 2 + 499), 2 * c4 + 1); c5 += 1) - s0(c0, c1, c2, c3, c4, c5); +for (int c0 = 0; c0 <= 3; c0 += 1) + for (int c1 = max(2 * c0 - 3, 0); c1 <= min(3, c0 + c0 / 2 + 1); c1 += 1) + for (int c2 = c0; c2 <= min(min(2 * c0 - c1 + 1, 3 * c1 + 2), 3); c2 += 1) + for (int c3 = max(max(max(c2 + floord(3 * c1 - c2 - 1, 6), c1 - (-c1 + 3) / 3), c0 - (-c0 + 3) / 3), 0); c3 <= min(c0 + 1, 3); c3 += 1) + for (int c4 = max(max(max(max(250 * c3 + 1, 333 * c2 + (c2 + 1) / 3), 333 * c1 + c1 / 3), -200 * c1 + 400 * c3 - 199), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332); c4 <= min(min(min(min(1000, -200 * c1 + 400 * c3 + 400), 500 * c0 + 499), 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334); c4 += 1) + for (int c5 = max(max(max(c4, 1000 * c3 - 2 * c4 + 2), 500 * c1 + (c4 + 1) / 2), 1000 * c0 - c4); c5 <= min(min(min(1000 * c0 - c4 + 999, 500 * c1 + (c4 + 1) / 2 + 499), 1000 * c3 - 2 * c4 + 1001), 2 * c4 + 1); c5 += 1) + s0(c0, c1, c2, c3, c4, c5); diff --git a/test_inputs/codegen/omega/lefur04-0.c b/test_inputs/codegen/omega/lefur04-0.c dissimilarity index 79% index 079505ef..051393f3 100644 --- a/test_inputs/codegen/omega/lefur04-0.c +++ b/test_inputs/codegen/omega/lefur04-0.c @@ -1,8 +1,8 @@ -for (int c0 = 0; c0 <= 3; c0 += 1) - for (int c1 = max(0, 2 * c0 - 3); c1 <= min(c0 + 1, 3); c1 += 1) - for (int c2 = c0; c2 <= min(min(3, 3 * c1 + 2), 2 * c0 - c1 + 1); c2 += 1) - for (int c3 = max(max(max(c2 - (c2 + 2) / 3, c2 + floord(3 * c1 - c2 - 1, 6)), c1 - (-c1 + 3) / 3), c0 - (-c2 + 3) / 3); c3 <= min(c0 + c0 / 2 + 1, 3); c3 += 1) - for (int c5 = max(max(max(max(c1 - (-c1 + 3) / 3, 0), 2 * c3 - 4), c3 - (c3 + 3) / 3), c2 - (c2 + 3) / 3); c5 <= min(min(-c2 + 2 * c3 - (c2 + 3) / 3 + 2, c1 + 1), c3); c5 += 1) - for (int c6 = max(max(max(max(max(250 * c3 + 1, 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332), -200 * c1 + 400 * c3 - 199), 333 * c1 + c1 / 3), 1000 * c0 - 500 * c5 - 501), 333 * c2 + (c2 + 1) / 3); c6 <= min(min(min(min(min(min(333 * c3 - (-c3 + 3) / 3 + 334, 1000), 333 * c2 - (-c2 + 3) / 3 + 333), 1000 * c0 - 500 * c5 + 997), 500 * c5 + 501), 500 * c0 + 499), -200 * c1 + 400 * c3 + 400); c6 += 1) - for (int c7 = max(max(max(max(c6, 500 * c1 + (c6 + 1) / 2), 1000 * c0 - c6), 500 * c5 + 2), 1000 * c3 - 2 * c6 + 2); c7 <= min(min(min(min(500 * c5 + 501, 2 * c6 + 1), 1000 * c3 - 2 * c6 + 1001), 1000 * c0 - c6 + 999), 500 * c1 + (c6 + 1) / 2 + 499); c7 += 1) - s0(c0, c1, c2, c3, c2 / 3, c5, c6, c7); +for (int c0 = 0; c0 <= 3; c0 += 1) + for (int c1 = max(2 * c0 - 3, c0 / 2); c1 <= min(c0 + 1, 3); c1 += 1) + for (int c2 = c0; c2 <= min(min(3, 2 * c0 - c1 + 1), 3 * c1 + 2); c2 += 1) + for (int c3 = max(max(max(c2 - (c2 + 2) / 3, c2 + floord(3 * c1 - c2 - 1, 6)), c1 - (-c1 + 3) / 3), c0 - (-c2 + 3) / 3); c3 <= min(c0 + c0 / 2 + 1, 3); c3 += 1) + for (int c5 = max(max(max(max(c1 - (c1 - 2 * c3 + 5) / 5, 0), c3 - (c3 + 3) / 3), 2 * c3 - 4), c2 - (c2 + 3) / 3); c5 <= min(min(c1 + 1, c3), -c2 + 2 * c3 - (c2 + 3) / 3 + 2); c5 += 1) + for (int c6 = max(max(max(max(max(333 * c2 + (c2 + 1) / 3, -200 * c1 + 400 * c3 - 199), 1000 * c0 - 500 * c5 - 501), 333 * c1 + c1 / 3), 250 * c3 + 1), 667 * c0 - 333 * c1 - (c0 + c1 + 3) / 3 - 332); c6 <= min(min(min(min(min(min(500 * c0 + 499, 333 * c2 - (-c2 + 3) / 3 + 333), 333 * c3 - (-c3 + 3) / 3 + 334), -200 * c1 + 400 * c3 + 400), 500 * c5 + 501), 1000), 1000 * c0 - 500 * c5 + 997); c6 += 1) + for (int c7 = max(max(max(max(c6, 500 * c5 + 2), 1000 * c3 - 2 * c6 + 2), 500 * c1 + (c6 + 1) / 2), 1000 * c0 - c6); c7 <= min(min(min(min(500 * c5 + 501, 2 * c6 + 1), 1000 * c0 - c6 + 999), 500 * c1 + (c6 + 1) / 2 + 499), 1000 * c3 - 2 * c6 + 1001); c7 += 1) + s0(c0, c1, c2, c3, c2 / 3, c5, c6, c7); diff --git a/test_inputs/codegen/omega/lift2-0.c b/test_inputs/codegen/omega/lift2-0.c index 181d6e58..9658b92a 100644 --- a/test_inputs/codegen/omega/lift2-0.c +++ b/test_inputs/codegen/omega/lift2-0.c @@ -4,6 +4,6 @@ for (int c0 = 1; c0 <= 100; c0 += 1) for (int c3 = 1; c3 <= 100; c3 += 1) for (int c4 = 1; c4 <= 100; c4 += 1) { s1(c0, c1, c2, c3, c4); - if (c0 >= 5 && c0 <= 60) + if (c0 <= 60 && c0 >= 5) s0(c0, c1, c2, c3, c4); } diff --git a/test_inputs/codegen/omega/lu-0.c b/test_inputs/codegen/omega/lu-0.c index abb9eae3..7ecc7cc8 100644 --- a/test_inputs/codegen/omega/lu-0.c +++ b/test_inputs/codegen/omega/lu-0.c @@ -1,10 +1,10 @@ for (int c0 = 1; c0 < n; c0 += 64) for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { - for (int c3 = c0; c3 <= min(min(c2 - 1, c0 + 63), c1 + 62); c3 += 1) - for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) + for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c1, c2 + 1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff --git a/test_inputs/codegen/omega/lu-1.c b/test_inputs/codegen/omega/lu-1.c index abb9eae3..7ecc7cc8 100644 --- a/test_inputs/codegen/omega/lu-1.c +++ b/test_inputs/codegen/omega/lu-1.c @@ -1,10 +1,10 @@ for (int c0 = 1; c0 < n; c0 += 64) for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { - for (int c3 = c0; c3 <= min(min(c2 - 1, c0 + 63), c1 + 62); c3 += 1) - for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) + for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c1, c2 + 1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff --git a/test_inputs/codegen/omega/lu-2.c b/test_inputs/codegen/omega/lu-2.c index abb9eae3..7ecc7cc8 100644 --- a/test_inputs/codegen/omega/lu-2.c +++ b/test_inputs/codegen/omega/lu-2.c @@ -1,10 +1,10 @@ for (int c0 = 1; c0 < n; c0 += 64) for (int c1 = c0 - 1; c1 <= n; c1 += 64) for (int c2 = c0; c2 <= n; c2 += 1) { - for (int c3 = c0; c3 <= min(min(c2 - 1, c0 + 63), c1 + 62); c3 += 1) - for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c3 = c0; c3 <= min(min(c0 + 63, c1 + 62), c2 - 1); c3 += 1) + for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) s1(c3, c4, c2); if (c0 + 63 >= c2) - for (int c4 = max(c1, c2 + 1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } diff --git a/test_inputs/codegen/omega/lu-3.c b/test_inputs/codegen/omega/lu-3.c index 4be6c2be..9128107c 100644 --- a/test_inputs/codegen/omega/lu-3.c +++ b/test_inputs/codegen/omega/lu-3.c @@ -1,14 +1,14 @@ for (int c0 = 1; c0 < n; c0 += 64) for (int c1 = c0 - 1; c1 <= n; c1 += 64) { - for (int c2 = c0; c2 <= min(c0 + 63, n); c2 += 1) { + for (int c2 = c0; c2 <= min(n, c0 + 63); c2 += 1) { for (int c3 = c0; c3 <= min(c1 + 62, c2 - 1); c3 += 1) - for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) s1(c3, c4, c2); - for (int c4 = max(c1, c2 + 1); c4 <= min(c1 + 63, n); c4 += 1) + for (int c4 = max(c2 + 1, c1); c4 <= min(n, c1 + 63); c4 += 1) s0(c2, c4); } for (int c2 = c0 + 64; c2 <= n; c2 += 1) for (int c3 = c0; c3 <= min(c0 + 63, c1 + 62); c3 += 1) - for (int c4 = max(c1, c3 + 1); c4 <= min(n, c1 + 63); c4 += 1) + for (int c4 = max(c3 + 1, c1); c4 <= min(c1 + 63, n); c4 += 1) s1(c3, c4, c2); } diff --git a/test_inputs/codegen/omega/m10-1.c b/test_inputs/codegen/omega/m10-1.c index 42478d13..d57375ed 100644 --- a/test_inputs/codegen/omega/m10-1.c +++ b/test_inputs/codegen/omega/m10-1.c @@ -1,5 +1,5 @@ for (int c0 = 1; c0 <= 18; c0 += 1) - if (c0 >= 2 && c0 <= 9) { + if (c0 <= 9 && c0 >= 2) { for (int c1 = 1; c1 <= 9; c1 += 1) { if (c0 % 2 == 0) s0(c1, c0 / 2); diff --git a/test_inputs/codegen/omega/m11-0.c b/test_inputs/codegen/omega/m11-0.c index e1c320c0..4d422eba 100644 --- a/test_inputs/codegen/omega/m11-0.c +++ b/test_inputs/codegen/omega/m11-0.c @@ -1,6 +1,6 @@ for (int c0 = 1; c0 <= min(4, floord(2 * m - 1, 17) + 1); c0 += 1) for (int c1 = 1; c1 <= 2; c1 += 1) for (int c2 = 0; c2 <= min(-c1 + c1 / 2 + 3, -c0 - c1 + (2 * m + 3 * c0 + 10 * c1 + 6) / 20 + 1); c2 += 1) - for (int c3 = 8 * c0 + (c0 + 1) / 2 - 8; c3 <= min(min(m - 5 * c1 - 10 * c2 + 5, 8 * c0 + c0 / 2), 30); c3 += 1) + for (int c3 = 8 * c0 + (c0 + 1) / 2 - 8; c3 <= min(min(8 * c0 + c0 / 2, 30), m - 5 * c1 - 10 * c2 + 5); c3 += 1) for (int c4 = 5 * c1 + 10 * c2 - 4; c4 <= min(m - c3 + 1, 5 * c1 + 10 * c2); c4 += 1) s0(c0, c1, c2, c3, c4, -9 * c0 + c3 + c0 / 2 + 9, -5 * c1 - 5 * c2 + c4 + 5); diff --git a/test_inputs/codegen/omega/p.delft-0.c b/test_inputs/codegen/omega/p.delft-0.c index c8fecaa8..be015bc6 100644 --- a/test_inputs/codegen/omega/p.delft-0.c +++ b/test_inputs/codegen/omega/p.delft-0.c @@ -1,4 +1,4 @@ -if (P1 == P2 && P2 <= 3 && P2 >= 0) - for (int c0 = 0; c0 <= min(2, -P2 + 4); c0 += 1) +if (P1 == P2 && P2 >= 0 && P2 <= 3) + for (int c0 = 0; c0 <= min(-P2 + 4, 2); c0 += 1) for (int c2 = -P2 - c0 + 3 * floord(P2 + c0 - 1, 3) + 3; c2 <= 3; c2 += 3) s0(c0, c0, c2, c2); diff --git a/test_inputs/codegen/omega/p.delft2-0.c b/test_inputs/codegen/omega/p.delft2-0.c index 99d40051..789078ed 100644 --- a/test_inputs/codegen/omega/p.delft2-0.c +++ b/test_inputs/codegen/omega/p.delft2-0.c @@ -1,8 +1,8 @@ -if ((2 * floord(P2, 2) == P2 && 2 * floord(P1, 2) == P1 && P2 >= 0 && P2 <= 3 && P1 >= 0 && P1 <= 3) || (2 * floord(P2, 2) == P2 && 2 * floord(P1 - 1, 2) + 1 == P1 && P2 >= 0 && P2 <= 3 && P1 >= 0 && P1 <= 3) || (2 * floord(P2 - 1, 2) + 1 == P2 && 2 * floord(P1, 2) == P1 && P2 >= 0 && P2 <= 3 && P1 >= 0 && P1 <= 3) || (2 * floord(P2 - 1, 2) + 1 == P2 && 2 * floord(P1 - 1, 2) + 1 == P1 && P2 >= 0 && P2 <= 3 && P1 >= 0 && P1 <= 3)) +if ((2 * floord(P2, 2) == P2 && 2 * floord(P1, 2) == P1 && P2 <= 3 && P2 >= 0 && P1 <= 3 && P1 >= 0) || (2 * floord(P2, 2) == P2 && 2 * floord(P1 - 1, 2) + 1 == P1 && P2 <= 3 && P2 >= 0 && P1 <= 3 && P1 >= 0) || (2 * floord(P2 - 1, 2) + 1 == P2 && 2 * floord(P1, 2) == P1 && P2 <= 3 && P2 >= 0 && P1 <= 3 && P1 >= 0) || (2 * floord(P2 - 1, 2) + 1 == P2 && 2 * floord(P1 - 1, 2) + 1 == P1 && P2 <= 3 && P2 >= 0 && P1 <= 3 && P1 >= 0)) for (int c0 = P1 - 1; c0 <= 3; c0 += 1) if ((2 * floord(c0, 2) == c0 && P2 % 2 == 0 && 2 * floord(P1 - 1, 2) + 1 == P1) || (2 * floord(c0, 2) == c0 && 2 * floord(P2 - 1, 2) + 1 == P2 && 2 * floord(P1 - 1, 2) + 1 == P1) || (2 * floord(c0 - 1, 2) + 1 == c0 && P2 % 2 == 0 && P1 % 2 == 0) || (2 * floord(c0 - 1, 2) + 1 == c0 && 2 * floord(P2 - 1, 2) + 1 == P2 && P1 % 2 == 0)) for (int c2 = 0; c2 <= -((P1 + 4) / 4) + 8; c2 += 1) - if ((-2 * ((-P2 + 4) / 4) + 2 * (P2 / 4) + 2 == P2 && 2 * floord(P2 - 1, 2) + 2 == P2 && P2 <= 6 && 18 * floord(9 * P1 + 17 * c0 + 14 * c2 + 3, 18) + 1 >= 9 * P1 + 17 * c0 + 14 * c2) || (2 * floord(P2 - 1, 2) + 1 == P2 && P2 + 1 >= 0 && 18 * floord(9 * P1 + 17 * c0 + 14 * c2 + 3, 18) + 1 >= 9 * P1 + 17 * c0 + 14 * c2 && (-P2 + 4) % 4 >= 1)) + if ((-2 * ((-P2 + 4) / 4) + 2 * (P2 / 4) + 2 == P2 && 2 * floord(P2 - 1, 2) + 2 == P2 && P2 <= 6 && 18 * floord(9 * P1 + 17 * c0 + 14 * c2 + 3, 18) + 1 >= 9 * P1 + 17 * c0 + 14 * c2) || (2 * floord(P2 - 1, 2) + 1 == P2 && 18 * floord(9 * P1 + 17 * c0 + 14 * c2 + 3, 18) + 1 >= 9 * P1 + 17 * c0 + 14 * c2 && P2 + 1 >= 0 && (-P2 + 4) % 4 >= 1)) for (int c3 = 0; c3 <= -((P2 + 4) / 4) + 8; c3 += 1) if ((5 * P2 + 2 * c3) % 9 <= 3 && 9 * ((4 * P2 + 3) / 9 / 2) + 7 >= 2 * P2 && 2 * P2 + 1 >= 9 * ((4 * P2 + 3) / 9 / 2)) if (c0 + 1 == P1 && (5 * P1 + 2 * c2) % 9 <= 2 && P1 >= 1) { diff --git a/test_inputs/codegen/omega/stride2-0.c b/test_inputs/codegen/omega/stride2-0.c index 0a7e8e74..c292b785 100644 --- a/test_inputs/codegen/omega/stride2-0.c +++ b/test_inputs/codegen/omega/stride2-0.c @@ -1,3 +1,3 @@ for (int c0 = 0; c0 <= n; c0 += 32) - for (int c1 = c0; c1 <= min(n, c0 + 31); c1 += 1) + for (int c1 = c0; c1 <= min(c0 + 31, n); c1 += 1) s0(c0, c1); diff --git a/test_inputs/codegen/omega/stride3-0.c b/test_inputs/codegen/omega/stride3-0.c index 8913c802..d3daa2af 100644 --- a/test_inputs/codegen/omega/stride3-0.c +++ b/test_inputs/codegen/omega/stride3-0.c @@ -1,3 +1,3 @@ for (int c0 = 3; c0 <= n; c0 += 32) - for (int c1 = c0; c1 <= min(n, c0 + 31); c1 += 1) + for (int c1 = c0; c1 <= min(c0 + 31, n); c1 += 1) s0(c0, c1); diff --git a/test_inputs/codegen/omega/stride5-0.c b/test_inputs/codegen/omega/stride5-0.c index 2eeeb5a7..dc67339e 100644 --- a/test_inputs/codegen/omega/stride5-0.c +++ b/test_inputs/codegen/omega/stride5-0.c @@ -1,3 +1,3 @@ -for (int c0 = 2; c0 <= min(100, -2 * n + 400); c0 += 2) +for (int c0 = 2; c0 <= min(-2 * n + 400, 100); c0 += 2) for (int c1 = 2 * n + c0; c1 <= 400; c1 += 2) s0(c0, c1); diff --git a/test_inputs/codegen/omega/syr2k-0.c b/test_inputs/codegen/omega/syr2k-0.c index 820bd57f..2c9b286c 100644 --- a/test_inputs/codegen/omega/syr2k-0.c +++ b/test_inputs/codegen/omega/syr2k-0.c @@ -1,4 +1,4 @@ for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) - for (int c1 = max(-n + 1, -b + 1); c1 <= min(b - c0, n - c0); c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) + for (int c1 = max(-b + 1, -n + 1); c1 <= min(n - c0, b - c0); c1 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n + c1, n); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff --git a/test_inputs/codegen/omega/syr2k-1.c b/test_inputs/codegen/omega/syr2k-1.c index fb20fb29..146b4e64 100644 --- a/test_inputs/codegen/omega/syr2k-1.c +++ b/test_inputs/codegen/omega/syr2k-1.c @@ -1,4 +1,4 @@ for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) for (int c1 = -b + 1; c1 <= b - c0; c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n, n + c1); c2 += 1) + for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff --git a/test_inputs/codegen/omega/syr2k-2.c b/test_inputs/codegen/omega/syr2k-2.c index 820bd57f..2c9b286c 100644 --- a/test_inputs/codegen/omega/syr2k-2.c +++ b/test_inputs/codegen/omega/syr2k-2.c @@ -1,4 +1,4 @@ for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) - for (int c1 = max(-n + 1, -b + 1); c1 <= min(b - c0, n - c0); c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) + for (int c1 = max(-b + 1, -n + 1); c1 <= min(n - c0, b - c0); c1 += 1) + for (int c2 = max(1, c0 + c1); c2 <= min(n + c1, n); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff --git a/test_inputs/codegen/omega/syr2k-3.c b/test_inputs/codegen/omega/syr2k-3.c index fb20fb29..146b4e64 100644 --- a/test_inputs/codegen/omega/syr2k-3.c +++ b/test_inputs/codegen/omega/syr2k-3.c @@ -1,4 +1,4 @@ for (int c0 = 1; c0 <= min(2 * b - 1, n); c0 += 1) for (int c1 = -b + 1; c1 <= b - c0; c1 += 1) - for (int c2 = max(c0 + c1, 1); c2 <= min(n, n + c1); c2 += 1) + for (int c2 = max(c0 + c1, 1); c2 <= min(n + c1, n); c2 += 1) s0(-c0 - c1 + c2 + 1, -c1 + c2, c2); diff --git a/test_inputs/codegen/omega/ts1d-check-sblock-0.c b/test_inputs/codegen/omega/ts1d-check-sblock-0.c index 46adf237..0a75c9ab 100644 --- a/test_inputs/codegen/omega/ts1d-check-sblock-0.c +++ b/test_inputs/codegen/omega/ts1d-check-sblock-0.c @@ -7,7 +7,7 @@ for (int c3 = 0; c3 < N; c3 += 1) s0(1, 0, 1, c3, 0); for (int c1 = 0; c1 <= floord(T - 1, 1000); c1 += 1) - for (int c2 = 1000 * c1 + 1; c2 <= min(N + 1000 * c1 + 997, N + T - 3); c2 += 1) - for (int c3 = max(-N - 1000 * c1 + c2 + 2, 0); c3 <= min(min(-1000 * c1 + c2 - 1, 999), T - 1000 * c1 - 1); c3 += 1) + for (int c2 = 1000 * c1 + 1; c2 <= min(N + T - 3, N + 1000 * c1 + 997); c2 += 1) + for (int c3 = max(-N - 1000 * c1 + c2 + 2, 0); c3 <= min(min(999, T - 1000 * c1 - 1), -1000 * c1 + c2 - 1); c3 += 1) s1(2, 1000 * c1 + c3, 1, -1000 * c1 + c2 - c3, 1); } diff --git a/test_inputs/codegen/omega/ts1d-check0-0.c b/test_inputs/codegen/omega/ts1d-check0-0.c index d252bdf9..436fcf6e 100644 --- a/test_inputs/codegen/omega/ts1d-check0-0.c +++ b/test_inputs/codegen/omega/ts1d-check0-0.c @@ -2,12 +2,12 @@ for (int c1 = 0; c1 < N; c1 += 1) s0(1, c1, 1, 0, 0); for (int c1 = 0; c1 <= floord(T - 1, 500); c1 += 1) - for (int c2 = 1000 * c1; c2 <= min(N + 1000 * c1 + 997, N + 2 * T - 3); c2 += 1) { - for (int c3 = max(0, -((N + c2) % 2) - N - 1000 * c1 + c2 + 2); c3 <= min(min(2 * T - 1000 * c1 - 2, 998), -1000 * c1 + c2 - 2); c3 += 2) { + for (int c2 = 1000 * c1; c2 <= min(N + 2 * T - 3, N + 1000 * c1 + 997); c2 += 1) { + for (int c3 = max(-((N + c2) % 2) - N - 1000 * c1 + c2 + 2, 0); c3 <= min(min(998, 2 * T - 1000 * c1 - 2), -1000 * c1 + c2 - 2); c3 += 2) { s1(2, 1000 * c1 + c3, 0, -1000 * c1 + c2 - c3, 1); s2(2, 1000 * c1 + c3 + 1, 0, -1000 * c1 + c2 - c3 - 1, 1); } - if (1000 * c1 + 999 >= c2 && 2 * T >= c2 + 1) + if (2 * T >= c2 + 1 && 1000 * c1 + 999 >= c2) s1(2, -(c2 % 2) + c2, 0, c2 % 2, 1); } } diff --git a/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c b/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c index 0cfc22a0..809649f4 100644 --- a/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c +++ b/test_inputs/codegen/omega/ts1d-mp-i_ts-m_b-0.c @@ -1,34 +1,34 @@ { for (int c1 = -1; c1 < (T >= 1 ? T : 0); c1 += 1) for (int c2 = 0; c2 < N; c2 += 1) - if (c2 == 0 && c1 >= 0 && T >= c1 + 1) { + if (c2 == 0 && T >= c1 + 1 && c1 >= 0) { s0(1, c1, 0, 0, 0); - } else if (c2 + 1 == N && c1 >= 0 && T >= c1 + 1) { + } else if (c2 + 1 == N && T >= c1 + 1 && c1 >= 0) { s0(1, c1, N - 1, 0, 0); - } else if (c1 + 1 == 0 && N >= c2 + 1 && c2 >= 0) + } else if (c1 + 1 == 0 && c2 >= 0 && N >= c2 + 1) s0(1, -1, c2, 0, 0); for (int c1 = 0; c1 <= floord(T - 1, 500); c1 += 1) { for (int c3 = -((c1 + 9) / 8) + 2; c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, 500 * c1 + 1); c4 <= min(min(1000 * c1 + 4000 * c3 - 3000, 2 * N - 4000 * c3 + 3995), N + T - 3); c4 += 1) - for (int c5 = max(-N - 500 * c1 + c4 + 2, 0); c5 <= min(min(T - 500 * c1 - 1, -500 * c1 + c4 - 1), -500 * c1 - 2000 * c3 + (c4 + 1) / 2 + 1999); c5 += 1) + for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, 500 * c1 + 1); c4 <= min(min(2 * N - 4000 * c3 + 3995, N + T - 3), 1000 * c1 + 4000 * c3 - 3000); c4 += 1) + for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(-500 * c1 + c4 - 1, -500 * c1 - 2000 * c3 + (c4 + 1) / 2 + 1999), T - 500 * c1 - 1); c5 += 1) s1(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); - for (int c3 = max(-((c1 + 9) / 8) + 2, -((T + 4000) / 4000) + 2); c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1) - for (int c4 = max(-4000 * c3 + 4000, 1000 * c1 + 4000 * c3 - 3999); c4 <= min(min(2 * N - 4000 * c3 + 3995, 1000 * c1 + 4000 * c3 - 3000), 2 * T + 4000 * c3 - 4000); c4 += 1) + for (int c3 = max(-((T + 4000) / 4000) + 2, -((c1 + 9) / 8) + 2); c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1) + for (int c4 = max(1000 * c1 + 4000 * c3 - 3999, -4000 * c3 + 4000); c4 <= min(min(2 * N - 4000 * c3 + 3995, 2 * T + 4000 * c3 - 4000), 1000 * c1 + 4000 * c3 - 3000); c4 += 1) s2(2, -2000 * c3 + (c4 + 1) / 2 + 1999, 1, 2000 * c3 + c4 - (c4 + 1) / 2 - 1999, 1); - for (int c3 = -((c1 + 7) / 8) + 1; c3 <= min(floord(N - 500 * c1 - 504, 4000) + 1, floord(N + T - 1000 * c1 - 1004, 4000) + 1); c3 += 1) + for (int c3 = -((c1 + 7) / 8) + 1; c3 <= min(floord(N + T - 1000 * c1 - 1004, 4000) + 1, floord(N - 500 * c1 - 504, 4000) + 1); c3 += 1) for (int c4 = max(1000 * c1 + 4000 * c3 - 2999, 500 * c1 + 1); c4 <= min(min(N + T - 3, N + 500 * c1 + 497), 1000 * c1 + 4000 * c3); c4 += 1) - for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(T - 500 * c1 - 1, -500 * c1 + c4 - 1), 499); c5 += 1) + for (int c5 = max(0, -N - 500 * c1 + c4 + 2); c5 <= min(min(-500 * c1 + c4 - 1, 499), T - 500 * c1 - 1); c5 += 1) s3(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); - for (int c3 = max(-((c1 + 9) / 8) + 1, -((T + 4000) / 4000) + 1); c3 <= floord(N - 500 * c1 - 3, 4000); c3 += 1) - for (int c4 = max(-4000 * c3, 1000 * c1 + 4000 * c3 + 1); c4 <= min(min(2 * N - 4000 * c3 - 5, 1000 * c1 + 4000 * c3 + 1000), 2 * T + 4000 * c3); c4 += 1) + for (int c3 = max(-((T + 4000) / 4000) + 1, -((c1 + 9) / 8) + 1); c3 <= floord(N - 500 * c1 - 3, 4000); c3 += 1) + for (int c4 = max(1000 * c1 + 4000 * c3 + 1, -4000 * c3); c4 <= min(min(2 * N - 4000 * c3 - 5, 2 * T + 4000 * c3), 1000 * c1 + 4000 * c3 + 1000); c4 += 1) s4(2, -2000 * c3 + (c4 + 1) / 2 - 1, 1, 2000 * c3 + c4 - (c4 + 1) / 2 + 1, 1); - for (int c3 = -((c1 + 8) / 8) + 1; c3 <= min(floord(N - 500 * c1 + 496, 4000), floord(N + T - 1000 * c1 - 4, 4000)); c3 += 1) - for (int c4 = max(1000 * c1 + 4000 * c3 + 1, -4000 * c3 + 2); c4 <= min(min(min(1000 * c1 + 4000 * c3 + 998, N + 500 * c1 + 497), 2 * T + 4000 * c3 - 2), N + T - 3); c4 += 1) - for (int c5 = max(-N - 500 * c1 + c4 + 2, -500 * c1 - 2000 * c3 + (c4 + 1) / 2); c5 <= min(min(T - 500 * c1 - 1, -500 * c1 + c4 - 1), 499); c5 += 1) + for (int c3 = -((c1 + 8) / 8) + 1; c3 <= min(floord(N + T - 1000 * c1 - 4, 4000), floord(N - 500 * c1 + 496, 4000)); c3 += 1) + for (int c4 = max(-4000 * c3 + 2, 1000 * c1 + 4000 * c3 + 1); c4 <= min(min(min(N + T - 3, N + 500 * c1 + 497), 2 * T + 4000 * c3 - 2), 1000 * c1 + 4000 * c3 + 998); c4 += 1) + for (int c5 = max(-500 * c1 - 2000 * c3 + (c4 + 1) / 2, -N - 500 * c1 + c4 + 2); c5 <= min(min(499, -500 * c1 + c4 - 1), T - 500 * c1 - 1); c5 += 1) s5(2, 500 * c1 + c5, 1, -500 * c1 + c4 - c5, 1); } if (T >= 1) for (int c3 = -((T + 3998) / 4000) + 1; c3 <= floord(N - T - 2, 4000) + 1; c3 += 1) - for (int c4 = max(2 * T + 4000 * c3 - 4001, T); c4 < min(2 * T + 4000 * c3 - 1, N + T - 2); c4 += 1) + for (int c4 = max(T, 2 * T + 4000 * c3 - 4001); c4 < min(N + T - 2, 2 * T + 4000 * c3 - 1); c4 += 1) s6(2, T - 1, 1, -T + c4 + 1, 1); } diff --git a/test_inputs/codegen/omega/wak1-0.c b/test_inputs/codegen/omega/wak1-0.c index 086c5619..0548b8aa 100644 --- a/test_inputs/codegen/omega/wak1-0.c +++ b/test_inputs/codegen/omega/wak1-0.c @@ -1,12 +1,12 @@ { - for (int c0 = a2; c0 <= min(min(a3 - 1, a1 - 1), b2); c0 += 1) + for (int c0 = a2; c0 <= min(min(b2, a3 - 1), a1 - 1); c0 += 1) s1(c0); - for (int c0 = a3; c0 <= min(a1 - 1, b3); c0 += 1) { + for (int c0 = a3; c0 <= min(b3, a1 - 1); c0 += 1) { if (c0 >= a2 && b2 >= c0) s1(c0); s2(c0); } - for (int c0 = max(max(b3 + 1, a3), a2); c0 <= min(a1 - 1, b2); c0 += 1) + for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(b2, a1 - 1); c0 += 1) s1(c0); for (int c0 = a1; c0 <= b1; c0 += 1) { s0(c0); @@ -15,13 +15,13 @@ if (b3 >= c0 && c0 >= a3) s2(c0); } - for (int c0 = max(max(b1 + 1, a1), a2); c0 <= min(a3 - 1, b2); c0 += 1) + for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(b2, a3 - 1); c0 += 1) s1(c0); - for (int c0 = max(max(b1 + 1, a1), a3); c0 <= b3; c0 += 1) { + for (int c0 = max(max(a1, b1 + 1), a3); c0 <= b3; c0 += 1) { if (c0 >= a2 && b2 >= c0) s1(c0); s2(c0); } - for (int c0 = max(max(max(max(b1 + 1, b3 + 1), a1), a3), a2); c0 <= b2; c0 += 1) + for (int c0 = max(max(max(max(a1, b1 + 1), a3), b3 + 1), a2); c0 <= b2; c0 += 1) s1(c0); } diff --git a/test_inputs/codegen/omega/wak1-1.c b/test_inputs/codegen/omega/wak1-1.c index 6314c44f..a925f613 100644 --- a/test_inputs/codegen/omega/wak1-1.c +++ b/test_inputs/codegen/omega/wak1-1.c @@ -1,13 +1,13 @@ { - for (int c0 = a3; c0 <= min(min(a2 - 1, a1 - 1), b3); c0 += 1) + for (int c0 = a3; c0 <= min(min(a2 - 1, b3), a1 - 1); c0 += 1) s2(c0); - for (int c0 = a2; c0 <= min(min(a3 - 1, a1 - 1), b2); c0 += 1) + for (int c0 = a2; c0 <= min(min(b2, a3 - 1), a1 - 1); c0 += 1) s1(c0); - for (int c0 = max(a3, a2); c0 <= min(min(a1 - 1, b2), b3); c0 += 1) { + for (int c0 = max(a3, a2); c0 <= min(min(b2, b3), a1 - 1); c0 += 1) { s1(c0); s2(c0); } - for (int c0 = max(max(b2 + 1, a3), a2); c0 <= min(a1 - 1, b3); c0 += 1) + for (int c0 = max(max(a3, a2), b2 + 1); c0 <= min(b3, a1 - 1); c0 += 1) s2(c0); for (int c0 = a1; c0 <= min(min(a2 - 1, a3 - 1), b1); c0 += 1) s0(c0); @@ -15,41 +15,41 @@ s0(c0); s2(c0); } - for (int c0 = max(max(b1 + 1, a1), a3); c0 <= min(a2 - 1, b3); c0 += 1) + for (int c0 = max(max(a1, b1 + 1), a3); c0 <= min(a2 - 1, b3); c0 += 1) s2(c0); - for (int c0 = max(a1, a2); c0 <= min(min(a3 - 1, b2), b1); c0 += 1) { + for (int c0 = max(a1, a2); c0 <= min(min(b2, a3 - 1), b1); c0 += 1) { s0(c0); s1(c0); } - for (int c0 = max(max(b1 + 1, a1), a2); c0 <= min(a3 - 1, b2); c0 += 1) + for (int c0 = max(max(a1, b1 + 1), a2); c0 <= min(b2, a3 - 1); c0 += 1) s1(c0); for (int c0 = max(max(a1, a3), a2); c0 <= min(min(b2, b3), b1); c0 += 1) { s0(c0); s1(c0); s2(c0); } - for (int c0 = max(max(max(b1 + 1, a1), a3), a2); c0 <= min(b2, b3); c0 += 1) { + for (int c0 = max(max(max(a1, b1 + 1), a3), a2); c0 <= min(b2, b3); c0 += 1) { s1(c0); s2(c0); } - for (int c0 = max(max(b2 + 1, a1), a2); c0 <= min(a3 - 1, b1); c0 += 1) + for (int c0 = max(max(a1, a2), b2 + 1); c0 <= min(a3 - 1, b1); c0 += 1) s0(c0); - for (int c0 = max(max(max(b2 + 1, a1), a3), a2); c0 <= min(b3, b1); c0 += 1) { + for (int c0 = max(max(max(a1, a3), a2), b2 + 1); c0 <= min(b3, b1); c0 += 1) { s0(c0); s2(c0); } - for (int c0 = max(max(max(max(b1 + 1, b2 + 1), a1), a3), a2); c0 <= b3; c0 += 1) + for (int c0 = max(max(max(max(a1, b1 + 1), a3), a2), b2 + 1); c0 <= b3; c0 += 1) s2(c0); - for (int c0 = max(max(b3 + 1, a3), a2); c0 <= min(a1 - 1, b2); c0 += 1) + for (int c0 = max(max(a3, b3 + 1), a2); c0 <= min(b2, a1 - 1); c0 += 1) s1(c0); - for (int c0 = max(max(b3 + 1, a1), a3); c0 <= min(a2 - 1, b1); c0 += 1) + for (int c0 = max(max(a1, a3), b3 + 1); c0 <= min(a2 - 1, b1); c0 += 1) s0(c0); - for (int c0 = max(max(max(b3 + 1, a1), a3), a2); c0 <= min(b2, b1); c0 += 1) { + for (int c0 = max(max(max(a1, a3), b3 + 1), a2); c0 <= min(b2, b1); c0 += 1) { s0(c0); s1(c0); } - for (int c0 = max(max(max(max(b1 + 1, b3 + 1), a1), a3), a2); c0 <= b2; c0 += 1) + for (int c0 = max(max(max(max(a1, b1 + 1), a3), b3 + 1), a2); c0 <= b2; c0 += 1) s1(c0); - for (int c0 = max(max(max(max(b3 + 1, b2 + 1), a1), a3), a2); c0 <= b1; c0 += 1) + for (int c0 = max(max(max(max(a1, a3), b3 + 1), a2), b2 + 1); c0 <= b1; c0 += 1) s0(c0); } diff --git a/test_inputs/codegen/omega/wak2-0.c b/test_inputs/codegen/omega/wak2-0.c index e64b4ef3..6c968d0a 100644 --- a/test_inputs/codegen/omega/wak2-0.c +++ b/test_inputs/codegen/omega/wak2-0.c @@ -17,10 +17,10 @@ s1(c0, c1_0); } if (c0 >= a1 && b1 >= c0) - for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1) + for (int c1_0 = max(d2 + 1, c1); c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } - for (int c0 = max(max(b2 + 1, a1), a2); c0 <= b1; c0 += 1) + for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } diff --git a/test_inputs/codegen/omega/wak2-1.c b/test_inputs/codegen/omega/wak2-1.c index f536cd75..a689e348 100644 --- a/test_inputs/codegen/omega/wak2-1.c +++ b/test_inputs/codegen/omega/wak2-1.c @@ -17,18 +17,18 @@ } else { for (int c1_0 = c1; c1_0 <= min(c2 - 1, d1); c1_0 += 1) s0(c0, c1_0); - for (int c1_0 = c2; c1_0 <= min(c1 - 1, d2); c1_0 += 1) + for (int c1_0 = c2; c1_0 <= min(d2, c1 - 1); c1_0 += 1) s1(c0, c1_0); for (int c1_0 = max(c2, c1); c1_0 <= min(d1, d2); c1_0 += 1) { s0(c0, c1_0); s1(c0, c1_0); } - for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1) + for (int c1_0 = max(d2 + 1, c1); c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); - for (int c1_0 = max(max(c1, d1 + 1), c2); c1_0 <= d2; c1_0 += 1) + for (int c1_0 = max(max(d1 + 1, c1), c2); c1_0 <= d2; c1_0 += 1) s1(c0, c1_0); } - for (int c0 = max(max(b2 + 1, a1), a2); c0 <= b1; c0 += 1) + for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1) for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1) s0(c0, c1_0); } diff --git a/test_inputs/codegen/omega/x-0.c b/test_inputs/codegen/omega/x-0.c index e009577e..820f71c2 100644 --- a/test_inputs/codegen/omega/x-0.c +++ b/test_inputs/codegen/omega/x-0.c @@ -1,14 +1,14 @@ for (int c0 = 1; c0 <= 11; c0 += 1) { - for (int c1 = max(-c0 + 9, 1); c1 <= min(c0 - 4, -c0 + 12); c1 += 1) + for (int c1 = max(1, -c0 + 9); c1 <= min(-c0 + 12, c0 - 4); c1 += 1) s0(c1, c0 + c1 - 8); - for (int c1 = max(1, c0 - 3); c1 <= min(c0, -c0 + 8); c1 += 1) + for (int c1 = max(c0 - 3, 1); c1 <= min(-c0 + 8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(-c0 + 9, c0 - 3); c1 <= min(c0, -c0 + 12); c1 += 1) { + for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(-c0 + 12, c0); c1 += 1) { s0(c1, c0 + c1 - 8); s1(c1, c0 - c1 + 1); } - for (int c1 = max(-c0 + 13, c0 - 3); c1 <= min(c0, 8); c1 += 1) + for (int c1 = max(c0 - 3, -c0 + 13); c1 <= min(8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(-c0 + 9, c0 + 1); c1 <= min(-c0 + 12, 8); c1 += 1) + for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(-c0 + 12, 8); c1 += 1) s0(c1, c0 + c1 - 8); } diff --git a/test_inputs/codegen/omega/x-1.c b/test_inputs/codegen/omega/x-1.c index e009577e..820f71c2 100644 --- a/test_inputs/codegen/omega/x-1.c +++ b/test_inputs/codegen/omega/x-1.c @@ -1,14 +1,14 @@ for (int c0 = 1; c0 <= 11; c0 += 1) { - for (int c1 = max(-c0 + 9, 1); c1 <= min(c0 - 4, -c0 + 12); c1 += 1) + for (int c1 = max(1, -c0 + 9); c1 <= min(-c0 + 12, c0 - 4); c1 += 1) s0(c1, c0 + c1 - 8); - for (int c1 = max(1, c0 - 3); c1 <= min(c0, -c0 + 8); c1 += 1) + for (int c1 = max(c0 - 3, 1); c1 <= min(-c0 + 8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(-c0 + 9, c0 - 3); c1 <= min(c0, -c0 + 12); c1 += 1) { + for (int c1 = max(c0 - 3, -c0 + 9); c1 <= min(-c0 + 12, c0); c1 += 1) { s0(c1, c0 + c1 - 8); s1(c1, c0 - c1 + 1); } - for (int c1 = max(-c0 + 13, c0 - 3); c1 <= min(c0, 8); c1 += 1) + for (int c1 = max(c0 - 3, -c0 + 13); c1 <= min(8, c0); c1 += 1) s1(c1, c0 - c1 + 1); - for (int c1 = max(-c0 + 9, c0 + 1); c1 <= min(-c0 + 12, 8); c1 += 1) + for (int c1 = max(c0 + 1, -c0 + 9); c1 <= min(-c0 + 12, 8); c1 += 1) s0(c1, c0 + c1 - 8); } diff --git a/test_inputs/codegen/separation_class.c b/test_inputs/codegen/separation_class.c index 836f8b6c..1a1810c8 100644 --- a/test_inputs/codegen/separation_class.c +++ b/test_inputs/codegen/separation_class.c @@ -5,13 +5,13 @@ for (int c3 = 10 * c1; c3 <= 10 * c1 + 9; c3 += 1) A(c2, c3); for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) - for (int c2 = 10 * c0; c2 <= min(-10 * c1 + 100, 10 * c0 + 9); c2 += 1) - for (int c3 = 10 * c1; c3 <= min(-c2 + 100, 10 * c1 + 9); c3 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) A(c2, c3); } for (int c0 = 9; c0 <= 10; c0 += 1) for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) - for (int c2 = 10 * c0; c2 <= min(-10 * c1 + 100, 10 * c0 + 9); c2 += 1) - for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(-c2 + 100, 10 * c1 + 9); c3 += 1) A(c2, c3); } diff --git a/test_inputs/codegen/separation_class2.c b/test_inputs/codegen/separation_class2.c index 2bddda28..3ea48aff 100644 --- a/test_inputs/codegen/separation_class2.c +++ b/test_inputs/codegen/separation_class2.c @@ -10,6 +10,6 @@ } for (int c1 = 0; c1 < n; c1 += 8) for (int c2 = 0; c2 < n % 8; c2 += 1) - for (int c3 = 0; c3 <= min(n - c1 - 1, 7); c3 += 1) + for (int c3 = 0; c3 <= min(7, n - c1 - 1); c3 += 1) A(-((n - 1) % 8) + n + c2 - 1, c1 + c3); } diff --git a/test_inputs/codegen/separation_class3.c b/test_inputs/codegen/separation_class3.c index 14f722ac..136cd07a 100644 --- a/test_inputs/codegen/separation_class3.c +++ b/test_inputs/codegen/separation_class3.c @@ -1,19 +1,20 @@ for (int c0 = 0; c0 <= 4; c0 += 1) { - if (c0 >= 1) { + if (c0 == 0) { + S_0(0, 4); + } else { S_0(2 * c0 - 1, 1); - if (c0 == 4) + if (c0 == 4) { for (int c6 = 3; c6 <= 5; c6 += 1) S_0(7, c6); - if (c0 <= 3) + } else for (int c4 = 2 * c0 - 1; c4 <= 2 * c0; c4 += 1) for (int c6 = -2 * c0 + c4 + 4; c6 <= 2 * c0 - c4 + 4; c6 += 1) S_0(c4, c6); - } else - S_0(0, 4); - for (int c4 = max(0, 2 * c0 - 1); c4 <= min(2 * c0, 7); c4 += 1) + } + for (int c4 = max(2 * c0 - 1, 0); c4 <= min(7, 2 * c0); c4 += 1) for (int c6 = -2 * c0 + c4 + 8; c6 <= 8; c6 += 1) S_0(c4, c6); - if (c0 >= 1 && c0 <= 3) { + if (c0 <= 3 && c0 >= 1) { for (int c2 = 0; c2 <= 1; c2 += 1) for (int c4 = 2 * c0 - 1; c4 <= 2 * c0; c4 += 1) for (int c6 = 2 * c0 + 4 * c2 - c4 + 1; c6 <= -2 * c0 + 4 * c2 + c4 + 3; c6 += 1) diff --git a/test_inputs/codegen/single_valued.c b/test_inputs/codegen/single_valued.c index aab48548..c09a7efe 100644 --- a/test_inputs/codegen/single_valued.c +++ b/test_inputs/codegen/single_valued.c @@ -1,2 +1,2 @@ -if ((2 * (63 * t1 % 64) + t1 <= 134 && t1 >= 2) || t1 == 1) +if (2 * (63 * t1 % 64) + t1 <= 134) S(2 * (63 * t1 % 64) + t1);