Polly 20.0.0git
isl_pw_lift_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
11#include <isl_pw_macro.h>
12
14 __isl_take EL *el,
16 void *user), void *user)
17{
18 int i;
19
20 if (!set || !el)
21 goto error;
22
23 for (i = 0; i < set->n; ++i) {
25 EL *copy;
26
29
30 copy = FN(EL,copy)(el);
31 copy = FN(EL,lift)(copy, isl_set_get_space(lift));
32
33 if (fn(lift, copy, user) < 0)
34 goto error;
35 }
36
38 FN(EL,free)(el);
39
40 return isl_stat_ok;
41error:
43 FN(EL,free)(el);
44 return isl_stat_error;
45}
46
47isl_stat FN(PW,foreach_lifted_piece)(__isl_keep PW *pw,
49 void *user), void *user)
50{
51 int i;
52
53 if (!pw)
54 return isl_stat_error;
55
56 for (i = 0; i < pw->n; ++i) {
58 isl_set *set;
59 EL *el;
60
61 any = isl_set_involves_locals(pw->p[i].set);
62 if (any < 0)
63 return isl_stat_error;
64 set = isl_set_copy(pw->p[i].set);
65 el = FN(EL,copy)(pw->p[i].FIELD);
66 if (!any) {
67 if (fn(set, el, user) < 0)
68 return isl_stat_error;
69 continue;
70 }
71 if (foreach_lifted_subset(set, el, fn, user) < 0)
72 return isl_stat_error;
73 }
74
75 return isl_stat_ok;
76}
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
isl_stat
Definition: ctx.h:84
@ isl_stat_error
Definition: ctx.h:85
@ isl_stat_ok
Definition: ctx.h:86
#define __isl_keep
Definition: ctx.h:25
isl_bool
Definition: ctx.h:89
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
Definition: hmap.h:37
isl_stat isl_stat(*) void user)
Definition: hmap.h:39
#define PW
Definition: isl_aff.c:4582
#define EL
static __isl_give isl_qpolynomial * lift(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:1660
static isl_stat foreach_lifted_subset(__isl_take isl_set *set, __isl_take EL *el, isl_stat(*fn)(__isl_take isl_set *set, __isl_take EL *el, void *user), void *user)
const char * set
Definition: isl_test.c:1356
struct isl_set isl_set
Definition: map_type.h:26
static bool any(const std::vector< bool > &vector)
Definition: python.cc:576
__isl_give isl_set * isl_set_lift(__isl_take isl_set *set)
Definition: isl_map.c:11364
__isl_export __isl_give isl_space * isl_set_get_space(__isl_keep isl_set *set)
Definition: isl_map.c:603
__isl_null isl_set * isl_set_free(__isl_take isl_set *set)
Definition: isl_map.c:3513
__isl_give isl_set * isl_set_copy(__isl_keep isl_set *set)
Definition: isl_map.c:1470
__isl_constructor __isl_give isl_set * isl_set_from_basic_set(__isl_take isl_basic_set *bset)
Definition: isl_map.c:3482
__isl_give isl_basic_set * isl_basic_set_copy(__isl_keep isl_basic_set *bset)
Definition: isl_map.c:1465
__isl_export isl_bool isl_set_involves_locals(__isl_keep isl_set *set)
Definition: isl_map.c:3014