From bb4d183e345c3c688defbc9bc6a5bf5cf43a88f2 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 21 Feb 2015 19:33:47 +0100 Subject: [PATCH] isl_local_space_substitute_seq: honor argument for the number of divs to modify An argument for specifying the number of divs to modify was introduced in 4a107ab (isl_local_space_substitute_seq: take argument for the number of divs to modify, Sat Sep 29 19:45:57 2012 +0200), but it was not actually taken into account, resulting in breakage as soon as this argument was effectively used in ad90fe4 (isl_aff_normalize: plug in divs with unit coefficient in other divs, Sat Sep 29 20:11:32 2012 +0200). Signed-off-by: Sven Verdoolaege --- isl_local_space.c | 2 +- isl_test.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/isl_local_space.c b/isl_local_space.c index 76226cfc..983cfe89 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -896,7 +896,7 @@ __isl_give isl_local_space *isl_local_space_substitute_seq( pos += isl_local_space_offset(ls, type); isl_int_init(v); - for (i = first; i < ls->div->n_row; ++i) { + for (i = first; i < first + n; ++i) { if (isl_int_is_zero(ls->div->row[i][1 + pos])) continue; isl_seq_substitute(ls->div->row[i], pos, subs, diff --git a/isl_test.c b/isl_test.c index 2e78ff7d..1e15e26f 100644 --- a/isl_test.c +++ b/isl_test.c @@ -4334,6 +4334,9 @@ struct { { "{ B[i] -> C[([i/2])] }", "{ B[5] }", "{ C[2] }" }, { "[n] -> { B[i,j] -> C[([i/2]) + 2j] }", "[n] -> { B[n,[n/3]] }", "[n] -> { C[([n/2]) + 2*[n/3]] }", }, + { "{ [i, j] -> [floor((i)/4) + floor((2*i+j)/5)] }", + "{ [i, j] -> [floor((i)/3), j] }", + "{ [i, j] -> [(floor((i)/12) + floor((j + 2*floor((i)/3))/5))] }" }, }; static int test_pullback(isl_ctx *ctx) -- 2.11.4.GIT