Coverage Report

Created: 2017-04-27 19:33

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/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
59.9k
{
23
59.9k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
59.9k
}
isl_multi_val_get_ctx
Line
Count
Source
22
5.24k
{
23
5.24k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
5.24k
}
isl_multi_union_pw_aff_get_ctx
Line
Count
Source
22
19.4k
{
23
19.4k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
19.4k
}
isl_multi_pw_aff_get_ctx
Line
Count
Source
22
14.3k
{
23
14.3k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
14.3k
}
isl_multi_aff_get_ctx
Line
Count
Source
22
20.8k
{
23
20.8k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
20.8k
}
25
26
__isl_give isl_space *FN(MULTI(BASE),get_space)(__isl_keep MULTI(BASE) *multi)
27
592k
{
28
592k
  return multi ? isl_space_copy(multi->space) : NULL;
29
592k
}
isl_multi_pw_aff_get_space
Line
Count
Source
27
22.2k
{
28
22.2k
  return multi ? isl_space_copy(multi->space) : NULL;
29
22.2k
}
isl_multi_val_get_space
Line
Count
Source
27
10.9k
{
28
10.9k
  return multi ? isl_space_copy(multi->space) : NULL;
29
10.9k
}
isl_multi_aff_get_space
Line
Count
Source
27
541k
{
28
541k
  return multi ? isl_space_copy(multi->space) : NULL;
29
541k
}
isl_multi_union_pw_aff_get_space
Line
Count
Source
27
17.6k
{
28
17.6k
  return multi ? isl_space_copy(multi->space) : NULL;
29
17.6k
}
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_union_pw_aff_find_dim_by_name
Unexecuted instantiation: isl_multi_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
41.4k
{
46
41.4k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
41.4k
}
isl_multi_aff_get_domain_space
Line
Count
Source
45
41.2k
{
46
41.2k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
41.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
116
{
46
116
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
116
}
Unexecuted instantiation: isl_multi_val_get_domain_space
48
49
__isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space)
50
102k
{
51
102k
  isl_ctx *ctx;
52
102k
  int n;
53
102k
  MULTI(BASE) *multi;
54
102k
55
102k
  if (!space)
56
0
    return NULL;
57
102k
58
102k
  ctx = isl_space_get_ctx(space);
59
102k
  n = isl_space_dim(space, isl_dim_out);
60
102k
  multi = isl_calloc(ctx, MULTI(BASE),
61
102k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
102k
  if (!multi)
63
0
    goto error;
64
102k
65
102k
  multi->space = space;
66
102k
  multi->n = n;
67
102k
  multi->ref = 1;
68
102k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
102k
}
isl_multi_union_pw_aff_alloc
Line
Count
Source
50
6.98k
{
51
6.98k
  isl_ctx *ctx;
52
6.98k
  int n;
53
6.98k
  MULTI(BASE) *multi;
54
6.98k
55
6.98k
  if (!space)
56
0
    return NULL;
57
6.98k
58
6.98k
  ctx = isl_space_get_ctx(space);
59
6.98k
  n = isl_space_dim(space, isl_dim_out);
60
6.98k
  multi = isl_calloc(ctx, MULTI(BASE),
61
6.98k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
6.98k
  if (!multi)
63
0
    goto error;
64
6.98k
65
6.98k
  multi->space = space;
66
6.98k
  multi->n = n;
67
6.98k
  multi->ref = 1;
68
6.98k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
6.98k
}
isl_multi_val_alloc
Line
Count
Source
50
2.00k
{
51
2.00k
  isl_ctx *ctx;
52
2.00k
  int n;
53
2.00k
  MULTI(BASE) *multi;
54
2.00k
55
2.00k
  if (!space)
56
0
    return NULL;
57
2.00k
58
2.00k
  ctx = isl_space_get_ctx(space);
59
2.00k
  n = isl_space_dim(space, isl_dim_out);
60
2.00k
  multi = isl_calloc(ctx, MULTI(BASE),
61
2.00k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
2.00k
  if (!multi)
63
0
    goto error;
64
2.00k
65
2.00k
  multi->space = space;
66
2.00k
  multi->n = n;
67
2.00k
  multi->ref = 1;
68
2.00k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
2.00k
}
isl_multi_aff_alloc
Line
Count
Source
50
87.0k
{
51
87.0k
  isl_ctx *ctx;
52
87.0k
  int n;
53
87.0k
  MULTI(BASE) *multi;
54
87.0k
55
87.0k
  if (!space)
56
0
    return NULL;
57
87.0k
58
87.0k
  ctx = isl_space_get_ctx(space);
59
87.0k
  n = isl_space_dim(space, isl_dim_out);
60
87.0k
  multi = isl_calloc(ctx, MULTI(BASE),
61
87.0k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
87.0k
  if (!multi)
63
0
    goto error;
64
87.0k
65
87.0k
  multi->space = space;
66
87.0k
  multi->n = n;
67
87.0k
  multi->ref = 1;
68
87.0k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
87.0k
}
isl_multi_pw_aff_alloc
Line
Count
Source
50
6.67k
{
51
6.67k
  isl_ctx *ctx;
52
6.67k
  int n;
53
6.67k
  MULTI(BASE) *multi;
54
6.67k
55
6.67k
  if (!space)
56
0
    return NULL;
57
6.67k
58
6.67k
  ctx = isl_space_get_ctx(space);
59
6.67k
  n = isl_space_dim(space, isl_dim_out);
60
6.67k
  multi = isl_calloc(ctx, MULTI(BASE),
61
6.67k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
6.67k
  if (!multi)
63
0
    goto error;
64
6.67k
65
6.67k
  multi->space = space;
66
6.67k
  multi->n = n;
67
6.67k
  multi->ref = 1;
68
6.67k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
6.67k
}
73
74
__isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi)
75
66.0k
{
76
66.0k
  int i;
77
66.0k
  MULTI(BASE) *dup;
78
66.0k
79
66.0k
  if (!multi)
80
0
    return NULL;
81
66.0k
82
66.0k
  
dup = 66.0k
FN66.0k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
66.0k
  if (!dup)
84
0
    return NULL;
85
66.0k
86
453k
  
for (i = 0; 66.0k
i < multi->n453k
;
++i387k
)
87
387k
    
dup = 387k
FN387k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
387k
                FN(EL,copy)(multi->p[i]));
89
66.0k
90
66.0k
  return dup;
91
66.0k
}
Unexecuted instantiation: isl_multi_pw_aff_dup
isl_multi_union_pw_aff_dup
Line
Count
Source
75
807
{
76
807
  int i;
77
807
  MULTI(BASE) *dup;
78
807
79
807
  if (!multi)
80
0
    return NULL;
81
807
82
807
  
dup = 807
FN807
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
807
  if (!dup)
84
0
    return NULL;
85
807
86
2.06k
  
for (i = 0; 807
i < multi->n2.06k
;
++i1.25k
)
87
1.25k
    
dup = 1.25k
FN1.25k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
1.25k
                FN(EL,copy)(multi->p[i]));
89
807
90
807
  return dup;
91
807
}
isl_multi_aff_dup
Line
Count
Source
75
65.2k
{
76
65.2k
  int i;
77
65.2k
  MULTI(BASE) *dup;
78
65.2k
79
65.2k
  if (!multi)
80
0
    return NULL;
81
65.2k
82
65.2k
  
dup = 65.2k
FN65.2k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
65.2k
  if (!dup)
84
0
    return NULL;
85
65.2k
86
451k
  
for (i = 0; 65.2k
i < multi->n451k
;
++i385k
)
87
385k
    
dup = 385k
FN385k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
385k
                FN(EL,copy)(multi->p[i]));
89
65.2k
90
65.2k
  return dup;
91
65.2k
}
isl_multi_val_dup
Line
Count
Source
75
3
{
76
3
  int i;
77
3
  MULTI(BASE) *dup;
78
3
79
3
  if (!multi)
80
0
    return NULL;
81
3
82
3
  
dup = 3
FN3
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
3
  if (!dup)
84
0
    return NULL;
85
3
86
12
  
for (i = 0; 3
i < multi->n12
;
++i9
)
87
9
    
dup = 9
FN9
(FN(MULTI(BASE),set),BASE)(dup, i,
88
9
                FN(EL,copy)(multi->p[i]));
89
3
90
3
  return dup;
91
3
}
92
93
__isl_give MULTI(BASE) *FN(MULTI(BASE),cow)(__isl_take MULTI(BASE) *multi)
94
540k
{
95
540k
  if (!multi)
96
0
    return NULL;
97
540k
98
540k
  
if (540k
multi->ref == 1540k
)
99
474k
    return multi;
100
540k
101
66.0k
  multi->ref--;
102
66.0k
  return FN(MULTI(BASE),dup)(multi);
103
540k
}
isl_multi_union_pw_aff_cow
Line
Count
Source
94
10.3k
{
95
10.3k
  if (!multi)
96
0
    return NULL;
97
10.3k
98
10.3k
  
if (10.3k
multi->ref == 110.3k
)
99
9.52k
    return multi;
100
10.3k
101
807
  multi->ref--;
102
807
  return FN(MULTI(BASE),dup)(multi);
103
10.3k
}
isl_multi_pw_aff_cow
Line
Count
Source
94
23.3k
{
95
23.3k
  if (!multi)
96
0
    return NULL;
97
23.3k
98
23.3k
  
if (23.3k
multi->ref == 123.3k
)
99
23.3k
    return multi;
100
23.3k
101
0
  multi->ref--;
102
0
  return FN(MULTI(BASE),dup)(multi);
103
23.3k
}
isl_multi_val_cow
Line
Count
Source
94
6.78k
{
95
6.78k
  if (!multi)
96
0
    return NULL;
97
6.78k
98
6.78k
  
if (6.78k
multi->ref == 16.78k
)
99
6.78k
    return multi;
100
6.78k
101
3
  multi->ref--;
102
3
  return FN(MULTI(BASE),dup)(multi);
103
6.78k
}
isl_multi_aff_cow
Line
Count
Source
94
500k
{
95
500k
  if (!multi)
96
0
    return NULL;
97
500k
98
500k
  
if (500k
multi->ref == 1500k
)
99
435k
    return multi;
100
500k
101
65.2k
  multi->ref--;
102
65.2k
  return FN(MULTI(BASE),dup)(multi);
103
500k
}
104
105
__isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi)
106
158k
{
107
158k
  if (!multi)
108
378
    return NULL;
109
158k
110
157k
  multi->ref++;
111
157k
  return multi;
112
158k
}
isl_multi_aff_copy
Line
Count
Source
106
138k
{
107
138k
  if (!multi)
108
378
    return NULL;
109
138k
110
138k
  multi->ref++;
111
138k
  return multi;
112
138k
}
Unexecuted instantiation: isl_multi_pw_aff_copy
isl_multi_union_pw_aff_copy
Line
Count
Source
106
12.0k
{
107
12.0k
  if (!multi)
108
0
    return NULL;
109
12.0k
110
12.0k
  multi->ref++;
111
12.0k
  return multi;
112
12.0k
}
isl_multi_val_copy
Line
Count
Source
106
7.58k
{
107
7.58k
  if (!multi)
108
0
    return NULL;
109
7.58k
110
7.58k
  multi->ref++;
111
7.58k
  return multi;
112
7.58k
}
113
114
__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi)
115
222k
{
116
222k
  int i;
117
222k
118
222k
  if (!multi)
119
27.5k
    return NULL;
120
222k
121
194k
  
if (194k
--multi->ref > 0194k
)
122
91.7k
    return NULL;
123
194k
124
102k
  isl_space_free(multi->space);
125
542k
  for (i = 0; 
i < multi->n542k
;
++i440k
)
126
440k
    
FN440k
(EL,free)(multi->p[i])440k
;
127
102k
  free(multi);
128
102k
129
102k
  return NULL;
130
194k
}
isl_multi_union_pw_aff_free
Line
Count
Source
115
18.2k
{
116
18.2k
  int i;
117
18.2k
118
18.2k
  if (!multi)
119
0
    return NULL;
120
18.2k
121
18.2k
  
if (18.2k
--multi->ref > 018.2k
)
122
11.2k
    return NULL;
123
18.2k
124
6.98k
  isl_space_free(multi->space);
125
12.8k
  for (i = 0; 
i < multi->n12.8k
;
++i5.90k
)
126
5.90k
    
FN5.90k
(EL,free)(multi->p[i])5.90k
;
127
6.98k
  free(multi);
128
6.98k
129
6.98k
  return NULL;
130
18.2k
}
isl_multi_val_free
Line
Count
Source
115
9.59k
{
116
9.59k
  int i;
117
9.59k
118
9.59k
  if (!multi)
119
4
    return NULL;
120
9.59k
121
9.59k
  
if (9.59k
--multi->ref > 09.59k
)
122
7.58k
    return NULL;
123
9.59k
124
2.00k
  isl_space_free(multi->space);
125
4.99k
  for (i = 0; 
i < multi->n4.99k
;
++i2.99k
)
126
2.99k
    
FN2.99k
(EL,free)(multi->p[i])2.99k
;
127
2.00k
  free(multi);
128
2.00k
129
2.00k
  return NULL;
130
9.59k
}
isl_multi_aff_free
Line
Count
Source
115
187k
{
116
187k
  int i;
117
187k
118
187k
  if (!multi)
119
27.5k
    return NULL;
120
187k
121
159k
  
if (159k
--multi->ref > 0159k
)
122
72.9k
    return NULL;
123
159k
124
87.0k
  isl_space_free(multi->space);
125
507k
  for (i = 0; 
i < multi->n507k
;
++i420k
)
126
420k
    
FN420k
(EL,free)(multi->p[i])420k
;
127
87.0k
  free(multi);
128
87.0k
129
87.0k
  return NULL;
130
159k
}
isl_multi_pw_aff_free
Line
Count
Source
115
6.67k
{
116
6.67k
  int i;
117
6.67k
118
6.67k
  if (!multi)
119
0
    return NULL;
120
6.67k
121
6.67k
  
if (6.67k
--multi->ref > 06.67k
)
122
0
    return NULL;
123
6.67k
124
6.67k
  isl_space_free(multi->space);
125
16.9k
  for (i = 0; 
i < multi->n16.9k
;
++i10.3k
)
126
10.3k
    
FN10.3k
(EL,free)(multi->p[i])10.3k
;
127
6.67k
  free(multi);
128
6.67k
129
6.67k
  return NULL;
130
6.67k
}
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 (0
multi->n == 0 || 0
n == 00
)
145
0
    return isl_bool_false;
146
0
147
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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 || 0
involves0
)
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_val_involves_dims
Unexecuted instantiation: isl_multi_pw_aff_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 (18
type == isl_dim_out18
)
167
0
    isl_die(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 (18
n == 0 && 18
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
18
173
12
  
multi = 12
FN12
(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 0
FN0
(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n24
;
++i12
)
{12
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
12
}
Unexecuted instantiation: isl_multi_pw_aff_insert_dims
Unexecuted instantiation: isl_multi_val_insert_dims
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 (18
type == isl_dim_out18
)
167
0
    isl_die(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 (18
n == 0 && 18
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
18
173
12
  
multi = 12
FN12
(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 0
FN0
(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n24
;
++i12
)
{12
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
12
}
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_val_add_dims
Unexecuted instantiation: isl_multi_pw_aff_add_dims
Unexecuted instantiation: isl_multi_aff_add_dims
199
#endif
200
201
unsigned FN(MULTI(BASE),dim)(__isl_keep MULTI(BASE) *multi,
202
  enum isl_dim_type type)
203
600k
{
204
600k
  return multi ? 
isl_space_dim(multi->space, type)600k
:
00
;
205
600k
}
isl_multi_aff_dim
Line
Count
Source
203
568k
{
204
568k
  return multi ? 
isl_space_dim(multi->space, type)568k
:
00
;
205
568k
}
isl_multi_val_dim
Line
Count
Source
203
4.73k
{
204
4.73k
  return multi ? 
isl_space_dim(multi->space, type)4.73k
:
00
;
205
4.73k
}
isl_multi_union_pw_aff_dim
Line
Count
Source
203
18.1k
{
204
18.1k
  return multi ? 
isl_space_dim(multi->space, type)18.1k
:
00
;
205
18.1k
}
isl_multi_pw_aff_dim
Line
Count
Source
203
8.64k
{
204
8.64k
  return multi ? 
isl_space_dim(multi->space, type)8.64k
:
00
;
205
8.64k
}
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_union_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_val_find_dim_by_id
Unexecuted instantiation: isl_multi_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_aff_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_val_get_dim_id
Unexecuted instantiation: isl_multi_aff_get_dim_id
Unexecuted instantiation: isl_multi_union_pw_aff_get_dim_id
Unexecuted instantiation: isl_multi_pw_aff_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 0
FN0
(MULTI(BASE),free)(multi);
239
0
240
0
  
if (0
type == isl_dim_out0
)
241
0
    return multi;
242
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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 0
FN0
(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_val_set_dim_name
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_name
Unexecuted instantiation: isl_multi_pw_aff_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_pw_aff_get_tuple_name
Unexecuted instantiation: isl_multi_aff_get_tuple_name
Unexecuted instantiation: isl_multi_val_get_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_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
3.98k
{
262
3.98k
  if (!multi)
263
0
    return isl_bool_error;
264
3.98k
  return isl_space_has_tuple_id(multi->space, type);
265
3.98k
}
Unexecuted instantiation: isl_multi_val_has_tuple_id
Unexecuted instantiation: isl_multi_aff_has_tuple_id
isl_multi_pw_aff_has_tuple_id
Line
Count
Source
261
2.02k
{
262
2.02k
  if (!multi)
263
0
    return isl_bool_error;
264
2.02k
  return isl_space_has_tuple_id(multi->space, type);
265
2.02k
}
isl_multi_union_pw_aff_has_tuple_id
Line
Count
Source
261
1.96k
{
262
1.96k
  if (!multi)
263
0
    return isl_bool_error;
264
1.96k
  return isl_space_has_tuple_id(multi->space, type);
265
1.96k
}
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
2.02k
{
272
2.02k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
2.02k
}
Unexecuted instantiation: isl_multi_aff_get_tuple_id
isl_multi_pw_aff_get_tuple_id
Line
Count
Source
271
2.02k
{
272
2.02k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
2.02k
}
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
51.4k
{
278
51.4k
  isl_ctx *ctx;
279
51.4k
280
51.4k
  if (!multi)
281
0
    return NULL;
282
51.4k
  
ctx = 51.4k
FN51.4k
(MULTI(BASE),get_ctx)(multi);
283
51.4k
  if (
pos < 0 || 51.4k
pos >= multi->n51.4k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
51.4k
      "index out of bounds", return NULL);
286
51.4k
  
return 51.4k
FN51.4k
(EL,copy)(multi->p[pos]);
287
51.4k
}
isl_multi_val_get_val
Line
Count
Source
277
5.17k
{
278
5.17k
  isl_ctx *ctx;
279
5.17k
280
5.17k
  if (!multi)
281
0
    return NULL;
282
5.17k
  
ctx = 5.17k
FN5.17k
(MULTI(BASE),get_ctx)(multi);
283
5.17k
  if (
pos < 0 || 5.17k
pos >= multi->n5.17k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
5.17k
      "index out of bounds", return NULL);
286
5.17k
  
return 5.17k
FN5.17k
(EL,copy)(multi->p[pos]);
287
5.17k
}
isl_multi_union_pw_aff_get_union_pw_aff
Line
Count
Source
277
15.0k
{
278
15.0k
  isl_ctx *ctx;
279
15.0k
280
15.0k
  if (!multi)
281
0
    return NULL;
282
15.0k
  
ctx = 15.0k
FN15.0k
(MULTI(BASE),get_ctx)(multi);
283
15.0k
  if (
pos < 0 || 15.0k
pos >= multi->n15.0k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
15.0k
      "index out of bounds", return NULL);
286
15.0k
  
return 15.0k
FN15.0k
(EL,copy)(multi->p[pos]);
287
15.0k
}
isl_multi_pw_aff_get_pw_aff
Line
Count
Source
277
10.3k
{
278
10.3k
  isl_ctx *ctx;
279
10.3k
280
10.3k
  if (!multi)
281
0
    return NULL;
282
10.3k
  
ctx = 10.3k
FN10.3k
(MULTI(BASE),get_ctx)(multi);
283
10.3k
  if (
pos < 0 || 10.3k
pos >= multi->n10.3k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
10.3k
      "index out of bounds", return NULL);
286
10.3k
  
return 10.3k
FN10.3k
(EL,copy)(multi->p[pos]);
287
10.3k
}
isl_multi_aff_get_aff
Line
Count
Source
277
20.8k
{
278
20.8k
  isl_ctx *ctx;
279
20.8k
280
20.8k
  if (!multi)
281
0
    return NULL;
282
20.8k
  
ctx = 20.8k
FN20.8k
(MULTI(BASE),get_ctx)(multi);
283
20.8k
  if (
pos < 0 || 20.8k
pos >= multi->n20.8k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
20.8k
      "index out of bounds", return NULL);
286
20.8k
  
return 20.8k
FN20.8k
(EL,copy)(multi->p[pos]);
287
20.8k
}
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
448k
{
292
448k
  isl_space *multi_space = NULL;
293
448k
  isl_space *el_space = NULL;
294
448k
  isl_bool match;
295
448k
296
448k
  multi = FN(MULTI(BASE),cow)(multi);
297
448k
  if (
!multi || 448k
!el448k
)
298
0
    goto error;
299
448k
300
448k
  
multi_space = 448k
FN448k
(MULTI(BASE),get_space)(multi);
301
448k
  match = FN(EL,matching_params)(el, multi_space);
302
448k
  if (match < 0)
303
0
    goto error;
304
448k
  
if (448k
!match448k
)
{0
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
448k
  if (
FN448k
(EL,check_match_domain_space)(el, multi_space) < 0448k
)
312
0
    goto error;
313
448k
314
448k
  
if (448k
pos < 0 || 448k
pos >= multi->n448k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
448k
      "index out of bounds", goto error);
317
448k
318
448k
  
FN448k
(EL,free)(multi->p[pos]);448k
319
448k
  multi->p[pos] = el;
320
448k
321
448k
  isl_space_free(multi_space);
322
448k
  isl_space_free(el_space);
323
448k
324
448k
  return multi;
325
0
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
448k
}
isl_multi_val_set_val
Line
Count
Source
291
6.78k
{
292
6.78k
  isl_space *multi_space = NULL;
293
6.78k
  isl_space *el_space = NULL;
294
6.78k
  isl_bool match;
295
6.78k
296
6.78k
  multi = FN(MULTI(BASE),cow)(multi);
297
6.78k
  if (
!multi || 6.78k
!el6.78k
)
298
0
    goto error;
299
6.78k
300
6.78k
  
multi_space = 6.78k
FN6.78k
(MULTI(BASE),get_space)(multi);
301
6.78k
  match = FN(EL,matching_params)(el, multi_space);
302
6.78k
  if (match < 0)
303
0
    goto error;
304
6.78k
  
if (6.78k
!match6.78k
)
{0
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
6.78k
  if (
FN6.78k
(EL,check_match_domain_space)(el, multi_space) < 06.78k
)
312
0
    goto error;
313
6.78k
314
6.78k
  
if (6.78k
pos < 0 || 6.78k
pos >= multi->n6.78k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
6.78k
      "index out of bounds", goto error);
317
6.78k
318
6.78k
  
FN6.78k
(EL,free)(multi->p[pos]);6.78k
319
6.78k
  multi->p[pos] = el;
320
6.78k
321
6.78k
  isl_space_free(multi_space);
322
6.78k
  isl_space_free(el_space);
323
6.78k
324
6.78k
  return multi;
325
0
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
6.78k
}
isl_multi_aff_set_aff
Line
Count
Source
291
424k
{
292
424k
  isl_space *multi_space = NULL;
293
424k
  isl_space *el_space = NULL;
294
424k
  isl_bool match;
295
424k
296
424k
  multi = FN(MULTI(BASE),cow)(multi);
297
424k
  if (
!multi || 424k
!el424k
)
298
0
    goto error;
299
424k
300
424k
  
multi_space = 424k
FN424k
(MULTI(BASE),get_space)(multi);
301
424k
  match = FN(EL,matching_params)(el, multi_space);
302
424k
  if (match < 0)
303
0
    goto error;
304
424k
  
if (424k
!match424k
)
{0
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
424k
  if (
FN424k
(EL,check_match_domain_space)(el, multi_space) < 0424k
)
312
0
    goto error;
313
424k
314
424k
  
if (424k
pos < 0 || 424k
pos >= multi->n424k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
424k
      "index out of bounds", goto error);
317
424k
318
424k
  
FN424k
(EL,free)(multi->p[pos]);424k
319
424k
  multi->p[pos] = el;
320
424k
321
424k
  isl_space_free(multi_space);
322
424k
  isl_space_free(el_space);
323
424k
324
424k
  return multi;
325
0
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
424k
}
isl_multi_union_pw_aff_set_union_pw_aff
Line
Count
Source
291
6.50k
{
292
6.50k
  isl_space *multi_space = NULL;
293
6.50k
  isl_space *el_space = NULL;
294
6.50k
  isl_bool match;
295
6.50k
296
6.50k
  multi = FN(MULTI(BASE),cow)(multi);
297
6.50k
  if (
!multi || 6.50k
!el6.50k
)
298
0
    goto error;
299
6.50k
300
6.50k
  
multi_space = 6.50k
FN6.50k
(MULTI(BASE),get_space)(multi);
301
6.50k
  match = FN(EL,matching_params)(el, multi_space);
302
6.50k
  if (match < 0)
303
0
    goto error;
304
6.50k
  
if (6.50k
!match6.50k
)
{0
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
6.50k
  if (
FN6.50k
(EL,check_match_domain_space)(el, multi_space) < 06.50k
)
312
0
    goto error;
313
6.50k
314
6.50k
  
if (6.50k
pos < 0 || 6.50k
pos >= multi->n6.50k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
6.50k
      "index out of bounds", goto error);
317
6.50k
318
6.50k
  
FN6.50k
(EL,free)(multi->p[pos]);6.50k
319
6.50k
  multi->p[pos] = el;
320
6.50k
321
6.50k
  isl_space_free(multi_space);
322
6.50k
  isl_space_free(el_space);
323
6.50k
324
6.50k
  return multi;
325
0
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
6.50k
}
isl_multi_pw_aff_set_pw_aff
Line
Count
Source
291
10.3k
{
292
10.3k
  isl_space *multi_space = NULL;
293
10.3k
  isl_space *el_space = NULL;
294
10.3k
  isl_bool match;
295
10.3k
296
10.3k
  multi = FN(MULTI(BASE),cow)(multi);
297
10.3k
  if (
!multi || 10.3k
!el10.3k
)
298
0
    goto error;
299
10.3k
300
10.3k
  
multi_space = 10.3k
FN10.3k
(MULTI(BASE),get_space)(multi);
301
10.3k
  match = FN(EL,matching_params)(el, multi_space);
302
10.3k
  if (match < 0)
303
0
    goto error;
304
10.3k
  
if (10.3k
!match10.3k
)
{0
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.3k
  if (
FN10.3k
(EL,check_match_domain_space)(el, multi_space) < 010.3k
)
312
0
    goto error;
313
10.3k
314
10.3k
  
if (10.3k
pos < 0 || 10.3k
pos >= multi->n10.3k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
10.3k
      "index out of bounds", goto error);
317
10.3k
318
10.3k
  
FN10.3k
(EL,free)(multi->p[pos]);10.3k
319
10.3k
  multi->p[pos] = el;
320
10.3k
321
10.3k
  isl_space_free(multi_space);
322
10.3k
  isl_space_free(el_space);
323
10.3k
324
10.3k
  return multi;
325
0
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.3k
}
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
9.49k
{
343
9.49k
  int i;
344
9.49k
345
9.49k
  multi = FN(MULTI(BASE),cow)(multi);
346
9.49k
  if (
!multi || 9.49k
!space9.49k
||
!domain9.49k
)
347
0
    goto error;
348
9.49k
349
33.6k
  
for (i = 0; 9.49k
i < multi->n33.6k
;
++i24.1k
)
{24.1k
350
24.1k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
24.1k
         isl_space_copy(domain));
352
24.1k
    if (!multi->p[i])
353
0
      goto error;
354
24.1k
  }
355
9.49k
  isl_space_free(domain);
356
9.49k
  isl_space_free(multi->space);
357
9.49k
  multi->space = space;
358
9.49k
359
9.49k
  return multi;
360
0
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
9.49k
}
isl_multi_union_pw_aff_reset_space_and_domain
Line
Count
Source
342
130
{
343
130
  int i;
344
130
345
130
  multi = FN(MULTI(BASE),cow)(multi);
346
130
  if (
!multi || 130
!space130
||
!domain130
)
347
0
    goto error;
348
130
349
282
  
for (i = 0; 130
i < multi->n282
;
++i152
)
{152
350
152
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
152
         isl_space_copy(domain));
352
152
    if (!multi->p[i])
353
0
      goto error;
354
152
  }
355
130
  isl_space_free(domain);
356
130
  isl_space_free(multi->space);
357
130
  multi->space = space;
358
130
359
130
  return multi;
360
0
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
130
}
isl_multi_pw_aff_reset_space_and_domain
Line
Count
Source
342
6.49k
{
343
6.49k
  int i;
344
6.49k
345
6.49k
  multi = FN(MULTI(BASE),cow)(multi);
346
6.49k
  if (
!multi || 6.49k
!space6.49k
||
!domain6.49k
)
347
0
    goto error;
348
6.49k
349
24.5k
  
for (i = 0; 6.49k
i < multi->n24.5k
;
++i18.0k
)
{18.0k
350
18.0k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
18.0k
         isl_space_copy(domain));
352
18.0k
    if (!multi->p[i])
353
0
      goto error;
354
18.0k
  }
355
6.49k
  isl_space_free(domain);
356
6.49k
  isl_space_free(multi->space);
357
6.49k
  multi->space = space;
358
6.49k
359
6.49k
  return multi;
360
0
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
6.49k
}
isl_multi_aff_reset_space_and_domain
Line
Count
Source
342
2.86k
{
343
2.86k
  int i;
344
2.86k
345
2.86k
  multi = FN(MULTI(BASE),cow)(multi);
346
2.86k
  if (
!multi || 2.86k
!space2.86k
||
!domain2.86k
)
347
0
    goto error;
348
2.86k
349
8.83k
  
for (i = 0; 2.86k
i < multi->n8.83k
;
++i5.96k
)
{5.96k
350
5.96k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
5.96k
         isl_space_copy(domain));
352
5.96k
    if (!multi->p[i])
353
0
      goto error;
354
5.96k
  }
355
2.86k
  isl_space_free(domain);
356
2.86k
  isl_space_free(multi->space);
357
2.86k
  multi->space = space;
358
2.86k
359
2.86k
  return multi;
360
0
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
2.86k
}
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
126
{
370
126
  isl_space *space;
371
126
372
126
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
126
            isl_space_copy(multi->space));
374
126
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
126
}
isl_multi_union_pw_aff_reset_domain_space
Line
Count
Source
369
116
{
370
116
  isl_space *space;
371
116
372
116
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
116
            isl_space_copy(multi->space));
374
116
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
116
}
Unexecuted instantiation: isl_multi_val_reset_domain_space
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
376
377
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space)(
378
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space)
379
7.96k
{
380
7.96k
  isl_space *domain;
381
7.96k
382
7.96k
  domain = isl_space_domain(isl_space_copy(space));
383
7.96k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
7.96k
}
isl_multi_aff_reset_space
Line
Count
Source
379
1.45k
{
380
1.45k
  isl_space *domain;
381
1.45k
382
1.45k
  domain = isl_space_domain(isl_space_copy(space));
383
1.45k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
1.45k
}
isl_multi_pw_aff_reset_space
Line
Count
Source
379
6.49k
{
380
6.49k
  isl_space *domain;
381
6.49k
382
6.49k
  domain = isl_space_domain(isl_space_copy(space));
383
6.49k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
6.49k
}
isl_multi_union_pw_aff_reset_space
Line
Count
Source
379
14
{
380
14
  isl_space *domain;
381
14
382
14
  domain = isl_space_domain(isl_space_copy(space));
383
14
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
14
}
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
6.49k
{
392
6.49k
  isl_space *space;
393
6.49k
394
6.49k
  multi = FN(MULTI(BASE),cow)(multi);
395
6.49k
  if (
!multi || 6.49k
!id6.49k
)
396
0
    goto error;
397
6.49k
398
6.49k
  
space = 6.49k
FN6.49k
(MULTI(BASE),get_space)(multi);
399
6.49k
  space = isl_space_set_dim_id(space, type, pos, id);
400
6.49k
401
6.49k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
6.49k
}
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_id
Unexecuted instantiation: isl_multi_aff_set_dim_id
Unexecuted instantiation: isl_multi_val_set_dim_id
isl_multi_pw_aff_set_dim_id
Line
Count
Source
391
6.49k
{
392
6.49k
  isl_space *space;
393
6.49k
394
6.49k
  multi = FN(MULTI(BASE),cow)(multi);
395
6.49k
  if (
!multi || 6.49k
!id6.49k
)
396
0
    goto error;
397
6.49k
398
6.49k
  
space = 6.49k
FN6.49k
(MULTI(BASE),get_space)(multi);
399
6.49k
  space = isl_space_set_dim_id(space, type, pos, id);
400
6.49k
401
6.49k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
6.49k
}
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 = 0
FN0
(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_val_set_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_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
93
{
428
93
  isl_space *space;
429
93
430
93
  multi = FN(MULTI(BASE),cow)(multi);
431
93
  if (!multi)
432
0
    goto error;
433
93
434
93
  
space = 93
FN93
(MULTI(BASE),get_space)(multi);
435
93
  space = isl_space_set_tuple_id(space, type, id);
436
93
437
93
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
93
}
isl_multi_aff_set_tuple_id
Line
Count
Source
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 = 90
FN90
(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
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
90
}
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_id
Unexecuted instantiation: isl_multi_val_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 = 3
FN3
(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
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
3
}
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
1.96k
{
448
1.96k
  isl_space *space;
449
1.96k
450
1.96k
  if (!multi)
451
0
    return NULL;
452
1.96k
  
if (1.96k
!1.96k
FN1.96k
(MULTI(BASE),has_tuple_id)(multi, type))
453
1.95k
    return multi;
454
1.96k
455
11
  
multi = 11
FN11
(MULTI(BASE),cow)(multi);
456
11
  if (!multi)
457
0
    return NULL;
458
11
459
11
  
space = 11
FN11
(MULTI(BASE),get_space)(multi);
460
11
  space = isl_space_reset_tuple_id(space, type);
461
11
462
11
  return FN(MULTI(BASE),reset_space)(multi, space);
463
11
}
Unexecuted instantiation: isl_multi_pw_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_val_reset_tuple_id
isl_multi_union_pw_aff_reset_tuple_id
Line
Count
Source
447
1.96k
{
448
1.96k
  isl_space *space;
449
1.96k
450
1.96k
  if (!multi)
451
0
    return NULL;
452
1.96k
  
if (1.96k
!1.96k
FN1.96k
(MULTI(BASE),has_tuple_id)(multi, type))
453
1.95k
    return multi;
454
1.96k
455
11
  
multi = 11
FN11
(MULTI(BASE),cow)(multi);
456
11
  if (!multi)
457
0
    return NULL;
458
11
459
11
  
space = 11
FN11
(MULTI(BASE),get_space)(multi);
460
11
  space = isl_space_reset_tuple_id(space, type);
461
11
462
11
  return FN(MULTI(BASE),reset_space)(multi, space);
463
11
}
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_union_pw_aff_reset_user
Unexecuted instantiation: isl_multi_pw_aff_reset_user
Unexecuted instantiation: isl_multi_val_reset_user
Unexecuted instantiation: isl_multi_aff_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
126
{
482
126
  int i;
483
126
484
126
  multi = FN(MULTI(BASE),cow)(multi);
485
126
  if (
!multi || 126
!exp126
)
486
0
    goto error;
487
126
488
242
  
for (i = 0; 126
i < multi->n242
;
++i116
)
{116
489
116
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
116
            isl_reordering_copy(exp));
491
116
    if (!multi->p[i])
492
0
      goto error;
493
116
  }
494
126
495
126
  
multi = 126
FN126
(MULTI(BASE),reset_domain_space)(multi,
496
126
                isl_space_copy(exp->dim));
497
126
498
126
  isl_reordering_free(exp);
499
126
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
126
}
Unexecuted instantiation: isl_multi_pw_aff_realign_domain
isl_multi_union_pw_aff_realign_domain
Line
Count
Source
481
116
{
482
116
  int i;
483
116
484
116
  multi = FN(MULTI(BASE),cow)(multi);
485
116
  if (
!multi || 116
!exp116
)
486
0
    goto error;
487
116
488
232
  
for (i = 0; 116
i < multi->n232
;
++i116
)
{116
489
116
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
116
            isl_reordering_copy(exp));
491
116
    if (!multi->p[i])
492
0
      goto error;
493
116
  }
494
116
495
116
  
multi = 116
FN116
(MULTI(BASE),reset_domain_space)(multi,
496
116
                isl_space_copy(exp->dim));
497
116
498
116
  isl_reordering_free(exp);
499
116
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
116
}
Unexecuted instantiation: isl_multi_val_realign_domain
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 || 10
!exp10
)
486
0
    goto error;
487
10
488
10
  
for (i = 0; 10
i < multi->n10
;
++i0
)
{0
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 = 10
FN10
(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
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
10
}
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.31k
{
511
2.31k
  isl_ctx *ctx;
512
2.31k
  isl_bool equal_params;
513
2.31k
  isl_reordering *exp;
514
2.31k
515
2.31k
  if (
!multi || 2.31k
!model2.31k
)
516
0
    goto error;
517
2.31k
518
2.31k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
2.31k
  if (equal_params < 0)
520
0
    goto error;
521
2.31k
  
if (2.31k
equal_params2.31k
)
{2.19k
522
2.19k
    isl_space_free(model);
523
2.19k
    return multi;
524
2.19k
  }
525
2.31k
526
126
  ctx = isl_space_get_ctx(model);
527
126
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
126
      "model has unnamed parameters", goto error);
530
126
  
if (126
!isl_space_has_named_params(multi->space)126
)
531
0
    isl_die(ctx, isl_error_invalid,
532
126
      "input has unnamed parameters", goto error);
533
126
534
126
  model = isl_space_params(model);
535
126
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
126
  exp = isl_reordering_extend_space(exp,
537
126
            FN(MULTI(BASE),get_domain_space)(multi));
538
126
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
126
540
126
  isl_space_free(model);
541
126
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
126
}
isl_multi_union_pw_aff_align_params
Line
Count
Source
510
841
{
511
841
  isl_ctx *ctx;
512
841
  isl_bool equal_params;
513
841
  isl_reordering *exp;
514
841
515
841
  if (
!multi || 841
!model841
)
516
0
    goto error;
517
841
518
841
  equal_params = isl_space_has_equal_params(multi->space, model);
519
841
  if (equal_params < 0)
520
0
    goto error;
521
841
  
if (841
equal_params841
)
{725
522
725
    isl_space_free(model);
523
725
    return multi;
524
725
  }
525
841
526
116
  ctx = isl_space_get_ctx(model);
527
116
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
116
      "model has unnamed parameters", goto error);
530
116
  
if (116
!isl_space_has_named_params(multi->space)116
)
531
0
    isl_die(ctx, isl_error_invalid,
532
116
      "input has unnamed parameters", goto error);
533
116
534
116
  model = isl_space_params(model);
535
116
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
116
  exp = isl_reordering_extend_space(exp,
537
116
            FN(MULTI(BASE),get_domain_space)(multi));
538
116
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
116
540
116
  isl_space_free(model);
541
116
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
116
}
Unexecuted instantiation: isl_multi_pw_aff_align_params
Unexecuted instantiation: isl_multi_val_align_params
isl_multi_aff_align_params
Line
Count
Source
510
1.47k
{
511
1.47k
  isl_ctx *ctx;
512
1.47k
  isl_bool equal_params;
513
1.47k
  isl_reordering *exp;
514
1.47k
515
1.47k
  if (
!multi || 1.47k
!model1.47k
)
516
0
    goto error;
517
1.47k
518
1.47k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.47k
  if (equal_params < 0)
520
0
    goto error;
521
1.47k
  
if (1.47k
equal_params1.47k
)
{1.46k
522
1.46k
    isl_space_free(model);
523
1.46k
    return multi;
524
1.46k
  }
525
1.47k
526
10
  ctx = isl_space_get_ctx(model);
527
10
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
10
      "model has unnamed parameters", goto error);
530
10
  
if (10
!isl_space_has_named_params(multi->space)10
)
531
0
    isl_die(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
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
10
}
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
4.39k
{
551
4.39k
  int i;
552
4.39k
  int n;
553
4.39k
  isl_ctx *ctx;
554
4.39k
  MULTI(BASE) *multi;
555
4.39k
556
4.39k
  if (
!space || 4.39k
!list4.39k
)
557
0
    goto error;
558
4.39k
559
4.39k
  ctx = isl_space_get_ctx(space);
560
4.39k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.39k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.39k
      "invalid number of elements in list", goto error);
564
4.39k
565
4.39k
  
multi = 4.39k
FN4.39k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
10.7k
  for (i = 0; 
i < n10.7k
;
++i6.33k
)
{6.33k
567
6.33k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.33k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.33k
  }
570
4.39k
571
4.39k
  isl_space_free(space);
572
4.39k
  FN(LIST(EL),free)(list);
573
4.39k
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
4.39k
}
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 || 15
!list15
)
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
0
    isl_die(ctx, isl_error_invalid,
563
15
      "invalid number of elements in list", goto error);
564
15
565
15
  
multi = 15
FN15
(MULTI(BASE),alloc)(isl_space_copy(space));
566
42
  for (i = 0; 
i < n42
;
++i27
)
{27
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
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
15
}
isl_multi_pw_aff_from_pw_aff_list
Line
Count
Source
550
4.36k
{
551
4.36k
  int i;
552
4.36k
  int n;
553
4.36k
  isl_ctx *ctx;
554
4.36k
  MULTI(BASE) *multi;
555
4.36k
556
4.36k
  if (
!space || 4.36k
!list4.36k
)
557
0
    goto error;
558
4.36k
559
4.36k
  ctx = isl_space_get_ctx(space);
560
4.36k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.36k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.36k
      "invalid number of elements in list", goto error);
564
4.36k
565
4.36k
  
multi = 4.36k
FN4.36k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
10.6k
  for (i = 0; 
i < n10.6k
;
++i6.29k
)
{6.29k
567
6.29k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.29k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.29k
  }
570
4.36k
571
4.36k
  isl_space_free(space);
572
4.36k
  FN(LIST(EL),free)(list);
573
4.36k
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
4.36k
}
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 || 11
!list11
)
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
0
    isl_die(ctx, isl_error_invalid,
563
11
      "invalid number of elements in list", goto error);
564
11
565
11
  
multi = 11
FN11
(MULTI(BASE),alloc)(isl_space_copy(space));
566
32
  for (i = 0; 
i < n32
;
++i21
)
{21
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
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
11
}
Unexecuted instantiation: isl_multi_aff_from_aff_list
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
3.86k
{
586
3.86k
  int i, n;
587
3.86k
  isl_local_space *ls;
588
3.86k
  MULTI(BASE) *multi;
589
3.86k
590
3.86k
  if (!space)
591
0
    return NULL;
592
3.86k
593
3.86k
  
if (3.86k
isl_space_is_set(space)3.86k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
3.86k
      "expecting map space", goto error);
596
3.86k
597
3.86k
  n = isl_space_dim(space, isl_dim_out);
598
3.86k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
3.86k
      "number of input and output dimensions needs to be "
601
3.86k
      "the same", goto error);
602
3.86k
603
3.86k
  
multi = 3.86k
FN3.86k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
3.86k
605
3.86k
  if (
!n3.86k
)
{1.93k
606
1.93k
    isl_space_free(space);
607
1.93k
    return multi;
608
1.93k
  }
609
3.86k
610
1.93k
  space = isl_space_domain(space);
611
1.93k
  ls = isl_local_space_from_space(space);
612
1.93k
613
9.54k
  for (i = 0; 
i < n9.54k
;
++i7.61k
)
{7.61k
614
7.61k
    EL *el;
615
7.61k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
7.61k
            isl_dim_set, i);
617
7.61k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
7.61k
  }
619
1.93k
620
1.93k
  isl_local_space_free(ls);
621
1.93k
622
1.93k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
3.86k
}
Unexecuted instantiation: isl_multi_pw_aff_identity
isl_multi_aff_identity
Line
Count
Source
585
3.86k
{
586
3.86k
  int i, n;
587
3.86k
  isl_local_space *ls;
588
3.86k
  MULTI(BASE) *multi;
589
3.86k
590
3.86k
  if (!space)
591
0
    return NULL;
592
3.86k
593
3.86k
  
if (3.86k
isl_space_is_set(space)3.86k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
3.86k
      "expecting map space", goto error);
596
3.86k
597
3.86k
  n = isl_space_dim(space, isl_dim_out);
598
3.86k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
3.86k
      "number of input and output dimensions needs to be "
601
3.86k
      "the same", goto error);
602
3.86k
603
3.86k
  
multi = 3.86k
FN3.86k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
3.86k
605
3.86k
  if (
!n3.86k
)
{1.93k
606
1.93k
    isl_space_free(space);
607
1.93k
    return multi;
608
1.93k
  }
609
3.86k
610
1.93k
  space = isl_space_domain(space);
611
1.93k
  ls = isl_local_space_from_space(space);
612
1.93k
613
9.54k
  for (i = 0; 
i < n9.54k
;
++i7.61k
)
{7.61k
614
7.61k
    EL *el;
615
7.61k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
7.61k
            isl_dim_set, i);
617
7.61k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
7.61k
  }
619
1.93k
620
1.93k
  isl_local_space_free(ls);
621
1.93k
622
1.93k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
3.86k
}
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
4.09k
{
635
4.09k
  int n;
636
4.09k
  MULTI(BASE) *multi;
637
4.09k
638
4.09k
  if (!space)
639
0
    return NULL;
640
4.09k
641
4.09k
  n = isl_space_dim(space , isl_dim_out);
642
4.09k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
4.09k
644
4.09k
  if (!n)
645
1.04k
    isl_space_free(space);
646
3.05k
  else {
647
3.05k
    int i;
648
3.05k
    isl_local_space *ls;
649
3.05k
    EL *el;
650
3.05k
651
3.05k
    space = isl_space_domain(space);
652
3.05k
    ls = isl_local_space_from_space(space);
653
3.05k
    el = FN(EL,zero_on_domain)(ls);
654
3.05k
655
7.55k
    for (i = 0; 
i < n7.55k
;
++i4.50k
)
656
4.50k
      
multi = 4.50k
FN4.50k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
4.50k
                  FN(EL,copy)(el));
658
3.05k
659
3.05k
    FN(EL,free)(el);
660
3.05k
  }
661
4.09k
662
4.09k
  return multi;
663
4.09k
}
isl_multi_aff_zero
Line
Count
Source
634
2.10k
{
635
2.10k
  int n;
636
2.10k
  MULTI(BASE) *multi;
637
2.10k
638
2.10k
  if (!space)
639
0
    return NULL;
640
2.10k
641
2.10k
  n = isl_space_dim(space , isl_dim_out);
642
2.10k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.10k
644
2.10k
  if (!n)
645
1.02k
    isl_space_free(space);
646
1.08k
  else {
647
1.08k
    int i;
648
1.08k
    isl_local_space *ls;
649
1.08k
    EL *el;
650
1.08k
651
1.08k
    space = isl_space_domain(space);
652
1.08k
    ls = isl_local_space_from_space(space);
653
1.08k
    el = FN(EL,zero_on_domain)(ls);
654
1.08k
655
2.62k
    for (i = 0; 
i < n2.62k
;
++i1.54k
)
656
1.54k
      
multi = 1.54k
FN1.54k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
1.54k
                  FN(EL,copy)(el));
658
1.08k
659
1.08k
    FN(EL,free)(el);
660
1.08k
  }
661
2.10k
662
2.10k
  return multi;
663
2.10k
}
Unexecuted instantiation: isl_multi_pw_aff_zero
isl_multi_val_zero
Line
Count
Source
634
1.99k
{
635
1.99k
  int n;
636
1.99k
  MULTI(BASE) *multi;
637
1.99k
638
1.99k
  if (!space)
639
0
    return NULL;
640
1.99k
641
1.99k
  n = isl_space_dim(space , isl_dim_out);
642
1.99k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
1.99k
644
1.99k
  if (!n)
645
23
    isl_space_free(space);
646
1.96k
  else {
647
1.96k
    int i;
648
1.96k
    isl_local_space *ls;
649
1.96k
    EL *el;
650
1.96k
651
1.96k
    space = isl_space_domain(space);
652
1.96k
    ls = isl_local_space_from_space(space);
653
1.96k
    el = FN(EL,zero_on_domain)(ls);
654
1.96k
655
4.92k
    for (i = 0; 
i < n4.92k
;
++i2.96k
)
656
2.96k
      
multi = 2.96k
FN2.96k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
2.96k
                  FN(EL,copy)(el));
658
1.96k
659
1.96k
    FN(EL,free)(el);
660
1.96k
  }
661
1.99k
662
1.99k
  return multi;
663
1.99k
}
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
224
{
678
224
  isl_space *space;
679
224
  MULTI(BASE) *multi;
680
224
681
224
  space = FN(EL,get_space(el));
682
224
  if (
isl_space_is_params(space)224
)
{0
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
224
  multi = FN(MULTI(BASE),alloc)(space);
687
224
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
224
689
224
  return multi;
690
224
}
Unexecuted instantiation: isl_multi_union_pw_aff_from_union_pw_aff
Unexecuted instantiation: isl_multi_pw_aff_from_pw_aff
isl_multi_aff_from_aff
Line
Count
Source
677
224
{
678
224
  isl_space *space;
679
224
  MULTI(BASE) *multi;
680
224
681
224
  space = FN(EL,get_space(el));
682
224
  if (
isl_space_is_params(space)224
)
{0
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
224
  multi = FN(MULTI(BASE),alloc)(space);
687
224
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
224
689
224
  return multi;
690
224
}
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
748
{
697
748
  int i;
698
748
  unsigned dim;
699
748
700
748
  multi = FN(MULTI(BASE),cow)(multi);
701
748
  if (!multi)
702
0
    return NULL;
703
748
704
748
  
dim = 748
FN748
(MULTI(BASE),dim)(multi, type);
705
748
  if (
first + n > dim || 748
first + n < first748
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
748
      "index out of bounds",
708
748
      return FN(MULTI(BASE),cow)(multi));
709
748
710
748
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
748
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
748
714
748
  
if (748
type == isl_dim_out748
)
{712
715
1.50k
    for (i = 0; 
i < n1.50k
;
++i790
)
716
790
      
FN790
(EL,free)(multi->p[first + i])790
;
717
1.26k
    for (i = first; 
i + n < multi->n1.26k
;
++i550
)
718
550
      multi->p[i] = multi->p[i + n];
719
712
    multi->n -= n;
720
712
721
712
    return multi;
722
712
  }
723
748
724
180
  
for (i = 0; 36
i < multi->n180
;
++i144
)
{144
725
144
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
144
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
144
  }
729
36
730
36
  return multi;
731
36
}
isl_multi_union_pw_aff_drop_dims
Line
Count
Source
696
60
{
697
60
  int i;
698
60
  unsigned dim;
699
60
700
60
  multi = FN(MULTI(BASE),cow)(multi);
701
60
  if (!multi)
702
0
    return NULL;
703
60
704
60
  
dim = 60
FN60
(MULTI(BASE),dim)(multi, type);
705
60
  if (
first + n > dim || 60
first + n < first60
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
60
      "index out of bounds",
708
60
      return FN(MULTI(BASE),cow)(multi));
709
60
710
60
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
60
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
60
714
60
  
if (60
type == isl_dim_out60
)
{60
715
135
    for (i = 0; 
i < n135
;
++i75
)
716
75
      
FN75
(EL,free)(multi->p[first + i])75
;
717
96
    for (i = first; 
i + n < multi->n96
;
++i36
)
718
36
      multi->p[i] = multi->p[i + n];
719
60
    multi->n -= n;
720
60
721
60
    return multi;
722
60
  }
723
60
724
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
725
0
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
0
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
0
  }
729
0
730
0
  return multi;
731
0
}
Unexecuted instantiation: isl_multi_pw_aff_drop_dims
Unexecuted instantiation: isl_multi_val_drop_dims
isl_multi_aff_drop_dims
Line
Count
Source
696
688
{
697
688
  int i;
698
688
  unsigned dim;
699
688
700
688
  multi = FN(MULTI(BASE),cow)(multi);
701
688
  if (!multi)
702
0
    return NULL;
703
688
704
688
  
dim = 688
FN688
(MULTI(BASE),dim)(multi, type);
705
688
  if (
first + n > dim || 688
first + n < first688
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
688
      "index out of bounds",
708
688
      return FN(MULTI(BASE),cow)(multi));
709
688
710
688
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
688
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
688
714
688
  
if (688
type == isl_dim_out688
)
{652
715
1.36k
    for (i = 0; 
i < n1.36k
;
++i715
)
716
715
      
FN715
(EL,free)(multi->p[first + i])715
;
717
1.16k
    for (i = first; 
i + n < multi->n1.16k
;
++i514
)
718
514
      multi->p[i] = multi->p[i + n];
719
652
    multi->n -= n;
720
652
721
652
    return multi;
722
652
  }
723
688
724
180
  
for (i = 0; 36
i < multi->n180
;
++i144
)
{144
725
144
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
144
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
144
  }
729
36
730
36
  return multi;
731
36
}
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
4.98k
{
740
4.98k
  isl_ctx *ctx;
741
4.98k
  isl_bool equal_params;
742
4.98k
743
4.98k
  if (
!multi1 || 4.98k
!multi24.98k
)
744
0
    goto error;
745
4.98k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
4.98k
  if (equal_params < 0)
747
0
    goto error;
748
4.98k
  
if (4.98k
equal_params4.98k
)
749
4.97k
    return fn(multi1, multi2);
750
8
  
ctx = 8
FN8
(MULTI(BASE),get_ctx)(multi1);
751
8
  if (!isl_space_has_named_params(multi1->space) ||
752
8
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
8
      "unaligned unnamed parameters", goto error);
755
8
  
multi1 = 8
FN8
(MULTI(BASE),align_params)(multi1,
756
8
              FN(MULTI(BASE),get_space)(multi2));
757
8
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
8
              FN(MULTI(BASE),get_space)(multi1));
759
8
  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
8
}
Unexecuted instantiation: isl_val.c:isl_multi_val_align_params_multi_multi_and
isl_aff.c:isl_multi_aff_align_params_multi_multi_and
Line
Count
Source
739
3.25k
{
740
3.25k
  isl_ctx *ctx;
741
3.25k
  isl_bool equal_params;
742
3.25k
743
3.25k
  if (
!multi1 || 3.25k
!multi23.25k
)
744
0
    goto error;
745
3.25k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
3.25k
  if (equal_params < 0)
747
0
    goto error;
748
3.25k
  
if (3.25k
equal_params3.25k
)
749
3.25k
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(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 = 0
FN0
(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
0
}
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 || 5
!multi25
)
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 (5
equal_params5
)
749
5
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(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 = 0
FN0
(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
0
}
isl_aff.c:isl_multi_union_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
1.72k
{
740
1.72k
  isl_ctx *ctx;
741
1.72k
  isl_bool equal_params;
742
1.72k
743
1.72k
  if (
!multi1 || 1.72k
!multi21.72k
)
744
0
    goto error;
745
1.72k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
1.72k
  if (equal_params < 0)
747
0
    goto error;
748
1.72k
  
if (1.72k
equal_params1.72k
)
749
1.71k
    return fn(multi1, multi2);
750
8
  
ctx = 8
FN8
(MULTI(BASE),get_ctx)(multi1);
751
8
  if (!isl_space_has_named_params(multi1->space) ||
752
8
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
8
      "unaligned unnamed parameters", goto error);
755
8
  
multi1 = 8
FN8
(MULTI(BASE),align_params)(multi1,
756
8
              FN(MULTI(BASE),get_space)(multi2));
757
8
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
8
              FN(MULTI(BASE),get_space)(multi1));
759
8
  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
8
}
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
1.79k
{
774
1.79k
  int i, n1, n2;
775
1.79k
  EL *el;
776
1.79k
  isl_space *space;
777
1.79k
  MULTI(BASE) *res;
778
1.79k
779
1.79k
  if (
!multi1 || 1.79k
!multi21.79k
)
780
0
    goto error;
781
1.79k
782
1.79k
  
space = isl_space_range_product(1.79k
FN1.79k
(MULTI(BASE),get_space)(multi1),
783
1.79k
          FN(MULTI(BASE),get_space)(multi2));
784
1.79k
  res = FN(MULTI(BASE),alloc)(space);
785
1.79k
786
1.79k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
1.79k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
1.79k
789
4.01k
  for (i = 0; 
i < n14.01k
;
++i2.22k
)
{2.22k
790
2.22k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.22k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.22k
  }
793
1.79k
794
3.24k
  for (i = 0; 
i < n23.24k
;
++i1.45k
)
{1.45k
795
1.45k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.45k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.45k
  }
798
1.79k
799
1.79k
  FN(MULTI(BASE),free)(multi1);
800
1.79k
  FN(MULTI(BASE),free)(multi2);
801
1.79k
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
1.79k
}
isl_aff.c:isl_multi_aff_range_product_aligned
Line
Count
Source
773
214
{
774
214
  int i, n1, n2;
775
214
  EL *el;
776
214
  isl_space *space;
777
214
  MULTI(BASE) *res;
778
214
779
214
  if (
!multi1 || 214
!multi2214
)
780
0
    goto error;
781
214
782
214
  
space = isl_space_range_product(214
FN214
(MULTI(BASE),get_space)(multi1),
783
214
          FN(MULTI(BASE),get_space)(multi2));
784
214
  res = FN(MULTI(BASE),alloc)(space);
785
214
786
214
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
214
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
214
789
761
  for (i = 0; 
i < n1761
;
++i547
)
{547
790
547
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
547
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
547
  }
793
214
794
446
  for (i = 0; 
i < n2446
;
++i232
)
{232
795
232
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
232
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
232
  }
798
214
799
214
  FN(MULTI(BASE),free)(multi1);
800
214
  FN(MULTI(BASE),free)(multi2);
801
214
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
214
}
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 || 5
!multi25
)
780
0
    goto error;
781
5
782
5
  
space = isl_space_range_product(5
FN5
(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 < n114
;
++i9
)
{9
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 < n214
;
++i9
)
{9
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
0
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
1.57k
{
774
1.57k
  int i, n1, n2;
775
1.57k
  EL *el;
776
1.57k
  isl_space *space;
777
1.57k
  MULTI(BASE) *res;
778
1.57k
779
1.57k
  if (
!multi1 || 1.57k
!multi21.57k
)
780
0
    goto error;
781
1.57k
782
1.57k
  
space = isl_space_range_product(1.57k
FN1.57k
(MULTI(BASE),get_space)(multi1),
783
1.57k
          FN(MULTI(BASE),get_space)(multi2));
784
1.57k
  res = FN(MULTI(BASE),alloc)(space);
785
1.57k
786
1.57k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
1.57k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
1.57k
789
3.24k
  for (i = 0; 
i < n13.24k
;
++i1.66k
)
{1.66k
790
1.66k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
1.66k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
1.66k
  }
793
1.57k
794
2.78k
  for (i = 0; 
i < n22.78k
;
++i1.20k
)
{1.20k
795
1.20k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.20k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.20k
  }
798
1.57k
799
1.57k
  FN(MULTI(BASE),free)(multi1);
800
1.57k
  FN(MULTI(BASE),free)(multi2);
801
1.57k
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
1.57k
}
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
1.79k
{
814
1.79k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
1.79k
          &FN(MULTI(BASE),range_product_aligned));
816
1.79k
}
isl_multi_union_pw_aff_range_product
Line
Count
Source
813
1.57k
{
814
1.57k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
1.57k
          &FN(MULTI(BASE),range_product_aligned));
816
1.57k
}
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
}
Unexecuted instantiation: isl_multi_val_range_product
isl_multi_aff_range_product
Line
Count
Source
813
214
{
814
214
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
214
          &FN(MULTI(BASE),range_product_aligned));
816
214
}
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
752
{
822
752
  if (!multi)
823
0
    return isl_bool_error;
824
752
  return isl_space_range_is_wrapping(multi->space);
825
752
}
Unexecuted instantiation: isl_multi_val_range_is_wrapping
Unexecuted instantiation: isl_multi_aff_range_is_wrapping
isl_multi_pw_aff_range_is_wrapping
Line
Count
Source
821
752
{
822
752
  if (!multi)
823
0
    return isl_bool_error;
824
752
  return isl_space_range_is_wrapping(multi->space);
825
752
}
Unexecuted instantiation: isl_multi_union_pw_aff_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 (0
!isl_space_range_is_wrapping(multi->space)0
)
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 = 0
FN0
(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_union_pw_aff_range_factor_domain
Unexecuted instantiation: isl_multi_aff_range_factor_domain
Unexecuted instantiation: isl_multi_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 (0
!isl_space_range_is_wrapping(multi->space)0
)
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 = 0
FN0
(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_union_pw_aff_range_factor_range
Unexecuted instantiation: isl_multi_val_range_factor_range
Unexecuted instantiation: isl_multi_pw_aff_range_factor_range
Unexecuted instantiation: isl_multi_aff_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 (0
!isl_space_is_wrapping(multi->space)0
)
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 = 0
FN0
(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_val_factor_range
Unexecuted instantiation: isl_multi_union_pw_aff_factor_range
Unexecuted instantiation: isl_multi_pw_aff_factor_range
Unexecuted instantiation: isl_multi_aff_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.67k
{
911
1.67k
  int i;
912
1.67k
  EL *el;
913
1.67k
  isl_space *space;
914
1.67k
  MULTI(BASE) *res;
915
1.67k
  int in1, in2, out1, out2;
916
1.67k
917
1.67k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.67k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.67k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.67k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.67k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.67k
          FN(MULTI(BASE),get_space)(multi2));
923
1.67k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.67k
  space = isl_space_domain(space);
925
1.67k
926
3.02k
  for (i = 0; 
i < out13.02k
;
++i1.34k
)
{1.34k
927
1.34k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.34k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.34k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.34k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.34k
  }
932
1.67k
933
3.94k
  for (i = 0; 
i < out23.94k
;
++i2.26k
)
{2.26k
934
2.26k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.26k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.26k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.26k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.26k
  }
939
1.67k
940
1.67k
  isl_space_free(space);
941
1.67k
  FN(MULTI(BASE),free)(multi1);
942
1.67k
  FN(MULTI(BASE),free)(multi2);
943
1.67k
  return res;
944
1.67k
}
Unexecuted instantiation: isl_multi_val_product_aligned
isl_multi_aff_product_aligned
Line
Count
Source
910
1.67k
{
911
1.67k
  int i;
912
1.67k
  EL *el;
913
1.67k
  isl_space *space;
914
1.67k
  MULTI(BASE) *res;
915
1.67k
  int in1, in2, out1, out2;
916
1.67k
917
1.67k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.67k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.67k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.67k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.67k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.67k
          FN(MULTI(BASE),get_space)(multi2));
923
1.67k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.67k
  space = isl_space_domain(space);
925
1.67k
926
3.02k
  for (i = 0; 
i < out13.02k
;
++i1.34k
)
{1.34k
927
1.34k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.34k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.34k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.34k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.34k
  }
932
1.67k
933
3.94k
  for (i = 0; 
i < out23.94k
;
++i2.26k
)
{2.26k
934
2.26k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.26k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.26k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.26k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.26k
  }
939
1.67k
940
1.67k
  isl_space_free(space);
941
1.67k
  FN(MULTI(BASE),free)(multi1);
942
1.67k
  FN(MULTI(BASE),free)(multi2);
943
1.67k
  return res;
944
1.67k
}
Unexecuted instantiation: isl_multi_pw_aff_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.67k
{
952
1.67k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.67k
          &FN(MULTI(BASE),product_aligned));
954
1.67k
}
Unexecuted instantiation: isl_multi_val_product
isl_multi_aff_product
Line
Count
Source
951
1.67k
{
952
1.67k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.67k
          &FN(MULTI(BASE),product_aligned));
954
1.67k
}
Unexecuted instantiation: isl_multi_pw_aff_product
955
#endif
956
957
__isl_give MULTI(BASE) *FN(MULTI(BASE),flatten_range)(
958
  __isl_take MULTI(BASE) *multi)
959
2.24k
{
960
2.24k
  if (!multi)
961
0
    return NULL;
962
2.24k
963
2.24k
  
if (2.24k
!multi->space->nested[1]2.24k
)
964
0
    return multi;
965
2.24k
966
2.24k
  
multi = 2.24k
FN2.24k
(MULTI(BASE),cow)(multi);
967
2.24k
  if (!multi)
968
0
    return NULL;
969
2.24k
970
2.24k
  multi->space = isl_space_flatten_range(multi->space);
971
2.24k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
2.24k
974
2.24k
  return multi;
975
2.24k
}
Unexecuted instantiation: isl_multi_val_flatten_range
isl_multi_union_pw_aff_flatten_range
Line
Count
Source
959
1.57k
{
960
1.57k
  if (!multi)
961
0
    return NULL;
962
1.57k
963
1.57k
  
if (1.57k
!multi->space->nested[1]1.57k
)
964
0
    return multi;
965
1.57k
966
1.57k
  
multi = 1.57k
FN1.57k
(MULTI(BASE),cow)(multi);
967
1.57k
  if (!multi)
968
0
    return NULL;
969
1.57k
970
1.57k
  multi->space = isl_space_flatten_range(multi->space);
971
1.57k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
1.57k
974
1.57k
  return multi;
975
1.57k
}
isl_multi_pw_aff_flatten_range
Line
Count
Source
959
1
{
960
1
  if (!multi)
961
0
    return NULL;
962
1
963
1
  
if (1
!multi->space->nested[1]1
)
964
0
    return multi;
965
1
966
1
  
multi = 1
FN1
(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 0
FN0
(MULTI(BASE),free)(multi);
973
1
974
1
  return multi;
975
1
}
isl_multi_aff_flatten_range
Line
Count
Source
959
666
{
960
666
  if (!multi)
961
0
    return NULL;
962
666
963
666
  
if (666
!multi->space->nested[1]666
)
964
0
    return multi;
965
666
966
666
  
multi = 666
FN666
(MULTI(BASE),cow)(multi);
967
666
  if (!multi)
968
0
    return NULL;
969
666
970
666
  multi->space = isl_space_flatten_range(multi->space);
971
666
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
666
974
666
  return multi;
975
666
}
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
1.68k
{
983
1.68k
  MULTI(BASE) *multi;
984
1.68k
985
1.68k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1.68k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1.68k
  return multi;
988
1.68k
}
Unexecuted instantiation: isl_multi_val_flat_range_product
isl_multi_aff_flat_range_product
Line
Count
Source
982
108
{
983
108
  MULTI(BASE) *multi;
984
108
985
108
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
108
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
108
  return multi;
988
108
}
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
1.57k
{
983
1.57k
  MULTI(BASE) *multi;
984
1.57k
985
1.57k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1.57k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1.57k
  return multi;
988
1.57k
}
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 || 9
!multi29
)
1010
0
    goto error;
1011
9
1012
9
  
dim = 9
FN9
(MULTI(BASE),dim)(multi1, isl_dim_out);
1013
9
  if (pos > dim)
1014
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1015
9
      "index out of bounds", goto error);
1016
9
1017
9
  
res = 9
FN9
(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
0
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_val_range_splice
Unexecuted instantiation: isl_multi_pw_aff_range_splice
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 || 9
!multi29
)
1010
0
    goto error;
1011
9
1012
9
  
dim = 9
FN9
(MULTI(BASE),dim)(multi1, isl_dim_out);
1013
9
  if (pos > dim)
1014
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1015
9
      "index out of bounds", goto error);
1016
9
1017
9
  
res = 9
FN9
(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
0
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_union_pw_aff_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 || 6
!multi26
)
1063
0
    goto error;
1064
6
1065
6
  
n_in1 = 6
FN6
(MULTI(BASE),dim)(multi1, isl_dim_in);
1066
6
  if (in_pos > n_in1)
1067
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1068
6
      "index out of bounds", goto error);
1069
6
1070
6
  
n_in2 = 6
FN6
(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
0
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 || 6
!multi26
)
1063
0
    goto error;
1064
6
1065
6
  
n_in1 = 6
FN6
(MULTI(BASE),dim)(multi1, isl_dim_in);
1066
6
  if (in_pos > n_in1)
1067
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi1), isl_error_invalid,
1068
6
      "index out of bounds", goto error);
1069
6
1070
6
  
n_in2 = 6
FN6
(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
0
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_val_splice
Unexecuted instantiation: isl_multi_pw_aff_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
148
{
1099
148
  int i;
1100
148
  isl_ctx *ctx;
1101
148
1102
148
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
148
  if (
!multi1 || 148
!multi2148
)
1104
0
    goto error;
1105
148
1106
148
  
ctx = 148
FN148
(MULTI(BASE),get_ctx)(multi1);
1107
148
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
148
      "spaces don't match", goto error);
1110
148
1111
399
  
for (i = 0; 148
i < multi1->n399
;
++i251
)
{251
1112
251
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
251
    if (!multi1->p[i])
1114
0
      goto error;
1115
251
  }
1116
148
1117
148
  
FN148
(MULTI(BASE),free)(multi2);148
1118
148
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
148
}
Unexecuted instantiation: isl_val.c:isl_multi_val_bin_op
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 || 3
!multi23
)
1104
0
    goto error;
1105
3
1106
3
  
ctx = 3
FN3
(MULTI(BASE),get_ctx)(multi1);
1107
3
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
3
      "spaces don't match", goto error);
1110
3
1111
6
  
for (i = 0; 3
i < multi1->n6
;
++i3
)
{3
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
  
FN3
(MULTI(BASE),free)(multi2);3
1118
3
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
3
}
isl_aff.c:isl_multi_union_pw_aff_bin_op
Line
Count
Source
1098
145
{
1099
145
  int i;
1100
145
  isl_ctx *ctx;
1101
145
1102
145
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
145
  if (
!multi1 || 145
!multi2145
)
1104
0
    goto error;
1105
145
1106
145
  
ctx = 145
FN145
(MULTI(BASE),get_ctx)(multi1);
1107
145
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
145
      "spaces don't match", goto error);
1110
145
1111
393
  
for (i = 0; 145
i < multi1->n393
;
++i248
)
{248
1112
248
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
248
    if (!multi1->p[i])
1114
0
      goto error;
1115
248
  }
1116
145
1117
145
  
FN145
(MULTI(BASE),free)(multi2);145
1118
145
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
145
}
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_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 
FN3
(MULTI(BASE),bin_op)(multi1, multi2, &
FN3
(EL,add));
1133
3
}
Unexecuted instantiation: isl_aff.c:isl_multi_union_pw_aff_add_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_add_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_add_aligned
isl_aff.c:isl_multi_aff_add_aligned
Line
Count
Source
1131
3
{
1132
3
  return 
FN3
(MULTI(BASE),bin_op)(multi1, multi2, &
FN3
(EL,add));
1133
3
}
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_union_pw_aff_add
Unexecuted instantiation: isl_multi_val_add
Unexecuted instantiation: isl_multi_pw_aff_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
68
{
1151
68
  return 
FN68
(MULTI(BASE),bin_op)(multi1, multi2, &
FN68
(EL,sub));
1152
68
}
Unexecuted instantiation: isl_aff.c:isl_multi_aff_sub_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_sub_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_sub_aligned
isl_aff.c:isl_multi_union_pw_aff_sub_aligned
Line
Count
Source
1150
68
{
1151
68
  return 
FN68
(MULTI(BASE),bin_op)(multi1, multi2, &
FN68
(EL,sub));
1152
68
}
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
68
{
1159
68
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
68
            &FN(MULTI(BASE),sub_aligned));
1161
68
}
Unexecuted instantiation: isl_multi_val_sub
isl_multi_union_pw_aff_sub
Line
Count
Source
1158
68
{
1159
68
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
68
            &FN(MULTI(BASE),sub_aligned));
1161
68
}
Unexecuted instantiation: isl_multi_pw_aff_sub
Unexecuted instantiation: isl_multi_aff_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 || 0
!v0
)
1171
0
    goto error;
1172
0
1173
0
  
if (0
isl_val_is_one(v)0
)
{0
1174
0
    isl_val_free(v);
1175
0
    return multi;
1176
0
  }
1177
0
1178
0
  
if (0
!isl_val_is_rat(v)0
)
1179
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1180
0
      "expecting rational factor", goto error);
1181
0
1182
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1183
0
  if (!multi)
1184
0
    return NULL;
1185
0
1186
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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_val_scale_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_val
Unexecuted instantiation: isl_multi_pw_aff_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 || 0
!v0
)
1207
0
    goto error;
1208
0
1209
0
  
if (0
isl_val_is_one(v)0
)
{0
1210
0
    isl_val_free(v);
1211
0
    return multi;
1212
0
  }
1213
0
1214
0
  
if (0
!isl_val_is_rat(v)0
)
1215
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1216
0
      "expecting rational factor", goto error);
1217
0
  
if (0
isl_val_is_zero(v)0
)
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 = 0
FN0
(MULTI(BASE),cow)(multi);
1222
0
  if (!multi)
1223
0
    return NULL;
1224
0
1225
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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_union_pw_aff_scale_down_val
Unexecuted instantiation: isl_multi_aff_scale_down_val
Unexecuted instantiation: isl_multi_val_scale_down_val
Unexecuted instantiation: isl_multi_pw_aff_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
67
{
1245
67
  int i;
1246
67
1247
67
  if (
!multi || 67
!mv67
)
1248
0
    goto error;
1249
67
1250
67
  
if (67
!isl_space_tuple_is_equal(multi->space, isl_dim_out,67
1251
67
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
67
      "spaces don't match", goto error);
1254
67
1255
67
  
multi = 67
FN67
(MULTI(BASE),cow)(multi);
1256
67
  if (!multi)
1257
0
    goto error;
1258
67
1259
212
  
for (i = 0; 67
i < multi->n212
;
++i145
)
{145
1260
145
    isl_val *v;
1261
145
1262
145
    v = isl_multi_val_get_val(mv, i);
1263
145
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
145
    if (!multi->p[i])
1265
0
      goto error;
1266
145
  }
1267
67
1268
67
  isl_multi_val_free(mv);
1269
67
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
67
}
isl_multi_union_pw_aff_scale_multi_val
Line
Count
Source
1244
67
{
1245
67
  int i;
1246
67
1247
67
  if (
!multi || 67
!mv67
)
1248
0
    goto error;
1249
67
1250
67
  
if (67
!isl_space_tuple_is_equal(multi->space, isl_dim_out,67
1251
67
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
67
      "spaces don't match", goto error);
1254
67
1255
67
  
multi = 67
FN67
(MULTI(BASE),cow)(multi);
1256
67
  if (!multi)
1257
0
    goto error;
1258
67
1259
212
  
for (i = 0; 67
i < multi->n212
;
++i145
)
{145
1260
145
    isl_val *v;
1261
145
1262
145
    v = isl_multi_val_get_val(mv, i);
1263
145
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
145
    if (!multi->p[i])
1265
0
      goto error;
1266
145
  }
1267
67
1268
67
  isl_multi_val_free(mv);
1269
67
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
67
}
Unexecuted instantiation: isl_multi_aff_scale_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_multi_val
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 || 0
!mv0
)
1284
0
    goto error;
1285
0
1286
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
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 = 0
FN0
(MULTI(BASE),cow)(multi);
1292
0
  if (!multi)
1293
0
    return NULL;
1294
0
1295
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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_union_pw_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_val_scale_down_multi_val
Unexecuted instantiation: isl_multi_pw_aff_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 || 0
!mv0
)
1320
0
    goto error;
1321
0
1322
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
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 = 0
FN0
(MULTI(BASE),cow)(multi);
1328
0
  if (!multi)
1329
0
    return NULL;
1330
0
1331
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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_union_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_val_mod_multi_val
Unexecuted instantiation: isl_multi_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_aff_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 (0
n == 0 &&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 (0
dst_type == isl_dim_out || 0
src_type == isl_dim_out0
)
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 (0
dst_type == isl_dim_div || 0
src_type == isl_dim_div0
)
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 (0
src_pos + n > isl_space_dim(multi->space, src_type)0
)
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 (0
dst_type == src_type0
)
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 = 0
FN0
(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 0
FN0
(MULTI(BASE),free)(multi);
1392
0
1393
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
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 0
FN0
(MULTI(BASE),free)(multi);
1398
0
  }
1399
0
1400
0
  return multi;
1401
0
}
Unexecuted instantiation: isl_multi_pw_aff_move_dims
Unexecuted instantiation: isl_multi_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 (0
!isl_space_is_set(multi->space)0
)
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 = 0
FN0
(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_val_from_range
Unexecuted instantiation: isl_multi_union_pw_aff_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.00k
{
1431
1.00k
  int i;
1432
1.00k
  isl_bool equal;
1433
1.00k
1434
1.00k
  if (
!multi1 || 1.00k
!multi21.00k
)
1435
0
    return isl_bool_error;
1436
1.00k
  
if (1.00k
multi1->n != multi2->n1.00k
)
1437
0
    return isl_bool_false;
1438
1.00k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.00k
  if (
equal < 0 || 1.00k
!equal1.00k
)
1440
0
    return equal;
1441
1.00k
1442
1.23k
  
for (i = 0; 1.00k
i < multi1->n1.23k
;
++i229
)
{1.12k
1443
1.12k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
1.12k
    if (
equal < 0 || 1.12k
!equal1.12k
)
1445
898
      return equal;
1446
1.12k
  }
1447
1.00k
1448
106
  return isl_bool_true;
1449
1.00k
}
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 || 8
!multi28
)
1435
0
    return isl_bool_error;
1436
8
  
if (8
multi1->n != multi2->n8
)
1437
0
    return isl_bool_false;
1438
8
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
8
  if (
equal < 0 || 8
!equal8
)
1440
0
    return equal;
1441
8
1442
24
  
for (i = 0; 8
i < multi1->n24
;
++i16
)
{16
1443
16
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
16
    if (
equal < 0 || 16
!equal16
)
1445
0
      return equal;
1446
16
  }
1447
8
1448
8
  return isl_bool_true;
1449
8
}
isl_multi_aff_plain_is_equal
Line
Count
Source
1430
995
{
1431
995
  int i;
1432
995
  isl_bool equal;
1433
995
1434
995
  if (
!multi1 || 995
!multi2995
)
1435
0
    return isl_bool_error;
1436
995
  
if (995
multi1->n != multi2->n995
)
1437
0
    return isl_bool_false;
1438
995
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
995
  if (
equal < 0 || 995
!equal995
)
1440
0
    return equal;
1441
995
1442
1.20k
  
for (i = 0; 995
i < multi1->n1.20k
;
++i211
)
{1.10k
1443
1.10k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
1.10k
    if (
equal < 0 || 1.10k
!equal1.10k
)
1445
898
      return equal;
1446
1.10k
  }
1447
995
1448
97
  return isl_bool_true;
1449
995
}
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 || 1
!multi21
)
1435
0
    return isl_bool_error;
1436
1
  
if (1
multi1->n != multi2->n1
)
1437
0
    return isl_bool_false;
1438
1
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1
  if (
equal < 0 || 1
!equal1
)
1440
0
    return equal;
1441
1
1442
3
  
for (i = 0; 1
i < multi1->n3
;
++i2
)
{2
1443
2
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2
    if (
equal < 0 || 2
!equal2
)
1445
0
      return equal;
1446
2
  }
1447
1
1448
1
  return isl_bool_true;
1449
1
}
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
660
{
1455
660
  int i;
1456
660
1457
660
  if (!multi)
1458
0
    return isl_bool_error;
1459
660
  
if (660
multi->n == 0660
)
1460
0
    return isl_bool_false;
1461
660
1462
1.62k
  
for (i = 0; 660
i < multi->n1.62k
;
++i966
)
{968
1463
968
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
968
    if (
has_nan < 0 || 968
has_nan968
)
1465
2
      return has_nan;
1466
968
  }
1467
660
1468
658
  return isl_bool_false;
1469
660
}
Unexecuted instantiation: isl_multi_union_pw_aff_involves_nan
Unexecuted instantiation: isl_multi_val_involves_nan
Unexecuted instantiation: isl_multi_pw_aff_involves_nan
isl_multi_aff_involves_nan
Line
Count
Source
1454
660
{
1455
660
  int i;
1456
660
1457
660
  if (!multi)
1458
0
    return isl_bool_error;
1459
660
  
if (660
multi->n == 0660
)
1460
0
    return isl_bool_false;
1461
660
1462
1.62k
  
for (i = 0; 660
i < multi->n1.62k
;
++i966
)
{968
1463
968
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
968
    if (
has_nan < 0 || 968
has_nan968
)
1465
2
      return has_nan;
1466
968
  }
1467
660
1468
658
  return isl_bool_false;
1469
660
}
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(0
FN0
(MULTI(BASE),get_domain_space)(multi));
1483
0
  for (i = 0; 
i < multi->n0
;
++i0
)
{0
1484
0
    isl_set *dom_i;
1485
0
1486
0
    dom_i = 
FN0
(EL,domain)(
FN0
(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; 0
i < multi->n0
;
++i0
)
{0
1507
0
    multi->p[i] = FN(EL,neg)(multi->p[i]);
1508
0
    if (!multi->p[i])
1509
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
1510
0
  }
1511
0
1512
0
  return multi;
1513
0
}
Unexecuted instantiation: isl_multi_pw_aff_neg
Unexecuted instantiation: isl_multi_aff_neg
Unexecuted instantiation: isl_multi_union_pw_aff_neg
Unexecuted instantiation: isl_multi_val_neg
1514
#endif