Coverage Report

Created: 2017-10-03 07:32

/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
87.4k
{
23
87.4k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
87.4k
}
isl_multi_val_get_ctx
Line
Count
Source
22
8.31k
{
23
8.31k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
8.31k
}
isl_multi_union_pw_aff_get_ctx
Line
Count
Source
22
24.8k
{
23
24.8k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
24.8k
}
isl_multi_pw_aff_get_ctx
Line
Count
Source
22
19.0k
{
23
19.0k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
19.0k
}
isl_multi_aff_get_ctx
Line
Count
Source
22
35.2k
{
23
35.2k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
35.2k
}
25
26
__isl_give isl_space *FN(MULTI(BASE),get_space)(__isl_keep MULTI(BASE) *multi)
27
1.22M
{
28
1.22M
  return multi ? isl_space_copy(multi->space) : NULL;
29
1.22M
}
isl_multi_pw_aff_get_space
Line
Count
Source
27
35.4k
{
28
35.4k
  return multi ? isl_space_copy(multi->space) : NULL;
29
35.4k
}
isl_multi_val_get_space
Line
Count
Source
27
17.4k
{
28
17.4k
  return multi ? isl_space_copy(multi->space) : NULL;
29
17.4k
}
isl_multi_aff_get_space
Line
Count
Source
27
1.14M
{
28
1.14M
  return multi ? isl_space_copy(multi->space) : NULL;
29
1.14M
}
isl_multi_union_pw_aff_get_space
Line
Count
Source
27
23.9k
{
28
23.9k
  return multi ? isl_space_copy(multi->space) : NULL;
29
23.9k
}
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
79.2k
{
46
79.2k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
79.2k
}
isl_multi_aff_get_domain_space
Line
Count
Source
45
78.9k
{
46
78.9k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
78.9k
}
isl_multi_pw_aff_get_domain_space
Line
Count
Source
45
91
{
46
91
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
91
}
isl_multi_union_pw_aff_get_domain_space
Line
Count
Source
45
146
{
46
146
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
146
}
Unexecuted instantiation: isl_multi_val_get_domain_space
48
49
__isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space)
50
179k
{
51
179k
  isl_ctx *ctx;
52
179k
  int n;
53
179k
  MULTI(BASE) *multi;
54
179k
55
179k
  if (!space)
56
0
    return NULL;
57
179k
58
179k
  ctx = isl_space_get_ctx(space);
59
179k
  n = isl_space_dim(space, isl_dim_out);
60
179k
  multi = isl_calloc(ctx, MULTI(BASE),
61
179k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
179k
  if (!multi)
63
0
    goto error;
64
179k
65
179k
  multi->space = space;
66
179k
  multi->n = n;
67
179k
  multi->ref = 1;
68
179k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
179k
}
isl_multi_union_pw_aff_alloc
Line
Count
Source
50
9.13k
{
51
9.13k
  isl_ctx *ctx;
52
9.13k
  int n;
53
9.13k
  MULTI(BASE) *multi;
54
9.13k
55
9.13k
  if (!space)
56
0
    return NULL;
57
9.13k
58
9.13k
  ctx = isl_space_get_ctx(space);
59
9.13k
  n = isl_space_dim(space, isl_dim_out);
60
9.13k
  multi = isl_calloc(ctx, MULTI(BASE),
61
9.13k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
9.13k
  if (!multi)
63
0
    goto error;
64
9.13k
65
9.13k
  multi->space = space;
66
9.13k
  multi->n = n;
67
9.13k
  multi->ref = 1;
68
9.13k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
9.13k
}
isl_multi_val_alloc
Line
Count
Source
50
3.50k
{
51
3.50k
  isl_ctx *ctx;
52
3.50k
  int n;
53
3.50k
  MULTI(BASE) *multi;
54
3.50k
55
3.50k
  if (!space)
56
0
    return NULL;
57
3.50k
58
3.50k
  ctx = isl_space_get_ctx(space);
59
3.50k
  n = isl_space_dim(space, isl_dim_out);
60
3.50k
  multi = isl_calloc(ctx, MULTI(BASE),
61
3.50k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
3.50k
  if (!multi)
63
0
    goto error;
64
3.50k
65
3.50k
  multi->space = space;
66
3.50k
  multi->n = n;
67
3.50k
  multi->ref = 1;
68
3.50k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
3.50k
}
isl_multi_aff_alloc
Line
Count
Source
50
157k
{
51
157k
  isl_ctx *ctx;
52
157k
  int n;
53
157k
  MULTI(BASE) *multi;
54
157k
55
157k
  if (!space)
56
0
    return NULL;
57
157k
58
157k
  ctx = isl_space_get_ctx(space);
59
157k
  n = isl_space_dim(space, isl_dim_out);
60
157k
  multi = isl_calloc(ctx, MULTI(BASE),
61
157k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
157k
  if (!multi)
63
0
    goto error;
64
157k
65
157k
  multi->space = space;
66
157k
  multi->n = n;
67
157k
  multi->ref = 1;
68
157k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
157k
}
isl_multi_pw_aff_alloc
Line
Count
Source
50
8.56k
{
51
8.56k
  isl_ctx *ctx;
52
8.56k
  int n;
53
8.56k
  MULTI(BASE) *multi;
54
8.56k
55
8.56k
  if (!space)
56
0
    return NULL;
57
8.56k
58
8.56k
  ctx = isl_space_get_ctx(space);
59
8.56k
  n = isl_space_dim(space, isl_dim_out);
60
8.56k
  multi = isl_calloc(ctx, MULTI(BASE),
61
8.56k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
8.56k
  if (!multi)
63
0
    goto error;
64
8.56k
65
8.56k
  multi->space = space;
66
8.56k
  multi->n = n;
67
8.56k
  multi->ref = 1;
68
8.56k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
8.56k
}
73
74
__isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi)
75
125k
{
76
125k
  int i;
77
125k
  MULTI(BASE) *dup;
78
125k
79
125k
  if (!multi)
80
0
    return NULL;
81
125k
82
125k
  
dup = 125k
FN125k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
125k
  if (!dup)
84
0
    return NULL;
85
125k
86
992k
  
for (i = 0; 125k
i < multi->n992k
;
++i866k
)
87
866k
    
dup = 866k
FN866k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
866k
                FN(EL,copy)(multi->p[i]));
89
125k
90
125k
  return dup;
91
125k
}
Unexecuted instantiation: isl_multi_pw_aff_dup
isl_multi_union_pw_aff_dup
Line
Count
Source
75
1.17k
{
76
1.17k
  int i;
77
1.17k
  MULTI(BASE) *dup;
78
1.17k
79
1.17k
  if (!multi)
80
0
    return NULL;
81
1.17k
82
1.17k
  
dup = 1.17k
FN1.17k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
1.17k
  if (!dup)
84
0
    return NULL;
85
1.17k
86
3.27k
  
for (i = 0; 1.17k
i < multi->n3.27k
;
++i2.09k
)
87
2.09k
    
dup = 2.09k
FN2.09k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
2.09k
                FN(EL,copy)(multi->p[i]));
89
1.17k
90
1.17k
  return dup;
91
1.17k
}
isl_multi_aff_dup
Line
Count
Source
75
124k
{
76
124k
  int i;
77
124k
  MULTI(BASE) *dup;
78
124k
79
124k
  if (!multi)
80
0
    return NULL;
81
124k
82
124k
  
dup = 124k
FN124k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
124k
  if (!dup)
84
0
    return NULL;
85
124k
86
988k
  
for (i = 0; 124k
i < multi->n988k
;
++i864k
)
87
864k
    
dup = 864k
FN864k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
864k
                FN(EL,copy)(multi->p[i]));
89
124k
90
124k
  return dup;
91
124k
}
isl_multi_val_dup
Line
Count
Source
75
164
{
76
164
  int i;
77
164
  MULTI(BASE) *dup;
78
164
79
164
  if (!multi)
80
0
    return NULL;
81
164
82
164
  
dup = 164
FN164
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
164
  if (!dup)
84
0
    return NULL;
85
164
86
576
  
for (i = 0; 164
i < multi->n576
;
++i412
)
87
412
    
dup = 412
FN412
(FN(MULTI(BASE),set),BASE)(dup, i,
88
412
                FN(EL,copy)(multi->p[i]));
89
164
90
164
  return dup;
91
164
}
92
93
__isl_give MULTI(BASE) *FN(MULTI(BASE),cow)(__isl_take MULTI(BASE) *multi)
94
1.14M
{
95
1.14M
  if (!multi)
96
0
    return NULL;
97
1.14M
98
1.14M
  
if (1.14M
multi->ref == 11.14M
)
99
1.01M
    return multi;
100
1.14M
101
125k
  multi->ref--;
102
125k
  return FN(MULTI(BASE),dup)(multi);
103
1.14M
}
isl_multi_union_pw_aff_cow
Line
Count
Source
94
13.8k
{
95
13.8k
  if (!multi)
96
0
    return NULL;
97
13.8k
98
13.8k
  
if (13.8k
multi->ref == 113.8k
)
99
12.6k
    return multi;
100
13.8k
101
1.17k
  multi->ref--;
102
1.17k
  return FN(MULTI(BASE),dup)(multi);
103
13.8k
}
isl_multi_pw_aff_cow
Line
Count
Source
94
43.7k
{
95
43.7k
  if (!multi)
96
0
    return NULL;
97
43.7k
98
43.7k
  
if (43.7k
multi->ref == 143.7k
)
99
43.7k
    return multi;
100
43.7k
101
0
  multi->ref--;
102
0
  return FN(MULTI(BASE),dup)(multi);
103
43.7k
}
isl_multi_val_cow
Line
Count
Source
94
10.7k
{
95
10.7k
  if (!multi)
96
0
    return NULL;
97
10.7k
98
10.7k
  
if (10.7k
multi->ref == 110.7k
)
99
10.5k
    return multi;
100
10.7k
101
164
  multi->ref--;
102
164
  return FN(MULTI(BASE),dup)(multi);
103
10.7k
}
isl_multi_aff_cow
Line
Count
Source
94
1.07M
{
95
1.07M
  if (!multi)
96
0
    return NULL;
97
1.07M
98
1.07M
  
if (1.07M
multi->ref == 11.07M
)
99
952k
    return multi;
100
1.07M
101
124k
  multi->ref--;
102
124k
  return FN(MULTI(BASE),dup)(multi);
103
1.07M
}
104
105
__isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi)
106
274k
{
107
274k
  if (!multi)
108
382
    return NULL;
109
274k
110
274k
  multi->ref++;
111
274k
  return multi;
112
274k
}
isl_multi_aff_copy
Line
Count
Source
106
247k
{
107
247k
  if (!multi)
108
382
    return NULL;
109
247k
110
246k
  multi->ref++;
111
246k
  return multi;
112
247k
}
isl_multi_pw_aff_copy
Line
Count
Source
106
2
{
107
2
  if (!multi)
108
0
    return NULL;
109
2
110
2
  multi->ref++;
111
2
  return multi;
112
2
}
isl_multi_union_pw_aff_copy
Line
Count
Source
106
15.5k
{
107
15.5k
  if (!multi)
108
0
    return NULL;
109
15.5k
110
15.5k
  multi->ref++;
111
15.5k
  return multi;
112
15.5k
}
isl_multi_val_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
}
113
114
__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi)
115
372k
{
116
372k
  int i;
117
372k
118
372k
  if (!multi)
119
44.5k
    return NULL;
120
372k
121
328k
  
if (328k
--multi->ref > 0328k
)
122
149k
    return NULL;
123
328k
124
179k
  isl_space_free(multi->space);
125
1.13M
  for (i = 0; 
i < multi->n1.13M
;
++i957k
)
126
957k
    
FN957k
(EL,free)(multi->p[i])957k
;
127
179k
  free(multi);
128
179k
129
179k
  return NULL;
130
372k
}
isl_multi_union_pw_aff_free
Line
Count
Source
115
23.5k
{
116
23.5k
  int i;
117
23.5k
118
23.5k
  if (!multi)
119
0
    return NULL;
120
23.5k
121
23.5k
  
if (23.5k
--multi->ref > 023.5k
)
122
14.3k
    return NULL;
123
23.5k
124
9.10k
  isl_space_free(multi->space);
125
17.2k
  for (i = 0; 
i < multi->n17.2k
;
++i8.17k
)
126
8.17k
    
FN8.17k
(EL,free)(multi->p[i])8.17k
;
127
9.10k
  free(multi);
128
9.10k
129
9.10k
  return NULL;
130
23.5k
}
isl_multi_val_free
Line
Count
Source
115
15.4k
{
116
15.4k
  int i;
117
15.4k
118
15.4k
  if (!multi)
119
4
    return NULL;
120
15.4k
121
15.4k
  
if (15.4k
--multi->ref > 015.4k
)
122
11.9k
    return NULL;
123
15.4k
124
3.50k
  isl_space_free(multi->space);
125
8.62k
  for (i = 0; 
i < multi->n8.62k
;
++i5.11k
)
126
5.11k
    
FN5.11k
(EL,free)(multi->p[i])5.11k
;
127
3.50k
  free(multi);
128
3.50k
129
3.50k
  return NULL;
130
15.4k
}
isl_multi_aff_free
Line
Count
Source
115
325k
{
116
325k
  int i;
117
325k
118
325k
  if (!multi)
119
44.5k
    return NULL;
120
325k
121
280k
  
if (280k
--multi->ref > 0280k
)
122
122k
    return NULL;
123
280k
124
157k
  isl_space_free(multi->space);
125
1.08M
  for (i = 0; 
i < multi->n1.08M
;
++i929k
)
126
929k
    
FN929k
(EL,free)(multi->p[i])929k
;
127
157k
  free(multi);
128
157k
129
157k
  return NULL;
130
325k
}
isl_multi_pw_aff_free
Line
Count
Source
115
8.56k
{
116
8.56k
  int i;
117
8.56k
118
8.56k
  if (!multi)
119
0
    return NULL;
120
8.56k
121
8.56k
  
if (8.56k
--multi->ref > 08.56k
)
122
2
    return NULL;
123
8.56k
124
8.56k
  isl_space_free(multi->space);
125
22.6k
  for (i = 0; 
i < multi->n22.6k
;
++i14.0k
)
126
14.0k
    
FN14.0k
(EL,free)(multi->p[i])14.0k
;
127
8.56k
  free(multi);
128
8.56k
129
8.56k
  return NULL;
130
8.56k
}
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
) {
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
) {
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
18
}
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
) {
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
18
}
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
1.33M
{
204
1.33M
  return multi ? 
isl_space_dim(multi->space, type)1.33M
:
00
;
205
1.33M
}
isl_multi_aff_dim
Line
Count
Source
203
1.29M
{
204
1.29M
  return multi ? 
isl_space_dim(multi->space, type)1.29M
:
00
;
205
1.29M
}
isl_multi_val_dim
Line
Count
Source
203
7.68k
{
204
7.68k
  return multi ? 
isl_space_dim(multi->space, type)7.68k
:
00
;
205
7.68k
}
isl_multi_union_pw_aff_dim
Line
Count
Source
203
23.2k
{
204
23.2k
  return multi ? 
isl_space_dim(multi->space, type)23.2k
:
00
;
205
23.2k
}
isl_multi_pw_aff_dim
Line
Count
Source
203
11.6k
{
204
11.6k
  return multi ? 
isl_space_dim(multi->space, type)11.6k
:
00
;
205
11.6k
}
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
) {
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
5.46k
{
262
5.46k
  if (!multi)
263
0
    return isl_bool_error;
264
5.46k
  return isl_space_has_tuple_id(multi->space, type);
265
5.46k
}
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
3.08k
{
262
3.08k
  if (!multi)
263
0
    return isl_bool_error;
264
3.08k
  return isl_space_has_tuple_id(multi->space, type);
265
3.08k
}
isl_multi_union_pw_aff_has_tuple_id
Line
Count
Source
261
2.37k
{
262
2.37k
  if (!multi)
263
0
    return isl_bool_error;
264
2.37k
  return isl_space_has_tuple_id(multi->space, type);
265
2.37k
}
266
267
/* Return the id of the specified tuple.
268
 */
269
__isl_give isl_id *FN(MULTI(BASE),get_tuple_id)(__isl_keep MULTI(BASE) *multi,
270
  enum isl_dim_type type)
271
3.08k
{
272
3.08k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
3.08k
}
Unexecuted instantiation: isl_multi_aff_get_tuple_id
isl_multi_pw_aff_get_tuple_id
Line
Count
Source
271
3.08k
{
272
3.08k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
3.08k
}
Unexecuted instantiation: isl_multi_union_pw_aff_get_tuple_id
Unexecuted instantiation: isl_multi_val_get_tuple_id
274
275
__isl_give EL *FN(FN(MULTI(BASE),get),BASE)(__isl_keep MULTI(BASE) *multi,
276
  int pos)
277
77.0k
{
278
77.0k
  isl_ctx *ctx;
279
77.0k
280
77.0k
  if (!multi)
281
0
    return NULL;
282
77.0k
  
ctx = 77.0k
FN77.0k
(MULTI(BASE),get_ctx)(multi);
283
77.0k
  if (
pos < 0 || 77.0k
pos >= multi->n77.0k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
77.0k
      "index out of bounds", return NULL);
286
77.0k
  
return 77.0k
FN77.0k
(EL,copy)(multi->p[pos]);
287
77.0k
}
isl_multi_val_get_val
Line
Count
Source
277
8.24k
{
278
8.24k
  isl_ctx *ctx;
279
8.24k
280
8.24k
  if (!multi)
281
0
    return NULL;
282
8.24k
  
ctx = 8.24k
FN8.24k
(MULTI(BASE),get_ctx)(multi);
283
8.24k
  if (
pos < 0 || 8.24k
pos >= multi->n8.24k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
8.24k
      "index out of bounds", return NULL);
286
8.24k
  
return 8.24k
FN8.24k
(EL,copy)(multi->p[pos]);
287
8.24k
}
isl_multi_union_pw_aff_get_union_pw_aff
Line
Count
Source
277
19.4k
{
278
19.4k
  isl_ctx *ctx;
279
19.4k
280
19.4k
  if (!multi)
281
0
    return NULL;
282
19.4k
  
ctx = 19.4k
FN19.4k
(MULTI(BASE),get_ctx)(multi);
283
19.4k
  if (
pos < 0 || 19.4k
pos >= multi->n19.4k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
19.4k
      "index out of bounds", return NULL);
286
19.4k
  
return 19.4k
FN19.4k
(EL,copy)(multi->p[pos]);
287
19.4k
}
isl_multi_pw_aff_get_pw_aff
Line
Count
Source
277
14.0k
{
278
14.0k
  isl_ctx *ctx;
279
14.0k
280
14.0k
  if (!multi)
281
0
    return NULL;
282
14.0k
  
ctx = 14.0k
FN14.0k
(MULTI(BASE),get_ctx)(multi);
283
14.0k
  if (
pos < 0 || 14.0k
pos >= multi->n14.0k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
14.0k
      "index out of bounds", return NULL);
286
14.0k
  
return 14.0k
FN14.0k
(EL,copy)(multi->p[pos]);
287
14.0k
}
isl_multi_aff_get_aff
Line
Count
Source
277
35.2k
{
278
35.2k
  isl_ctx *ctx;
279
35.2k
280
35.2k
  if (!multi)
281
0
    return NULL;
282
35.2k
  
ctx = 35.2k
FN35.2k
(MULTI(BASE),get_ctx)(multi);
283
35.2k
  if (
pos < 0 || 35.2k
pos >= multi->n35.2k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
35.2k
      "index out of bounds", return NULL);
286
35.2k
  
return 35.2k
FN35.2k
(EL,copy)(multi->p[pos]);
287
35.2k
}
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
970k
{
292
970k
  isl_space *multi_space = NULL;
293
970k
  isl_space *el_space = NULL;
294
970k
  isl_bool match;
295
970k
296
970k
  multi = FN(MULTI(BASE),cow)(multi);
297
970k
  if (
!multi || 970k
!el970k
)
298
0
    goto error;
299
970k
300
970k
  
multi_space = 970k
FN970k
(MULTI(BASE),get_space)(multi);
301
970k
  match = FN(EL,matching_params)(el, multi_space);
302
970k
  if (match < 0)
303
0
    goto error;
304
970k
  
if (970k
!match970k
) {
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
970k
  if (
FN970k
(EL,check_match_domain_space)(el, multi_space) < 0970k
)
312
0
    goto error;
313
970k
314
970k
  
if (970k
pos < 0 || 970k
pos >= multi->n970k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
970k
      "index out of bounds", goto error);
317
970k
318
970k
  
FN970k
(EL,free)(multi->p[pos]);
319
970k
  multi->p[pos] = el;
320
970k
321
970k
  isl_space_free(multi_space);
322
970k
  isl_space_free(el_space);
323
970k
324
970k
  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
970k
}
isl_multi_val_set_val
Line
Count
Source
291
10.7k
{
292
10.7k
  isl_space *multi_space = NULL;
293
10.7k
  isl_space *el_space = NULL;
294
10.7k
  isl_bool match;
295
10.7k
296
10.7k
  multi = FN(MULTI(BASE),cow)(multi);
297
10.7k
  if (
!multi || 10.7k
!el10.7k
)
298
0
    goto error;
299
10.7k
300
10.7k
  
multi_space = 10.7k
FN10.7k
(MULTI(BASE),get_space)(multi);
301
10.7k
  match = FN(EL,matching_params)(el, multi_space);
302
10.7k
  if (match < 0)
303
0
    goto error;
304
10.7k
  
if (10.7k
!match10.7k
) {
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.7k
  if (
FN10.7k
(EL,check_match_domain_space)(el, multi_space) < 010.7k
)
312
0
    goto error;
313
10.7k
314
10.7k
  
if (10.7k
pos < 0 || 10.7k
pos >= multi->n10.7k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
10.7k
      "index out of bounds", goto error);
317
10.7k
318
10.7k
  
FN10.7k
(EL,free)(multi->p[pos]);
319
10.7k
  multi->p[pos] = el;
320
10.7k
321
10.7k
  isl_space_free(multi_space);
322
10.7k
  isl_space_free(el_space);
323
10.7k
324
10.7k
  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.7k
}
isl_multi_aff_set_aff
Line
Count
Source
291
936k
{
292
936k
  isl_space *multi_space = NULL;
293
936k
  isl_space *el_space = NULL;
294
936k
  isl_bool match;
295
936k
296
936k
  multi = FN(MULTI(BASE),cow)(multi);
297
936k
  if (
!multi || 936k
!el936k
)
298
0
    goto error;
299
936k
300
936k
  
multi_space = 936k
FN936k
(MULTI(BASE),get_space)(multi);
301
936k
  match = FN(EL,matching_params)(el, multi_space);
302
936k
  if (match < 0)
303
0
    goto error;
304
936k
  
if (936k
!match936k
) {
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
936k
  if (
FN936k
(EL,check_match_domain_space)(el, multi_space) < 0936k
)
312
0
    goto error;
313
936k
314
936k
  
if (936k
pos < 0 || 936k
pos >= multi->n936k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
936k
      "index out of bounds", goto error);
317
936k
318
936k
  
FN936k
(EL,free)(multi->p[pos]);
319
936k
  multi->p[pos] = el;
320
936k
321
936k
  isl_space_free(multi_space);
322
936k
  isl_space_free(el_space);
323
936k
324
936k
  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
936k
}
isl_multi_union_pw_aff_set_union_pw_aff
Line
Count
Source
291
8.96k
{
292
8.96k
  isl_space *multi_space = NULL;
293
8.96k
  isl_space *el_space = NULL;
294
8.96k
  isl_bool match;
295
8.96k
296
8.96k
  multi = FN(MULTI(BASE),cow)(multi);
297
8.96k
  if (
!multi || 8.96k
!el8.96k
)
298
0
    goto error;
299
8.96k
300
8.96k
  
multi_space = 8.96k
FN8.96k
(MULTI(BASE),get_space)(multi);
301
8.96k
  match = FN(EL,matching_params)(el, multi_space);
302
8.96k
  if (match < 0)
303
0
    goto error;
304
8.96k
  
if (8.96k
!match8.96k
) {
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
8.96k
  if (
FN8.96k
(EL,check_match_domain_space)(el, multi_space) < 08.96k
)
312
0
    goto error;
313
8.96k
314
8.96k
  
if (8.96k
pos < 0 || 8.96k
pos >= multi->n8.96k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
8.96k
      "index out of bounds", goto error);
317
8.96k
318
8.96k
  
FN8.96k
(EL,free)(multi->p[pos]);
319
8.96k
  multi->p[pos] = el;
320
8.96k
321
8.96k
  isl_space_free(multi_space);
322
8.96k
  isl_space_free(el_space);
323
8.96k
324
8.96k
  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
8.96k
}
isl_multi_pw_aff_set_pw_aff
Line
Count
Source
291
14.0k
{
292
14.0k
  isl_space *multi_space = NULL;
293
14.0k
  isl_space *el_space = NULL;
294
14.0k
  isl_bool match;
295
14.0k
296
14.0k
  multi = FN(MULTI(BASE),cow)(multi);
297
14.0k
  if (
!multi || 14.0k
!el14.0k
)
298
0
    goto error;
299
14.0k
300
14.0k
  
multi_space = 14.0k
FN14.0k
(MULTI(BASE),get_space)(multi);
301
14.0k
  match = FN(EL,matching_params)(el, multi_space);
302
14.0k
  if (match < 0)
303
0
    goto error;
304
14.0k
  
if (14.0k
!match14.0k
) {
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
14.0k
  if (
FN14.0k
(EL,check_match_domain_space)(el, multi_space) < 014.0k
)
312
0
    goto error;
313
14.0k
314
14.0k
  
if (14.0k
pos < 0 || 14.0k
pos >= multi->n14.0k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
14.0k
      "index out of bounds", goto error);
317
14.0k
318
14.0k
  
FN14.0k
(EL,free)(multi->p[pos]);
319
14.0k
  multi->p[pos] = el;
320
14.0k
321
14.0k
  isl_space_free(multi_space);
322
14.0k
  isl_space_free(el_space);
323
14.0k
324
14.0k
  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
14.0k
}
332
333
/* Reset the space of "multi".  This function is called from isl_pw_templ.c
334
 * and doesn't know if the space of an element object is represented
335
 * directly or through its domain.  It therefore passes along both,
336
 * which we pass along to the element function since we don't how
337
 * that is represented either.
338
 */
339
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space_and_domain)(
340
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space,
341
  __isl_take isl_space *domain)
342
19.6k
{
343
19.6k
  int i;
344
19.6k
345
19.6k
  multi = FN(MULTI(BASE),cow)(multi);
346
19.6k
  if (
!multi || 19.6k
!space19.6k
||
!domain19.6k
)
347
0
    goto error;
348
19.6k
349
72.7k
  
for (i = 0; 19.6k
i < multi->n72.7k
;
++i53.1k
) {
350
53.1k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
53.1k
         isl_space_copy(domain));
352
53.1k
    if (!multi->p[i])
353
0
      goto error;
354
53.1k
  }
355
19.6k
  isl_space_free(domain);
356
19.6k
  isl_space_free(multi->space);
357
19.6k
  multi->space = space;
358
19.6k
359
19.6k
  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
19.6k
}
isl_multi_union_pw_aff_reset_space_and_domain
Line
Count
Source
342
163
{
343
163
  int i;
344
163
345
163
  multi = FN(MULTI(BASE),cow)(multi);
346
163
  if (
!multi || 163
!space163
||
!domain163
)
347
0
    goto error;
348
163
349
354
  
for (i = 0; 163
i < multi->n354
;
++i191
) {
350
191
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
191
         isl_space_copy(domain));
352
191
    if (!multi->p[i])
353
0
      goto error;
354
191
  }
355
163
  isl_space_free(domain);
356
163
  isl_space_free(multi->space);
357
163
  multi->space = space;
358
163
359
163
  return multi;
360
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
163
}
isl_multi_pw_aff_reset_space_and_domain
Line
Count
Source
342
14.7k
{
343
14.7k
  int i;
344
14.7k
345
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
346
14.7k
  if (
!multi || 14.7k
!space14.7k
||
!domain14.7k
)
347
0
    goto error;
348
14.7k
349
56.3k
  
for (i = 0; 14.7k
i < multi->n56.3k
;
++i41.6k
) {
350
41.6k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
41.6k
         isl_space_copy(domain));
352
41.6k
    if (!multi->p[i])
353
0
      goto error;
354
41.6k
  }
355
14.7k
  isl_space_free(domain);
356
14.7k
  isl_space_free(multi->space);
357
14.7k
  multi->space = space;
358
14.7k
359
14.7k
  return multi;
360
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
14.7k
}
isl_multi_aff_reset_space_and_domain
Line
Count
Source
342
4.74k
{
343
4.74k
  int i;
344
4.74k
345
4.74k
  multi = FN(MULTI(BASE),cow)(multi);
346
4.74k
  if (
!multi || 4.74k
!space4.74k
||
!domain4.74k
)
347
0
    goto error;
348
4.74k
349
16.0k
  
for (i = 0; 4.74k
i < multi->n16.0k
;
++i11.2k
) {
350
11.2k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
11.2k
         isl_space_copy(domain));
352
11.2k
    if (!multi->p[i])
353
0
      goto error;
354
11.2k
  }
355
4.74k
  isl_space_free(domain);
356
4.74k
  isl_space_free(multi->space);
357
4.74k
  multi->space = space;
358
4.74k
359
4.74k
  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
4.74k
}
Unexecuted instantiation: isl_multi_val_reset_space_and_domain
366
367
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_domain_space)(
368
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *domain)
369
156
{
370
156
  isl_space *space;
371
156
372
156
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
156
            isl_space_copy(multi->space));
374
156
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
156
}
isl_multi_union_pw_aff_reset_domain_space
Line
Count
Source
369
146
{
370
146
  isl_space *space;
371
146
372
146
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
146
            isl_space_copy(multi->space));
374
146
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
146
}
Unexecuted instantiation: isl_multi_val_reset_domain_space
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
17.0k
{
380
17.0k
  isl_space *domain;
381
17.0k
382
17.0k
  domain = isl_space_domain(isl_space_copy(space));
383
17.0k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
17.0k
}
isl_multi_aff_reset_space
Line
Count
Source
379
2.31k
{
380
2.31k
  isl_space *domain;
381
2.31k
382
2.31k
  domain = isl_space_domain(isl_space_copy(space));
383
2.31k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
2.31k
}
isl_multi_pw_aff_reset_space
Line
Count
Source
379
14.7k
{
380
14.7k
  isl_space *domain;
381
14.7k
382
14.7k
  domain = isl_space_domain(isl_space_copy(space));
383
14.7k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
14.7k
}
isl_multi_union_pw_aff_reset_space
Line
Count
Source
379
17
{
380
17
  isl_space *domain;
381
17
382
17
  domain = isl_space_domain(isl_space_copy(space));
383
17
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
17
}
Unexecuted instantiation: isl_multi_val_reset_space
385
386
/* Set the id of the given dimension of "multi" to "id".
387
 */
388
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_id)(
389
  __isl_take MULTI(BASE) *multi,
390
  enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
391
14.7k
{
392
14.7k
  isl_space *space;
393
14.7k
394
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
395
14.7k
  if (
!multi || 14.7k
!id14.7k
)
396
0
    goto error;
397
14.7k
398
14.7k
  
space = 14.7k
FN14.7k
(MULTI(BASE),get_space)(multi);
399
14.7k
  space = isl_space_set_dim_id(space, type, pos, id);
400
14.7k
401
14.7k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
14.7k
}
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_id
Unexecuted instantiation: isl_multi_aff_set_dim_id
Unexecuted instantiation: isl_multi_val_set_dim_id
isl_multi_pw_aff_set_dim_id
Line
Count
Source
391
14.7k
{
392
14.7k
  isl_space *space;
393
14.7k
394
14.7k
  multi = FN(MULTI(BASE),cow)(multi);
395
14.7k
  if (
!multi || 14.7k
!id14.7k
)
396
0
    goto error;
397
14.7k
398
14.7k
  
space = 14.7k
FN14.7k
(MULTI(BASE),get_space)(multi);
399
14.7k
  space = isl_space_set_dim_id(space, type, pos, id);
400
14.7k
401
14.7k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
14.7k
}
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
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
}
isl_multi_aff_set_tuple_id
Line
Count
Source
427
87
{
428
87
  isl_space *space;
429
87
430
87
  multi = FN(MULTI(BASE),cow)(multi);
431
87
  if (!multi)
432
0
    goto error;
433
87
434
87
  
space = 87
FN87
(MULTI(BASE),get_space)(multi);
435
87
  space = isl_space_set_tuple_id(space, type, id);
436
87
437
87
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
87
}
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
2.37k
{
448
2.37k
  isl_space *space;
449
2.37k
450
2.37k
  if (!multi)
451
0
    return NULL;
452
2.37k
  
if (2.37k
!2.37k
FN2.37k
(MULTI(BASE),has_tuple_id)(multi, type))
453
2.36k
    return multi;
454
2.37k
455
14
  
multi = 14
FN14
(MULTI(BASE),cow)(multi);
456
14
  if (!multi)
457
0
    return NULL;
458
14
459
14
  
space = 14
FN14
(MULTI(BASE),get_space)(multi);
460
14
  space = isl_space_reset_tuple_id(space, type);
461
14
462
14
  return FN(MULTI(BASE),reset_space)(multi, space);
463
2.37k
}
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
2.37k
{
448
2.37k
  isl_space *space;
449
2.37k
450
2.37k
  if (!multi)
451
0
    return NULL;
452
2.37k
  
if (2.37k
!2.37k
FN2.37k
(MULTI(BASE),has_tuple_id)(multi, type))
453
2.36k
    return multi;
454
2.37k
455
14
  
multi = 14
FN14
(MULTI(BASE),cow)(multi);
456
14
  if (!multi)
457
0
    return NULL;
458
14
459
14
  
space = 14
FN14
(MULTI(BASE),get_space)(multi);
460
14
  space = isl_space_reset_tuple_id(space, type);
461
14
462
14
  return FN(MULTI(BASE),reset_space)(multi, space);
463
2.37k
}
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
156
{
482
156
  int i;
483
156
484
156
  multi = FN(MULTI(BASE),cow)(multi);
485
156
  if (
!multi || 156
!exp156
)
486
0
    goto error;
487
156
488
302
  
for (i = 0; 156
i < multi->n302
;
++i146
) {
489
146
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
146
            isl_reordering_copy(exp));
491
146
    if (!multi->p[i])
492
0
      goto error;
493
146
  }
494
156
495
156
  
multi = 156
FN156
(MULTI(BASE),reset_domain_space)(multi,
496
156
                isl_space_copy(exp->dim));
497
156
498
156
  isl_reordering_free(exp);
499
156
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
156
}
Unexecuted instantiation: isl_multi_pw_aff_realign_domain
isl_multi_union_pw_aff_realign_domain
Line
Count
Source
481
146
{
482
146
  int i;
483
146
484
146
  multi = FN(MULTI(BASE),cow)(multi);
485
146
  if (
!multi || 146
!exp146
)
486
0
    goto error;
487
146
488
292
  
for (i = 0; 146
i < multi->n292
;
++i146
) {
489
146
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
146
            isl_reordering_copy(exp));
491
146
    if (!multi->p[i])
492
0
      goto error;
493
146
  }
494
146
495
146
  
multi = 146
FN146
(MULTI(BASE),reset_domain_space)(multi,
496
146
                isl_space_copy(exp->dim));
497
146
498
146
  isl_reordering_free(exp);
499
146
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
146
}
Unexecuted instantiation: isl_multi_val_realign_domain
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
) {
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.64k
{
511
2.64k
  isl_ctx *ctx;
512
2.64k
  isl_bool equal_params;
513
2.64k
  isl_reordering *exp;
514
2.64k
515
2.64k
  if (
!multi || 2.64k
!model2.64k
)
516
0
    goto error;
517
2.64k
518
2.64k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
2.64k
  if (equal_params < 0)
520
0
    goto error;
521
2.64k
  
if (2.64k
equal_params2.64k
) {
522
2.48k
    isl_space_free(model);
523
2.48k
    return multi;
524
2.48k
  }
525
2.64k
526
156
  ctx = isl_space_get_ctx(model);
527
156
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
156
      "model has unnamed parameters", goto error);
530
156
  
if (156
!isl_space_has_named_params(multi->space)156
)
531
0
    isl_die(ctx, isl_error_invalid,
532
156
      "input has unnamed parameters", goto error);
533
156
534
156
  model = isl_space_params(model);
535
156
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
156
  exp = isl_reordering_extend_space(exp,
537
156
            FN(MULTI(BASE),get_domain_space)(multi));
538
156
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
156
540
156
  isl_space_free(model);
541
156
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
2.64k
}
isl_multi_union_pw_aff_align_params
Line
Count
Source
510
1.00k
{
511
1.00k
  isl_ctx *ctx;
512
1.00k
  isl_bool equal_params;
513
1.00k
  isl_reordering *exp;
514
1.00k
515
1.00k
  if (
!multi || 1.00k
!model1.00k
)
516
0
    goto error;
517
1.00k
518
1.00k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.00k
  if (equal_params < 0)
520
0
    goto error;
521
1.00k
  
if (1.00k
equal_params1.00k
) {
522
862
    isl_space_free(model);
523
862
    return multi;
524
862
  }
525
1.00k
526
146
  ctx = isl_space_get_ctx(model);
527
146
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
146
      "model has unnamed parameters", goto error);
530
146
  
if (146
!isl_space_has_named_params(multi->space)146
)
531
0
    isl_die(ctx, isl_error_invalid,
532
146
      "input has unnamed parameters", goto error);
533
146
534
146
  model = isl_space_params(model);
535
146
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
146
  exp = isl_reordering_extend_space(exp,
537
146
            FN(MULTI(BASE),get_domain_space)(multi));
538
146
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
146
540
146
  isl_space_free(model);
541
146
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
1.00k
}
isl_multi_pw_aff_align_params
Line
Count
Source
510
4
{
511
4
  isl_ctx *ctx;
512
4
  isl_bool equal_params;
513
4
  isl_reordering *exp;
514
4
515
4
  if (
!multi || 4
!model4
)
516
0
    goto error;
517
4
518
4
  equal_params = isl_space_has_equal_params(multi->space, model);
519
4
  if (equal_params < 0)
520
0
    goto error;
521
4
  
if (4
equal_params4
) {
522
4
    isl_space_free(model);
523
4
    return multi;
524
4
  }
525
4
526
0
  ctx = isl_space_get_ctx(model);
527
0
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
0
      "model has unnamed parameters", goto error);
530
0
  
if (0
!isl_space_has_named_params(multi->space)0
)
531
0
    isl_die(ctx, isl_error_invalid,
532
0
      "input has unnamed parameters", goto error);
533
0
534
0
  model = isl_space_params(model);
535
0
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
0
  exp = isl_reordering_extend_space(exp,
537
0
            FN(MULTI(BASE),get_domain_space)(multi));
538
0
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
0
540
0
  isl_space_free(model);
541
0
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
4
}
Unexecuted instantiation: isl_multi_val_align_params
isl_multi_aff_align_params
Line
Count
Source
510
1.63k
{
511
1.63k
  isl_ctx *ctx;
512
1.63k
  isl_bool equal_params;
513
1.63k
  isl_reordering *exp;
514
1.63k
515
1.63k
  if (
!multi || 1.63k
!model1.63k
)
516
0
    goto error;
517
1.63k
518
1.63k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.63k
  if (equal_params < 0)
520
0
    goto error;
521
1.63k
  
if (1.63k
equal_params1.63k
) {
522
1.62k
    isl_space_free(model);
523
1.62k
    return multi;
524
1.62k
  }
525
1.63k
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
1.63k
}
547
548
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))(
549
  __isl_take isl_space *space, __isl_take LIST(EL) *list)
550
5.21k
{
551
5.21k
  int i;
552
5.21k
  int n;
553
5.21k
  isl_ctx *ctx;
554
5.21k
  MULTI(BASE) *multi;
555
5.21k
556
5.21k
  if (
!space || 5.21k
!list5.21k
)
557
2
    goto error;
558
5.21k
559
5.21k
  ctx = isl_space_get_ctx(space);
560
5.21k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
5.21k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
5.21k
      "invalid number of elements in list", goto error);
564
5.21k
565
5.21k
  
multi = 5.21k
FN5.21k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
12.4k
  for (i = 0; 
i < n12.4k
;
++i7.27k
) {
567
7.27k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
7.27k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
7.27k
  }
570
5.21k
571
5.21k
  isl_space_free(space);
572
5.21k
  FN(LIST(EL),free)(list);
573
5.21k
  return multi;
574
2
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
5.21k
}
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
) {
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
5.18k
{
551
5.18k
  int i;
552
5.18k
  int n;
553
5.18k
  isl_ctx *ctx;
554
5.18k
  MULTI(BASE) *multi;
555
5.18k
556
5.18k
  if (
!space || 5.18k
!list5.18k
)
557
2
    goto error;
558
5.18k
559
5.18k
  ctx = isl_space_get_ctx(space);
560
5.18k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
5.18k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
5.18k
      "invalid number of elements in list", goto error);
564
5.18k
565
5.18k
  
multi = 5.18k
FN5.18k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
12.4k
  for (i = 0; 
i < n12.4k
;
++i7.22k
) {
567
7.22k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
7.22k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
7.22k
  }
570
5.18k
571
5.18k
  isl_space_free(space);
572
5.18k
  FN(LIST(EL),free)(list);
573
5.18k
  return multi;
574
2
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
5.18k
}
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
) {
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
5.96k
{
586
5.96k
  int i, n;
587
5.96k
  isl_local_space *ls;
588
5.96k
  MULTI(BASE) *multi;
589
5.96k
590
5.96k
  if (!space)
591
0
    return NULL;
592
5.96k
593
5.96k
  
if (5.96k
isl_space_is_set(space)5.96k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
5.96k
      "expecting map space", goto error);
596
5.96k
597
5.96k
  n = isl_space_dim(space, isl_dim_out);
598
5.96k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
5.96k
      "number of input and output dimensions needs to be "
601
5.96k
      "the same", goto error);
602
5.96k
603
5.96k
  
multi = 5.96k
FN5.96k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
5.96k
605
5.96k
  if (
!n5.96k
) {
606
2.04k
    isl_space_free(space);
607
2.04k
    return multi;
608
2.04k
  }
609
5.96k
610
3.91k
  space = isl_space_domain(space);
611
3.91k
  ls = isl_local_space_from_space(space);
612
3.91k
613
27.1k
  for (i = 0; 
i < n27.1k
;
++i23.2k
) {
614
23.2k
    EL *el;
615
23.2k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
23.2k
            isl_dim_set, i);
617
23.2k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
23.2k
  }
619
3.91k
620
3.91k
  isl_local_space_free(ls);
621
3.91k
622
3.91k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
5.96k
}
Unexecuted instantiation: isl_multi_pw_aff_identity
isl_multi_aff_identity
Line
Count
Source
585
5.96k
{
586
5.96k
  int i, n;
587
5.96k
  isl_local_space *ls;
588
5.96k
  MULTI(BASE) *multi;
589
5.96k
590
5.96k
  if (!space)
591
0
    return NULL;
592
5.96k
593
5.96k
  
if (5.96k
isl_space_is_set(space)5.96k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
5.96k
      "expecting map space", goto error);
596
5.96k
597
5.96k
  n = isl_space_dim(space, isl_dim_out);
598
5.96k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
5.96k
      "number of input and output dimensions needs to be "
601
5.96k
      "the same", goto error);
602
5.96k
603
5.96k
  
multi = 5.96k
FN5.96k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
5.96k
605
5.96k
  if (
!n5.96k
) {
606
2.04k
    isl_space_free(space);
607
2.04k
    return multi;
608
2.04k
  }
609
5.96k
610
3.91k
  space = isl_space_domain(space);
611
3.91k
  ls = isl_local_space_from_space(space);
612
3.91k
613
27.1k
  for (i = 0; 
i < n27.1k
;
++i23.2k
) {
614
23.2k
    EL *el;
615
23.2k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
23.2k
            isl_dim_set, i);
617
23.2k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
23.2k
  }
619
3.91k
620
3.91k
  isl_local_space_free(ls);
621
3.91k
622
3.91k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
5.96k
}
627
#endif
628
629
#ifndef NO_ZERO
630
/* Construct a multi expression in the given space with value zero in
631
 * each of the output dimensions.
632
 */
633
__isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
634
5.81k
{
635
5.81k
  int n;
636
5.81k
  MULTI(BASE) *multi;
637
5.81k
638
5.81k
  if (!space)
639
0
    return NULL;
640
5.81k
641
5.81k
  n = isl_space_dim(space , isl_dim_out);
642
5.81k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
5.81k
644
5.81k
  if (!n)
645
1.20k
    isl_space_free(space);
646
4.61k
  else {
647
4.61k
    int i;
648
4.61k
    isl_local_space *ls;
649
4.61k
    EL *el;
650
4.61k
651
4.61k
    space = isl_space_domain(space);
652
4.61k
    ls = isl_local_space_from_space(space);
653
4.61k
    el = FN(EL,zero_on_domain)(ls);
654
4.61k
655
11.1k
    for (i = 0; 
i < n11.1k
;
++i6.51k
)
656
6.51k
      
multi = 6.51k
FN6.51k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
6.51k
                  FN(EL,copy)(el));
658
4.61k
659
4.61k
    FN(EL,free)(el);
660
4.61k
  }
661
5.81k
662
5.81k
  return multi;
663
5.81k
}
isl_multi_aff_zero
Line
Count
Source
634
2.48k
{
635
2.48k
  int n;
636
2.48k
  MULTI(BASE) *multi;
637
2.48k
638
2.48k
  if (!space)
639
0
    return NULL;
640
2.48k
641
2.48k
  n = isl_space_dim(space , isl_dim_out);
642
2.48k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.48k
644
2.48k
  if (!n)
645
1.17k
    isl_space_free(space);
646
1.30k
  else {
647
1.30k
    int i;
648
1.30k
    isl_local_space *ls;
649
1.30k
    EL *el;
650
1.30k
651
1.30k
    space = isl_space_domain(space);
652
1.30k
    ls = isl_local_space_from_space(space);
653
1.30k
    el = FN(EL,zero_on_domain)(ls);
654
1.30k
655
3.14k
    for (i = 0; 
i < n3.14k
;
++i1.83k
)
656
1.83k
      
multi = 1.83k
FN1.83k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
1.83k
                  FN(EL,copy)(el));
658
1.30k
659
1.30k
    FN(EL,free)(el);
660
1.30k
  }
661
2.48k
662
2.48k
  return multi;
663
2.48k
}
Unexecuted instantiation: isl_multi_pw_aff_zero
isl_multi_val_zero
Line
Count
Source
634
3.33k
{
635
3.33k
  int n;
636
3.33k
  MULTI(BASE) *multi;
637
3.33k
638
3.33k
  if (!space)
639
0
    return NULL;
640
3.33k
641
3.33k
  n = isl_space_dim(space , isl_dim_out);
642
3.33k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
3.33k
644
3.33k
  if (!n)
645
25
    isl_space_free(space);
646
3.30k
  else {
647
3.30k
    int i;
648
3.30k
    isl_local_space *ls;
649
3.30k
    EL *el;
650
3.30k
651
3.30k
    space = isl_space_domain(space);
652
3.30k
    ls = isl_local_space_from_space(space);
653
3.30k
    el = FN(EL,zero_on_domain)(ls);
654
3.30k
655
7.99k
    for (i = 0; 
i < n7.99k
;
++i4.68k
)
656
4.68k
      
multi = 4.68k
FN4.68k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
4.68k
                  FN(EL,copy)(el));
658
3.30k
659
3.30k
    FN(EL,free)(el);
660
3.30k
  }
661
3.33k
662
3.33k
  return multi;
663
3.33k
}
664
#endif
665
666
#ifndef NO_FROM_BASE
667
/* Create a multiple expression with a single output/set dimension
668
 * equal to "el".
669
 * For most multiple expression types, the base type has a single
670
 * output/set dimension and the space of the result is therefore
671
 * the same as the space of the input.
672
 * In the case of isl_multi_union_pw_aff, however, the base type
673
 * lives in a parameter space and we therefore need to add
674
 * a single set dimension.
675
 */
676
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),BASE)(__isl_take EL *el)
677
254
{
678
254
  isl_space *space;
679
254
  MULTI(BASE) *multi;
680
254
681
254
  space = FN(EL,get_space(el));
682
254
  if (
isl_space_is_params(space)254
) {
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
254
  multi = FN(MULTI(BASE),alloc)(space);
687
254
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
254
689
254
  return multi;
690
254
}
Unexecuted instantiation: isl_multi_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
254
{
678
254
  isl_space *space;
679
254
  MULTI(BASE) *multi;
680
254
681
254
  space = FN(EL,get_space(el));
682
254
  if (
isl_space_is_params(space)254
) {
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
254
  multi = FN(MULTI(BASE),alloc)(space);
687
254
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
254
689
254
  return multi;
690
254
}
691
#endif
692
693
__isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)(
694
  __isl_take MULTI(BASE) *multi,
695
  enum isl_dim_type type, unsigned first, unsigned n)
696
1.25k
{
697
1.25k
  int i;
698
1.25k
  unsigned dim;
699
1.25k
700
1.25k
  multi = FN(MULTI(BASE),cow)(multi);
701
1.25k
  if (!multi)
702
0
    return NULL;
703
1.25k
704
1.25k
  
dim = 1.25k
FN1.25k
(MULTI(BASE),dim)(multi, type);
705
1.25k
  if (
first + n > dim || 1.25k
first + n < first1.25k
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
1.25k
      "index out of bounds",
708
1.25k
      return FN(MULTI(BASE),free)(multi));
709
1.25k
710
1.25k
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
1.25k
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
713
1.25k
714
1.25k
  
if (1.25k
type == isl_dim_out1.25k
) {
715
2.11k
    for (i = 0; 
i < n2.11k
;
++i1.07k
)
716
1.07k
      
FN1.07k
(EL,free)(multi->p[first + i])1.07k
;
717
1.86k
    for (i = first; 
i + n < multi->n1.86k
;
++i832
)
718
832
      multi->p[i] = multi->p[i + n];
719
1.03k
    multi->n -= n;
720
1.03k
721
1.03k
    return multi;
722
1.03k
  }
723
1.25k
724
844
  
for (i = 0; 222
i < multi->n844
;
++i622
) {
725
622
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
622
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
728
622
  }
729
222
730
222
  return multi;
731
1.25k
}
isl_multi_union_pw_aff_drop_dims
Line
Count
Source
696
66
{
697
66
  int i;
698
66
  unsigned dim;
699
66
700
66
  multi = FN(MULTI(BASE),cow)(multi);
701
66
  if (!multi)
702
0
    return NULL;
703
66
704
66
  
dim = 66
FN66
(MULTI(BASE),dim)(multi, type);
705
66
  if (
first + n > dim || 66
first + n < first66
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
66
      "index out of bounds",
708
66
      return FN(MULTI(BASE),free)(multi));
709
66
710
66
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
66
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
713
66
714
66
  
if (66
type == isl_dim_out66
) {
715
150
    for (i = 0; 
i < n150
;
++i84
)
716
84
      
FN84
(EL,free)(multi->p[first + i])84
;
717
105
    for (i = first; 
i + n < multi->n105
;
++i39
)
718
39
      multi->p[i] = multi->p[i + n];
719
66
    multi->n -= n;
720
66
721
66
    return multi;
722
66
  }
723
66
724
0
  
for (i = 0; 0
i < multi->n0
;
++i0
) {
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),free)(multi);
728
0
  }
729
0
730
0
  return multi;
731
66
}
Unexecuted instantiation: isl_multi_pw_aff_drop_dims
Unexecuted instantiation: isl_multi_val_drop_dims
isl_multi_aff_drop_dims
Line
Count
Source
696
1.19k
{
697
1.19k
  int i;
698
1.19k
  unsigned dim;
699
1.19k
700
1.19k
  multi = FN(MULTI(BASE),cow)(multi);
701
1.19k
  if (!multi)
702
0
    return NULL;
703
1.19k
704
1.19k
  
dim = 1.19k
FN1.19k
(MULTI(BASE),dim)(multi, type);
705
1.19k
  if (
first + n > dim || 1.19k
first + n < first1.19k
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
1.19k
      "index out of bounds",
708
1.19k
      return FN(MULTI(BASE),free)(multi));
709
1.19k
710
1.19k
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
1.19k
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
713
1.19k
714
1.19k
  
if (1.19k
type == isl_dim_out1.19k
) {
715
1.96k
    for (i = 0; 
i < n1.96k
;
++i995
)
716
995
      
FN995
(EL,free)(multi->p[first + i])995
;
717
1.76k
    for (i = first; 
i + n < multi->n1.76k
;
++i793
)
718
793
      multi->p[i] = multi->p[i + n];
719
970
    multi->n -= n;
720
970
721
970
    return multi;
722
970
  }
723
1.19k
724
844
  
for (i = 0; 222
i < multi->n844
;
++i622
) {
725
622
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
622
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
728
622
  }
729
222
730
222
  return multi;
731
1.19k
}
732
733
/* Align the parameters of "multi1" and "multi2" (if needed) and call "fn".
734
 */
735
static __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params_multi_multi_and)(
736
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2,
737
  __isl_give MULTI(BASE) *(*fn)(__isl_take MULTI(BASE) *multi1,
738
    __isl_take MULTI(BASE) *multi2))
739
6.61k
{
740
6.61k
  isl_ctx *ctx;
741
6.61k
  isl_bool equal_params;
742
6.61k
743
6.61k
  if (
!multi1 || 6.61k
!multi26.61k
)
744
0
    goto error;
745
6.61k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
6.61k
  if (equal_params < 0)
747
0
    goto error;
748
6.61k
  
if (6.61k
equal_params6.61k
)
749
6.59k
    return fn(multi1, multi2);
750
20
  
ctx = 20
FN20
(MULTI(BASE),get_ctx)(multi1);
751
20
  if (!isl_space_has_named_params(multi1->space) ||
752
20
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
20
      "unaligned unnamed parameters", goto error);
755
20
  
multi1 = 20
FN20
(MULTI(BASE),align_params)(multi1,
756
20
              FN(MULTI(BASE),get_space)(multi2));
757
20
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
20
              FN(MULTI(BASE),get_space)(multi1));
759
20
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
6.61k
}
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
4.31k
{
740
4.31k
  isl_ctx *ctx;
741
4.31k
  isl_bool equal_params;
742
4.31k
743
4.31k
  if (
!multi1 || 4.31k
!multi24.31k
)
744
0
    goto error;
745
4.31k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
4.31k
  if (equal_params < 0)
747
0
    goto error;
748
4.31k
  
if (4.31k
equal_params4.31k
)
749
4.31k
    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
4.31k
}
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
5
}
isl_aff.c:isl_multi_union_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
2.29k
{
740
2.29k
  isl_ctx *ctx;
741
2.29k
  isl_bool equal_params;
742
2.29k
743
2.29k
  if (
!multi1 || 2.29k
!multi22.29k
)
744
0
    goto error;
745
2.29k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
2.29k
  if (equal_params < 0)
747
0
    goto error;
748
2.29k
  
if (2.29k
equal_params2.29k
)
749
2.27k
    return fn(multi1, multi2);
750
20
  
ctx = 20
FN20
(MULTI(BASE),get_ctx)(multi1);
751
20
  if (!isl_space_has_named_params(multi1->space) ||
752
20
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
20
      "unaligned unnamed parameters", goto error);
755
20
  
multi1 = 20
FN20
(MULTI(BASE),align_params)(multi1,
756
20
              FN(MULTI(BASE),get_space)(multi2));
757
20
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
20
              FN(MULTI(BASE),get_space)(multi1));
759
20
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
2.29k
}
765
766
/* Given two MULTI(BASE)s A -> B and C -> D,
767
 * construct a MULTI(BASE) (A * C) -> [B -> D].
768
 *
769
 * The parameters are assumed to have been aligned.
770
 */
771
static __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product_aligned)(
772
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
773
2.38k
{
774
2.38k
  int i, n1, n2;
775
2.38k
  EL *el;
776
2.38k
  isl_space *space;
777
2.38k
  MULTI(BASE) *res;
778
2.38k
779
2.38k
  if (
!multi1 || 2.38k
!multi22.38k
)
780
0
    goto error;
781
2.38k
782
2.38k
  
space = isl_space_range_product(2.38k
FN2.38k
(MULTI(BASE),get_space)(multi1),
783
2.38k
          FN(MULTI(BASE),get_space)(multi2));
784
2.38k
  res = FN(MULTI(BASE),alloc)(space);
785
2.38k
786
2.38k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
2.38k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
2.38k
789
5.32k
  for (i = 0; 
i < n15.32k
;
++i2.93k
) {
790
2.93k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.93k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.93k
  }
793
2.38k
794
4.22k
  for (i = 0; 
i < n24.22k
;
++i1.83k
) {
795
1.83k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.83k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.83k
  }
798
2.38k
799
2.38k
  FN(MULTI(BASE),free)(multi1);
800
2.38k
  FN(MULTI(BASE),free)(multi2);
801
2.38k
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
2.38k
}
isl_aff.c:isl_multi_aff_range_product_aligned
Line
Count
Source
773
244
{
774
244
  int i, n1, n2;
775
244
  EL *el;
776
244
  isl_space *space;
777
244
  MULTI(BASE) *res;
778
244
779
244
  if (
!multi1 || 244
!multi2244
)
780
0
    goto error;
781
244
782
244
  
space = isl_space_range_product(244
FN244
(MULTI(BASE),get_space)(multi1),
783
244
          FN(MULTI(BASE),get_space)(multi2));
784
244
  res = FN(MULTI(BASE),alloc)(space);
785
244
786
244
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
244
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
244
789
918
  for (i = 0; 
i < n1918
;
++i674
) {
790
674
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
674
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
674
  }
793
244
794
506
  for (i = 0; 
i < n2506
;
++i262
) {
795
262
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
262
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
262
  }
798
244
799
244
  FN(MULTI(BASE),free)(multi1);
800
244
  FN(MULTI(BASE),free)(multi2);
801
244
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
244
}
isl_aff.c:isl_multi_pw_aff_range_product_aligned
Line
Count
Source
773
5
{
774
5
  int i, n1, n2;
775
5
  EL *el;
776
5
  isl_space *space;
777
5
  MULTI(BASE) *res;
778
5
779
5
  if (
!multi1 || 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
) {
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
) {
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
2.13k
{
774
2.13k
  int i, n1, n2;
775
2.13k
  EL *el;
776
2.13k
  isl_space *space;
777
2.13k
  MULTI(BASE) *res;
778
2.13k
779
2.13k
  if (
!multi1 || 2.13k
!multi22.13k
)
780
0
    goto error;
781
2.13k
782
2.13k
  
space = isl_space_range_product(2.13k
FN2.13k
(MULTI(BASE),get_space)(multi1),
783
2.13k
          FN(MULTI(BASE),get_space)(multi2));
784
2.13k
  res = FN(MULTI(BASE),alloc)(space);
785
2.13k
786
2.13k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
2.13k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
2.13k
789
4.39k
  for (i = 0; 
i < n14.39k
;
++i2.25k
) {
790
2.25k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.25k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.25k
  }
793
2.13k
794
3.70k
  for (i = 0; 
i < n23.70k
;
++i1.56k
) {
795
1.56k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.56k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.56k
  }
798
2.13k
799
2.13k
  FN(MULTI(BASE),free)(multi1);
800
2.13k
  FN(MULTI(BASE),free)(multi2);
801
2.13k
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
2.13k
}
Unexecuted instantiation: isl_val.c:isl_multi_val_range_product_aligned
807
808
/* Given two MULTI(BASE)s A -> B and C -> D,
809
 * construct a MULTI(BASE) (A * C) -> [B -> D].
810
 */
811
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)(
812
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
813
2.38k
{
814
2.38k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
2.38k
          &FN(MULTI(BASE),range_product_aligned));
816
2.38k
}
isl_multi_union_pw_aff_range_product
Line
Count
Source
813
2.13k
{
814
2.13k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
2.13k
          &FN(MULTI(BASE),range_product_aligned));
816
2.13k
}
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
244
{
814
244
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
244
          &FN(MULTI(BASE),range_product_aligned));
816
244
}
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
990
{
822
990
  if (!multi)
823
0
    return isl_bool_error;
824
990
  return isl_space_range_is_wrapping(multi->space);
825
990
}
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
990
{
822
990
  if (!multi)
823
0
    return isl_bool_error;
824
990
  return isl_space_range_is_wrapping(multi->space);
825
990
}
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.83k
{
911
1.83k
  int i;
912
1.83k
  EL *el;
913
1.83k
  isl_space *space;
914
1.83k
  MULTI(BASE) *res;
915
1.83k
  int in1, in2, out1, out2;
916
1.83k
917
1.83k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.83k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.83k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.83k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.83k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.83k
          FN(MULTI(BASE),get_space)(multi2));
923
1.83k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.83k
  space = isl_space_domain(space);
925
1.83k
926
3.41k
  for (i = 0; 
i < out13.41k
;
++i1.57k
) {
927
1.57k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.57k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.57k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.57k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.57k
  }
932
1.83k
933
4.39k
  for (i = 0; 
i < out24.39k
;
++i2.55k
) {
934
2.55k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.55k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.55k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.55k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.55k
  }
939
1.83k
940
1.83k
  isl_space_free(space);
941
1.83k
  FN(MULTI(BASE),free)(multi1);
942
1.83k
  FN(MULTI(BASE),free)(multi2);
943
1.83k
  return res;
944
1.83k
}
Unexecuted instantiation: isl_multi_val_product_aligned
isl_multi_aff_product_aligned
Line
Count
Source
910
1.83k
{
911
1.83k
  int i;
912
1.83k
  EL *el;
913
1.83k
  isl_space *space;
914
1.83k
  MULTI(BASE) *res;
915
1.83k
  int in1, in2, out1, out2;
916
1.83k
917
1.83k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.83k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.83k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.83k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.83k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.83k
          FN(MULTI(BASE),get_space)(multi2));
923
1.83k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.83k
  space = isl_space_domain(space);
925
1.83k
926
3.41k
  for (i = 0; 
i < out13.41k
;
++i1.57k
) {
927
1.57k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.57k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.57k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.57k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.57k
  }
932
1.83k
933
4.39k
  for (i = 0; 
i < out24.39k
;
++i2.55k
) {
934
2.55k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.55k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.55k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.55k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.55k
  }
939
1.83k
940
1.83k
  isl_space_free(space);
941
1.83k
  FN(MULTI(BASE),free)(multi1);
942
1.83k
  FN(MULTI(BASE),free)(multi2);
943
1.83k
  return res;
944
1.83k
}
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.83k
{
952
1.83k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.83k
          &FN(MULTI(BASE),product_aligned));
954
1.83k
}
Unexecuted instantiation: isl_multi_val_product
isl_multi_aff_product
Line
Count
Source
951
1.83k
{
952
1.83k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.83k
          &FN(MULTI(BASE),product_aligned));
954
1.83k
}
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.88k
{
960
2.88k
  if (!multi)
961
0
    return NULL;
962
2.88k
963
2.88k
  
if (2.88k
!multi->space->nested[1]2.88k
)
964
0
    return multi;
965
2.88k
966
2.88k
  
multi = 2.88k
FN2.88k
(MULTI(BASE),cow)(multi);
967
2.88k
  if (!multi)
968
0
    return NULL;
969
2.88k
970
2.88k
  multi->space = isl_space_flatten_range(multi->space);
971
2.88k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
2.88k
974
2.88k
  return multi;
975
2.88k
}
Unexecuted instantiation: isl_multi_val_flatten_range
isl_multi_union_pw_aff_flatten_range
Line
Count
Source
959
2.13k
{
960
2.13k
  if (!multi)
961
0
    return NULL;
962
2.13k
963
2.13k
  
if (2.13k
!multi->space->nested[1]2.13k
)
964
0
    return multi;
965
2.13k
966
2.13k
  
multi = 2.13k
FN2.13k
(MULTI(BASE),cow)(multi);
967
2.13k
  if (!multi)
968
0
    return NULL;
969
2.13k
970
2.13k
  multi->space = isl_space_flatten_range(multi->space);
971
2.13k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
2.13k
974
2.13k
  return multi;
975
2.13k
}
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
744
{
960
744
  if (!multi)
961
0
    return NULL;
962
744
963
744
  
if (744
!multi->space->nested[1]744
)
964
0
    return multi;
965
744
966
744
  
multi = 744
FN744
(MULTI(BASE),cow)(multi);
967
744
  if (!multi)
968
0
    return NULL;
969
744
970
744
  multi->space = isl_space_flatten_range(multi->space);
971
744
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
744
974
744
  return multi;
975
744
}
976
977
/* Given two MULTI(BASE)s A -> B and C -> D,
978
 * construct a MULTI(BASE) (A * C) -> (B, D).
979
 */
980
__isl_give MULTI(BASE) *FN(MULTI(BASE),flat_range_product)(
981
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
982
2.27k
{
983
2.27k
  MULTI(BASE) *multi;
984
2.27k
985
2.27k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
2.27k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
2.27k
  return multi;
988
2.27k
}
Unexecuted instantiation: isl_multi_val_flat_range_product
isl_multi_aff_flat_range_product
Line
Count
Source
982
132
{
983
132
  MULTI(BASE) *multi;
984
132
985
132
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
132
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
132
  return multi;
988
132
}
isl_multi_pw_aff_flat_range_product
Line
Count
Source
982
1
{
983
1
  MULTI(BASE) *multi;
984
1
985
1
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1
  return multi;
988
1
}
isl_multi_union_pw_aff_flat_range_product
Line
Count
Source
982
2.13k
{
983
2.13k
  MULTI(BASE) *multi;
984
2.13k
985
2.13k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
2.13k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
2.13k
  return multi;
988
2.13k
}
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
157
{
1099
157
  int i;
1100
157
  isl_ctx *ctx;
1101
157
1102
157
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
157
  if (
!multi1 || 157
!multi2157
)
1104
0
    goto error;
1105
157
1106
157
  
ctx = 157
FN157
(MULTI(BASE),get_ctx)(multi1);
1107
157
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
157
      "spaces don't match", goto error);
1110
157
1111
433
  
for (i = 0; 157
i < multi1->n433
;
++i276
) {
1112
276
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
276
    if (!multi1->p[i])
1114
0
      goto error;
1115
276
  }
1116
157
1117
157
  
FN157
(MULTI(BASE),free)(multi2);
1118
157
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
157
}
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
) {
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);
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
154
{
1099
154
  int i;
1100
154
  isl_ctx *ctx;
1101
154
1102
154
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
154
  if (
!multi1 || 154
!multi2154
)
1104
0
    goto error;
1105
154
1106
154
  
ctx = 154
FN154
(MULTI(BASE),get_ctx)(multi1);
1107
154
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
154
      "spaces don't match", goto error);
1110
154
1111
427
  
for (i = 0; 154
i < multi1->n427
;
++i273
) {
1112
273
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
273
    if (!multi1->p[i])
1114
0
      goto error;
1115
273
  }
1116
154
1117
154
  
FN154
(MULTI(BASE),free)(multi2);
1118
154
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
154
}
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
74
{
1151
74
  return 
FN74
(MULTI(BASE),bin_op)(multi1, multi2, &
FN74
(EL,sub));
1152
74
}
Unexecuted instantiation: isl_aff.c:isl_multi_aff_sub_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_sub_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_sub_aligned
isl_aff.c:isl_multi_union_pw_aff_sub_aligned
Line
Count
Source
1150
74
{
1151
74
  return 
FN74
(MULTI(BASE),bin_op)(multi1, multi2, &
FN74
(EL,sub));
1152
74
}
1153
1154
/* Subtract "multi2" from "multi1" and return the result.
1155
 */
1156
__isl_give MULTI(BASE) *FN(MULTI(BASE),sub)(__isl_take MULTI(BASE) *multi1,
1157
  __isl_take MULTI(BASE) *multi2)
1158
74
{
1159
74
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
74
            &FN(MULTI(BASE),sub_aligned));
1161
74
}
Unexecuted instantiation: isl_multi_val_sub
isl_multi_union_pw_aff_sub
Line
Count
Source
1158
74
{
1159
74
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
74
            &FN(MULTI(BASE),sub_aligned));
1161
74
}
Unexecuted instantiation: isl_multi_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
) {
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
) {
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
) {
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
) {
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
73
{
1245
73
  int i;
1246
73
1247
73
  if (
!multi || 73
!mv73
)
1248
0
    goto error;
1249
73
1250
73
  
if (73
!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1251
73
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
73
      "spaces don't match", goto error);
1254
73
1255
73
  
multi = 73
FN73
(MULTI(BASE),cow)(multi);
1256
73
  if (!multi)
1257
0
    goto error;
1258
73
1259
236
  
for (i = 0; 73
i < multi->n236
;
++i163
) {
1260
163
    isl_val *v;
1261
163
1262
163
    v = isl_multi_val_get_val(mv, i);
1263
163
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
163
    if (!multi->p[i])
1265
0
      goto error;
1266
163
  }
1267
73
1268
73
  isl_multi_val_free(mv);
1269
73
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
73
}
isl_multi_union_pw_aff_scale_multi_val
Line
Count
Source
1244
73
{
1245
73
  int i;
1246
73
1247
73
  if (
!multi || 73
!mv73
)
1248
0
    goto error;
1249
73
1250
73
  
if (73
!isl_space_tuple_is_equal(multi->space, isl_dim_out,
1251
73
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
73
      "spaces don't match", goto error);
1254
73
1255
73
  
multi = 73
FN73
(MULTI(BASE),cow)(multi);
1256
73
  if (!multi)
1257
0
    goto error;
1258
73
1259
236
  
for (i = 0; 73
i < multi->n236
;
++i163
) {
1260
163
    isl_val *v;
1261
163
1262
163
    v = isl_multi_val_get_val(mv, i);
1263
163
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
163
    if (!multi->p[i])
1265
0
      goto error;
1266
163
  }
1267
73
1268
73
  isl_multi_val_free(mv);
1269
73
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
73
}
Unexecuted instantiation: isl_multi_aff_scale_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_multi_val
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,
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
) {
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,
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
) {
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 &&
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
) {
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.82k
{
1431
1.82k
  int i;
1432
1.82k
  isl_bool equal;
1433
1.82k
1434
1.82k
  if (
!multi1 || 1.82k
!multi21.82k
)
1435
0
    return isl_bool_error;
1436
1.82k
  
if (1.82k
multi1->n != multi2->n1.82k
)
1437
0
    return isl_bool_false;
1438
1.82k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.82k
  if (
equal < 0 || 1.82k
!equal1.82k
)
1440
0
    return equal;
1441
1.82k
1442
2.15k
  
for (i = 0; 1.82k
i < multi1->n2.15k
;
++i327
) {
1443
2.03k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2.03k
    if (
equal < 0 || 2.03k
!equal2.03k
)
1445
1.70k
      return equal;
1446
2.03k
  }
1447
1.82k
1448
121
  return isl_bool_true;
1449
1.82k
}
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
) {
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
1.81k
{
1431
1.81k
  int i;
1432
1.81k
  isl_bool equal;
1433
1.81k
1434
1.81k
  if (
!multi1 || 1.81k
!multi21.81k
)
1435
0
    return isl_bool_error;
1436
1.81k
  
if (1.81k
multi1->n != multi2->n1.81k
)
1437
0
    return isl_bool_false;
1438
1.81k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.81k
  if (
equal < 0 || 1.81k
!equal1.81k
)
1440
0
    return equal;
1441
1.81k
1442
2.12k
  
for (i = 0; 1.81k
i < multi1->n2.12k
;
++i309
) {
1443
2.01k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2.01k
    if (
equal < 0 || 2.01k
!equal2.01k
)
1445
1.70k
      return equal;
1446
2.01k
  }
1447
1.81k
1448
112
  return isl_bool_true;
1449
1.81k
}
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
) {
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
1.01k
{
1455
1.01k
  int i;
1456
1.01k
1457
1.01k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.01k
  
if (1.01k
multi->n == 01.01k
)
1460
0
    return isl_bool_false;
1461
1.01k
1462
2.93k
  
for (i = 0; 1.01k
i < multi->n2.93k
;
++i1.91k
) {
1463
1.92k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
1.92k
    if (
has_nan < 0 || 1.92k
has_nan1.92k
)
1465
2
      return has_nan;
1466
1.92k
  }
1467
1.01k
1468
1.01k
  return isl_bool_false;
1469
1.01k
}
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
1.01k
{
1455
1.01k
  int i;
1456
1.01k
1457
1.01k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.01k
  
if (1.01k
multi->n == 01.01k
)
1460
0
    return isl_bool_false;
1461
1.01k
1462
2.93k
  
for (i = 0; 1.01k
i < multi->n2.93k
;
++i1.91k
) {
1463
1.92k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
1.92k
    if (
has_nan < 0 || 1.92k
has_nan1.92k
)
1465
2
      return has_nan;
1466
1.92k
  }
1467
1.01k
1468
1.01k
  return isl_bool_false;
1469
1.01k
}
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
) {
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
) {
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