From a6f371ad8ebf40abfbf444ac270774741a9580f9 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 27 Jan 2011 20:01:28 +0100 Subject: [PATCH] isl_dim_move: update parameters of nested spaces Signed-off-by: Sven Verdoolaege --- isl_dim.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/isl_dim.c b/isl_dim.c index 2ada2e1..2d19663 100644 --- a/isl_dim.c +++ b/isl_dim.c @@ -576,6 +576,8 @@ __isl_give isl_dim *isl_dim_move(__isl_take isl_dim *dim, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n) { + int i; + if (!dim) return NULL; if (n == 0) @@ -647,6 +649,18 @@ __isl_give isl_dim *isl_dim_move(__isl_take isl_dim *dim, case isl_dim_out: dim->n_out -= n; break; } + if (dst_type != isl_dim_param && src_type != isl_dim_param) + return dim; + + for (i = 0; i < 2; ++i) { + if (!dim->nested[i]) + continue; + dim->nested[i] = isl_dim_replace(dim->nested[i], + isl_dim_param, dim); + if (!dim->nested[i]) + goto error; + } + return dim; error: isl_dim_free(dim); -- 2.7.4