isl_stream_read_map: allow anonymous unconstrained dimensions
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 15 Dec 2012 13:44:55 +0000 (15 14:44 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 15 Dec 2012 13:44:55 +0000 (15 14:44 +0100)
In particular, allow a '*' in tuples to represent such anonymous
unconstrained dimensions.  The same syntax is used by Omega.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_input.c
isl_test.c

index f0c3d7c..b032bf1 100644 (file)
@@ -941,7 +941,11 @@ static __isl_give isl_multi_pw_aff *read_tuple_var_list(struct isl_stream *s,
                        new_name = p >= n;
                }
 
-               if (new_name) {
+               if (tok->type == '*') {
+                       if (vars_add_anon(v) < 0)
+                               goto error;
+                       isl_token_free(tok);
+               } else if (new_name) {
                        res = tuple_set_dim_name(res, i, v->v->name);
                        isl_token_free(tok);
                        if (isl_stream_eat_if_available(s, '='))
index f0aee84..f59db99 100644 (file)
@@ -205,6 +205,9 @@ int test_parse(struct isl_ctx *ctx)
                                      "[n] -> { [i] : i <= n }") < 0)
                return -1;
 
+       if (test_parse_map_equal(ctx, "{ [*] }", "{ [a] }") < 0)
+               return -1;
+
        return 0;
 }