Polly 20.0.0git
isl_pw_move_dims_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 INRIA Saclay
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8 * 91893 Orsay, France
9 */
10
12 enum isl_dim_type dst_type, unsigned dst_pos,
13 enum isl_dim_type src_type, unsigned src_pos, unsigned n)
14{
15 int i;
16 isl_size n_piece;
17 isl_space *space;
18
19 space = FN(PW,take_space)(pw);
20 space = isl_space_move_dims(space, dst_type, dst_pos,
21 src_type, src_pos, n);
22 pw = FN(PW,restore_space)(pw, space);
23
24 n_piece = FN(PW,n_piece)(pw);
25 if (n_piece < 0)
26 return FN(PW,free)(pw);
27
28 for (i = 0; i < n_piece; ++i) {
29 EL *el;
30
31 el = FN(PW,take_base_at)(pw, i);
32 el = FN(EL,move_dims)(el,
33 dst_type, dst_pos, src_type, src_pos, n);
34 pw = FN(PW,restore_base_at)(pw, i, el);
35 }
36
37 if (dst_type == isl_dim_in)
38 dst_type = isl_dim_set;
39 if (src_type == isl_dim_in)
40 src_type = isl_dim_set;
41
42 for (i = 0; i < n_piece; ++i) {
44
45 domain = FN(PW,take_domain_at)(pw, i);
46 domain = isl_set_move_dims(domain, dst_type, dst_pos,
47 src_type, src_pos, n);
48 pw = FN(PW,restore_domain_at)(pw, i, domain);
49 }
50
51 return pw;
52}
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
int isl_size
Definition: ctx.h:96
#define PW
Definition: isl_aff.c:4582
#define EL
static __isl_give isl_qpolynomial * move_dims(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:1719
struct isl_set isl_set
Definition: map_type.h:26
__isl_give isl_set * isl_set_move_dims(__isl_take isl_set *set, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n)
Definition: isl_map.c:4321
__isl_give isl_space * isl_space_move_dims(__isl_take isl_space *space, enum isl_dim_type dst_type, unsigned dst_pos, enum isl_dim_type src_type, unsigned src_pos, unsigned n)
Definition: isl_space.c:1389
isl_dim_type
Definition: space_type.h:13
@ isl_dim_in
Definition: space_type.h:16
@ isl_dim_set
Definition: space_type.h:18
static Signature domain
n
Definition: youcefn.c:8