Coverage Report

Created: 2017-11-23 03:11

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/lib/External/isl/isl_multi_templ.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2011      Sven Verdoolaege
3
 * Copyright 2012-2013 Ecole Normale Superieure
4
 *
5
 * Use of this software is governed by the MIT license
6
 *
7
 * Written by Sven Verdoolaege,
8
 * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France
9
 */
10
11
#include <isl_space_private.h>
12
#include <isl/set.h>
13
#include <isl_reordering.h>
14
15
#include <isl_multi_macro.h>
16
17
#define MULTI_NAME(BASE) "isl_multi_" #BASE
18
#define xLIST(EL) EL ## _list
19
#define LIST(EL) xLIST(EL)
20
21
isl_ctx *FN(MULTI(BASE),get_ctx)(__isl_keep MULTI(BASE) *multi)
22
88.4k
{
23
88.4k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
88.4k
}
isl_multi_aff_get_ctx
Line
Count
Source
22
35.6k
{
23
35.6k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
35.6k
}
isl_multi_pw_aff_get_ctx
Line
Count
Source
22
19.1k
{
23
19.1k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
19.1k
}
isl_multi_union_pw_aff_get_ctx
Line
Count
Source
22
25.1k
{
23
25.1k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
25.1k
}
isl_multi_val_get_ctx
Line
Count
Source
22
8.50k
{
23
8.50k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
8.50k
}
25
26
__isl_give isl_space *FN(MULTI(BASE),get_space)(__isl_keep MULTI(BASE) *multi)
27
1.23M
{
28
1.23M
  return multi ? isl_space_copy(multi->space) : NULL;
29
1.23M
}
isl_multi_aff_get_space
Line
Count
Source
27
1.15M
{
28
1.15M
  return multi ? isl_space_copy(multi->space) : NULL;
29
1.15M
}
isl_multi_pw_aff_get_space
Line
Count
Source
27
35.6k
{
28
35.6k
  return multi ? isl_space_copy(multi->space) : NULL;
29
35.6k
}
isl_multi_union_pw_aff_get_space
Line
Count
Source
27
25.7k
{
28
25.7k
  return multi ? isl_space_copy(multi->space) : NULL;
29
25.7k
}
isl_multi_val_get_space
Line
Count
Source
27
17.8k
{
28
17.8k
  return multi ? isl_space_copy(multi->space) : NULL;
29
17.8k
}
30
31
/* Return the position of the dimension of the given type and name
32
 * in "multi".
33
 * Return -1 if no such dimension can be found.
34
 */
35
int FN(MULTI(BASE),find_dim_by_name)(__isl_keep MULTI(BASE) *multi,
36
  enum isl_dim_type type, const char *name)
37
0
{
38
0
  if (!multi)
39
0
    return -1;
40
0
  return isl_space_find_dim_by_name(multi->space, type, name);
41
0
}
Unexecuted instantiation: isl_multi_aff_find_dim_by_name
Unexecuted instantiation: isl_multi_pw_aff_find_dim_by_name
Unexecuted instantiation: isl_multi_union_pw_aff_find_dim_by_name
Unexecuted instantiation: isl_multi_val_find_dim_by_name
42
43
__isl_give isl_space *FN(MULTI(BASE),get_domain_space)(
44
  __isl_keep MULTI(BASE) *multi)
45
79.4k
{
46
79.4k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
79.4k
}
isl_multi_aff_get_domain_space
Line
Count
Source
45
79.2k
{
46
79.2k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
79.2k
}
isl_multi_pw_aff_get_domain_space
Line
Count
Source
45
91
{
46
91
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
91
}
isl_multi_union_pw_aff_get_domain_space
Line
Count
Source
45
146
{
46
146
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
146
}
Unexecuted instantiation: isl_multi_val_get_domain_space
48
49
__isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space)
50
182k
{
51
182k
  isl_ctx *ctx;
52
182k
  int n;
53
182k
  MULTI(BASE) *multi;
54
182k
55
182k
  if (!space)
56
0
    return NULL;
57
182k
58
182k
  ctx = isl_space_get_ctx(space);
59
182k
  n = isl_space_dim(space, isl_dim_out);
60
182k
  multi = isl_calloc(ctx, MULTI(BASE),
61
182k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
182k
  if (!multi)
63
0
    goto error;
64
182k
65
182k
  multi->space = space;
66
182k
  multi->n = n;
67
182k
  multi->ref = 1;
68
182k
  return multi;
69
182k
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
182k
}
isl_multi_aff_alloc
Line
Count
Source
50
159k
{
51
159k
  isl_ctx *ctx;
52
159k
  int n;
53
159k
  MULTI(BASE) *multi;
54
159k
55
159k
  if (!space)
56
0
    return NULL;
57
159k
58
159k
  ctx = isl_space_get_ctx(space);
59
159k
  n = isl_space_dim(space, isl_dim_out);
60
159k
  multi = isl_calloc(ctx, MULTI(BASE),
61
159k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
159k
  if (!multi)
63
0
    goto error;
64
159k
65
159k
  multi->space = space;
66
159k
  multi->n = n;
67
159k
  multi->ref = 1;
68
159k
  return multi;
69
159k
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
159k
}
isl_multi_pw_aff_alloc
Line
Count
Source
50
8.66k
{
51
8.66k
  isl_ctx *ctx;
52
8.66k
  int n;
53
8.66k
  MULTI(BASE) *multi;
54
8.66k
55
8.66k
  if (!space)
56
0
    return NULL;
57
8.66k
58
8.66k
  ctx = isl_space_get_ctx(space);
59
8.66k
  n = isl_space_dim(space, isl_dim_out);
60
8.66k
  multi = isl_calloc(ctx, MULTI(BASE),
61
8.66k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
8.66k
  if (!multi)
63
0
    goto error;
64
8.66k
65
8.66k
  multi->space = space;
66
8.66k
  multi->n = n;
67
8.66k
  multi->ref = 1;
68
8.66k
  return multi;
69
8.66k
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
8.66k
}
isl_multi_union_pw_aff_alloc
Line
Count
Source
50
10.8k
{
51
10.8k
  isl_ctx *ctx;
52
10.8k
  int n;
53
10.8k
  MULTI(BASE) *multi;
54
10.8k
55
10.8k
  if (!space)
56
0
    return NULL;
57
10.8k
58
10.8k
  ctx = isl_space_get_ctx(space);
59
10.8k
  n = isl_space_dim(space, isl_dim_out);
60
10.8k
  multi = isl_calloc(ctx, MULTI(BASE),
61
10.8k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
10.8k
  if (!multi)
63
0
    goto error;
64
10.8k
65
10.8k
  multi->space = space;
66
10.8k
  multi->n = n;
67
10.8k
  multi->ref = 1;
68
10.8k
  return multi;
69
10.8k
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
10.8k
}
isl_multi_val_alloc
Line
Count
Source
50
3.60k
{
51
3.60k
  isl_ctx *ctx;
52
3.60k
  int n;
53
3.60k
  MULTI(BASE) *multi;
54
3.60k
55
3.60k
  if (!space)
56
0
    return NULL;
57
3.60k
58
3.60k
  ctx = isl_space_get_ctx(space);
59
3.60k
  n = isl_space_dim(space, isl_dim_out);
60
3.60k
  multi = isl_calloc(ctx, MULTI(BASE),
61
3.60k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
3.60k
  if (!multi)
63
0
    goto error;
64
3.60k
65
3.60k
  multi->space = space;
66
3.60k
  multi->n = n;
67
3.60k
  multi->ref = 1;
68
3.60k
  return multi;
69
3.60k
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
3.60k
}
73
74
__isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi)
75
127k
{
76
127k
  int i;
77
127k
  MULTI(BASE) *dup;
78
127k
79
127k
  if (!multi)
80
0
    return NULL;
81
127k
82
127k
  dup = FN(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
127k
  if (!dup)
84
0
    return NULL;
85
127k
86
996k
  
for (i = 0; 127k
i < multi->n;
++i868k
)
87
868k
    dup = FN(FN(MULTI(BASE),set),BASE)(dup, i,
88
868k
                FN(EL,copy)(multi->p[i]));
89
127k
90
127k
  return dup;
91
127k
}
isl_multi_aff_dup
Line
Count
Source
75
124k
{
76
124k
  int i;
77
124k
  MULTI(BASE) *dup;
78
124k
79
124k
  if (!multi)
80
0
    return NULL;
81
124k
82
124k
  dup = FN(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
124k
  if (!dup)
84
0
    return NULL;
85
124k
86
989k
  
for (i = 0; 124k
i < multi->n;
++i864k
)
87
864k
    dup = FN(FN(MULTI(BASE),set),BASE)(dup, i,
88
864k
                FN(EL,copy)(multi->p[i]));
89
124k
90
124k
  return dup;
91
124k
}
Unexecuted instantiation: isl_multi_pw_aff_dup
isl_multi_union_pw_aff_dup
Line
Count
Source
75
2.78k
{
76
2.78k
  int i;
77
2.78k
  MULTI(BASE) *dup;
78
2.78k
79
2.78k
  if (!multi)
80
0
    return NULL;
81
2.78k
82
2.78k
  dup = FN(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
2.78k
  if (!dup)
84
0
    return NULL;
85
2.78k
86
6.48k
  
for (i = 0; 2.78k
i < multi->n;
++i3.69k
)
87
3.69k
    dup = FN(FN(MULTI(BASE),set),BASE)(dup, i,
88
3.69k
                FN(EL,copy)(multi->p[i]));
89
2.78k
90
2.78k
  return dup;
91
2.78k
}
isl_multi_val_dup
Line
Count
Source
75
164
{
76
164
  int i;
77
164
  MULTI(BASE) *dup;
78
164
79
164
  if (!multi)
80
0
    return NULL;
81
164
82
164
  dup = FN(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
164
  if (!dup)
84
0
    return NULL;
85
164
86
576
  
for (i = 0; 164
i < multi->n;
++i412
)
87
412
    dup = FN(FN(MULTI(BASE),set),BASE)(dup, i,
88
412
                FN(EL,copy)(multi->p[i]));
89
164
90
164
  return dup;
91
164
}
92
93
__isl_give MULTI(BASE) *FN(MULTI(BASE),cow)(__isl_take MULTI(BASE) *multi)
94
1.15M
{
95
1.15M
  if (!multi)
96
0
    return NULL;
97
1.15M
98
1.15M
  if (multi->ref == 1)
99
1.02M
    return multi;
100
127k
101
127k
  multi->ref--;
102
127k
  return FN(MULTI(BASE),dup)(multi);
103
1.15M
}
isl_multi_aff_cow
Line
Count
Source
94
1.08M
{
95
1.08M
  if (!multi)
96
0
    return NULL;
97
1.08M
98
1.08M
  if (multi->ref == 1)
99
956k
    return multi;
100
124k
101
124k
  multi->ref--;
102
124k
  return FN(MULTI(BASE),dup)(multi);
103
1.08M
}
isl_multi_pw_aff_cow
Line
Count
Source
94
43.8k
{
95
43.8k
  if (!multi)
96
0
    return NULL;
97
43.8k
98
43.8k
  if (multi->ref == 1)
99
43.8k
    return multi;
100
0
101
0
  multi->ref--;
102
0
  return FN(MULTI(BASE),dup)(multi);
103
43.8k
}
isl_multi_union_pw_aff_cow
Line
Count
Source
94
15.6k
{
95
15.6k
  if (!multi)
96
0
    return NULL;
97
15.6k
98
15.6k
  if (multi->ref == 1)
99
12.8k
    return multi;
100
2.78k
101
2.78k
  multi->ref--;
102
2.78k
  return FN(MULTI(BASE),dup)(multi);
103
15.6k
}
isl_multi_val_cow
Line
Count
Source
94
10.9k
{
95
10.9k
  if (!multi)
96
0
    return NULL;
97
10.9k
98
10.9k
  if (multi->ref == 1)
99
10.8k
    return multi;
100
164
101
164
  multi->ref--;
102
164
  return FN(MULTI(BASE),dup)(multi);
103
10.9k
}
104
105
__isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi)
106
278k
{
107
278k
  if (!multi)
108
394
    return NULL;
109
278k
110
278k
  multi->ref++;
111
278k
  return multi;
112
278k
}
isl_multi_aff_copy
Line
Count
Source
106
248k
{
107
248k
  if (!multi)
108
394
    return NULL;
109
248k
110
248k
  multi->ref++;
111
248k
  return multi;
112
248k
}
isl_multi_pw_aff_copy
Line
Count
Source
106
2
{
107
2
  if (!multi)
108
0
    return NULL;
109
2
110
2
  multi->ref++;
111
2
  return multi;
112
2
}
isl_multi_union_pw_aff_copy
Line
Count
Source
106
17.3k
{
107
17.3k
  if (!multi)
108
0
    return NULL;
109
17.3k
110
17.3k
  multi->ref++;
111
17.3k
  return multi;
112
17.3k
}
isl_multi_val_copy
Line
Count
Source
106
12.3k
{
107
12.3k
  if (!multi)
108
0
    return NULL;
109
12.3k
110
12.3k
  multi->ref++;
111
12.3k
  return multi;
112
12.3k
}
113
114
__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi)
115
377k
{
116
377k
  int i;
117
377k
118
377k
  if (!multi)
119
44.5k
    return NULL;
120
333k
121
333k
  if (--multi->ref > 0)
122
150k
    return NULL;
123
182k
124
182k
  isl_space_free(multi->space);
125
1.14M
  for (i = 0; i < multi->n; 
++i962k
)
126
962k
    FN(EL,free)(multi->p[i]);
127
377k
  free(multi);
128
377k
129
377k
  return NULL;
130
377k
}
isl_multi_aff_free
Line
Count
Source
115
327k
{
116
327k
  int i;
117
327k
118
327k
  if (!multi)
119
44.5k
    return NULL;
120
283k
121
283k
  if (--multi->ref > 0)
122
124k
    return NULL;
123
159k
124
159k
  isl_space_free(multi->space);
125
1.09M
  for (i = 0; i < multi->n; 
++i932k
)
126
932k
    FN(EL,free)(multi->p[i]);
127
327k
  free(multi);
128
327k
129
327k
  return NULL;
130
327k
}
isl_multi_pw_aff_free
Line
Count
Source
115
8.66k
{
116
8.66k
  int i;
117
8.66k
118
8.66k
  if (!multi)
119
0
    return NULL;
120
8.66k
121
8.66k
  if (--multi->ref > 0)
122
2
    return NULL;
123
8.66k
124
8.66k
  isl_space_free(multi->space);
125
22.8k
  for (i = 0; i < multi->n; 
++i14.1k
)
126
14.1k
    FN(EL,free)(multi->p[i]);
127
8.66k
  free(multi);
128
8.66k
129
8.66k
  return NULL;
130
8.66k
}
isl_multi_union_pw_aff_free
Line
Count
Source
115
25.3k
{
116
25.3k
  int i;
117
25.3k
118
25.3k
  if (!multi)
119
0
    return NULL;
120
25.3k
121
25.3k
  if (--multi->ref > 0)
122
14.5k
    return NULL;
123
10.8k
124
10.8k
  isl_space_free(multi->space);
125
20.7k
  for (i = 0; i < multi->n; 
++i9.86k
)
126
10.8k
    
FN9.86k
(EL,free)(multi->p[i])9.86k
;
127
25.3k
  free(multi);
128
25.3k
129
25.3k
  return NULL;
130
25.3k
}
isl_multi_val_free
Line
Count
Source
115
15.8k
{
116
15.8k
  int i;
117
15.8k
118
15.8k
  if (!multi)
119
4
    return NULL;
120
15.8k
121
15.8k
  if (--multi->ref > 0)
122
12.1k
    return NULL;
123
3.60k
124
3.60k
  isl_space_free(multi->space);
125
8.86k
  for (i = 0; i < multi->n; 
++i5.25k
)
126
5.25k
    FN(EL,free)(multi->p[i]);
127
15.8k
  free(multi);
128
15.8k
129
15.8k
  return NULL;
130
15.8k
}
131
132
#ifndef NO_DIMS
133
/* Check whether "multi" has non-zero coefficients for any dimension
134
 * in the given range or if any of these dimensions appear
135
 * with non-zero coefficients in any of the integer divisions involved.
136
 */
137
isl_bool FN(MULTI(BASE),involves_dims)(__isl_keep MULTI(BASE) *multi,
138
  enum isl_dim_type type, unsigned first, unsigned n)
139
0
{
140
0
  int i;
141
0
142
0
  if (!multi)
143
0
    return isl_bool_error;
144
0
  if (multi->n == 0 || n == 0)
145
0
    return isl_bool_false;
146
0
147
0
  for (i = 0; i < multi->n; ++i) {
148
0
    isl_bool involves;
149
0
150
0
    involves = FN(EL,involves_dims)(multi->p[i], type, first, n);
151
0
    if (involves < 0 || involves)
152
0
      return involves;
153
0
  }
154
0
155
0
  return isl_bool_false;
156
0
}
Unexecuted instantiation: isl_multi_aff_involves_dims
Unexecuted instantiation: isl_multi_pw_aff_involves_dims
Unexecuted instantiation: isl_multi_val_involves_dims
157
158
__isl_give MULTI(BASE) *FN(MULTI(BASE),insert_dims)(
159
  __isl_take MULTI(BASE) *multi,
160
  enum isl_dim_type type, unsigned first, unsigned n)
161
18
{
162
18
  int i;
163
18
164
18
  if (!multi)
165
0
    return NULL;
166
18
  if (type == isl_dim_out)
167
18
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
168
18
      "cannot insert output/set dimensions",
169
18
      return FN(MULTI(BASE),free)(multi));
170
18
  if (n == 0 && 
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
12
173
12
  multi = FN(MULTI(BASE),cow)(multi);
174
12
  if (!multi)
175
0
    return NULL;
176
12
177
12
  multi->space = isl_space_insert_dims(multi->space, type, first, n);
178
12
  if (!multi->space)
179
0
    return FN(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n;
++i12
) {
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      return FN(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
18
}
isl_multi_aff_insert_dims
Line
Count
Source
161
18
{
162
18
  int i;
163
18
164
18
  if (!multi)
165
0
    return NULL;
166
18
  if (type == isl_dim_out)
167
18
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
168
18
      "cannot insert output/set dimensions",
169
18
      return FN(MULTI(BASE),free)(multi));
170
18
  if (n == 0 && 
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
12
173
12
  multi = FN(MULTI(BASE),cow)(multi);
174
12
  if (!multi)
175
0
    return NULL;
176
12
177
12
  multi->space = isl_space_insert_dims(multi->space, type, first, n);
178
12
  if (!multi->space)
179
0
    return FN(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n;
++i12
) {
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      return FN(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
18
}
Unexecuted instantiation: isl_multi_pw_aff_insert_dims
Unexecuted instantiation: isl_multi_val_insert_dims
189
190
__isl_give MULTI(BASE) *FN(MULTI(BASE),add_dims)(__isl_take MULTI(BASE) *multi,
191
  enum isl_dim_type type, unsigned n)
192
0
{
193
0
  unsigned pos;
194
0
195
0
  pos = FN(MULTI(BASE),dim)(multi, type);
196
0
197
0
  return FN(MULTI(BASE),insert_dims)(multi, type, pos, n);
198
0
}
Unexecuted instantiation: isl_multi_aff_add_dims
Unexecuted instantiation: isl_multi_pw_aff_add_dims
Unexecuted instantiation: isl_multi_val_add_dims
199
#endif
200
201
unsigned FN(MULTI(BASE),dim)(__isl_keep MULTI(BASE) *multi,
202
  enum isl_dim_type type)
203
1.34M
{
204
1.34M
  return multi ? isl_space_dim(multi->space, type) : 
00
;
205
1.34M
}
isl_multi_aff_dim
Line
Count
Source
203
1.29M
{
204
1.29M
  return multi ? isl_space_dim(multi->space, type) : 
00
;
205
1.29M
}
isl_multi_pw_aff_dim
Line
Count
Source
203
11.7k
{
204
11.7k
  return multi ? isl_space_dim(multi->space, type) : 
00
;
205
11.7k
}
isl_multi_union_pw_aff_dim
Line
Count
Source
203
23.5k
{
204
23.5k
  return multi ? isl_space_dim(multi->space, type) : 
00
;
205
23.5k
}
isl_multi_val_dim
Line
Count
Source
203
7.87k
{
204
7.87k
  return multi ? isl_space_dim(multi->space, type) : 
00
;
205
7.87k
}
206
207
/* Return the position of the first dimension of "type" with id "id".
208
 * Return -1 if there is no such dimension.
209
 */
210
int FN(MULTI(BASE),find_dim_by_id)(__isl_keep MULTI(BASE) *multi,
211
  enum isl_dim_type type, __isl_keep isl_id *id)
212
0
{
213
0
  if (!multi)
214
0
    return -1;
215
0
  return isl_space_find_dim_by_id(multi->space, type, id);
216
0
}
Unexecuted instantiation: isl_multi_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_union_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_val_find_dim_by_id
217
218
/* Return the id of the given dimension.
219
 */
220
__isl_give isl_id *FN(MULTI(BASE),get_dim_id)(__isl_keep MULTI(BASE) *multi,
221
  enum isl_dim_type type, unsigned pos)
222
0
{
223
0
  return multi ? isl_space_get_dim_id(multi->space, type, pos) : NULL;
224
0
}
Unexecuted instantiation: isl_multi_aff_get_dim_id
Unexecuted instantiation: isl_multi_pw_aff_get_dim_id
Unexecuted instantiation: isl_multi_union_pw_aff_get_dim_id
Unexecuted instantiation: isl_multi_val_get_dim_id
225
226
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_name)(
227
  __isl_take MULTI(BASE) *multi,
228
  enum isl_dim_type type, unsigned pos, const char *s)
229
0
{
230
0
  int i;
231
0
232
0
  multi = FN(MULTI(BASE),cow)(multi);
233
0
  if (!multi)
234
0
    return NULL;
235
0
236
0
  multi->space = isl_space_set_dim_name(multi->space, type, pos, s);
237
0
  if (!multi->space)
238
0
    return FN(MULTI(BASE),free)(multi);
239
0
240
0
  if (type == isl_dim_out)
241
0
    return multi;
242
0
  for (i = 0; i < multi->n; ++i) {
243
0
    multi->p[i] = FN(EL,set_dim_name)(multi->p[i], type, pos, s);
244
0
    if (!multi->p[i])
245
0
      return FN(MULTI(BASE),free)(multi);
246
0
  }
247
0
248
0
  return multi;
249
0
}
Unexecuted instantiation: isl_multi_aff_set_dim_name
Unexecuted instantiation: isl_multi_pw_aff_set_dim_name
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_name
Unexecuted instantiation: isl_multi_val_set_dim_name
250
251
const char *FN(MULTI(BASE),get_tuple_name)(__isl_keep MULTI(BASE) *multi,
252
  enum isl_dim_type type)
253
0
{
254
0
  return multi ? isl_space_get_tuple_name(multi->space, type) : NULL;
255
0
}
Unexecuted instantiation: isl_multi_aff_get_tuple_name
Unexecuted instantiation: isl_multi_pw_aff_get_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_get_tuple_name
Unexecuted instantiation: isl_multi_val_get_tuple_name
256
257
/* Does the specified tuple have an id?
258
 */
259
isl_bool FN(MULTI(BASE),has_tuple_id)(__isl_keep MULTI(BASE) *multi,
260
  enum isl_dim_type type)
261
5.48k
{
262
5.48k
  if (!multi)
263
0
    return isl_bool_error;
264
5.48k
  return isl_space_has_tuple_id(multi->space, type);
265
5.48k
}
Unexecuted instantiation: isl_multi_aff_has_tuple_id
isl_multi_pw_aff_has_tuple_id
Line
Count
Source
261
3.09k
{
262
3.09k
  if (!multi)
263
0
    return isl_bool_error;
264
3.09k
  return isl_space_has_tuple_id(multi->space, type);
265
3.09k
}
isl_multi_union_pw_aff_has_tuple_id
Line
Count
Source
261
2.39k
{
262
2.39k
  if (!multi)
263
0
    return isl_bool_error;
264
2.39k
  return isl_space_has_tuple_id(multi->space, type);
265
2.39k
}
Unexecuted instantiation: isl_multi_val_has_tuple_id
266
267
/* Return the id of the specified tuple.
268
 */
269
__isl_give isl_id *FN(MULTI(BASE),get_tuple_id)(__isl_keep MULTI(BASE) *multi,
270
  enum isl_dim_type type)
271
3.09k
{
272
3.09k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
3.09k
}
Unexecuted instantiation: isl_multi_aff_get_tuple_id
isl_multi_pw_aff_get_tuple_id
Line
Count
Source
271
3.09k
{
272
3.09k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
3.09k
}
Unexecuted instantiation: isl_multi_union_pw_aff_get_tuple_id
Unexecuted instantiation: isl_multi_val_get_tuple_id
274
275
__isl_give EL *FN(FN(MULTI(BASE),get),BASE)(__isl_keep MULTI(BASE) *multi,
276
  int pos)
277
77.9k
{
278
77.9k
  isl_ctx *ctx;
279
77.9k
280
77.9k
  if (!multi)
281
0
    return NULL;
282
77.9k
  ctx = FN(MULTI(BASE),get_ctx)(multi);
283
77.9k
  if (pos < 0 || pos >= multi->n)
284
77.9k
    
isl_die0
(ctx, isl_error_invalid,
285
77.9k
      "index out of bounds", return NULL);
286
77.9k
  return FN(EL,copy)(multi->p[pos]);
287
77.9k
}
isl_multi_aff_get_aff
Line
Count
Source
277
35.6k
{
278
35.6k
  isl_ctx *ctx;
279
35.6k
280
35.6k
  if (!multi)
281
0
    return NULL;
282
35.6k
  ctx = FN(MULTI(BASE),get_ctx)(multi);
283
35.6k
  if (pos < 0 || pos >= multi->n)
284
35.6k
    
isl_die0
(ctx, isl_error_invalid,
285
35.6k
      "index out of bounds", return NULL);
286
35.6k
  return FN(EL,copy)(multi->p[pos]);
287
35.6k
}
isl_multi_pw_aff_get_pw_aff
Line
Count
Source
277
14.1k
{
278
14.1k
  isl_ctx *ctx;
279
14.1k
280
14.1k
  if (!multi)
281
0
    return NULL;
282
14.1k
  ctx = FN(MULTI(BASE),get_ctx)(multi);
283
14.1k
  if (pos < 0 || pos >= multi->n)
284
14.1k
    
isl_die0
(ctx, isl_error_invalid,
285
14.1k
      "index out of bounds", return NULL);
286
14.1k
  return FN(EL,copy)(multi->p[pos]);
287
14.1k
}
isl_multi_union_pw_aff_get_union_pw_aff
Line
Count
Source
277
19.6k
{
278
19.6k
  isl_ctx *ctx;
279
19.6k
280
19.6k
  if (!multi)
281
0
    return NULL;
282
19.6k
  ctx = FN(MULTI(BASE),get_ctx)(multi);
283
19.6k
  if (pos < 0 || pos >= multi->n)
284
19.6k
    
isl_die0
(ctx, isl_error_invalid,
285
19.6k
      "index out of bounds", return NULL);
286
19.6k
  return FN(EL,copy)(multi->p[pos]);
287
19.6k
}
isl_multi_val_get_val
Line
Count
Source
277
8.42k
{
278
8.42k
  isl_ctx *ctx;
279
8.42k
280
8.42k
  if (!multi)
281
0
    return NULL;
282
8.42k
  ctx = FN(MULTI(BASE),get_ctx)(multi);
283
8.42k
  if (pos < 0 || pos >= multi->n)
284
8.42k
    
isl_die0
(ctx, isl_error_invalid,
285
8.42k
      "index out of bounds", return NULL);
286
8.42k
  return FN(EL,copy)(multi->p[pos]);
287
8.42k
}
288
289
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),set),BASE)(
290
  __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el)
291
975k
{
292
975k
  isl_space *multi_space = NULL;
293
975k
  isl_space *el_space = NULL;
294
975k
  isl_bool match;
295
975k
296
975k
  multi = FN(MULTI(BASE),cow)(multi);
297
975k
  if (!multi || !el)
298
0
    goto error;
299
975k
300
975k
  multi_space = FN(MULTI(BASE),get_space)(multi);
301
975k
  match = FN(EL,matching_params)(el, multi_space);
302
975k
  if (match < 0)
303
0
    goto error;
304
975k
  if (!match) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
975k
  if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
312
0
    goto error;
313
975k
314
975k
  if (pos < 0 || pos >= multi->n)
315
975k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
975k
      "index out of bounds", goto error);
317
975k
318
975k
  FN(EL,free)(multi->p[pos]);
319
975k
  multi->p[pos] = el;
320
975k
321
975k
  isl_space_free(multi_space);
322
975k
  isl_space_free(el_space);
323
975k
324
975k
  return multi;
325
975k
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
975k
}
isl_multi_aff_set_aff
Line
Count
Source
291
939k
{
292
939k
  isl_space *multi_space = NULL;
293
939k
  isl_space *el_space = NULL;
294
939k
  isl_bool match;
295
939k
296
939k
  multi = FN(MULTI(BASE),cow)(multi);
297
939k
  if (!multi || !el)
298
0
    goto error;
299
939k
300
939k
  multi_space = FN(MULTI(BASE),get_space)(multi);
301
939k
  match = FN(EL,matching_params)(el, multi_space);
302
939k
  if (match < 0)
303
0
    goto error;
304
939k
  if (!match) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
939k
  if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
312
0
    goto error;
313
939k
314
939k
  if (pos < 0 || pos >= multi->n)
315
939k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
939k
      "index out of bounds", goto error);
317
939k
318
939k
  FN(EL,free)(multi->p[pos]);
319
939k
  multi->p[pos] = el;
320
939k
321
939k
  isl_space_free(multi_space);
322
939k
  isl_space_free(el_space);
323
939k
324
939k
  return multi;
325
939k
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
939k
}
isl_multi_pw_aff_set_pw_aff
Line
Count
Source
291
14.1k
{
292
14.1k
  isl_space *multi_space = NULL;
293
14.1k
  isl_space *el_space = NULL;
294
14.1k
  isl_bool match;
295
14.1k
296
14.1k
  multi = FN(MULTI(BASE),cow)(multi);
297
14.1k
  if (!multi || !el)
298
0
    goto error;
299
14.1k
300
14.1k
  multi_space = FN(MULTI(BASE),get_space)(multi);
301
14.1k
  match = FN(EL,matching_params)(el, multi_space);
302
14.1k
  if (match < 0)
303
0
    goto error;
304
14.1k
  if (!match) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
14.1k
  if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
312
0
    goto error;
313
14.1k
314
14.1k
  if (pos < 0 || pos >= multi->n)
315
14.1k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
14.1k
      "index out of bounds", goto error);
317
14.1k
318
14.1k
  FN(EL,free)(multi->p[pos]);
319
14.1k
  multi->p[pos] = el;
320
14.1k
321
14.1k
  isl_space_free(multi_space);
322
14.1k
  isl_space_free(el_space);
323
14.1k
324
14.1k
  return multi;
325
14.1k
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
14.1k
}
isl_multi_union_pw_aff_set_union_pw_aff
Line
Count
Source
291
10.6k
{
292
10.6k
  isl_space *multi_space = NULL;
293
10.6k
  isl_space *el_space = NULL;
294
10.6k
  isl_bool match;
295
10.6k
296
10.6k
  multi = FN(MULTI(BASE),cow)(multi);
297
10.6k
  if (!multi || !el)
298
0
    goto error;
299
10.6k
300
10.6k
  multi_space = FN(MULTI(BASE),get_space)(multi);
301
10.6k
  match = FN(EL,matching_params)(el, multi_space);
302
10.6k
  if (match < 0)
303
0
    goto error;
304
10.6k
  if (!match) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
10.6k
  if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
312
0
    goto error;
313
10.6k
314
10.6k
  if (pos < 0 || pos >= multi->n)
315
10.6k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
10.6k
      "index out of bounds", goto error);
317
10.6k
318
10.6k
  FN(EL,free)(multi->p[pos]);
319
10.6k
  multi->p[pos] = el;
320
10.6k
321
10.6k
  isl_space_free(multi_space);
322
10.6k
  isl_space_free(el_space);
323
10.6k
324
10.6k
  return multi;
325
10.6k
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
10.6k
}
isl_multi_val_set_val
Line
Count
Source
291
10.9k
{
292
10.9k
  isl_space *multi_space = NULL;
293
10.9k
  isl_space *el_space = NULL;
294
10.9k
  isl_bool match;
295
10.9k
296
10.9k
  multi = FN(MULTI(BASE),cow)(multi);
297
10.9k
  if (!multi || !el)
298
0
    goto error;
299
10.9k
300
10.9k
  multi_space = FN(MULTI(BASE),get_space)(multi);
301
10.9k
  match = FN(EL,matching_params)(el, multi_space);
302
10.9k
  if (match < 0)
303
0
    goto error;
304
10.9k
  if (!match) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
10.9k
  if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
312
0
    goto error;
313
10.9k
314
10.9k
  if (pos < 0 || pos >= multi->n)
315
10.9k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
10.9k
      "index out of bounds", goto error);
317
10.9k
318
10.9k
  FN(EL,free)(multi->p[pos]);
319
10.9k
  multi->p[pos] = el;
320
10.9k
321
10.9k
  isl_space_free(multi_space);
322
10.9k
  isl_space_free(el_space);
323
10.9k
324
10.9k
  return multi;
325
10.9k
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
10.9k
}
332
333
/* Reset the space of "multi".  This function is called from isl_pw_templ.c
334
 * and doesn't know if the space of an element object is represented
335
 * directly or through its domain.  It therefore passes along both,
336
 * which we pass along to the element function since we don't how
337
 * that is represented either.
338
 */
339
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space_and_domain)(
340
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space,
341
  __isl_take isl_space *domain)
342
19.7k
{
343
19.7k
  int i;
344
19.7k
345
19.7k
  multi = FN(MULTI(BASE),cow)(multi);
346
19.7k
  if (!multi || !space || !domain)
347
0
    goto error;
348
19.7k
349
73.4k
  
for (i = 0; 19.7k
i < multi->n;
++i53.6k
) {
350
53.6k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
53.6k
         isl_space_copy(domain));
352
53.6k
    if (!multi->p[i])
353
0
      goto error;
354
53.6k
  }
355
19.7k
  isl_space_free(domain);
356
19.7k
  isl_space_free(multi->space);
357
19.7k
  multi->space = space;
358
19.7k
359
19.7k
  return multi;
360
19.7k
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
19.7k
}
isl_multi_aff_reset_space_and_domain
Line
Count
Source
342
4.88k
{
343
4.88k
  int i;
344
4.88k
345
4.88k
  multi = FN(MULTI(BASE),cow)(multi);
346
4.88k
  if (!multi || !space || !domain)
347
0
    goto error;
348
4.88k
349
16.6k
  
for (i = 0; 4.88k
i < multi->n;
++i11.8k
) {
350
11.8k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
11.8k
         isl_space_copy(domain));
352
11.8k
    if (!multi->p[i])
353
0
      goto error;
354
11.8k
  }
355
4.88k
  isl_space_free(domain);
356
4.88k
  isl_space_free(multi->space);
357
4.88k
  multi->space = space;
358
4.88k
359
4.88k
  return multi;
360
4.88k
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
4.88k
}
isl_multi_pw_aff_reset_space_and_domain
Line
Count
Source
342
14.7k
{
343
14.7k
  int i;
344
14.7k
345
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
346
14.7k
  if (!multi || !space || !domain)
347
0
    goto error;
348
14.7k
349
56.4k
  
for (i = 0; 14.7k
i < multi->n;
++i41.6k
) {
350
41.6k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
41.6k
         isl_space_copy(domain));
352
41.6k
    if (!multi->p[i])
353
0
      goto error;
354
41.6k
  }
355
14.7k
  isl_space_free(domain);
356
14.7k
  isl_space_free(multi->space);
357
14.7k
  multi->space = space;
358
14.7k
359
14.7k
  return multi;
360
14.7k
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
14.7k
}
isl_multi_union_pw_aff_reset_space_and_domain
Line
Count
Source
342
163
{
343
163
  int i;
344
163
345
163
  multi = FN(MULTI(BASE),cow)(multi);
346
163
  if (!multi || !space || !domain)
347
0
    goto error;
348
163
349
354
  
for (i = 0; 163
i < multi->n;
++i191
) {
350
191
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
191
         isl_space_copy(domain));
352
191
    if (!multi->p[i])
353
0
      goto error;
354
191
  }
355
163
  isl_space_free(domain);
356
163
  isl_space_free(multi->space);
357
163
  multi->space = space;
358
163
359
163
  return multi;
360
163
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
163
}
Unexecuted instantiation: isl_multi_val_reset_space_and_domain
366
367
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_domain_space)(
368
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *domain)
369
156
{
370
156
  isl_space *space;
371
156
372
156
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
156
            isl_space_copy(multi->space));
374
156
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
156
}
isl_multi_aff_reset_domain_space
Line
Count
Source
369
10
{
370
10
  isl_space *space;
371
10
372
10
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
10
            isl_space_copy(multi->space));
374
10
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
10
}
Unexecuted instantiation: isl_multi_pw_aff_reset_domain_space
isl_multi_union_pw_aff_reset_domain_space
Line
Count
Source
369
146
{
370
146
  isl_space *space;
371
146
372
146
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
146
            isl_space_copy(multi->space));
374
146
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
146
}
Unexecuted instantiation: isl_multi_val_reset_domain_space
376
377
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space)(
378
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space)
379
17.0k
{
380
17.0k
  isl_space *domain;
381
17.0k
382
17.0k
  domain = isl_space_domain(isl_space_copy(space));
383
17.0k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
17.0k
}
isl_multi_aff_reset_space
Line
Count
Source
379
2.32k
{
380
2.32k
  isl_space *domain;
381
2.32k
382
2.32k
  domain = isl_space_domain(isl_space_copy(space));
383
2.32k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
2.32k
}
isl_multi_pw_aff_reset_space
Line
Count
Source
379
14.7k
{
380
14.7k
  isl_space *domain;
381
14.7k
382
14.7k
  domain = isl_space_domain(isl_space_copy(space));
383
14.7k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
14.7k
}
isl_multi_union_pw_aff_reset_space
Line
Count
Source
379
17
{
380
17
  isl_space *domain;
381
17
382
17
  domain = isl_space_domain(isl_space_copy(space));
383
17
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
17
}
Unexecuted instantiation: isl_multi_val_reset_space
385
386
/* Set the id of the given dimension of "multi" to "id".
387
 */
388
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_id)(
389
  __isl_take MULTI(BASE) *multi,
390
  enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
391
14.7k
{
392
14.7k
  isl_space *space;
393
14.7k
394
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
395
14.7k
  if (!multi || !id)
396
0
    goto error;
397
14.7k
398
14.7k
  space = FN(MULTI(BASE),get_space)(multi);
399
14.7k
  space = isl_space_set_dim_id(space, type, pos, id);
400
14.7k
401
14.7k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
14.7k
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
14.7k
}
Unexecuted instantiation: isl_multi_aff_set_dim_id
isl_multi_pw_aff_set_dim_id
Line
Count
Source
391
14.7k
{
392
14.7k
  isl_space *space;
393
14.7k
394
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
395
14.7k
  if (!multi || !id)
396
0
    goto error;
397
14.7k
398
14.7k
  space = FN(MULTI(BASE),get_space)(multi);
399
14.7k
  space = isl_space_set_dim_id(space, type, pos, id);
400
14.7k
401
14.7k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
14.7k
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
14.7k
}
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_id
Unexecuted instantiation: isl_multi_val_set_dim_id
407
408
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_name)(
409
  __isl_keep MULTI(BASE) *multi, enum isl_dim_type type,
410
  const char *s)
411
0
{
412
0
  isl_space *space;
413
0
414
0
  multi = FN(MULTI(BASE),cow)(multi);
415
0
  if (!multi)
416
0
    return NULL;
417
0
418
0
  space = FN(MULTI(BASE),get_space)(multi);
419
0
  space = isl_space_set_tuple_name(space, type, s);
420
0
421
0
  return FN(MULTI(BASE),reset_space)(multi, space);
422
0
}
Unexecuted instantiation: isl_multi_aff_set_tuple_name
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_set_tuple_name
Unexecuted instantiation: isl_multi_val_set_tuple_name
423
424
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_id)(
425
  __isl_take MULTI(BASE) *multi, enum isl_dim_type type,
426
  __isl_take isl_id *id)
427
90
{
428
90
  isl_space *space;
429
90
430
90
  multi = FN(MULTI(BASE),cow)(multi);
431
90
  if (!multi)
432
0
    goto error;
433
90
434
90
  space = FN(MULTI(BASE),get_space)(multi);
435
90
  space = isl_space_set_tuple_id(space, type, id);
436
90
437
90
  return FN(MULTI(BASE),reset_space)(multi, space);
438
90
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
90
}
isl_multi_aff_set_tuple_id
Line
Count
Source
427
87
{
428
87
  isl_space *space;
429
87
430
87
  multi = FN(MULTI(BASE),cow)(multi);
431
87
  if (!multi)
432
0
    goto error;
433
87
434
87
  space = FN(MULTI(BASE),get_space)(multi);
435
87
  space = isl_space_set_tuple_id(space, type, id);
436
87
437
87
  return FN(MULTI(BASE),reset_space)(multi, space);
438
87
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
87
}
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_id
isl_multi_union_pw_aff_set_tuple_id
Line
Count
Source
427
3
{
428
3
  isl_space *space;
429
3
430
3
  multi = FN(MULTI(BASE),cow)(multi);
431
3
  if (!multi)
432
0
    goto error;
433
3
434
3
  space = FN(MULTI(BASE),get_space)(multi);
435
3
  space = isl_space_set_tuple_id(space, type, id);
436
3
437
3
  return FN(MULTI(BASE),reset_space)(multi, space);
438
3
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
3
}
Unexecuted instantiation: isl_multi_val_set_tuple_id
442
443
/* Drop the id on the specified tuple.
444
 */
445
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_tuple_id)(
446
  __isl_take MULTI(BASE) *multi, enum isl_dim_type type)
447
2.38k
{
448
2.38k
  isl_space *space;
449
2.38k
450
2.38k
  if (!multi)
451
0
    return NULL;
452
2.38k
  if (!FN(MULTI(BASE),has_tuple_id)(multi, type))
453
2.37k
    return multi;
454
14
455
14
  multi = FN(MULTI(BASE),cow)(multi);
456
14
  if (!multi)
457
0
    return NULL;
458
14
459
14
  space = FN(MULTI(BASE),get_space)(multi);
460
14
  space = isl_space_reset_tuple_id(space, type);
461
14
462
14
  return FN(MULTI(BASE),reset_space)(multi, space);
463
2.38k
}
Unexecuted instantiation: isl_multi_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_pw_aff_reset_tuple_id
isl_multi_union_pw_aff_reset_tuple_id
Line
Count
Source
447
2.38k
{
448
2.38k
  isl_space *space;
449
2.38k
450
2.38k
  if (!multi)
451
0
    return NULL;
452
2.38k
  if (!FN(MULTI(BASE),has_tuple_id)(multi, type))
453
2.37k
    return multi;
454
14
455
14
  multi = FN(MULTI(BASE),cow)(multi);
456
14
  if (!multi)
457
0
    return NULL;
458
14
459
14
  space = FN(MULTI(BASE),get_space)(multi);
460
14
  space = isl_space_reset_tuple_id(space, type);
461
14
462
14
  return FN(MULTI(BASE),reset_space)(multi, space);
463
2.38k
}
Unexecuted instantiation: isl_multi_val_reset_tuple_id
464
465
/* Reset the user pointer on all identifiers of parameters and tuples
466
 * of the space of "multi".
467
 */
468
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_user)(
469
  __isl_take MULTI(BASE) *multi)
470
0
{
471
0
  isl_space *space;
472
0
473
0
  space = FN(MULTI(BASE),get_space)(multi);
474
0
  space = isl_space_reset_user(space);
475
0
476
0
  return FN(MULTI(BASE),reset_space)(multi, space);
477
0
}
Unexecuted instantiation: isl_multi_aff_reset_user
Unexecuted instantiation: isl_multi_pw_aff_reset_user
Unexecuted instantiation: isl_multi_union_pw_aff_reset_user
Unexecuted instantiation: isl_multi_val_reset_user
478
479
__isl_give MULTI(BASE) *FN(MULTI(BASE),realign_domain)(
480
  __isl_take MULTI(BASE) *multi, __isl_take isl_reordering *exp)
481
156
{
482
156
  int i;
483
156
484
156
  multi = FN(MULTI(BASE),cow)(multi);
485
156
  if (!multi || !exp)
486
0
    goto error;
487
156
488
302
  
for (i = 0; 156
i < multi->n;
++i146
) {
489
146
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
146
            isl_reordering_copy(exp));
491
146
    if (!multi->p[i])
492
0
      goto error;
493
146
  }
494
156
495
156
  multi = FN(MULTI(BASE),reset_domain_space)(multi,
496
156
                isl_space_copy(exp->dim));
497
156
498
156
  isl_reordering_free(exp);
499
156
  return multi;
500
156
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
156
}
isl_multi_aff_realign_domain
Line
Count
Source
481
10
{
482
10
  int i;
483
10
484
10
  multi = FN(MULTI(BASE),cow)(multi);
485
10
  if (!multi || !exp)
486
0
    goto error;
487
10
488
10
  for (i = 0; i < multi->n; 
++i0
) {
489
0
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
0
            isl_reordering_copy(exp));
491
0
    if (!multi->p[i])
492
0
      goto error;
493
0
  }
494
10
495
10
  multi = FN(MULTI(BASE),reset_domain_space)(multi,
496
10
                isl_space_copy(exp->dim));
497
10
498
10
  isl_reordering_free(exp);
499
10
  return multi;
500
10
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
10
}
Unexecuted instantiation: isl_multi_pw_aff_realign_domain
isl_multi_union_pw_aff_realign_domain
Line
Count
Source
481
146
{
482
146
  int i;
483
146
484
146
  multi = FN(MULTI(BASE),cow)(multi);
485
146
  if (!multi || !exp)
486
0
    goto error;
487
146
488
292
  
for (i = 0; 146
i < multi->n;
++i146
) {
489
146
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
146
            isl_reordering_copy(exp));
491
146
    if (!multi->p[i])
492
0
      goto error;
493
146
  }
494
146
495
146
  multi = FN(MULTI(BASE),reset_domain_space)(multi,
496
146
                isl_space_copy(exp->dim));
497
146
498
146
  isl_reordering_free(exp);
499
146
  return multi;
500
146
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
146
}
Unexecuted instantiation: isl_multi_val_realign_domain
505
506
/* Align the parameters of "multi" to those of "model".
507
 */
508
__isl_give MULTI(BASE) *FN(MULTI(BASE),align_params)(
509
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *model)
510
2.66k
{
511
2.66k
  isl_ctx *ctx;
512
2.66k
  isl_bool equal_params;
513
2.66k
  isl_reordering *exp;
514
2.66k
515
2.66k
  if (!multi || !model)
516
0
    goto error;
517
2.66k
518
2.66k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
2.66k
  if (equal_params < 0)
520
0
    goto error;
521
2.66k
  if (equal_params) {
522
2.50k
    isl_space_free(model);
523
2.50k
    return multi;
524
2.50k
  }
525
156
526
156
  ctx = isl_space_get_ctx(model);
527
156
  if (!isl_space_has_named_params(model))
528
156
    
isl_die0
(ctx, isl_error_invalid,
529
156
      "model has unnamed parameters", goto error);
530
156
  if (!isl_space_has_named_params(multi->space))
531
156
    
isl_die0
(ctx, isl_error_invalid,
532
156
      "input has unnamed parameters", goto error);
533
156
534
156
  model = isl_space_params(model);
535
156
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
156
  exp = isl_reordering_extend_space(exp,
537
156
            FN(MULTI(BASE),get_domain_space)(multi));
538
156
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
156
540
156
  isl_space_free(model);
541
156
  return multi;
542
156
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
2.66k
}
isl_multi_aff_align_params
Line
Count
Source
510
1.64k
{
511
1.64k
  isl_ctx *ctx;
512
1.64k
  isl_bool equal_params;
513
1.64k
  isl_reordering *exp;
514
1.64k
515
1.64k
  if (!multi || !model)
516
0
    goto error;
517
1.64k
518
1.64k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.64k
  if (equal_params < 0)
520
0
    goto error;
521
1.64k
  if (equal_params) {
522
1.63k
    isl_space_free(model);
523
1.63k
    return multi;
524
1.63k
  }
525
10
526
10
  ctx = isl_space_get_ctx(model);
527
10
  if (!isl_space_has_named_params(model))
528
10
    
isl_die0
(ctx, isl_error_invalid,
529
10
      "model has unnamed parameters", goto error);
530
10
  if (!isl_space_has_named_params(multi->space))
531
10
    
isl_die0
(ctx, isl_error_invalid,
532
10
      "input has unnamed parameters", goto error);
533
10
534
10
  model = isl_space_params(model);
535
10
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
10
  exp = isl_reordering_extend_space(exp,
537
10
            FN(MULTI(BASE),get_domain_space)(multi));
538
10
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
10
540
10
  isl_space_free(model);
541
10
  return multi;
542
10
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
1.64k
}
isl_multi_pw_aff_align_params
Line
Count
Source
510
4
{
511
4
  isl_ctx *ctx;
512
4
  isl_bool equal_params;
513
4
  isl_reordering *exp;
514
4
515
4
  if (!multi || !model)
516
0
    goto error;
517
4
518
4
  equal_params = isl_space_has_equal_params(multi->space, model);
519
4
  if (equal_params < 0)
520
0
    goto error;
521
4
  if (equal_params) {
522
4
    isl_space_free(model);
523
4
    return multi;
524
4
  }
525
0
526
0
  ctx = isl_space_get_ctx(model);
527
0
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
0
      "model has unnamed parameters", goto error);
530
0
  if (!isl_space_has_named_params(multi->space))
531
0
    isl_die(ctx, isl_error_invalid,
532
0
      "input has unnamed parameters", goto error);
533
0
534
0
  model = isl_space_params(model);
535
0
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
0
  exp = isl_reordering_extend_space(exp,
537
0
            FN(MULTI(BASE),get_domain_space)(multi));
538
0
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
0
540
0
  isl_space_free(model);
541
0
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
4
}
isl_multi_union_pw_aff_align_params
Line
Count
Source
510
1.01k
{
511
1.01k
  isl_ctx *ctx;
512
1.01k
  isl_bool equal_params;
513
1.01k
  isl_reordering *exp;
514
1.01k
515
1.01k
  if (!multi || !model)
516
0
    goto error;
517
1.01k
518
1.01k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.01k
  if (equal_params < 0)
520
0
    goto error;
521
1.01k
  if (equal_params) {
522
866
    isl_space_free(model);
523
866
    return multi;
524
866
  }
525
146
526
146
  ctx = isl_space_get_ctx(model);
527
146
  if (!isl_space_has_named_params(model))
528
146
    
isl_die0
(ctx, isl_error_invalid,
529
146
      "model has unnamed parameters", goto error);
530
146
  if (!isl_space_has_named_params(multi->space))
531
146
    
isl_die0
(ctx, isl_error_invalid,
532
146
      "input has unnamed parameters", goto error);
533
146
534
146
  model = isl_space_params(model);
535
146
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
146
  exp = isl_reordering_extend_space(exp,
537
146
            FN(MULTI(BASE),get_domain_space)(multi));
538
146
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
146
540
146
  isl_space_free(model);
541
146
  return multi;
542
146
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
1.01k
}
Unexecuted instantiation: isl_multi_val_align_params
547
548
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))(
549
  __isl_take isl_space *space, __isl_take LIST(EL) *list)
550
5.29k
{
551
5.29k
  int i;
552
5.29k
  int n;
553
5.29k
  isl_ctx *ctx;
554
5.29k
  MULTI(BASE) *multi;
555
5.29k
556
5.29k
  if (!space || 
!list5.29k
)
557
2
    goto error;
558
5.29k
559
5.29k
  ctx = isl_space_get_ctx(space);
560
5.29k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
5.29k
  if (n != isl_space_dim(space, isl_dim_out))
562
5.29k
    
isl_die0
(ctx, isl_error_invalid,
563
5.29k
      "invalid number of elements in list", goto error);
564
5.29k
565
5.29k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
566
12.6k
  for (i = 0; i < n; 
++i7.35k
) {
567
7.35k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
7.35k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
7.35k
  }
570
5.29k
571
5.29k
  isl_space_free(space);
572
5.29k
  FN(LIST(EL),free)(list);
573
5.29k
  return multi;
574
5.29k
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
5.29k
}
Unexecuted instantiation: isl_multi_aff_from_aff_list
isl_multi_pw_aff_from_pw_aff_list
Line
Count
Source
550
5.26k
{
551
5.26k
  int i;
552
5.26k
  int n;
553
5.26k
  isl_ctx *ctx;
554
5.26k
  MULTI(BASE) *multi;
555
5.26k
556
5.26k
  if (!space || 
!list5.26k
)
557
2
    goto error;
558
5.26k
559
5.26k
  ctx = isl_space_get_ctx(space);
560
5.26k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
5.26k
  if (n != isl_space_dim(space, isl_dim_out))
562
5.26k
    
isl_die0
(ctx, isl_error_invalid,
563
5.26k
      "invalid number of elements in list", goto error);
564
5.26k
565
5.26k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
566
12.5k
  for (i = 0; i < n; 
++i7.30k
) {
567
7.30k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
7.30k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
7.30k
  }
570
5.26k
571
5.26k
  isl_space_free(space);
572
5.26k
  FN(LIST(EL),free)(list);
573
5.26k
  return multi;
574
5.26k
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
5.26k
}
isl_multi_union_pw_aff_from_union_pw_aff_list
Line
Count
Source
550
15
{
551
15
  int i;
552
15
  int n;
553
15
  isl_ctx *ctx;
554
15
  MULTI(BASE) *multi;
555
15
556
15
  if (!space || !list)
557
0
    goto error;
558
15
559
15
  ctx = isl_space_get_ctx(space);
560
15
  n = FN(FN(LIST(EL),n),BASE)(list);
561
15
  if (n != isl_space_dim(space, isl_dim_out))
562
15
    
isl_die0
(ctx, isl_error_invalid,
563
15
      "invalid number of elements in list", goto error);
564
15
565
15
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
566
42
  for (i = 0; i < n; 
++i27
) {
567
27
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
27
          FN(FN(LIST(EL),get),BASE)(list, i));
569
27
  }
570
15
571
15
  isl_space_free(space);
572
15
  FN(LIST(EL),free)(list);
573
15
  return multi;
574
15
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
15
}
isl_multi_val_from_val_list
Line
Count
Source
550
11
{
551
11
  int i;
552
11
  int n;
553
11
  isl_ctx *ctx;
554
11
  MULTI(BASE) *multi;
555
11
556
11
  if (!space || !list)
557
0
    goto error;
558
11
559
11
  ctx = isl_space_get_ctx(space);
560
11
  n = FN(FN(LIST(EL),n),BASE)(list);
561
11
  if (n != isl_space_dim(space, isl_dim_out))
562
11
    
isl_die0
(ctx, isl_error_invalid,
563
11
      "invalid number of elements in list", goto error);
564
11
565
11
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
566
32
  for (i = 0; i < n; 
++i21
) {
567
21
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
21
          FN(FN(LIST(EL),get),BASE)(list, i));
569
21
  }
570
11
571
11
  isl_space_free(space);
572
11
  FN(LIST(EL),free)(list);
573
11
  return multi;
574
11
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
11
}
579
580
#ifndef NO_IDENTITY
581
/* Create a multi expression in the given space that maps each
582
 * input dimension to the corresponding output dimension.
583
 */
584
__isl_give MULTI(BASE) *FN(MULTI(BASE),identity)(__isl_take isl_space *space)
585
6.11k
{
586
6.11k
  int i, n;
587
6.11k
  isl_local_space *ls;
588
6.11k
  MULTI(BASE) *multi;
589
6.11k
590
6.11k
  if (!space)
591
0
    return NULL;
592
6.11k
593
6.11k
  if (isl_space_is_set(space))
594
6.11k
    
isl_die0
(isl_space_get_ctx(space), isl_error_invalid,
595
6.11k
      "expecting map space", goto error);
596
6.11k
597
6.11k
  n = isl_space_dim(space, isl_dim_out);
598
6.11k
  if (n != isl_space_dim(space, isl_dim_in))
599
6.11k
    
isl_die0
(isl_space_get_ctx(space), isl_error_invalid,
600
6.11k
      "number of input and output dimensions needs to be "
601
6.11k
      "the same", goto error);
602
6.11k
603
6.11k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
604
6.11k
605
6.11k
  if (!n) {
606
2.05k
    isl_space_free(space);
607
2.05k
    return multi;
608
2.05k
  }
609
4.06k
610
4.06k
  space = isl_space_domain(space);
611
4.06k
  ls = isl_local_space_from_space(space);
612
4.06k
613
28.0k
  for (i = 0; i < n; 
++i23.9k
) {
614
23.9k
    EL *el;
615
23.9k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
23.9k
            isl_dim_set, i);
617
23.9k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
23.9k
  }
619
4.06k
620
4.06k
  isl_local_space_free(ls);
621
4.06k
622
4.06k
  return multi;
623
4.06k
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
6.11k
}
isl_multi_aff_identity
Line
Count
Source
585
6.11k
{
586
6.11k
  int i, n;
587
6.11k
  isl_local_space *ls;
588
6.11k
  MULTI(BASE) *multi;
589
6.11k
590
6.11k
  if (!space)
591
0
    return NULL;
592
6.11k
593
6.11k
  if (isl_space_is_set(space))
594
6.11k
    
isl_die0
(isl_space_get_ctx(space), isl_error_invalid,
595
6.11k
      "expecting map space", goto error);
596
6.11k
597
6.11k
  n = isl_space_dim(space, isl_dim_out);
598
6.11k
  if (n != isl_space_dim(space, isl_dim_in))
599
6.11k
    
isl_die0
(isl_space_get_ctx(space), isl_error_invalid,
600
6.11k
      "number of input and output dimensions needs to be "
601
6.11k
      "the same", goto error);
602
6.11k
603
6.11k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
604
6.11k
605
6.11k
  if (!n) {
606
2.05k
    isl_space_free(space);
607
2.05k
    return multi;
608
2.05k
  }
609
4.06k
610
4.06k
  space = isl_space_domain(space);
611
4.06k
  ls = isl_local_space_from_space(space);
612
4.06k
613
28.0k
  for (i = 0; i < n; 
++i23.9k
) {
614
23.9k
    EL *el;
615
23.9k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
23.9k
            isl_dim_set, i);
617
23.9k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
23.9k
  }
619
4.06k
620
4.06k
  isl_local_space_free(ls);
621
4.06k
622
4.06k
  return multi;
623
4.06k
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
6.11k
}
Unexecuted instantiation: isl_multi_pw_aff_identity
627
#endif
628
629
#ifndef NO_ZERO
630
/* Construct a multi expression in the given space with value zero in
631
 * each of the output dimensions.
632
 */
633
__isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
634
5.93k
{
635
5.93k
  int n;
636
5.93k
  MULTI(BASE) *multi;
637
5.93k
638
5.93k
  if (!space)
639
0
    return NULL;
640
5.93k
641
5.93k
  n = isl_space_dim(space , isl_dim_out);
642
5.93k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
5.93k
644
5.93k
  if (!n)
645
1.21k
    isl_space_free(space);
646
4.71k
  else {
647
4.71k
    int i;
648
4.71k
    isl_local_space *ls;
649
4.71k
    EL *el;
650
4.71k
651
4.71k
    space = isl_space_domain(space);
652
4.71k
    ls = isl_local_space_from_space(space);
653
4.71k
    el = FN(EL,zero_on_domain)(ls);
654
4.71k
655
11.3k
    for (i = 0; i < n; 
++i6.66k
)
656
6.66k
      multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
657
6.66k
                  FN(EL,copy)(el));
658
4.71k
659
4.71k
    FN(EL,free)(el);
660
4.71k
  }
661
5.93k
662
5.93k
  return multi;
663
5.93k
}
isl_multi_aff_zero
Line
Count
Source
634
2.50k
{
635
2.50k
  int n;
636
2.50k
  MULTI(BASE) *multi;
637
2.50k
638
2.50k
  if (!space)
639
0
    return NULL;
640
2.50k
641
2.50k
  n = isl_space_dim(space , isl_dim_out);
642
2.50k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.50k
644
2.50k
  if (!n)
645
1.18k
    isl_space_free(space);
646
1.31k
  else {
647
1.31k
    int i;
648
1.31k
    isl_local_space *ls;
649
1.31k
    EL *el;
650
1.31k
651
1.31k
    space = isl_space_domain(space);
652
1.31k
    ls = isl_local_space_from_space(space);
653
1.31k
    el = FN(EL,zero_on_domain)(ls);
654
1.31k
655
3.15k
    for (i = 0; i < n; 
++i1.83k
)
656
1.83k
      multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
657
1.83k
                  FN(EL,copy)(el));
658
1.31k
659
1.31k
    FN(EL,free)(el);
660
1.31k
  }
661
2.50k
662
2.50k
  return multi;
663
2.50k
}
Unexecuted instantiation: isl_multi_pw_aff_zero
isl_multi_val_zero
Line
Count
Source
634
3.43k
{
635
3.43k
  int n;
636
3.43k
  MULTI(BASE) *multi;
637
3.43k
638
3.43k
  if (!space)
639
0
    return NULL;
640
3.43k
641
3.43k
  n = isl_space_dim(space , isl_dim_out);
642
3.43k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
3.43k
644
3.43k
  if (!n)
645
29
    isl_space_free(space);
646
3.40k
  else {
647
3.40k
    int i;
648
3.40k
    isl_local_space *ls;
649
3.40k
    EL *el;
650
3.40k
651
3.40k
    space = isl_space_domain(space);
652
3.40k
    ls = isl_local_space_from_space(space);
653
3.40k
    el = FN(EL,zero_on_domain)(ls);
654
3.40k
655
8.22k
    for (i = 0; i < n; 
++i4.82k
)
656
4.82k
      multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
657
4.82k
                  FN(EL,copy)(el));
658
3.40k
659
3.40k
    FN(EL,free)(el);
660
3.40k
  }
661
3.43k
662
3.43k
  return multi;
663
3.43k
}
664
#endif
665
666
#ifndef NO_FROM_BASE
667
/* Create a multiple expression with a single output/set dimension
668
 * equal to "el".
669
 * For most multiple expression types, the base type has a single
670
 * output/set dimension and the space of the result is therefore
671
 * the same as the space of the input.
672
 * In the case of isl_multi_union_pw_aff, however, the base type
673
 * lives in a parameter space and we therefore need to add
674
 * a single set dimension.
675
 */
676
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),BASE)(__isl_take EL *el)
677
254
{
678
254
  isl_space *space;
679
254
  MULTI(BASE) *multi;
680
254
681
254
  space = FN(EL,get_space(el));
682
254
  if (isl_space_is_params(space)) {
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
254
  multi = FN(MULTI(BASE),alloc)(space);
687
254
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
254
689
254
  return multi;
690
254
}
isl_multi_aff_from_aff
Line
Count
Source
677
254
{
678
254
  isl_space *space;
679
254
  MULTI(BASE) *multi;
680
254
681
254
  space = FN(EL,get_space(el));
682
254
  if (isl_space_is_params(space)) {
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
254
  multi = FN(MULTI(BASE),alloc)(space);
687
254
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
254
689
254
  return multi;
690
254
}
Unexecuted instantiation: isl_multi_pw_aff_from_pw_aff
Unexecuted instantiation: isl_multi_union_pw_aff_from_union_pw_aff
691
#endif
692
693
__isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)(
694
  __isl_take MULTI(BASE) *multi,
695
  enum isl_dim_type type, unsigned first, unsigned n)
696
1.42k
{
697
1.42k
  int i;
698
1.42k
  unsigned dim;
699
1.42k
700
1.42k
  multi = FN(MULTI(BASE),cow)(multi);
701
1.42k
  if (!multi)
702
0
    return NULL;
703
1.42k
704
1.42k
  dim = FN(MULTI(BASE),dim)(multi, type);
705
1.42k
  if (first + n > dim || first + n < first)
706
1.42k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
1.42k
      "index out of bounds",
708
1.42k
      return FN(MULTI(BASE),free)(multi));
709
1.42k
710
1.42k
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
1.42k
  if (!multi->space)
712
0
    return FN(MULTI(BASE),free)(multi);
713
1.42k
714
1.42k
  if (type == isl_dim_out) {
715
2.19k
    for (i = 0; i < n; 
++i1.11k
)
716
1.11k
      FN(EL,free)(multi->p[first + i]);
717
1.94k
    for (i = first; i + n < multi->n; 
++i872
)
718
1.07k
      
multi->p[i] = multi->p[i + n]872
;
719
1.07k
    multi->n -= n;
720
1.07k
721
1.07k
    return multi;
722
1.07k
  }
723
346
724
1.50k
  
for (i = 0; 346
i < multi->n;
++i1.15k
) {
725
1.15k
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
1.15k
    if (!multi->p[i])
727
0
      return FN(MULTI(BASE),free)(multi);
728
1.15k
  }
729
346
730
346
  return multi;
731
1.42k
}
isl_multi_aff_drop_dims
Line
Count
Source
696
1.35k
{
697
1.35k
  int i;
698
1.35k
  unsigned dim;
699
1.35k
700
1.35k
  multi = FN(MULTI(BASE),cow)(multi);
701
1.35k
  if (!multi)
702
0
    return NULL;
703
1.35k
704
1.35k
  dim = FN(MULTI(BASE),dim)(multi, type);
705
1.35k
  if (first + n > dim || first + n < first)
706
1.35k
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
1.35k
      "index out of bounds",
708
1.35k
      return FN(MULTI(BASE),free)(multi));
709
1.35k
710
1.35k
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
1.35k
  if (!multi->space)
712
0
    return FN(MULTI(BASE),free)(multi);
713
1.35k
714
1.35k
  if (type == isl_dim_out) {
715
2.04k
    for (i = 0; i < n; 
++i1.03k
)
716
1.03k
      FN(EL,free)(multi->p[first + i]);
717
1.84k
    for (i = first; i + n < multi->n; 
++i833
)
718
1.01k
      
multi->p[i] = multi->p[i + n]833
;
719
1.01k
    multi->n -= n;
720
1.01k
721
1.01k
    return multi;
722
1.01k
  }
723
346
724
1.50k
  
for (i = 0; 346
i < multi->n;
++i1.15k
) {
725
1.15k
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
1.15k
    if (!multi->p[i])
727
0
      return FN(MULTI(BASE),free)(multi);
728
1.15k
  }
729
346
730
346
  return multi;
731
1.35k
}
Unexecuted instantiation: isl_multi_pw_aff_drop_dims
isl_multi_union_pw_aff_drop_dims
Line
Count
Source
696
66
{
697
66
  int i;
698
66
  unsigned dim;
699
66
700
66
  multi = FN(MULTI(BASE),cow)(multi);
701
66
  if (!multi)
702
0
    return NULL;
703
66
704
66
  dim = FN(MULTI(BASE),dim)(multi, type);
705
66
  if (first + n > dim || first + n < first)
706
66
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
66
      "index out of bounds",
708
66
      return FN(MULTI(BASE),free)(multi));
709
66
710
66
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
66
  if (!multi->space)
712
0
    return FN(MULTI(BASE),free)(multi);
713
66
714
66
  if (type == isl_dim_out) {
715
150
    for (i = 0; i < n; 
++i84
)
716
84
      FN(EL,free)(multi->p[first + i]);
717
105
    for (i = first; i + n < multi->n; 
++i39
)
718
66
      
multi->p[i] = multi->p[i + n]39
;
719
66
    multi->n -= n;
720
66
721
66
    return multi;
722
66
  }
723
0
724
0
  for (i = 0; i < multi->n; ++i) {
725
0
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
0
    if (!multi->p[i])
727
0
      return FN(MULTI(BASE),free)(multi);
728
0
  }
729
0
730
0
  return multi;
731
66
}
Unexecuted instantiation: isl_multi_val_drop_dims
732
733
/* Align the parameters of "multi1" and "multi2" (if needed) and call "fn".
734
 */
735
static __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params_multi_multi_and)(
736
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2,
737
  __isl_give MULTI(BASE) *(*fn)(__isl_take MULTI(BASE) *multi1,
738
    __isl_take MULTI(BASE) *multi2))
739
6.65k
{
740
6.65k
  isl_ctx *ctx;
741
6.65k
  isl_bool equal_params;
742
6.65k
743
6.65k
  if (!multi1 || !multi2)
744
0
    goto error;
745
6.65k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
6.65k
  if (equal_params < 0)
747
0
    goto error;
748
6.65k
  if (equal_params)
749
6.63k
    return fn(multi1, multi2);
750
20
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
751
20
  if (!isl_space_has_named_params(multi1->space) ||
752
20
      !isl_space_has_named_params(multi2->space))
753
20
    
isl_die0
(ctx, isl_error_invalid,
754
20
      "unaligned unnamed parameters", goto error);
755
20
  multi1 = FN(MULTI(BASE),align_params)(multi1,
756
20
              FN(MULTI(BASE),get_space)(multi2));
757
20
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
20
              FN(MULTI(BASE),get_space)(multi1));
759
20
  return fn(multi1, multi2);
760
20
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
6.65k
}
isl_aff.c:isl_multi_aff_align_params_multi_multi_and
Line
Count
Source
739
4.33k
{
740
4.33k
  isl_ctx *ctx;
741
4.33k
  isl_bool equal_params;
742
4.33k
743
4.33k
  if (!multi1 || !multi2)
744
0
    goto error;
745
4.33k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
4.33k
  if (equal_params < 0)
747
0
    goto error;
748
4.33k
  if (equal_params)
749
4.33k
    return fn(multi1, multi2);
750
0
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  multi1 = FN(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
4.33k
}
isl_aff.c:isl_multi_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
5
{
740
5
  isl_ctx *ctx;
741
5
  isl_bool equal_params;
742
5
743
5
  if (!multi1 || !multi2)
744
0
    goto error;
745
5
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
5
  if (equal_params < 0)
747
0
    goto error;
748
5
  if (equal_params)
749
5
    return fn(multi1, multi2);
750
0
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  multi1 = FN(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
5
}
isl_aff.c:isl_multi_union_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
2.31k
{
740
2.31k
  isl_ctx *ctx;
741
2.31k
  isl_bool equal_params;
742
2.31k
743
2.31k
  if (!multi1 || !multi2)
744
0
    goto error;
745
2.31k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
2.31k
  if (equal_params < 0)
747
0
    goto error;
748
2.31k
  if (equal_params)
749
2.29k
    return fn(multi1, multi2);
750
20
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
751
20
  if (!isl_space_has_named_params(multi1->space) ||
752
20
      !isl_space_has_named_params(multi2->space))
753
20
    
isl_die0
(ctx, isl_error_invalid,
754
20
      "unaligned unnamed parameters", goto error);
755
20
  multi1 = FN(MULTI(BASE),align_params)(multi1,
756
20
              FN(MULTI(BASE),get_space)(multi2));
757
20
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
20
              FN(MULTI(BASE),get_space)(multi1));
759
20
  return fn(multi1, multi2);
760
20
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
2.31k
}
Unexecuted instantiation: isl_val.c:isl_multi_val_align_params_multi_multi_and
765
766
/* Given two MULTI(BASE)s A -> B and C -> D,
767
 * construct a MULTI(BASE) (A * C) -> [B -> D].
768
 *
769
 * The parameters are assumed to have been aligned.
770
 */
771
static __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product_aligned)(
772
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
773
2.40k
{
774
2.40k
  int i, n1, n2;
775
2.40k
  EL *el;
776
2.40k
  isl_space *space;
777
2.40k
  MULTI(BASE) *res;
778
2.40k
779
2.40k
  if (!multi1 || !multi2)
780
0
    goto error;
781
2.40k
782
2.40k
  space = isl_space_range_product(FN(MULTI(BASE),get_space)(multi1),
783
2.40k
          FN(MULTI(BASE),get_space)(multi2));
784
2.40k
  res = FN(MULTI(BASE),alloc)(space);
785
2.40k
786
2.40k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
2.40k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
2.40k
789
5.36k
  for (i = 0; i < n1; 
++i2.95k
) {
790
2.95k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.95k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.95k
  }
793
2.40k
794
4.24k
  for (i = 0; i < n2; 
++i1.83k
) {
795
1.83k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.83k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.83k
  }
798
2.40k
799
2.40k
  FN(MULTI(BASE),free)(multi1);
800
2.40k
  FN(MULTI(BASE),free)(multi2);
801
2.40k
  return res;
802
2.40k
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
2.40k
}
isl_aff.c:isl_multi_aff_range_product_aligned
Line
Count
Source
773
244
{
774
244
  int i, n1, n2;
775
244
  EL *el;
776
244
  isl_space *space;
777
244
  MULTI(BASE) *res;
778
244
779
244
  if (!multi1 || !multi2)
780
0
    goto error;
781
244
782
244
  space = isl_space_range_product(FN(MULTI(BASE),get_space)(multi1),
783
244
          FN(MULTI(BASE),get_space)(multi2));
784
244
  res = FN(MULTI(BASE),alloc)(space);
785
244
786
244
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
244
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
244
789
918
  for (i = 0; i < n1; 
++i674
) {
790
674
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
674
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
674
  }
793
244
794
506
  for (i = 0; i < n2; 
++i262
) {
795
262
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
262
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
262
  }
798
244
799
244
  FN(MULTI(BASE),free)(multi1);
800
244
  FN(MULTI(BASE),free)(multi2);
801
244
  return res;
802
244
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
244
}
isl_aff.c:isl_multi_pw_aff_range_product_aligned
Line
Count
Source
773
5
{
774
5
  int i, n1, n2;
775
5
  EL *el;
776
5
  isl_space *space;
777
5
  MULTI(BASE) *res;
778
5
779
5
  if (!multi1 || !multi2)
780
0
    goto error;
781
5
782
5
  space = isl_space_range_product(FN(MULTI(BASE),get_space)(multi1),
783
5
          FN(MULTI(BASE),get_space)(multi2));
784
5
  res = FN(MULTI(BASE),alloc)(space);
785
5
786
5
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
5
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
5
789
14
  for (i = 0; i < n1; 
++i9
) {
790
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
9
  }
793
5
794
14
  for (i = 0; i < n2; 
++i9
) {
795
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
9
  }
798
5
799
5
  FN(MULTI(BASE),free)(multi1);
800
5
  FN(MULTI(BASE),free)(multi2);
801
5
  return res;
802
5
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
5
}
isl_aff.c:isl_multi_union_pw_aff_range_product_aligned
Line
Count
Source
773
2.15k
{
774
2.15k
  int i, n1, n2;
775
2.15k
  EL *el;
776
2.15k
  isl_space *space;
777
2.15k
  MULTI(BASE) *res;
778
2.15k
779
2.15k
  if (!multi1 || !multi2)
780
0
    goto error;
781
2.15k
782
2.15k
  space = isl_space_range_product(FN(MULTI(BASE),get_space)(multi1),
783
2.15k
          FN(MULTI(BASE),get_space)(multi2));
784
2.15k
  res = FN(MULTI(BASE),alloc)(space);
785
2.15k
786
2.15k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
2.15k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
2.15k
789
4.43k
  for (i = 0; i < n1; 
++i2.27k
) {
790
2.27k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.27k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.27k
  }
793
2.15k
794
3.72k
  for (i = 0; i < n2; 
++i1.56k
) {
795
1.56k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.56k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.56k
  }
798
2.15k
799
2.15k
  FN(MULTI(BASE),free)(multi1);
800
2.15k
  FN(MULTI(BASE),free)(multi2);
801
2.15k
  return res;
802
2.15k
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
2.15k
}
Unexecuted instantiation: isl_val.c:isl_multi_val_range_product_aligned
807
808
/* Given two MULTI(BASE)s A -> B and C -> D,
809
 * construct a MULTI(BASE) (A * C) -> [B -> D].
810
 */
811
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)(
812
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
813
2.40k
{
814
2.40k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
2.40k
          &FN(MULTI(BASE),range_product_aligned));
816
2.40k
}
isl_multi_aff_range_product
Line
Count
Source
813
244
{
814
244
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
244
          &FN(MULTI(BASE),range_product_aligned));
816
244
}
isl_multi_pw_aff_range_product
Line
Count
Source
813
5
{
814
5
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
5
          &FN(MULTI(BASE),range_product_aligned));
816
5
}
isl_multi_union_pw_aff_range_product
Line
Count
Source
813
2.15k
{
814
2.15k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
2.15k
          &FN(MULTI(BASE),range_product_aligned));
816
2.15k
}
Unexecuted instantiation: isl_multi_val_range_product
817
818
/* Is the range of "multi" a wrapped relation?
819
 */
820
isl_bool FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi)
821
993
{
822
993
  if (!multi)
823
0
    return isl_bool_error;
824
993
  return isl_space_range_is_wrapping(multi->space);
825
993
}
Unexecuted instantiation: isl_multi_aff_range_is_wrapping
isl_multi_pw_aff_range_is_wrapping
Line
Count
Source
821
993
{
822
993
  if (!multi)
823
0
    return isl_bool_error;
824
993
  return isl_space_range_is_wrapping(multi->space);
825
993
}
Unexecuted instantiation: isl_multi_union_pw_aff_range_is_wrapping
Unexecuted instantiation: isl_multi_val_range_is_wrapping
826
827
/* Given a function A -> [B -> C], extract the function A -> B.
828
 */
829
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_domain)(
830
  __isl_take MULTI(BASE) *multi)
831
0
{
832
0
  isl_space *space;
833
0
  int total, keep;
834
0
835
0
  if (!multi)
836
0
    return NULL;
837
0
  if (!isl_space_range_is_wrapping(multi->space))
838
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
839
0
      "range is not a product",
840
0
      return FN(MULTI(BASE),free)(multi));
841
0
842
0
  space = FN(MULTI(BASE),get_space)(multi);
843
0
  total = isl_space_dim(space, isl_dim_out);
844
0
  space = isl_space_range_factor_domain(space);
845
0
  keep = isl_space_dim(space, isl_dim_out);
846
0
  multi = FN(MULTI(BASE),drop_dims)(multi,
847
0
          isl_dim_out, keep, total - keep);
848
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
849
0
850
0
  return multi;
851
0
}
Unexecuted instantiation: isl_multi_aff_range_factor_domain
Unexecuted instantiation: isl_multi_pw_aff_range_factor_domain
Unexecuted instantiation: isl_multi_union_pw_aff_range_factor_domain
Unexecuted instantiation: isl_multi_val_range_factor_domain
852
853
/* Given a function A -> [B -> C], extract the function A -> C.
854
 */
855
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_factor_range)(
856
  __isl_take MULTI(BASE) *multi)
857
0
{
858
0
  isl_space *space;
859
0
  int total, keep;
860
0
861
0
  if (!multi)
862
0
    return NULL;
863
0
  if (!isl_space_range_is_wrapping(multi->space))
864
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
865
0
      "range is not a product",
866
0
      return FN(MULTI(BASE),free)(multi));
867
0
868
0
  space = FN(MULTI(BASE),get_space)(multi);
869
0
  total = isl_space_dim(space, isl_dim_out);
870
0
  space = isl_space_range_factor_range(space);
871
0
  keep = isl_space_dim(space, isl_dim_out);
872
0
  multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_out, 0, total - keep);
873
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
874
0
875
0
  return multi;
876
0
}
Unexecuted instantiation: isl_multi_aff_range_factor_range
Unexecuted instantiation: isl_multi_pw_aff_range_factor_range
Unexecuted instantiation: isl_multi_union_pw_aff_range_factor_range
Unexecuted instantiation: isl_multi_val_range_factor_range
877
878
/* Given a function [B -> C], extract the function C.
879
 */
880
__isl_give MULTI(BASE) *FN(MULTI(BASE),factor_range)(
881
  __isl_take MULTI(BASE) *multi)
882
0
{
883
0
  isl_space *space;
884
0
  int total, keep;
885
0
886
0
  if (!multi)
887
0
    return NULL;
888
0
  if (!isl_space_is_wrapping(multi->space))
889
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
890
0
      "not a product", return FN(MULTI(BASE),free)(multi));
891
0
892
0
  space = FN(MULTI(BASE),get_space)(multi);
893
0
  total = isl_space_dim(space, isl_dim_out);
894
0
  space = isl_space_factor_range(space);
895
0
  keep = isl_space_dim(space, isl_dim_out);
896
0
  multi = FN(MULTI(BASE),drop_dims)(multi, isl_dim_out, 0, total - keep);
897
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
898
0
899
0
  return multi;
900
0
}
Unexecuted instantiation: isl_multi_aff_factor_range
Unexecuted instantiation: isl_multi_pw_aff_factor_range
Unexecuted instantiation: isl_multi_union_pw_aff_factor_range
Unexecuted instantiation: isl_multi_val_factor_range
901
902
#ifndef NO_PRODUCT
903
/* Given two MULTI(BASE)s A -> B and C -> D,
904
 * construct a MULTI(BASE) [A -> C] -> [B -> D].
905
 *
906
 * The parameters are assumed to have been aligned.
907
 */
908
__isl_give MULTI(BASE) *FN(MULTI(BASE),product_aligned)(
909
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
910
1.85k
{
911
1.85k
  int i;
912
1.85k
  EL *el;
913
1.85k
  isl_space *space;
914
1.85k
  MULTI(BASE) *res;
915
1.85k
  int in1, in2, out1, out2;
916
1.85k
917
1.85k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.85k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.85k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.85k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.85k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.85k
          FN(MULTI(BASE),get_space)(multi2));
923
1.85k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.85k
  space = isl_space_domain(space);
925
1.85k
926
3.42k
  for (i = 0; i < out1; 
++i1.57k
) {
927
1.57k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.57k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.57k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.57k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.57k
  }
932
1.85k
933
4.41k
  for (i = 0; i < out2; 
++i2.56k
) {
934
2.56k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.56k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.56k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.56k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.56k
  }
939
1.85k
940
1.85k
  isl_space_free(space);
941
1.85k
  FN(MULTI(BASE),free)(multi1);
942
1.85k
  FN(MULTI(BASE),free)(multi2);
943
1.85k
  return res;
944
1.85k
}
isl_multi_aff_product_aligned
Line
Count
Source
910
1.85k
{
911
1.85k
  int i;
912
1.85k
  EL *el;
913
1.85k
  isl_space *space;
914
1.85k
  MULTI(BASE) *res;
915
1.85k
  int in1, in2, out1, out2;
916
1.85k
917
1.85k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.85k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.85k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.85k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.85k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.85k
          FN(MULTI(BASE),get_space)(multi2));
923
1.85k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.85k
  space = isl_space_domain(space);
925
1.85k
926
3.42k
  for (i = 0; i < out1; 
++i1.57k
) {
927
1.57k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.57k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.57k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.57k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.57k
  }
932
1.85k
933
4.41k
  for (i = 0; i < out2; 
++i2.56k
) {
934
2.56k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.56k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.56k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.56k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.56k
  }
939
1.85k
940
1.85k
  isl_space_free(space);
941
1.85k
  FN(MULTI(BASE),free)(multi1);
942
1.85k
  FN(MULTI(BASE),free)(multi2);
943
1.85k
  return res;
944
1.85k
}
Unexecuted instantiation: isl_multi_pw_aff_product_aligned
Unexecuted instantiation: isl_multi_val_product_aligned
945
946
/* Given two MULTI(BASE)s A -> B and C -> D,
947
 * construct a MULTI(BASE) [A -> C] -> [B -> D].
948
 */
949
__isl_give MULTI(BASE) *FN(MULTI(BASE),product)(
950
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
951
1.85k
{
952
1.85k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.85k
          &FN(MULTI(BASE),product_aligned));
954
1.85k
}
isl_multi_aff_product
Line
Count
Source
951
1.85k
{
952
1.85k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.85k
          &FN(MULTI(BASE),product_aligned));
954
1.85k
}
Unexecuted instantiation: isl_multi_pw_aff_product
Unexecuted instantiation: isl_multi_val_product
955
#endif
956
957
__isl_give MULTI(BASE) *FN(MULTI(BASE),flatten_range)(
958
  __isl_take MULTI(BASE) *multi)
959
2.90k
{
960
2.90k
  if (!multi)
961
0
    return NULL;
962
2.90k
963
2.90k
  if (!multi->space->nested[1])
964
0
    return multi;
965
2.90k
966
2.90k
  multi = FN(MULTI(BASE),cow)(multi);
967
2.90k
  if (!multi)
968
0
    return NULL;
969
2.90k
970
2.90k
  multi->space = isl_space_flatten_range(multi->space);
971
2.90k
  if (!multi->space)
972
0
    return FN(MULTI(BASE),free)(multi);
973
2.90k
974
2.90k
  return multi;
975
2.90k
}
isl_multi_aff_flatten_range
Line
Count
Source
959
748
{
960
748
  if (!multi)
961
0
    return NULL;
962
748
963
748
  if (!multi->space->nested[1])
964
0
    return multi;
965
748
966
748
  multi = FN(MULTI(BASE),cow)(multi);
967
748
  if (!multi)
968
0
    return NULL;
969
748
970
748
  multi->space = isl_space_flatten_range(multi->space);
971
748
  if (!multi->space)
972
0
    return FN(MULTI(BASE),free)(multi);
973
748
974
748
  return multi;
975
748
}
isl_multi_pw_aff_flatten_range
Line
Count
Source
959
1
{
960
1
  if (!multi)
961
0
    return NULL;
962
1
963
1
  if (!multi->space->nested[1])
964
0
    return multi;
965
1
966
1
  multi = FN(MULTI(BASE),cow)(multi);
967
1
  if (!multi)
968
0
    return NULL;
969
1
970
1
  multi->space = isl_space_flatten_range(multi->space);
971
1
  if (!multi->space)
972
0
    return FN(MULTI(BASE),free)(multi);
973
1
974
1
  return multi;
975
1
}
isl_multi_union_pw_aff_flatten_range
Line
Count
Source
959
2.15k
{
960
2.15k
  if (!multi)
961
0
    return NULL;
962
2.15k
963
2.15k
  if (!multi->space->nested[1])
964
0
    return multi;
965
2.15k
966
2.15k
  multi = FN(MULTI(BASE),cow)(multi);
967
2.15k
  if (!multi)
968
0
    return NULL;
969
2.15k
970
2.15k
  multi->space = isl_space_flatten_range(multi->space);
971
2.15k
  if (!multi->space)
972
0
    return FN(MULTI(BASE),free)(multi);
973
2.15k
974
2.15k
  return multi;
975
2.15k
}
Unexecuted instantiation: isl_multi_val_flatten_range
976
977
/* Given two MULTI(BASE)s A -> B and C -> D,
978
 * construct a MULTI(BASE) (A * C) -> (B, D).
979
 */
980
__isl_give MULTI(BASE) *FN(MULTI(BASE),flat_range_product)(
981
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
982
2.29k
{
983
2.29k
  MULTI(BASE) *multi;
984
2.29k
985
2.29k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
2.29k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
2.29k
  return multi;
988
2.29k
}
isl_multi_aff_flat_range_product
Line
Count
Source
982
132
{
983
132
  MULTI(BASE) *multi;
984
132
985
132
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
132
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
132
  return multi;
988
132
}
isl_multi_pw_aff_flat_range_product
Line
Count
Source
982
1
{
983
1
  MULTI(BASE) *multi;
984
1
985
1
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1
  return multi;
988
1
}
isl_multi_union_pw_aff_flat_range_product
Line
Count
Source
982
2.15k
{
983
2.15k
  MULTI(BASE) *multi;
984
2.15k
985
2.15k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
2.15k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
2.15k
  return multi;
988
2.15k
}
Unexecuted instantiation: isl_multi_val_flat_range_product
989
990
/* Given two multi expressions, "multi1"
991
 *
992
 *  [A] -> [B1 B2]
993
 *
994
 * where B2 starts at position "pos", and "multi2"
995
 *
996
 *  [A] -> [D]
997
 *
998
 * return the multi expression
999
 *
1000
 *  [A] -> [B1 D B2]
1001
 */
1002
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_splice)(
1003
  __isl_take MULTI(BASE) *multi1, unsigned pos,
1004
  __isl_take MULTI(BASE) *multi2)
1005
9
{
1006
9
  MULTI(BASE) *res;
1007
9
  unsigned dim;
1008
9
1009
9
  if (!multi1 || !multi2)
1010
0
    goto error;
1011
9
1012
9
  dim = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
1013
9
  if (pos > dim)
1014
9
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1015
9
      "index out of bounds", goto error);
1016
9
1017
9
  res = FN(MULTI(BASE),copy)(multi1);
1018
9
  res = FN(MULTI(BASE),drop_dims)(res, isl_dim_out, pos, dim - pos);
1019
9
  multi1 = FN(MULTI(BASE),drop_dims)(multi1, isl_dim_out, 0, pos);
1020
9
1021
9
  res = FN(MULTI(BASE),flat_range_product)(res, multi2);
1022
9
  res = FN(MULTI(BASE),flat_range_product)(res, multi1);
1023
9
1024
9
  return res;
1025
9
error:
1026
0
  FN(MULTI(BASE),free)(multi1);
1027
0
  FN(MULTI(BASE),free)(multi2);
1028
0
  return NULL;
1029
9
}
isl_multi_aff_range_splice
Line
Count
Source
1005
9
{
1006
9
  MULTI(BASE) *res;
1007
9
  unsigned dim;
1008
9
1009
9
  if (!multi1 || !multi2)
1010
0
    goto error;
1011
9
1012
9
  dim = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
1013
9
  if (pos > dim)
1014
9
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1015
9
      "index out of bounds", goto error);
1016
9
1017
9
  res = FN(MULTI(BASE),copy)(multi1);
1018
9
  res = FN(MULTI(BASE),drop_dims)(res, isl_dim_out, pos, dim - pos);
1019
9
  multi1 = FN(MULTI(BASE),drop_dims)(multi1, isl_dim_out, 0, pos);
1020
9
1021
9
  res = FN(MULTI(BASE),flat_range_product)(res, multi2);
1022
9
  res = FN(MULTI(BASE),flat_range_product)(res, multi1);
1023
9
1024
9
  return res;
1025
9
error:
1026
0
  FN(MULTI(BASE),free)(multi1);
1027
0
  FN(MULTI(BASE),free)(multi2);
1028
0
  return NULL;
1029
9
}
Unexecuted instantiation: isl_multi_pw_aff_range_splice
Unexecuted instantiation: isl_multi_union_pw_aff_range_splice
Unexecuted instantiation: isl_multi_val_range_splice
1030
1031
#ifndef NO_SPLICE
1032
/* Given two multi expressions, "multi1"
1033
 *
1034
 *  [A1 A2] -> [B1 B2]
1035
 *
1036
 * where A2 starts at position "in_pos" and B2 starts at position "out_pos",
1037
 * and "multi2"
1038
 *
1039
 *  [C] -> [D]
1040
 *
1041
 * return the multi expression
1042
 *
1043
 *  [A1 C A2] -> [B1 D B2]
1044
 *
1045
 * We first insert input dimensions to obtain
1046
 *
1047
 *  [A1 C A2] -> [B1 B2]
1048
 *
1049
 * and
1050
 *
1051
 *  [A1 C A2] -> [D]
1052
 *
1053
 * and then apply range_splice.
1054
 */
1055
__isl_give MULTI(BASE) *FN(MULTI(BASE),splice)(
1056
  __isl_take MULTI(BASE) *multi1, unsigned in_pos, unsigned out_pos,
1057
  __isl_take MULTI(BASE) *multi2)
1058
6
{
1059
6
  unsigned n_in1;
1060
6
  unsigned n_in2;
1061
6
1062
6
  if (!multi1 || !multi2)
1063
0
    goto error;
1064
6
1065
6
  n_in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
1066
6
  if (in_pos > n_in1)
1067
6
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1068
6
      "index out of bounds", goto error);
1069
6
1070
6
  n_in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
1071
6
1072
6
  multi1 = FN(MULTI(BASE),insert_dims)(multi1, isl_dim_in, in_pos, n_in2);
1073
6
  multi2 = FN(MULTI(BASE),insert_dims)(multi2, isl_dim_in, n_in2,
1074
6
            n_in1 - in_pos);
1075
6
  multi2 = FN(MULTI(BASE),insert_dims)(multi2, isl_dim_in, 0, in_pos);
1076
6
1077
6
  return FN(MULTI(BASE),range_splice)(multi1, out_pos, multi2);
1078
6
error:
1079
0
  FN(MULTI(BASE),free)(multi1);
1080
0
  FN(MULTI(BASE),free)(multi2);
1081
0
  return NULL;
1082
6
}
isl_multi_aff_splice
Line
Count
Source
1058
6
{
1059
6
  unsigned n_in1;
1060
6
  unsigned n_in2;
1061
6
1062
6
  if (!multi1 || !multi2)
1063
0
    goto error;
1064
6
1065
6
  n_in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
1066
6
  if (in_pos > n_in1)
1067
6
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1068
6
      "index out of bounds", goto error);
1069
6
1070
6
  n_in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
1071
6
1072
6
  multi1 = FN(MULTI(BASE),insert_dims)(multi1, isl_dim_in, in_pos, n_in2);
1073
6
  multi2 = FN(MULTI(BASE),insert_dims)(multi2, isl_dim_in, n_in2,
1074
6
            n_in1 - in_pos);
1075
6
  multi2 = FN(MULTI(BASE),insert_dims)(multi2, isl_dim_in, 0, in_pos);
1076
6
1077
6
  return FN(MULTI(BASE),range_splice)(multi1, out_pos, multi2);
1078
6
error:
1079
0
  FN(MULTI(BASE),free)(multi1);
1080
0
  FN(MULTI(BASE),free)(multi2);
1081
0
  return NULL;
1082
6
}
Unexecuted instantiation: isl_multi_pw_aff_splice
Unexecuted instantiation: isl_multi_val_splice
1083
#endif
1084
1085
/* This function is currently only used from isl_aff.c
1086
 */
1087
static __isl_give MULTI(BASE) *FN(MULTI(BASE),bin_op)(
1088
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2,
1089
  __isl_give EL *(*fn)(__isl_take EL *, __isl_take EL *))
1090
  __attribute__ ((unused));
1091
1092
/* Pairwise perform "fn" to the elements of "multi1" and "multi2" and
1093
 * return the result.
1094
 */
1095
static __isl_give MULTI(BASE) *FN(MULTI(BASE),bin_op)(
1096
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2,
1097
  __isl_give EL *(*fn)(__isl_take EL *, __isl_take EL *))
1098
157
{
1099
157
  int i;
1100
157
  isl_ctx *ctx;
1101
157
1102
157
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
157
  if (!multi1 || !multi2)
1104
0
    goto error;
1105
157
1106
157
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
1107
157
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
157
    
isl_die0
(ctx, isl_error_invalid,
1109
157
      "spaces don't match", goto error);
1110
157
1111
433
  
for (i = 0; 157
i < multi1->n;
++i276
) {
1112
276
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
276
    if (!multi1->p[i])
1114
0
      goto error;
1115
276
  }
1116
157
1117
157
  FN(MULTI(BASE),free)(multi2);
1118
157
  return multi1;
1119
157
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
157
}
isl_aff.c:isl_multi_aff_bin_op
Line
Count
Source
1098
3
{
1099
3
  int i;
1100
3
  isl_ctx *ctx;
1101
3
1102
3
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
3
  if (!multi1 || !multi2)
1104
0
    goto error;
1105
3
1106
3
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
1107
3
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
3
    
isl_die0
(ctx, isl_error_invalid,
1109
3
      "spaces don't match", goto error);
1110
3
1111
6
  
for (i = 0; 3
i < multi1->n;
++i3
) {
1112
3
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
3
    if (!multi1->p[i])
1114
0
      goto error;
1115
3
  }
1116
3
1117
3
  FN(MULTI(BASE),free)(multi2);
1118
3
  return multi1;
1119
3
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
3
}
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_bin_op
isl_aff.c:isl_multi_union_pw_aff_bin_op
Line
Count
Source
1098
154
{
1099
154
  int i;
1100
154
  isl_ctx *ctx;
1101
154
1102
154
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
154
  if (!multi1 || !multi2)
1104
0
    goto error;
1105
154
1106
154
  ctx = FN(MULTI(BASE),get_ctx)(multi1);
1107
154
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
154
    
isl_die0
(ctx, isl_error_invalid,
1109
154
      "spaces don't match", goto error);
1110
154
1111
427
  
for (i = 0; 154
i < multi1->n;
++i273
) {
1112
273
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
273
    if (!multi1->p[i])
1114
0
      goto error;
1115
273
  }
1116
154
1117
154
  FN(MULTI(BASE),free)(multi2);
1118
154
  return multi1;
1119
154
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
154
}
Unexecuted instantiation: isl_val.c:isl_multi_val_bin_op
1124
1125
/* Add "multi2" from "multi1" and return the result.
1126
 *
1127
 * The parameters of "multi1" and "multi2" are assumed to have been aligned.
1128
 */
1129
static __isl_give MULTI(BASE) *FN(MULTI(BASE),add_aligned)(
1130
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
1131
3
{
1132
3
  return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,add));
1133
3
}
isl_aff.c:isl_multi_aff_add_aligned
Line
Count
Source
1131
3
{
1132
3
  return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,add));
1133
3
}
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_add_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_union_pw_aff_add_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_add_aligned
1134
1135
/* Add "multi2" from "multi1" and return the result.
1136
 */
1137
__isl_give MULTI(BASE) *FN(MULTI(BASE),add)(__isl_take MULTI(BASE) *multi1,
1138
  __isl_take MULTI(BASE) *multi2)
1139
3
{
1140
3
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1141
3
            &FN(MULTI(BASE),add_aligned));
1142
3
}
isl_multi_aff_add
Line
Count
Source
1139
3
{
1140
3
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1141
3
            &FN(MULTI(BASE),add_aligned));
1142
3
}
Unexecuted instantiation: isl_multi_pw_aff_add
Unexecuted instantiation: isl_multi_union_pw_aff_add
Unexecuted instantiation: isl_multi_val_add
1143
1144
/* Subtract "multi2" from "multi1" and return the result.
1145
 *
1146
 * The parameters of "multi1" and "multi2" are assumed to have been aligned.
1147
 */
1148
static __isl_give MULTI(BASE) *FN(MULTI(BASE),sub_aligned)(
1149
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
1150
74
{
1151
74
  return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,sub));
1152
74
}
Unexecuted instantiation: isl_aff.c:isl_multi_aff_sub_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_sub_aligned
isl_aff.c:isl_multi_union_pw_aff_sub_aligned
Line
Count
Source
1150
74
{
1151
74
  return FN(MULTI(BASE),bin_op)(multi1, multi2, &FN(EL,sub));
1152
74
}
Unexecuted instantiation: isl_val.c:isl_multi_val_sub_aligned
1153
1154
/* Subtract "multi2" from "multi1" and return the result.
1155
 */
1156
__isl_give MULTI(BASE) *FN(MULTI(BASE),sub)(__isl_take MULTI(BASE) *multi1,
1157
  __isl_take MULTI(BASE) *multi2)
1158
74
{
1159
74
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
74
            &FN(MULTI(BASE),sub_aligned));
1161
74
}
Unexecuted instantiation: isl_multi_aff_sub
Unexecuted instantiation: isl_multi_pw_aff_sub
isl_multi_union_pw_aff_sub
Line
Count
Source
1158
74
{
1159
74
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
74
            &FN(MULTI(BASE),sub_aligned));
1161
74
}
Unexecuted instantiation: isl_multi_val_sub
1162
1163
/* Multiply the elements of "multi" by "v" and return the result.
1164
 */
1165
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_val)(__isl_take MULTI(BASE) *multi,
1166
  __isl_take isl_val *v)
1167
0
{
1168
0
  int i;
1169
0
1170
0
  if (!multi || !v)
1171
0
    goto error;
1172
0
1173
0
  if (isl_val_is_one(v)) {
1174
0
    isl_val_free(v);
1175
0
    return multi;
1176
0
  }
1177
0
1178
0
  if (!isl_val_is_rat(v))
1179
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1180
0
      "expecting rational factor", goto error);
1181
0
1182
0
  multi = FN(MULTI(BASE),cow)(multi);
1183
0
  if (!multi)
1184
0
    return NULL;
1185
0
1186
0
  for (i = 0; i < multi->n; ++i) {
1187
0
    multi->p[i] = FN(EL,scale_val)(multi->p[i], isl_val_copy(v));
1188
0
    if (!multi->p[i])
1189
0
      goto error;
1190
0
  }
1191
0
1192
0
  isl_val_free(v);
1193
0
  return multi;
1194
0
error:
1195
0
  isl_val_free(v);
1196
0
  return FN(MULTI(BASE),free)(multi);
1197
0
}
Unexecuted instantiation: isl_multi_aff_scale_val
Unexecuted instantiation: isl_multi_pw_aff_scale_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_val
Unexecuted instantiation: isl_multi_val_scale_val
1198
1199
/* Divide the elements of "multi" by "v" and return the result.
1200
 */
1201
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_val)(
1202
  __isl_take MULTI(BASE) *multi, __isl_take isl_val *v)
1203
0
{
1204
0
  int i;
1205
0
1206
0
  if (!multi || !v)
1207
0
    goto error;
1208
0
1209
0
  if (isl_val_is_one(v)) {
1210
0
    isl_val_free(v);
1211
0
    return multi;
1212
0
  }
1213
0
1214
0
  if (!isl_val_is_rat(v))
1215
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1216
0
      "expecting rational factor", goto error);
1217
0
  if (isl_val_is_zero(v))
1218
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1219
0
      "cannot scale down by zero", goto error);
1220
0
1221
0
  multi = FN(MULTI(BASE),cow)(multi);
1222
0
  if (!multi)
1223
0
    return NULL;
1224
0
1225
0
  for (i = 0; i < multi->n; ++i) {
1226
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i],
1227
0
                isl_val_copy(v));
1228
0
    if (!multi->p[i])
1229
0
      goto error;
1230
0
  }
1231
0
1232
0
  isl_val_free(v);
1233
0
  return multi;
1234
0
error:
1235
0
  isl_val_free(v);
1236
0
  return FN(MULTI(BASE),free)(multi);
1237
0
}
Unexecuted instantiation: isl_multi_aff_scale_down_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_val
Unexecuted instantiation: isl_multi_val_scale_down_val
1238
1239
/* Multiply the elements of "multi" by the corresponding element of "mv"
1240
 * and return the result.
1241
 */
1242
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_multi_val)(
1243
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1244
73
{
1245
73
  int i;
1246
73
1247
73
  if (!multi || !mv)
1248
0
    goto error;
1249
73
1250
73
  if (!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1251
73
          mv->space, isl_dim_set))
1252
73
    
isl_die0
(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
73
      "spaces don't match", goto error);
1254
73
1255
73
  multi = FN(MULTI(BASE),cow)(multi);
1256
73
  if (!multi)
1257
0
    goto error;
1258
73
1259
236
  
for (i = 0; 73
i < multi->n;
++i163
) {
1260
163
    isl_val *v;
1261
163
1262
163
    v = isl_multi_val_get_val(mv, i);
1263
163
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
163
    if (!multi->p[i])
1265
0
      goto error;
1266
163
  }
1267
73
1268
73
  isl_multi_val_free(mv);
1269
73
  return multi;
1270
73
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
73
}
Unexecuted instantiation: isl_multi_aff_scale_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_multi_val
isl_multi_union_pw_aff_scale_multi_val
Line
Count
Source
1244
73
{
1245
73
  int i;
1246
73
1247
73
  if (!multi || !mv)
1248
0
    goto error;
1249
73
1250
73
  if (!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1251
73
          mv->space, isl_dim_set))
1252
73
    
isl_die0
(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
73
      "spaces don't match", goto error);
1254
73
1255
73
  multi = FN(MULTI(BASE),cow)(multi);
1256
73
  if (!multi)
1257
0
    goto error;
1258
73
1259
236
  
for (i = 0; 73
i < multi->n;
++i163
) {
1260
163
    isl_val *v;
1261
163
1262
163
    v = isl_multi_val_get_val(mv, i);
1263
163
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
163
    if (!multi->p[i])
1265
0
      goto error;
1266
163
  }
1267
73
1268
73
  isl_multi_val_free(mv);
1269
73
  return multi;
1270
73
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
73
}
Unexecuted instantiation: isl_multi_val_scale_multi_val
1274
1275
/* Divide the elements of "multi" by the corresponding element of "mv"
1276
 * and return the result.
1277
 */
1278
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_multi_val)(
1279
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1280
0
{
1281
0
  int i;
1282
0
1283
0
  if (!multi || !mv)
1284
0
    goto error;
1285
0
1286
0
  if (!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1287
0
          mv->space, isl_dim_set))
1288
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1289
0
      "spaces don't match", goto error);
1290
0
1291
0
  multi = FN(MULTI(BASE),cow)(multi);
1292
0
  if (!multi)
1293
0
    return NULL;
1294
0
1295
0
  for (i = 0; i < multi->n; ++i) {
1296
0
    isl_val *v;
1297
0
1298
0
    v = isl_multi_val_get_val(mv, i);
1299
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i], v);
1300
0
    if (!multi->p[i])
1301
0
      goto error;
1302
0
  }
1303
0
1304
0
  isl_multi_val_free(mv);
1305
0
  return multi;
1306
0
error:
1307
0
  isl_multi_val_free(mv);
1308
0
  return FN(MULTI(BASE),free)(multi);
1309
0
}
Unexecuted instantiation: isl_multi_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_val_scale_down_multi_val
1310
1311
/* Compute the residues of the elements of "multi" modulo
1312
 * the corresponding element of "mv" and return the result.
1313
 */
1314
__isl_give MULTI(BASE) *FN(MULTI(BASE),mod_multi_val)(
1315
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1316
0
{
1317
0
  int i;
1318
0
1319
0
  if (!multi || !mv)
1320
0
    goto error;
1321
0
1322
0
  if (!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1323
0
          mv->space, isl_dim_set))
1324
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1325
0
      "spaces don't match", goto error);
1326
0
1327
0
  multi = FN(MULTI(BASE),cow)(multi);
1328
0
  if (!multi)
1329
0
    return NULL;
1330
0
1331
0
  for (i = 0; i < multi->n; ++i) {
1332
0
    isl_val *v;
1333
0
1334
0
    v = isl_multi_val_get_val(mv, i);
1335
0
    multi->p[i] = FN(EL,mod_val)(multi->p[i], v);
1336
0
    if (!multi->p[i])
1337
0
      goto error;
1338
0
  }
1339
0
1340
0
  isl_multi_val_free(mv);
1341
0
  return multi;
1342
0
error:
1343
0
  isl_multi_val_free(mv);
1344
0
  return FN(MULTI(BASE),free)(multi);
1345
0
}
Unexecuted instantiation: isl_multi_aff_mod_multi_val
Unexecuted instantiation: isl_multi_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_union_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_val_mod_multi_val
1346
1347
#ifndef NO_MOVE_DIMS
1348
/* Move the "n" dimensions of "src_type" starting at "src_pos" of "multi"
1349
 * to dimensions of "dst_type" at "dst_pos".
1350
 *
1351
 * We only support moving input dimensions to parameters and vice versa.
1352
 */
1353
__isl_give MULTI(BASE) *FN(MULTI(BASE),move_dims)(__isl_take MULTI(BASE) *multi,
1354
  enum isl_dim_type dst_type, unsigned dst_pos,
1355
  enum isl_dim_type src_type, unsigned src_pos, unsigned n)
1356
0
{
1357
0
  int i;
1358
0
1359
0
  if (!multi)
1360
0
    return NULL;
1361
0
1362
0
  if (n == 0 &&
1363
0
      !isl_space_is_named_or_nested(multi->space, src_type) &&
1364
0
      !isl_space_is_named_or_nested(multi->space, dst_type))
1365
0
    return multi;
1366
0
1367
0
  if (dst_type == isl_dim_out || src_type == isl_dim_out)
1368
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1369
0
      "cannot move output/set dimension",
1370
0
      return FN(MULTI(BASE),free)(multi));
1371
0
  if (dst_type == isl_dim_div || src_type == isl_dim_div)
1372
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1373
0
      "cannot move divs",
1374
0
      return FN(MULTI(BASE),free)(multi));
1375
0
  if (src_pos + n > isl_space_dim(multi->space, src_type))
1376
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1377
0
      "range out of bounds",
1378
0
      return FN(MULTI(BASE),free)(multi));
1379
0
  if (dst_type == src_type)
1380
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_unsupported,
1381
0
      "moving dims within the same type not supported",
1382
0
      return FN(MULTI(BASE),free)(multi));
1383
0
1384
0
  multi = FN(MULTI(BASE),cow)(multi);
1385
0
  if (!multi)
1386
0
    return NULL;
1387
0
1388
0
  multi->space = isl_space_move_dims(multi->space, dst_type, dst_pos,
1389
0
            src_type, src_pos, n);
1390
0
  if (!multi->space)
1391
0
    return FN(MULTI(BASE),free)(multi);
1392
0
1393
0
  for (i = 0; i < multi->n; ++i) {
1394
0
    multi->p[i] = FN(EL,move_dims)(multi->p[i], dst_type, dst_pos,
1395
0
            src_type, src_pos, n);
1396
0
    if (!multi->p[i])
1397
0
      return FN(MULTI(BASE),free)(multi);
1398
0
  }
1399
0
1400
0
  return multi;
1401
0
}
Unexecuted instantiation: isl_multi_aff_move_dims
Unexecuted instantiation: isl_multi_pw_aff_move_dims
1402
#endif
1403
1404
/* Convert a multiple expression defined over a parameter domain
1405
 * into one that is defined over a zero-dimensional set.
1406
 */
1407
__isl_give MULTI(BASE) *FN(MULTI(BASE),from_range)(
1408
  __isl_take MULTI(BASE) *multi)
1409
0
{
1410
0
  isl_space *space;
1411
0
1412
0
  if (!multi)
1413
0
    return NULL;
1414
0
  if (!isl_space_is_set(multi->space))
1415
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1416
0
      "not living in a set space",
1417
0
      return FN(MULTI(BASE),free)(multi));
1418
0
1419
0
  space = FN(MULTI(BASE),get_space)(multi);
1420
0
  space = isl_space_from_range(space);
1421
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
1422
0
1423
0
  return multi;
1424
0
}
Unexecuted instantiation: isl_multi_aff_from_range
Unexecuted instantiation: isl_multi_pw_aff_from_range
Unexecuted instantiation: isl_multi_union_pw_aff_from_range
Unexecuted instantiation: isl_multi_val_from_range
1425
1426
/* Are "multi1" and "multi2" obviously equal?
1427
 */
1428
isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1,
1429
  __isl_keep MULTI(BASE) *multi2)
1430
1.86k
{
1431
1.86k
  int i;
1432
1.86k
  isl_bool equal;
1433
1.86k
1434
1.86k
  if (!multi1 || !multi2)
1435
0
    return isl_bool_error;
1436
1.86k
  if (multi1->n != multi2->n)
1437
0
    return isl_bool_false;
1438
1.86k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.86k
  if (equal < 0 || !equal)
1440
0
    return equal;
1441
1.86k
1442
2.44k
  
for (i = 0; 1.86k
i < multi1->n;
++i587
) {
1443
2.32k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2.32k
    if (equal < 0 || !equal)
1445
1.74k
      return equal;
1446
2.32k
  }
1447
1.86k
1448
1.86k
  
return isl_bool_true121
;
1449
1.86k
}
isl_multi_aff_plain_is_equal
Line
Count
Source
1430
1.85k
{
1431
1.85k
  int i;
1432
1.85k
  isl_bool equal;
1433
1.85k
1434
1.85k
  if (!multi1 || !multi2)
1435
0
    return isl_bool_error;
1436
1.85k
  if (multi1->n != multi2->n)
1437
0
    return isl_bool_false;
1438
1.85k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.85k
  if (equal < 0 || !equal)
1440
0
    return equal;
1441
1.85k
1442
2.42k
  
for (i = 0; 1.85k
i < multi1->n;
++i569
) {
1443
2.30k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2.30k
    if (equal < 0 || !equal)
1445
1.74k
      return equal;
1446
2.30k
  }
1447
1.85k
1448
1.85k
  
return isl_bool_true112
;
1449
1.85k
}
isl_multi_pw_aff_plain_is_equal
Line
Count
Source
1430
1
{
1431
1
  int i;
1432
1
  isl_bool equal;
1433
1
1434
1
  if (!multi1 || !multi2)
1435
0
    return isl_bool_error;
1436
1
  if (multi1->n != multi2->n)
1437
0
    return isl_bool_false;
1438
1
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1
  if (equal < 0 || !equal)
1440
0
    return equal;
1441
1
1442
3
  
for (i = 0; 1
i < multi1->n;
++i2
) {
1443
2
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2
    if (equal < 0 || !equal)
1445
0
      return equal;
1446
2
  }
1447
1
1448
1
  return isl_bool_true;
1449
1
}
isl_multi_union_pw_aff_plain_is_equal
Line
Count
Source
1430
8
{
1431
8
  int i;
1432
8
  isl_bool equal;
1433
8
1434
8
  if (!multi1 || !multi2)
1435
0
    return isl_bool_error;
1436
8
  if (multi1->n != multi2->n)
1437
0
    return isl_bool_false;
1438
8
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
8
  if (equal < 0 || !equal)
1440
0
    return equal;
1441
8
1442
24
  
for (i = 0; 8
i < multi1->n;
++i16
) {
1443
16
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
16
    if (equal < 0 || !equal)
1445
0
      return equal;
1446
16
  }
1447
8
1448
8
  return isl_bool_true;
1449
8
}
Unexecuted instantiation: isl_multi_val_plain_is_equal
1450
1451
/* Does "multi" involve any NaNs?
1452
 */
1453
isl_bool FN(MULTI(BASE),involves_nan)(__isl_keep MULTI(BASE) *multi)
1454
1.05k
{
1455
1.05k
  int i;
1456
1.05k
1457
1.05k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.05k
  if (multi->n == 0)
1460
0
    return isl_bool_false;
1461
1.05k
1462
3.06k
  
for (i = 0; 1.05k
i < multi->n;
++i2.01k
) {
1463
2.01k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
2.01k
    if (has_nan < 0 || has_nan)
1465
2
      return has_nan;
1466
2.01k
  }
1467
1.05k
1468
1.05k
  
return isl_bool_false1.05k
;
1469
1.05k
}
isl_multi_aff_involves_nan
Line
Count
Source
1454
1.05k
{
1455
1.05k
  int i;
1456
1.05k
1457
1.05k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.05k
  if (multi->n == 0)
1460
0
    return isl_bool_false;
1461
1.05k
1462
3.06k
  
for (i = 0; 1.05k
i < multi->n;
++i2.01k
) {
1463
2.01k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
2.01k
    if (has_nan < 0 || has_nan)
1465
2
      return has_nan;
1466
2.01k
  }
1467
1.05k
1468
1.05k
  
return isl_bool_false1.05k
;
1469
1.05k
}
Unexecuted instantiation: isl_multi_pw_aff_involves_nan
Unexecuted instantiation: isl_multi_union_pw_aff_involves_nan
Unexecuted instantiation: isl_multi_val_involves_nan
1470
1471
#ifndef NO_DOMAIN
1472
/* Return the shared domain of the elements of "multi".
1473
 */
1474
__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi)
1475
0
{
1476
0
  int i;
1477
0
  isl_set *dom;
1478
0
1479
0
  if (!multi)
1480
0
    return NULL;
1481
0
1482
0
  dom = isl_set_universe(FN(MULTI(BASE),get_domain_space)(multi));
1483
0
  for (i = 0; i < multi->n; ++i) {
1484
0
    isl_set *dom_i;
1485
0
1486
0
    dom_i = FN(EL,domain)(FN(FN(MULTI(BASE),get),BASE)(multi, i));
1487
0
    dom = isl_set_intersect(dom, dom_i);
1488
0
  }
1489
0
1490
0
  FN(MULTI(BASE),free)(multi);
1491
0
  return dom;
1492
0
}
1493
#endif
1494
1495
#ifndef NO_NEG
1496
/* Return the opposite of "multi".
1497
 */
1498
__isl_give MULTI(BASE) *FN(MULTI(BASE),neg)(__isl_take MULTI(BASE) *multi)
1499
0
{
1500
0
  int i;
1501
0
1502
0
  multi = FN(MULTI(BASE),cow)(multi);
1503
0
  if (!multi)
1504
0
    return NULL;
1505
0
1506
0
  for (i = 0; i < multi->n; ++i) {
1507
0
    multi->p[i] = FN(EL,neg)(multi->p[i]);
1508
0
    if (!multi->p[i])
1509
0
      return FN(MULTI(BASE),free)(multi);
1510
0
  }
1511
0
1512
0
  return multi;
1513
0
}
Unexecuted instantiation: isl_multi_aff_neg
Unexecuted instantiation: isl_multi_pw_aff_neg
Unexecuted instantiation: isl_multi_union_pw_aff_neg
Unexecuted instantiation: isl_multi_val_neg
1514
#endif