From d9de9dbb39bd36188d31b85f760fa694dc722e91 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 5 Oct 2009 23:23:59 +0200 Subject: [PATCH] cloog_domain_stride: handle union domains CLooG normally separates all domains into disjoint convex sets, but cloog_domain_stride is called on domains that have not been separated yet. This commit adds support for union domains in cloog_domain_stride. In the case of the PolyLib backend, we simply give up if we are handed a union domain. It's not worth it to provide a proper implementation for the PolyLib backend. Signed-off-by: Sven Verdoolaege --- source/isl/domain.c | 4 +--- source/polylib/domain.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/isl/domain.c b/source/isl/domain.c index 5ab6cfd..58b1db4 100644 --- a/source/isl/domain.c +++ b/source/isl/domain.c @@ -597,9 +597,7 @@ void cloog_domain_stride(CloogDomain *domain, int strided_level, cloog_int_t *stride, cloog_int_t *offset) { struct isl_set *set = &domain->set; - assert(set->n == 1); - isl_basic_set_dim_residue_class(set->p[0], strided_level - 1, - stride, offset); + isl_set_dim_residue_class(set, strided_level - 1, stride, offset); if (!isl_int_is_zero(*offset)) isl_int_sub(*offset, *stride, *offset); return; diff --git a/source/polylib/domain.c b/source/polylib/domain.c index 6a14070..d060448 100644 --- a/source/polylib/domain.c +++ b/source/polylib/domain.c @@ -1130,6 +1130,12 @@ void cloog_domain_stride(CloogDomain *domain, int strided_level, polyhedron = domain->polyhedron ; dimension = polyhedron->Dimension ; + if (polyhedron->next) { + value_set_si(*offset, 0); + value_set_si(*stride, 1); + return; + } + /* Look at all equalities involving strided_level and the inner * iterators. We can ignore the outer iterators and the parameters * here because the lower bound on strided_level is assumed to -- 2.11.4.GIT