add isl_local_space_range
authorTobias Grosser <tobias@grosser.es>
Thu, 1 Dec 2011 14:15:44 +0000 (15:15 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 2 Dec 2011 15:41:37 +0000 (16:41 +0100)
Signed-off-by: Tobias Grosser <tobias@grosser.es>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/local_space.h
isl_local_space.c

index 3502045..6a7ca93 100644 (file)
@@ -783,6 +783,8 @@ using the following functions.
 
        __isl_give isl_local_space *isl_local_space_domain(
                __isl_take isl_local_space *ls);
+       __isl_give isl_local_space *isl_local_space_range(
+               __isl_take isl_local_space *ls);
        __isl_give isl_local_space *isl_local_space_from_domain(
                __isl_take isl_local_space *ls);
        __isl_give isl_local_space *isl_local_space_intersect(
index 7f73e0b..1f6108d 100644 (file)
@@ -39,6 +39,8 @@ __isl_give isl_aff *isl_local_space_get_div(__isl_keep isl_local_space *ls,
 
 __isl_give isl_local_space *isl_local_space_domain(
        __isl_take isl_local_space *ls);
+__isl_give isl_local_space *isl_local_space_range(
+       __isl_take isl_local_space *ls);
 __isl_give isl_local_space *isl_local_space_from_domain(
        __isl_take isl_local_space *ls);
 __isl_give isl_local_space *isl_local_space_add_dims(
index 8a27e81..a57fff1 100644 (file)
@@ -532,6 +532,21 @@ __isl_give isl_local_space *isl_local_space_domain(
        return ls;
 }
 
+__isl_give isl_local_space *isl_local_space_range(
+       __isl_take isl_local_space *ls)
+{
+       ls = isl_local_space_drop_dims(ls, isl_dim_in,
+                                       0, isl_local_space_dim(ls, isl_dim_in));
+       ls = isl_local_space_cow(ls);
+       if (!ls)
+               return NULL;
+
+       ls->dim = isl_space_range(ls->dim);
+       if (!ls->dim)
+               return isl_local_space_free(ls);
+       return ls;
+}
+
 /* Construct a local space for a map that has the given local
  * space as domain and that has a zero-dimensional range.
  */