Polly 20.0.0git
isl_multi_union_pw_aff_explicit_domain.c
Go to the documentation of this file.
1/*
2 * Copyright 2017 Sven Verdoolaege
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege.
7 */
8
9/* Initialize the explicit domain of "mupa".
10 *
11 * The explicit domain is initialized to a universe parameter set.
12 * It may later be specialized with constraints on the parameter or
13 * specific domain instances.
14 */
18{
19 isl_space *space;
20
21 if (isl_multi_union_pw_aff_check_has_explicit_domain(mupa) < 0)
22 return isl_multi_union_pw_aff_free(mupa);
23 space = isl_space_params(isl_multi_union_pw_aff_get_space(mupa));
25 if (!mupa->u.dom)
26 return isl_multi_union_pw_aff_free(mupa);
27 return mupa;
28}
29
30/* Drop the "n" dimensions of type "type" starting at position "pos"
31 * of the explicit domain of "mupa".
32 */
36 enum isl_dim_type type, unsigned pos, unsigned n)
37{
38 if (isl_multi_union_pw_aff_check_has_explicit_domain(mupa) < 0)
39 return isl_multi_union_pw_aff_free(mupa);
40 if (type != isl_dim_param)
41 isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid,
42 "can only drop parameters",
43 return isl_multi_union_pw_aff_free(mupa));
44 mupa = isl_multi_union_pw_aff_cow(mupa);
45 if (!mupa)
46 return NULL;
47 mupa->u.dom = isl_union_set_project_out(mupa->u.dom, type, pos, n);
48 if (!mupa->u.dom)
49 return isl_multi_union_pw_aff_free(mupa);
50 return mupa;
51}
struct isl_multi_union_pw_aff isl_multi_union_pw_aff
Definition: aff_type.h:46
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
#define isl_die(ctx, errno, msg, code)
Definition: ctx.h:137
@ isl_error_invalid
Definition: ctx.h:80
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_map.c:70
static __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_drop_explicit_domain_dims(__isl_take isl_multi_union_pw_aff *mupa, enum isl_dim_type type, unsigned pos, unsigned n)
static __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_init_explicit_domain(__isl_take isl_multi_union_pw_aff *mupa)
enum isl_fold type
Definition: isl_test.c:4017
const char * mupa
Definition: isl_test.c:7365
__isl_export __isl_give isl_set * isl_set_universe(__isl_take isl_space *space)
Definition: isl_map.c:6366
__isl_export __isl_give isl_space * isl_space_params(__isl_take isl_space *space)
Definition: isl_space.c:2211
isl_dim_type
Definition: space_type.h:13
@ isl_dim_param
Definition: space_type.h:15
__isl_give isl_union_set * isl_union_set_project_out(__isl_take isl_union_set *uset, enum isl_dim_type type, unsigned first, unsigned n)
__isl_constructor __isl_give isl_union_set * isl_union_set_from_set(__isl_take isl_set *set)
n
Definition: youcefn.c:8