Polly 20.0.0git
isl_multi_no_domain_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2013 Ecole Normale Superieure
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
9
10#include <isl/space.h>
11#include <isl/local_space.h>
12#include <isl_reordering.h>
13
14#include <isl_multi_macro.h>
15
16/* The functions in this file are meant for base object types
17 * that do not have any associated space. They are only meant to be used
18 * in the generic isl_multi_* functions which have to deal with base objects
19 * that do have an associated space.
20 */
21
22
23/* Drop the "n" first dimensions of type "type" at position "first".
24 *
25 * For a base expression without an associated space, this function
26 * does not do anything.
27 */
29 enum isl_dim_type type, unsigned first, unsigned n)
30{
31 return el;
32}
33
34/* Return the space of "el".
35 *
36 * For a base expression without an associated space,
37 * the conditions surrounding the call to this function make sure
38 * that this function will never actually get called. We return a valid
39 * space anyway, just in case.
40 */
41static __isl_give isl_space *FN(EL,get_space)(__isl_keep EL *el)
42{
43 if (!el)
44 return NULL;
45
46 return isl_space_params_alloc(FN(EL,get_ctx)(el), 0);
47}
48
49/* Reset the domain space of "el" to "space".
50 *
51 * For a base expression without an associated space, this function
52 * does not do anything, apart from error handling and cleaning up memory.
53 */
55 __isl_take isl_space *space)
56{
57 if (!space)
58 return FN(EL,free)(el);
59 isl_space_free(space);
60 return el;
61}
62
63/* Align the parameters of "el" to those of "space".
64 *
65 * For a base expression without an associated space, this function
66 * does not do anything, apart from error handling and cleaning up memory.
67 * Note that the conditions surrounding the call to this function make sure
68 * that this function will never actually get called.
69 */
71 __isl_take isl_space *space)
72{
73 if (!space)
74 return FN(EL,free)(el);
75 isl_space_free(space);
76 return el;
77}
78
79/* Reorder the dimensions of the domain of "el" according
80 * to the given reordering.
81 *
82 * For a base expression without an associated space, this function
83 * does not do anything, apart from error handling and cleaning up memory.
84 */
87{
88 if (!r)
89 return FN(EL,free)(el);
91 return el;
92}
93
94/* Do the parameters of "el" match those of "space"?
95 *
96 * For a base expression without an associated space, this function
97 * simply returns true, except if "el" or "space" are NULL.
98 */
99static isl_bool FN(EL,matching_params)(__isl_keep EL *el,
100 __isl_keep isl_space *space)
101{
102 if (!el || !space)
103 return isl_bool_error;
104 return isl_bool_true;
105}
106
107/* Check that the domain space of "el" matches "space".
108 *
109 * For a base expression without an associated space, this function
110 * simply returns isl_stat_ok, except if "el" or "space" are NULL.
111 */
112static isl_stat FN(EL,check_match_domain_space)(__isl_keep EL *el,
113 __isl_keep isl_space *space)
114{
115 if (!el || !space)
116 return isl_stat_error;
117 return isl_stat_ok;
118}
#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_give
Definition: ctx.h:19
#define __isl_keep
Definition: ctx.h:25
isl_bool
Definition: ctx.h:89
@ isl_bool_true
Definition: ctx.h:92
@ isl_bool_error
Definition: ctx.h:90
#define EL
static __isl_give isl_qpolynomial * reset_domain_space(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:232
static __isl_give isl_qpolynomial * realign_domain(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:2027
static __isl_give isl_qpolynomial * drop_dims(__isl_take isl_qpolynomial *qp, void *user)
Definition: isl_fold.c:373
__isl_null isl_reordering * isl_reordering_free(__isl_take isl_reordering *exp)
static __isl_give isl_schedule_node * align_params(__isl_take isl_schedule_node *node, void *user)
Definition: isl_schedule.c:311
enum isl_fold type
Definition: isl_test.c:4017
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
Definition: isl_space.c:445
__isl_give isl_space * isl_space_params_alloc(isl_ctx *ctx, unsigned nparam)
Definition: isl_space.c:195
isl_dim_type
Definition: space_type.h:13
n
Definition: youcefn.c:8