Coverage Report

Created: 2017-03-28 09:59

/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
52.2k
{
23
52.2k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
52.2k
}
isl_multi_val_get_ctx
Line
Count
Source
22
5.20k
{
23
5.20k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
5.20k
}
isl_multi_union_pw_aff_get_ctx
Line
Count
Source
22
14.4k
{
23
14.4k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
14.4k
}
isl_multi_pw_aff_get_ctx
Line
Count
Source
22
13.5k
{
23
13.5k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
13.5k
}
isl_multi_aff_get_ctx
Line
Count
Source
22
19.0k
{
23
19.0k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
19.0k
}
25
26
__isl_give isl_space *FN(MULTI(BASE),get_space)(__isl_keep MULTI(BASE) *multi)
27
527k
{
28
527k
  return multi ? isl_space_copy(multi->space) : NULL;
29
527k
}
isl_multi_pw_aff_get_space
Line
Count
Source
27
20.6k
{
28
20.6k
  return multi ? isl_space_copy(multi->space) : NULL;
29
20.6k
}
isl_multi_val_get_space
Line
Count
Source
27
10.8k
{
28
10.8k
  return multi ? isl_space_copy(multi->space) : NULL;
29
10.8k
}
isl_multi_aff_get_space
Line
Count
Source
27
483k
{
28
483k
  return multi ? isl_space_copy(multi->space) : NULL;
29
483k
}
isl_multi_union_pw_aff_get_space
Line
Count
Source
27
13.3k
{
28
13.3k
  return multi ? isl_space_copy(multi->space) : NULL;
29
13.3k
}
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
37.5k
{
46
37.5k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
37.5k
}
isl_multi_aff_get_domain_space
Line
Count
Source
45
37.3k
{
46
37.3k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
37.3k
}
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
112
{
46
112
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
112
}
Unexecuted instantiation: isl_multi_val_get_domain_space
48
49
__isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space)
50
91.1k
{
51
91.1k
  isl_ctx *ctx;
52
91.1k
  int n;
53
91.1k
  MULTI(BASE) *multi;
54
91.1k
55
91.1k
  if (!space)
56
0
    return NULL;
57
91.1k
58
91.1k
  ctx = isl_space_get_ctx(space);
59
91.1k
  n = isl_space_dim(space, isl_dim_out);
60
91.1k
  multi = isl_calloc(ctx, MULTI(BASE),
61
91.1k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
91.1k
  if (!multi)
63
0
    goto error;
64
91.1k
65
91.1k
  multi->space = space;
66
91.1k
  multi->n = n;
67
91.1k
  multi->ref = 1;
68
91.1k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
91.1k
}
isl_multi_union_pw_aff_alloc
Line
Count
Source
50
4.72k
{
51
4.72k
  isl_ctx *ctx;
52
4.72k
  int n;
53
4.72k
  MULTI(BASE) *multi;
54
4.72k
55
4.72k
  if (!space)
56
0
    return NULL;
57
4.72k
58
4.72k
  ctx = isl_space_get_ctx(space);
59
4.72k
  n = isl_space_dim(space, isl_dim_out);
60
4.72k
  multi = isl_calloc(ctx, MULTI(BASE),
61
4.72k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
4.72k
  if (!multi)
63
0
    goto error;
64
4.72k
65
4.72k
  multi->space = space;
66
4.72k
  multi->n = n;
67
4.72k
  multi->ref = 1;
68
4.72k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
4.72k
}
isl_multi_val_alloc
Line
Count
Source
50
1.98k
{
51
1.98k
  isl_ctx *ctx;
52
1.98k
  int n;
53
1.98k
  MULTI(BASE) *multi;
54
1.98k
55
1.98k
  if (!space)
56
0
    return NULL;
57
1.98k
58
1.98k
  ctx = isl_space_get_ctx(space);
59
1.98k
  n = isl_space_dim(space, isl_dim_out);
60
1.98k
  multi = isl_calloc(ctx, MULTI(BASE),
61
1.98k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
1.98k
  if (!multi)
63
0
    goto error;
64
1.98k
65
1.98k
  multi->space = space;
66
1.98k
  multi->n = n;
67
1.98k
  multi->ref = 1;
68
1.98k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
1.98k
}
isl_multi_aff_alloc
Line
Count
Source
50
78.0k
{
51
78.0k
  isl_ctx *ctx;
52
78.0k
  int n;
53
78.0k
  MULTI(BASE) *multi;
54
78.0k
55
78.0k
  if (!space)
56
0
    return NULL;
57
78.0k
58
78.0k
  ctx = isl_space_get_ctx(space);
59
78.0k
  n = isl_space_dim(space, isl_dim_out);
60
78.0k
  multi = isl_calloc(ctx, MULTI(BASE),
61
78.0k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
78.0k
  if (!multi)
63
0
    goto error;
64
78.0k
65
78.0k
  multi->space = space;
66
78.0k
  multi->n = n;
67
78.0k
  multi->ref = 1;
68
78.0k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
78.0k
}
isl_multi_pw_aff_alloc
Line
Count
Source
50
6.37k
{
51
6.37k
  isl_ctx *ctx;
52
6.37k
  int n;
53
6.37k
  MULTI(BASE) *multi;
54
6.37k
55
6.37k
  if (!space)
56
0
    return NULL;
57
6.37k
58
6.37k
  ctx = isl_space_get_ctx(space);
59
6.37k
  n = isl_space_dim(space, isl_dim_out);
60
6.37k
  multi = isl_calloc(ctx, MULTI(BASE),
61
6.37k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
6.37k
  if (!multi)
63
0
    goto error;
64
6.37k
65
6.37k
  multi->space = space;
66
6.37k
  multi->n = n;
67
6.37k
  multi->ref = 1;
68
6.37k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
6.37k
}
73
74
__isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi)
75
59.0k
{
76
59.0k
  int i;
77
59.0k
  MULTI(BASE) *dup;
78
59.0k
79
59.0k
  if (!multi)
80
0
    return NULL;
81
59.0k
82
59.0k
  
dup = 59.0k
FN59.0k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
59.0k
  if (!dup)
84
0
    return NULL;
85
59.0k
86
405k
  
for (i = 0; 59.0k
i < multi->n405k
;
++i346k
)
87
346k
    
dup = 346k
FN346k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
346k
                FN(EL,copy)(multi->p[i]));
89
59.0k
90
59.0k
  return dup;
91
59.0k
}
Unexecuted instantiation: isl_multi_pw_aff_dup
isl_multi_union_pw_aff_dup
Line
Count
Source
75
789
{
76
789
  int i;
77
789
  MULTI(BASE) *dup;
78
789
79
789
  if (!multi)
80
0
    return NULL;
81
789
82
789
  
dup = 789
FN789
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
789
  if (!dup)
84
0
    return NULL;
85
789
86
2.01k
  
for (i = 0; 789
i < multi->n2.01k
;
++i1.22k
)
87
1.22k
    
dup = 1.22k
FN1.22k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
1.22k
                FN(EL,copy)(multi->p[i]));
89
789
90
789
  return dup;
91
789
}
isl_multi_aff_dup
Line
Count
Source
75
58.2k
{
76
58.2k
  int i;
77
58.2k
  MULTI(BASE) *dup;
78
58.2k
79
58.2k
  if (!multi)
80
0
    return NULL;
81
58.2k
82
58.2k
  
dup = 58.2k
FN58.2k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
58.2k
  if (!dup)
84
0
    return NULL;
85
58.2k
86
403k
  
for (i = 0; 58.2k
i < multi->n403k
;
++i344k
)
87
344k
    
dup = 344k
FN344k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
344k
                FN(EL,copy)(multi->p[i]));
89
58.2k
90
58.2k
  return dup;
91
58.2k
}
isl_multi_val_dup
Line
Count
Source
75
3
{
76
3
  int i;
77
3
  MULTI(BASE) *dup;
78
3
79
3
  if (!multi)
80
0
    return NULL;
81
3
82
3
  
dup = 3
FN3
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
3
  if (!dup)
84
0
    return NULL;
85
3
86
12
  
for (i = 0; 3
i < multi->n12
;
++i9
)
87
9
    
dup = 9
FN9
(FN(MULTI(BASE),set),BASE)(dup, i,
88
9
                FN(EL,copy)(multi->p[i]));
89
3
90
3
  return dup;
91
3
}
92
93
__isl_give MULTI(BASE) *FN(MULTI(BASE),cow)(__isl_take MULTI(BASE) *multi)
94
481k
{
95
481k
  if (!multi)
96
0
    return NULL;
97
481k
98
481k
  
if (481k
multi->ref == 1481k
)
99
422k
    return multi;
100
481k
101
59.0k
  multi->ref--;
102
59.0k
  return FN(MULTI(BASE),dup)(multi);
103
481k
}
isl_multi_union_pw_aff_cow
Line
Count
Source
94
8.20k
{
95
8.20k
  if (!multi)
96
0
    return NULL;
97
8.20k
98
8.20k
  
if (8.20k
multi->ref == 18.20k
)
99
7.41k
    return multi;
100
8.20k
101
789
  multi->ref--;
102
789
  return FN(MULTI(BASE),dup)(multi);
103
8.20k
}
isl_multi_pw_aff_cow
Line
Count
Source
94
21.1k
{
95
21.1k
  if (!multi)
96
0
    return NULL;
97
21.1k
98
21.1k
  
if (21.1k
multi->ref == 121.1k
)
99
21.1k
    return multi;
100
21.1k
101
0
  multi->ref--;
102
0
  return FN(MULTI(BASE),dup)(multi);
103
21.1k
}
isl_multi_val_cow
Line
Count
Source
94
6.72k
{
95
6.72k
  if (!multi)
96
0
    return NULL;
97
6.72k
98
6.72k
  
if (6.72k
multi->ref == 16.72k
)
99
6.72k
    return multi;
100
6.72k
101
3
  multi->ref--;
102
3
  return FN(MULTI(BASE),dup)(multi);
103
6.72k
}
isl_multi_aff_cow
Line
Count
Source
94
445k
{
95
445k
  if (!multi)
96
0
    return NULL;
97
445k
98
445k
  
if (445k
multi->ref == 1445k
)
99
387k
    return multi;
100
445k
101
58.2k
  multi->ref--;
102
58.2k
  return FN(MULTI(BASE),dup)(multi);
103
445k
}
104
105
__isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi)
106
140k
{
107
140k
  if (!multi)
108
374
    return NULL;
109
140k
110
140k
  multi->ref++;
111
140k
  return multi;
112
140k
}
isl_multi_aff_copy
Line
Count
Source
106
124k
{
107
124k
  if (!multi)
108
374
    return NULL;
109
124k
110
124k
  multi->ref++;
111
124k
  return multi;
112
124k
}
Unexecuted instantiation: isl_multi_pw_aff_copy
isl_multi_union_pw_aff_copy
Line
Count
Source
106
8.43k
{
107
8.43k
  if (!multi)
108
0
    return NULL;
109
8.43k
110
8.43k
  multi->ref++;
111
8.43k
  return multi;
112
8.43k
}
isl_multi_val_copy
Line
Count
Source
106
7.54k
{
107
7.54k
  if (!multi)
108
0
    return NULL;
109
7.54k
110
7.54k
  multi->ref++;
111
7.54k
  return multi;
112
7.54k
}
113
114
__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi)
115
197k
{
116
197k
  int i;
117
197k
118
197k
  if (!multi)
119
24.9k
    return NULL;
120
197k
121
172k
  
if (172k
--multi->ref > 0172k
)
122
81.2k
    return NULL;
123
172k
124
91.1k
  isl_space_free(multi->space);
125
483k
  for (i = 0; 
i < multi->n483k
;
++i391k
)
126
391k
    
FN391k
(EL,free)(multi->p[i])391k
;
127
91.1k
  free(multi);
128
91.1k
129
91.1k
  return NULL;
130
172k
}
isl_multi_union_pw_aff_free
Line
Count
Source
115
12.3k
{
116
12.3k
  int i;
117
12.3k
118
12.3k
  if (!multi)
119
0
    return NULL;
120
12.3k
121
12.3k
  
if (12.3k
--multi->ref > 012.3k
)
122
7.64k
    return NULL;
123
12.3k
124
4.72k
  isl_space_free(multi->space);
125
9.33k
  for (i = 0; 
i < multi->n9.33k
;
++i4.60k
)
126
4.60k
    
FN4.60k
(EL,free)(multi->p[i])4.60k
;
127
4.72k
  free(multi);
128
4.72k
129
4.72k
  return NULL;
130
12.3k
}
isl_multi_val_free
Line
Count
Source
115
9.53k
{
116
9.53k
  int i;
117
9.53k
118
9.53k
  if (!multi)
119
4
    return NULL;
120
9.53k
121
9.52k
  
if (9.52k
--multi->ref > 09.52k
)
122
7.54k
    return NULL;
123
9.52k
124
1.98k
  isl_space_free(multi->space);
125
4.93k
  for (i = 0; 
i < multi->n4.93k
;
++i2.95k
)
126
2.95k
    
FN2.95k
(EL,free)(multi->p[i])2.95k
;
127
1.98k
  free(multi);
128
1.98k
129
1.98k
  return NULL;
130
9.52k
}
isl_multi_aff_free
Line
Count
Source
115
169k
{
116
169k
  int i;
117
169k
118
169k
  if (!multi)
119
24.9k
    return NULL;
120
169k
121
144k
  
if (144k
--multi->ref > 0144k
)
122
66.0k
    return NULL;
123
144k
124
78.0k
  isl_space_free(multi->space);
125
452k
  for (i = 0; 
i < multi->n452k
;
++i374k
)
126
374k
    
FN374k
(EL,free)(multi->p[i])374k
;
127
78.0k
  free(multi);
128
78.0k
129
78.0k
  return NULL;
130
144k
}
isl_multi_pw_aff_free
Line
Count
Source
115
6.37k
{
116
6.37k
  int i;
117
6.37k
118
6.37k
  if (!multi)
119
0
    return NULL;
120
6.37k
121
6.37k
  
if (6.37k
--multi->ref > 06.37k
)
122
0
    return NULL;
123
6.37k
124
6.37k
  isl_space_free(multi->space);
125
15.9k
  for (i = 0; 
i < multi->n15.9k
;
++i9.62k
)
126
9.62k
    
FN9.62k
(EL,free)(multi->p[i])9.62k
;
127
6.37k
  free(multi);
128
6.37k
129
6.37k
  return NULL;
130
6.37k
}
131
132
#ifndef NO_DIMS
133
/* Check whether "multi" has non-zero coefficients for any dimension
134
 * in the given range or if any of these dimensions appear
135
 * with non-zero coefficients in any of the integer divisions involved.
136
 */
137
isl_bool FN(MULTI(BASE),involves_dims)(__isl_keep MULTI(BASE) *multi,
138
  enum isl_dim_type type, unsigned first, unsigned n)
139
0
{
140
0
  int i;
141
0
142
0
  if (!multi)
143
0
    return isl_bool_error;
144
0
  
if (0
multi->n == 0 || 0
n == 00
)
145
0
    return isl_bool_false;
146
0
147
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
148
0
    isl_bool involves;
149
0
150
0
    involves = FN(EL,involves_dims)(multi->p[i], type, first, n);
151
0
    if (
involves < 0 || 0
involves0
)
152
0
      return involves;
153
0
  }
154
0
155
0
  return isl_bool_false;
156
0
}
Unexecuted instantiation: isl_multi_aff_involves_dims
Unexecuted instantiation: isl_multi_val_involves_dims
Unexecuted instantiation: isl_multi_pw_aff_involves_dims
157
158
__isl_give MULTI(BASE) *FN(MULTI(BASE),insert_dims)(
159
  __isl_take MULTI(BASE) *multi,
160
  enum isl_dim_type type, unsigned first, unsigned n)
161
18
{
162
18
  int i;
163
18
164
18
  if (!multi)
165
0
    return NULL;
166
18
  
if (18
type == isl_dim_out18
)
167
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
168
18
      "cannot insert output/set dimensions",
169
18
      return FN(MULTI(BASE),free)(multi));
170
18
  
if (18
n == 0 && 18
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
18
173
12
  
multi = 12
FN12
(MULTI(BASE),cow)(multi);
174
12
  if (!multi)
175
0
    return NULL;
176
12
177
12
  multi->space = isl_space_insert_dims(multi->space, type, first, n);
178
12
  if (!multi->space)
179
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n24
;
++i12
)
{12
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
12
}
Unexecuted instantiation: isl_multi_pw_aff_insert_dims
Unexecuted instantiation: isl_multi_val_insert_dims
isl_multi_aff_insert_dims
Line
Count
Source
161
18
{
162
18
  int i;
163
18
164
18
  if (!multi)
165
0
    return NULL;
166
18
  
if (18
type == isl_dim_out18
)
167
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
168
18
      "cannot insert output/set dimensions",
169
18
      return FN(MULTI(BASE),free)(multi));
170
18
  
if (18
n == 0 && 18
!isl_space_is_named_or_nested(multi->space, type)6
)
171
6
    return multi;
172
18
173
12
  
multi = 12
FN12
(MULTI(BASE),cow)(multi);
174
12
  if (!multi)
175
0
    return NULL;
176
12
177
12
  multi->space = isl_space_insert_dims(multi->space, type, first, n);
178
12
  if (!multi->space)
179
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
180
12
181
24
  
for (i = 0; 12
i < multi->n24
;
++i12
)
{12
182
12
    multi->p[i] = FN(EL,insert_dims)(multi->p[i], type, first, n);
183
12
    if (!multi->p[i])
184
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
185
12
  }
186
12
187
12
  return multi;
188
12
}
189
190
__isl_give MULTI(BASE) *FN(MULTI(BASE),add_dims)(__isl_take MULTI(BASE) *multi,
191
  enum isl_dim_type type, unsigned n)
192
0
{
193
0
  unsigned pos;
194
0
195
0
  pos = FN(MULTI(BASE),dim)(multi, type);
196
0
197
0
  return FN(MULTI(BASE),insert_dims)(multi, type, pos, n);
198
0
}
Unexecuted instantiation: isl_multi_val_add_dims
Unexecuted instantiation: isl_multi_pw_aff_add_dims
Unexecuted instantiation: isl_multi_aff_add_dims
199
#endif
200
201
unsigned FN(MULTI(BASE),dim)(__isl_keep MULTI(BASE) *multi,
202
  enum isl_dim_type type)
203
553k
{
204
553k
  return multi ? 
isl_space_dim(multi->space, type)553k
:
00
;
205
553k
}
isl_multi_aff_dim
Line
Count
Source
203
528k
{
204
528k
  return multi ? 
isl_space_dim(multi->space, type)528k
:
00
;
205
528k
}
isl_multi_val_dim
Line
Count
Source
203
4.70k
{
204
4.70k
  return multi ? 
isl_space_dim(multi->space, type)4.70k
:
00
;
205
4.70k
}
isl_multi_union_pw_aff_dim
Line
Count
Source
203
11.9k
{
204
11.9k
  return multi ? 
isl_space_dim(multi->space, type)11.9k
:
00
;
205
11.9k
}
isl_multi_pw_aff_dim
Line
Count
Source
203
8.20k
{
204
8.20k
  return multi ? 
isl_space_dim(multi->space, type)8.20k
:
00
;
205
8.20k
}
206
207
/* Return the position of the first dimension of "type" with id "id".
208
 * Return -1 if there is no such dimension.
209
 */
210
int FN(MULTI(BASE),find_dim_by_id)(__isl_keep MULTI(BASE) *multi,
211
  enum isl_dim_type type, __isl_keep isl_id *id)
212
0
{
213
0
  if (!multi)
214
0
    return -1;
215
0
  return isl_space_find_dim_by_id(multi->space, type, id);
216
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_val_find_dim_by_id
Unexecuted instantiation: isl_multi_pw_aff_find_dim_by_id
Unexecuted instantiation: isl_multi_aff_find_dim_by_id
217
218
/* Return the id of the given dimension.
219
 */
220
__isl_give isl_id *FN(MULTI(BASE),get_dim_id)(__isl_keep MULTI(BASE) *multi,
221
  enum isl_dim_type type, unsigned pos)
222
0
{
223
0
  return multi ? isl_space_get_dim_id(multi->space, type, pos) : NULL;
224
0
}
Unexecuted instantiation: isl_multi_val_get_dim_id
Unexecuted instantiation: isl_multi_aff_get_dim_id
Unexecuted instantiation: isl_multi_union_pw_aff_get_dim_id
Unexecuted instantiation: isl_multi_pw_aff_get_dim_id
225
226
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_name)(
227
  __isl_take MULTI(BASE) *multi,
228
  enum isl_dim_type type, unsigned pos, const char *s)
229
0
{
230
0
  int i;
231
0
232
0
  multi = FN(MULTI(BASE),cow)(multi);
233
0
  if (!multi)
234
0
    return NULL;
235
0
236
0
  multi->space = isl_space_set_dim_name(multi->space, type, pos, s);
237
0
  if (!multi->space)
238
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
239
0
240
0
  
if (0
type == isl_dim_out0
)
241
0
    return multi;
242
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
243
0
    multi->p[i] = FN(EL,set_dim_name)(multi->p[i], type, pos, s);
244
0
    if (!multi->p[i])
245
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
246
0
  }
247
0
248
0
  return multi;
249
0
}
Unexecuted instantiation: isl_multi_aff_set_dim_name
Unexecuted instantiation: isl_multi_val_set_dim_name
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_name
Unexecuted instantiation: isl_multi_pw_aff_set_dim_name
250
251
const char *FN(MULTI(BASE),get_tuple_name)(__isl_keep MULTI(BASE) *multi,
252
  enum isl_dim_type type)
253
0
{
254
0
  return multi ? isl_space_get_tuple_name(multi->space, type) : NULL;
255
0
}
Unexecuted instantiation: isl_multi_pw_aff_get_tuple_name
Unexecuted instantiation: isl_multi_aff_get_tuple_name
Unexecuted instantiation: isl_multi_val_get_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_get_tuple_name
256
257
/* Does the specified tuple have an id?
258
 */
259
isl_bool FN(MULTI(BASE),has_tuple_id)(__isl_keep MULTI(BASE) *multi,
260
  enum isl_dim_type type)
261
2.88k
{
262
2.88k
  if (!multi)
263
0
    return isl_bool_error;
264
2.88k
  return isl_space_has_tuple_id(multi->space, type);
265
2.88k
}
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
1.87k
{
262
1.87k
  if (!multi)
263
0
    return isl_bool_error;
264
1.87k
  return isl_space_has_tuple_id(multi->space, type);
265
1.87k
}
isl_multi_union_pw_aff_has_tuple_id
Line
Count
Source
261
1.00k
{
262
1.00k
  if (!multi)
263
0
    return isl_bool_error;
264
1.00k
  return isl_space_has_tuple_id(multi->space, type);
265
1.00k
}
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
1.87k
{
272
1.87k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
1.87k
}
Unexecuted instantiation: isl_multi_aff_get_tuple_id
isl_multi_pw_aff_get_tuple_id
Line
Count
Source
271
1.87k
{
272
1.87k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
1.87k
}
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
43.9k
{
278
43.9k
  isl_ctx *ctx;
279
43.9k
280
43.9k
  if (!multi)
281
0
    return NULL;
282
43.9k
  
ctx = 43.9k
FN43.9k
(MULTI(BASE),get_ctx)(multi);
283
43.9k
  if (
pos < 0 || 43.9k
pos >= multi->n43.9k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
43.9k
      "index out of bounds", return NULL);
286
43.9k
  
return 43.9k
FN43.9k
(EL,copy)(multi->p[pos]);
287
43.9k
}
isl_multi_val_get_val
Line
Count
Source
277
5.13k
{
278
5.13k
  isl_ctx *ctx;
279
5.13k
280
5.13k
  if (!multi)
281
0
    return NULL;
282
5.13k
  
ctx = 5.13k
FN5.13k
(MULTI(BASE),get_ctx)(multi);
283
5.13k
  if (
pos < 0 || 5.13k
pos >= multi->n5.13k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
5.13k
      "index out of bounds", return NULL);
286
5.13k
  
return 5.13k
FN5.13k
(EL,copy)(multi->p[pos]);
287
5.13k
}
isl_multi_union_pw_aff_get_union_pw_aff
Line
Count
Source
277
10.1k
{
278
10.1k
  isl_ctx *ctx;
279
10.1k
280
10.1k
  if (!multi)
281
0
    return NULL;
282
10.1k
  
ctx = 10.1k
FN10.1k
(MULTI(BASE),get_ctx)(multi);
283
10.1k
  if (
pos < 0 || 10.1k
pos >= multi->n10.1k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
10.1k
      "index out of bounds", return NULL);
286
10.1k
  
return 10.1k
FN10.1k
(EL,copy)(multi->p[pos]);
287
10.1k
}
isl_multi_pw_aff_get_pw_aff
Line
Count
Source
277
9.62k
{
278
9.62k
  isl_ctx *ctx;
279
9.62k
280
9.62k
  if (!multi)
281
0
    return NULL;
282
9.62k
  
ctx = 9.62k
FN9.62k
(MULTI(BASE),get_ctx)(multi);
283
9.62k
  if (
pos < 0 || 9.62k
pos >= multi->n9.62k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
9.62k
      "index out of bounds", return NULL);
286
9.62k
  
return 9.62k
FN9.62k
(EL,copy)(multi->p[pos]);
287
9.62k
}
isl_multi_aff_get_aff
Line
Count
Source
277
19.0k
{
278
19.0k
  isl_ctx *ctx;
279
19.0k
280
19.0k
  if (!multi)
281
0
    return NULL;
282
19.0k
  
ctx = 19.0k
FN19.0k
(MULTI(BASE),get_ctx)(multi);
283
19.0k
  if (
pos < 0 || 19.0k
pos >= multi->n19.0k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
19.0k
      "index out of bounds", return NULL);
286
19.0k
  
return 19.0k
FN19.0k
(EL,copy)(multi->p[pos]);
287
19.0k
}
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
399k
{
292
399k
  isl_space *multi_space = NULL;
293
399k
  isl_space *el_space = NULL;
294
399k
  isl_bool match;
295
399k
296
399k
  multi = FN(MULTI(BASE),cow)(multi);
297
399k
  if (
!multi || 399k
!el399k
)
298
0
    goto error;
299
399k
300
399k
  
multi_space = 399k
FN399k
(MULTI(BASE),get_space)(multi);
301
399k
  match = FN(EL,matching_params)(el, multi_space);
302
399k
  if (match < 0)
303
0
    goto error;
304
399k
  
if (399k
!match399k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
399k
  if (
FN399k
(EL,check_match_domain_space)(el, multi_space) < 0399k
)
312
0
    goto error;
313
399k
314
399k
  
if (399k
pos < 0 || 399k
pos >= multi->n399k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
399k
      "index out of bounds", goto error);
317
399k
318
399k
  
FN399k
(EL,free)(multi->p[pos]);399k
319
399k
  multi->p[pos] = el;
320
399k
321
399k
  isl_space_free(multi_space);
322
399k
  isl_space_free(el_space);
323
399k
324
399k
  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
399k
}
isl_multi_val_set_val
Line
Count
Source
291
6.72k
{
292
6.72k
  isl_space *multi_space = NULL;
293
6.72k
  isl_space *el_space = NULL;
294
6.72k
  isl_bool match;
295
6.72k
296
6.72k
  multi = FN(MULTI(BASE),cow)(multi);
297
6.72k
  if (
!multi || 6.72k
!el6.72k
)
298
0
    goto error;
299
6.72k
300
6.72k
  
multi_space = 6.72k
FN6.72k
(MULTI(BASE),get_space)(multi);
301
6.72k
  match = FN(EL,matching_params)(el, multi_space);
302
6.72k
  if (match < 0)
303
0
    goto error;
304
6.72k
  
if (6.72k
!match6.72k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
6.72k
  if (
FN6.72k
(EL,check_match_domain_space)(el, multi_space) < 06.72k
)
312
0
    goto error;
313
6.72k
314
6.72k
  
if (6.72k
pos < 0 || 6.72k
pos >= multi->n6.72k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
6.72k
      "index out of bounds", goto error);
317
6.72k
318
6.72k
  
FN6.72k
(EL,free)(multi->p[pos]);6.72k
319
6.72k
  multi->p[pos] = el;
320
6.72k
321
6.72k
  isl_space_free(multi_space);
322
6.72k
  isl_space_free(el_space);
323
6.72k
324
6.72k
  return multi;
325
0
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
6.72k
}
isl_multi_aff_set_aff
Line
Count
Source
291
378k
{
292
378k
  isl_space *multi_space = NULL;
293
378k
  isl_space *el_space = NULL;
294
378k
  isl_bool match;
295
378k
296
378k
  multi = FN(MULTI(BASE),cow)(multi);
297
378k
  if (
!multi || 378k
!el378k
)
298
0
    goto error;
299
378k
300
378k
  
multi_space = 378k
FN378k
(MULTI(BASE),get_space)(multi);
301
378k
  match = FN(EL,matching_params)(el, multi_space);
302
378k
  if (match < 0)
303
0
    goto error;
304
378k
  
if (378k
!match378k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
378k
  if (
FN378k
(EL,check_match_domain_space)(el, multi_space) < 0378k
)
312
0
    goto error;
313
378k
314
378k
  
if (378k
pos < 0 || 378k
pos >= multi->n378k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
378k
      "index out of bounds", goto error);
317
378k
318
378k
  
FN378k
(EL,free)(multi->p[pos]);378k
319
378k
  multi->p[pos] = el;
320
378k
321
378k
  isl_space_free(multi_space);
322
378k
  isl_space_free(el_space);
323
378k
324
378k
  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
378k
}
isl_multi_union_pw_aff_set_union_pw_aff
Line
Count
Source
291
5.18k
{
292
5.18k
  isl_space *multi_space = NULL;
293
5.18k
  isl_space *el_space = NULL;
294
5.18k
  isl_bool match;
295
5.18k
296
5.18k
  multi = FN(MULTI(BASE),cow)(multi);
297
5.18k
  if (
!multi || 5.18k
!el5.18k
)
298
0
    goto error;
299
5.18k
300
5.18k
  
multi_space = 5.18k
FN5.18k
(MULTI(BASE),get_space)(multi);
301
5.18k
  match = FN(EL,matching_params)(el, multi_space);
302
5.18k
  if (match < 0)
303
0
    goto error;
304
5.18k
  
if (5.18k
!match5.18k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
5.18k
  if (
FN5.18k
(EL,check_match_domain_space)(el, multi_space) < 05.18k
)
312
0
    goto error;
313
5.18k
314
5.18k
  
if (5.18k
pos < 0 || 5.18k
pos >= multi->n5.18k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
5.18k
      "index out of bounds", goto error);
317
5.18k
318
5.18k
  
FN5.18k
(EL,free)(multi->p[pos]);5.18k
319
5.18k
  multi->p[pos] = el;
320
5.18k
321
5.18k
  isl_space_free(multi_space);
322
5.18k
  isl_space_free(el_space);
323
5.18k
324
5.18k
  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
5.18k
}
isl_multi_pw_aff_set_pw_aff
Line
Count
Source
291
9.62k
{
292
9.62k
  isl_space *multi_space = NULL;
293
9.62k
  isl_space *el_space = NULL;
294
9.62k
  isl_bool match;
295
9.62k
296
9.62k
  multi = FN(MULTI(BASE),cow)(multi);
297
9.62k
  if (
!multi || 9.62k
!el9.62k
)
298
0
    goto error;
299
9.62k
300
9.62k
  
multi_space = 9.62k
FN9.62k
(MULTI(BASE),get_space)(multi);
301
9.62k
  match = FN(EL,matching_params)(el, multi_space);
302
9.62k
  if (match < 0)
303
0
    goto error;
304
9.62k
  
if (9.62k
!match9.62k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
9.62k
  if (
FN9.62k
(EL,check_match_domain_space)(el, multi_space) < 09.62k
)
312
0
    goto error;
313
9.62k
314
9.62k
  
if (9.62k
pos < 0 || 9.62k
pos >= multi->n9.62k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
9.62k
      "index out of bounds", goto error);
317
9.62k
318
9.62k
  
FN9.62k
(EL,free)(multi->p[pos]);9.62k
319
9.62k
  multi->p[pos] = el;
320
9.62k
321
9.62k
  isl_space_free(multi_space);
322
9.62k
  isl_space_free(el_space);
323
9.62k
324
9.62k
  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
9.62k
}
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
8.43k
{
343
8.43k
  int i;
344
8.43k
345
8.43k
  multi = FN(MULTI(BASE),cow)(multi);
346
8.43k
  if (
!multi || 8.43k
!space8.43k
||
!domain8.43k
)
347
0
    goto error;
348
8.43k
349
29.4k
  
for (i = 0; 8.43k
i < multi->n29.4k
;
++i20.9k
)
{20.9k
350
20.9k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
20.9k
         isl_space_copy(domain));
352
20.9k
    if (!multi->p[i])
353
0
      goto error;
354
20.9k
  }
355
8.43k
  isl_space_free(domain);
356
8.43k
  isl_space_free(multi->space);
357
8.43k
  multi->space = space;
358
8.43k
359
8.43k
  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
8.43k
}
isl_multi_union_pw_aff_reset_space_and_domain
Line
Count
Source
342
115
{
343
115
  int i;
344
115
345
115
  multi = FN(MULTI(BASE),cow)(multi);
346
115
  if (
!multi || 115
!space115
||
!domain115
)
347
0
    goto error;
348
115
349
230
  
for (i = 0; 115
i < multi->n230
;
++i115
)
{115
350
115
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
115
         isl_space_copy(domain));
352
115
    if (!multi->p[i])
353
0
      goto error;
354
115
  }
355
115
  isl_space_free(domain);
356
115
  isl_space_free(multi->space);
357
115
  multi->space = space;
358
115
359
115
  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
115
}
isl_multi_pw_aff_reset_space_and_domain
Line
Count
Source
342
5.72k
{
343
5.72k
  int i;
344
5.72k
345
5.72k
  multi = FN(MULTI(BASE),cow)(multi);
346
5.72k
  if (
!multi || 5.72k
!space5.72k
||
!domain5.72k
)
347
0
    goto error;
348
5.72k
349
21.4k
  
for (i = 0; 5.72k
i < multi->n21.4k
;
++i15.6k
)
{15.6k
350
15.6k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
15.6k
         isl_space_copy(domain));
352
15.6k
    if (!multi->p[i])
353
0
      goto error;
354
15.6k
  }
355
5.72k
  isl_space_free(domain);
356
5.72k
  isl_space_free(multi->space);
357
5.72k
  multi->space = space;
358
5.72k
359
5.72k
  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
5.72k
}
isl_multi_aff_reset_space_and_domain
Line
Count
Source
342
2.60k
{
343
2.60k
  int i;
344
2.60k
345
2.60k
  multi = FN(MULTI(BASE),cow)(multi);
346
2.60k
  if (
!multi || 2.60k
!space2.60k
||
!domain2.60k
)
347
0
    goto error;
348
2.60k
349
7.78k
  
for (i = 0; 2.60k
i < multi->n7.78k
;
++i5.18k
)
{5.18k
350
5.18k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
5.18k
         isl_space_copy(domain));
352
5.18k
    if (!multi->p[i])
353
0
      goto error;
354
5.18k
  }
355
2.60k
  isl_space_free(domain);
356
2.60k
  isl_space_free(multi->space);
357
2.60k
  multi->space = space;
358
2.60k
359
2.60k
  return multi;
360
0
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
2.60k
}
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
122
{
370
122
  isl_space *space;
371
122
372
122
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
122
            isl_space_copy(multi->space));
374
122
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
122
}
isl_multi_union_pw_aff_reset_domain_space
Line
Count
Source
369
112
{
370
112
  isl_space *space;
371
112
372
112
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
112
            isl_space_copy(multi->space));
374
112
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
112
}
Unexecuted instantiation: isl_multi_val_reset_domain_space
isl_multi_aff_reset_domain_space
Line
Count
Source
369
10
{
370
10
  isl_space *space;
371
10
372
10
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
10
            isl_space_copy(multi->space));
374
10
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
10
}
Unexecuted instantiation: isl_multi_pw_aff_reset_domain_space
376
377
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space)(
378
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space)
379
7.04k
{
380
7.04k
  isl_space *domain;
381
7.04k
382
7.04k
  domain = isl_space_domain(isl_space_copy(space));
383
7.04k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
7.04k
}
isl_multi_aff_reset_space
Line
Count
Source
379
1.32k
{
380
1.32k
  isl_space *domain;
381
1.32k
382
1.32k
  domain = isl_space_domain(isl_space_copy(space));
383
1.32k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
1.32k
}
isl_multi_pw_aff_reset_space
Line
Count
Source
379
5.72k
{
380
5.72k
  isl_space *domain;
381
5.72k
382
5.72k
  domain = isl_space_domain(isl_space_copy(space));
383
5.72k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
5.72k
}
isl_multi_union_pw_aff_reset_space
Line
Count
Source
379
3
{
380
3
  isl_space *domain;
381
3
382
3
  domain = isl_space_domain(isl_space_copy(space));
383
3
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
3
}
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
5.72k
{
392
5.72k
  isl_space *space;
393
5.72k
394
5.72k
  multi = FN(MULTI(BASE),cow)(multi);
395
5.72k
  if (
!multi || 5.72k
!id5.72k
)
396
0
    goto error;
397
5.72k
398
5.72k
  
space = 5.72k
FN5.72k
(MULTI(BASE),get_space)(multi);
399
5.72k
  space = isl_space_set_dim_id(space, type, pos, id);
400
5.72k
401
5.72k
  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
5.72k
}
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
5.72k
{
392
5.72k
  isl_space *space;
393
5.72k
394
5.72k
  multi = FN(MULTI(BASE),cow)(multi);
395
5.72k
  if (
!multi || 5.72k
!id5.72k
)
396
0
    goto error;
397
5.72k
398
5.72k
  
space = 5.72k
FN5.72k
(MULTI(BASE),get_space)(multi);
399
5.72k
  space = isl_space_set_dim_id(space, type, pos, id);
400
5.72k
401
5.72k
  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
5.72k
}
407
408
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_name)(
409
  __isl_keep MULTI(BASE) *multi, enum isl_dim_type type,
410
  const char *s)
411
0
{
412
0
  isl_space *space;
413
0
414
0
  multi = FN(MULTI(BASE),cow)(multi);
415
0
  if (!multi)
416
0
    return NULL;
417
0
418
0
  
space = 0
FN0
(MULTI(BASE),get_space)(multi);
419
0
  space = isl_space_set_tuple_name(space, type, s);
420
0
421
0
  return FN(MULTI(BASE),reset_space)(multi, space);
422
0
}
Unexecuted instantiation: isl_multi_aff_set_tuple_name
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_name
Unexecuted instantiation: isl_multi_val_set_tuple_name
Unexecuted instantiation: isl_multi_union_pw_aff_set_tuple_name
423
424
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_tuple_id)(
425
  __isl_take MULTI(BASE) *multi, enum isl_dim_type type,
426
  __isl_take isl_id *id)
427
93
{
428
93
  isl_space *space;
429
93
430
93
  multi = FN(MULTI(BASE),cow)(multi);
431
93
  if (!multi)
432
0
    goto error;
433
93
434
93
  
space = 93
FN93
(MULTI(BASE),get_space)(multi);
435
93
  space = isl_space_set_tuple_id(space, type, id);
436
93
437
93
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
93
}
isl_multi_aff_set_tuple_id
Line
Count
Source
427
90
{
428
90
  isl_space *space;
429
90
430
90
  multi = FN(MULTI(BASE),cow)(multi);
431
90
  if (!multi)
432
0
    goto error;
433
90
434
90
  
space = 90
FN90
(MULTI(BASE),get_space)(multi);
435
90
  space = isl_space_set_tuple_id(space, type, id);
436
90
437
90
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
90
}
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_id
Unexecuted instantiation: isl_multi_val_set_tuple_id
isl_multi_union_pw_aff_set_tuple_id
Line
Count
Source
427
3
{
428
3
  isl_space *space;
429
3
430
3
  multi = FN(MULTI(BASE),cow)(multi);
431
3
  if (!multi)
432
0
    goto error;
433
3
434
3
  
space = 3
FN3
(MULTI(BASE),get_space)(multi);
435
3
  space = isl_space_set_tuple_id(space, type, id);
436
3
437
3
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
3
}
442
443
/* Drop the id on the specified tuple.
444
 */
445
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_tuple_id)(
446
  __isl_take MULTI(BASE) *multi, enum isl_dim_type type)
447
1.00k
{
448
1.00k
  isl_space *space;
449
1.00k
450
1.00k
  if (!multi)
451
0
    return NULL;
452
1.00k
  
if (1.00k
!1.00k
FN1.00k
(MULTI(BASE),has_tuple_id)(multi, type))
453
1.00k
    return multi;
454
1.00k
455
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
456
0
  if (!multi)
457
0
    return NULL;
458
0
459
0
  
space = 0
FN0
(MULTI(BASE),get_space)(multi);
460
0
  space = isl_space_reset_tuple_id(space, type);
461
0
462
0
  return FN(MULTI(BASE),reset_space)(multi, space);
463
0
}
Unexecuted instantiation: isl_multi_pw_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_val_reset_tuple_id
isl_multi_union_pw_aff_reset_tuple_id
Line
Count
Source
447
1.00k
{
448
1.00k
  isl_space *space;
449
1.00k
450
1.00k
  if (!multi)
451
0
    return NULL;
452
1.00k
  
if (1.00k
!1.00k
FN1.00k
(MULTI(BASE),has_tuple_id)(multi, type))
453
1.00k
    return multi;
454
1.00k
455
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
456
0
  if (!multi)
457
0
    return NULL;
458
0
459
0
  
space = 0
FN0
(MULTI(BASE),get_space)(multi);
460
0
  space = isl_space_reset_tuple_id(space, type);
461
0
462
0
  return FN(MULTI(BASE),reset_space)(multi, space);
463
0
}
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
122
{
482
122
  int i;
483
122
484
122
  multi = FN(MULTI(BASE),cow)(multi);
485
122
  if (
!multi || 122
!exp122
)
486
0
    goto error;
487
122
488
234
  
for (i = 0; 122
i < multi->n234
;
++i112
)
{112
489
112
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
112
            isl_reordering_copy(exp));
491
112
    if (!multi->p[i])
492
0
      goto error;
493
112
  }
494
122
495
122
  
multi = 122
FN122
(MULTI(BASE),reset_domain_space)(multi,
496
122
                isl_space_copy(exp->dim));
497
122
498
122
  isl_reordering_free(exp);
499
122
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
122
}
Unexecuted instantiation: isl_multi_pw_aff_realign_domain
isl_multi_union_pw_aff_realign_domain
Line
Count
Source
481
112
{
482
112
  int i;
483
112
484
112
  multi = FN(MULTI(BASE),cow)(multi);
485
112
  if (
!multi || 112
!exp112
)
486
0
    goto error;
487
112
488
224
  
for (i = 0; 112
i < multi->n224
;
++i112
)
{112
489
112
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
112
            isl_reordering_copy(exp));
491
112
    if (!multi->p[i])
492
0
      goto error;
493
112
  }
494
112
495
112
  
multi = 112
FN112
(MULTI(BASE),reset_domain_space)(multi,
496
112
                isl_space_copy(exp->dim));
497
112
498
112
  isl_reordering_free(exp);
499
112
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
112
}
Unexecuted instantiation: isl_multi_val_realign_domain
isl_multi_aff_realign_domain
Line
Count
Source
481
10
{
482
10
  int i;
483
10
484
10
  multi = FN(MULTI(BASE),cow)(multi);
485
10
  if (
!multi || 10
!exp10
)
486
0
    goto error;
487
10
488
10
  
for (i = 0; 10
i < multi->n10
;
++i0
)
{0
489
0
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
0
            isl_reordering_copy(exp));
491
0
    if (!multi->p[i])
492
0
      goto error;
493
0
  }
494
10
495
10
  
multi = 10
FN10
(MULTI(BASE),reset_domain_space)(multi,
496
10
                isl_space_copy(exp->dim));
497
10
498
10
  isl_reordering_free(exp);
499
10
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
10
}
505
506
/* Align the parameters of "multi" to those of "model".
507
 */
508
__isl_give MULTI(BASE) *FN(MULTI(BASE),align_params)(
509
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *model)
510
2.27k
{
511
2.27k
  isl_ctx *ctx;
512
2.27k
  isl_bool equal_params;
513
2.27k
  isl_reordering *exp;
514
2.27k
515
2.27k
  if (
!multi || 2.27k
!model2.27k
)
516
0
    goto error;
517
2.27k
518
2.27k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
2.27k
  if (equal_params < 0)
520
0
    goto error;
521
2.27k
  
if (2.27k
equal_params2.27k
)
{2.15k
522
2.15k
    isl_space_free(model);
523
2.15k
    return multi;
524
2.15k
  }
525
2.27k
526
122
  ctx = isl_space_get_ctx(model);
527
122
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
122
      "model has unnamed parameters", goto error);
530
122
  
if (122
!isl_space_has_named_params(multi->space)122
)
531
0
    isl_die(ctx, isl_error_invalid,
532
122
      "input has unnamed parameters", goto error);
533
122
534
122
  model = isl_space_params(model);
535
122
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
122
  exp = isl_reordering_extend_space(exp,
537
122
            FN(MULTI(BASE),get_domain_space)(multi));
538
122
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
122
540
122
  isl_space_free(model);
541
122
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
122
}
isl_multi_union_pw_aff_align_params
Line
Count
Source
510
821
{
511
821
  isl_ctx *ctx;
512
821
  isl_bool equal_params;
513
821
  isl_reordering *exp;
514
821
515
821
  if (
!multi || 821
!model821
)
516
0
    goto error;
517
821
518
821
  equal_params = isl_space_has_equal_params(multi->space, model);
519
821
  if (equal_params < 0)
520
0
    goto error;
521
821
  
if (821
equal_params821
)
{709
522
709
    isl_space_free(model);
523
709
    return multi;
524
709
  }
525
821
526
112
  ctx = isl_space_get_ctx(model);
527
112
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
112
      "model has unnamed parameters", goto error);
530
112
  
if (112
!isl_space_has_named_params(multi->space)112
)
531
0
    isl_die(ctx, isl_error_invalid,
532
112
      "input has unnamed parameters", goto error);
533
112
534
112
  model = isl_space_params(model);
535
112
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
112
  exp = isl_reordering_extend_space(exp,
537
112
            FN(MULTI(BASE),get_domain_space)(multi));
538
112
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
112
540
112
  isl_space_free(model);
541
112
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
112
}
Unexecuted instantiation: isl_multi_pw_aff_align_params
Unexecuted instantiation: isl_multi_val_align_params
isl_multi_aff_align_params
Line
Count
Source
510
1.45k
{
511
1.45k
  isl_ctx *ctx;
512
1.45k
  isl_bool equal_params;
513
1.45k
  isl_reordering *exp;
514
1.45k
515
1.45k
  if (
!multi || 1.45k
!model1.45k
)
516
0
    goto error;
517
1.45k
518
1.45k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.45k
  if (equal_params < 0)
520
0
    goto error;
521
1.45k
  
if (1.45k
equal_params1.45k
)
{1.44k
522
1.44k
    isl_space_free(model);
523
1.44k
    return multi;
524
1.44k
  }
525
1.45k
526
10
  ctx = isl_space_get_ctx(model);
527
10
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
10
      "model has unnamed parameters", goto error);
530
10
  
if (10
!isl_space_has_named_params(multi->space)10
)
531
0
    isl_die(ctx, isl_error_invalid,
532
10
      "input has unnamed parameters", goto error);
533
10
534
10
  model = isl_space_params(model);
535
10
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
10
  exp = isl_reordering_extend_space(exp,
537
10
            FN(MULTI(BASE),get_domain_space)(multi));
538
10
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
10
540
10
  isl_space_free(model);
541
10
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
10
}
547
548
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))(
549
  __isl_take isl_space *space, __isl_take LIST(EL) *list)
550
4.23k
{
551
4.23k
  int i;
552
4.23k
  int n;
553
4.23k
  isl_ctx *ctx;
554
4.23k
  MULTI(BASE) *multi;
555
4.23k
556
4.23k
  if (
!space || 4.23k
!list4.23k
)
557
0
    goto error;
558
4.23k
559
4.23k
  ctx = isl_space_get_ctx(space);
560
4.23k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.23k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.23k
      "invalid number of elements in list", goto error);
564
4.23k
565
4.23k
  
multi = 4.23k
FN4.23k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
10.3k
  for (i = 0; 
i < n10.3k
;
++i6.06k
)
{6.06k
567
6.06k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.06k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.06k
  }
570
4.23k
571
4.23k
  isl_space_free(space);
572
4.23k
  FN(LIST(EL),free)(list);
573
4.23k
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
4.23k
}
isl_multi_union_pw_aff_from_union_pw_aff_list
Line
Count
Source
550
15
{
551
15
  int i;
552
15
  int n;
553
15
  isl_ctx *ctx;
554
15
  MULTI(BASE) *multi;
555
15
556
15
  if (
!space || 15
!list15
)
557
0
    goto error;
558
15
559
15
  ctx = isl_space_get_ctx(space);
560
15
  n = FN(FN(LIST(EL),n),BASE)(list);
561
15
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
15
      "invalid number of elements in list", goto error);
564
15
565
15
  
multi = 15
FN15
(MULTI(BASE),alloc)(isl_space_copy(space));
566
42
  for (i = 0; 
i < n42
;
++i27
)
{27
567
27
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
27
          FN(FN(LIST(EL),get),BASE)(list, i));
569
27
  }
570
15
571
15
  isl_space_free(space);
572
15
  FN(LIST(EL),free)(list);
573
15
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
15
}
isl_multi_pw_aff_from_pw_aff_list
Line
Count
Source
550
4.21k
{
551
4.21k
  int i;
552
4.21k
  int n;
553
4.21k
  isl_ctx *ctx;
554
4.21k
  MULTI(BASE) *multi;
555
4.21k
556
4.21k
  if (
!space || 4.21k
!list4.21k
)
557
0
    goto error;
558
4.21k
559
4.21k
  ctx = isl_space_get_ctx(space);
560
4.21k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.21k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.21k
      "invalid number of elements in list", goto error);
564
4.21k
565
4.21k
  
multi = 4.21k
FN4.21k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
10.2k
  for (i = 0; 
i < n10.2k
;
++i6.02k
)
{6.02k
567
6.02k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.02k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.02k
  }
570
4.21k
571
4.21k
  isl_space_free(space);
572
4.21k
  FN(LIST(EL),free)(list);
573
4.21k
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
4.21k
}
isl_multi_val_from_val_list
Line
Count
Source
550
11
{
551
11
  int i;
552
11
  int n;
553
11
  isl_ctx *ctx;
554
11
  MULTI(BASE) *multi;
555
11
556
11
  if (
!space || 11
!list11
)
557
0
    goto error;
558
11
559
11
  ctx = isl_space_get_ctx(space);
560
11
  n = FN(FN(LIST(EL),n),BASE)(list);
561
11
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
11
      "invalid number of elements in list", goto error);
564
11
565
11
  
multi = 11
FN11
(MULTI(BASE),alloc)(isl_space_copy(space));
566
32
  for (i = 0; 
i < n32
;
++i21
)
{21
567
21
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
21
          FN(FN(LIST(EL),get),BASE)(list, i));
569
21
  }
570
11
571
11
  isl_space_free(space);
572
11
  FN(LIST(EL),free)(list);
573
11
  return multi;
574
0
error:
575
0
  isl_space_free(space);
576
0
  FN(LIST(EL),free)(list);
577
0
  return NULL;
578
11
}
Unexecuted instantiation: isl_multi_aff_from_aff_list
579
580
#ifndef NO_IDENTITY
581
/* Create a multi expression in the given space that maps each
582
 * input dimension to the corresponding output dimension.
583
 */
584
__isl_give MULTI(BASE) *FN(MULTI(BASE),identity)(__isl_take isl_space *space)
585
3.40k
{
586
3.40k
  int i, n;
587
3.40k
  isl_local_space *ls;
588
3.40k
  MULTI(BASE) *multi;
589
3.40k
590
3.40k
  if (!space)
591
0
    return NULL;
592
3.40k
593
3.40k
  
if (3.40k
isl_space_is_set(space)3.40k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
3.40k
      "expecting map space", goto error);
596
3.40k
597
3.40k
  n = isl_space_dim(space, isl_dim_out);
598
3.40k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
3.40k
      "number of input and output dimensions needs to be "
601
3.40k
      "the same", goto error);
602
3.40k
603
3.40k
  
multi = 3.40k
FN3.40k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
3.40k
605
3.40k
  if (
!n3.40k
)
{1.91k
606
1.91k
    isl_space_free(space);
607
1.91k
    return multi;
608
1.91k
  }
609
3.40k
610
1.49k
  space = isl_space_domain(space);
611
1.49k
  ls = isl_local_space_from_space(space);
612
1.49k
613
7.99k
  for (i = 0; 
i < n7.99k
;
++i6.50k
)
{6.50k
614
6.50k
    EL *el;
615
6.50k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
6.50k
            isl_dim_set, i);
617
6.50k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
6.50k
  }
619
1.49k
620
1.49k
  isl_local_space_free(ls);
621
1.49k
622
1.49k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
3.40k
}
Unexecuted instantiation: isl_multi_pw_aff_identity
isl_multi_aff_identity
Line
Count
Source
585
3.40k
{
586
3.40k
  int i, n;
587
3.40k
  isl_local_space *ls;
588
3.40k
  MULTI(BASE) *multi;
589
3.40k
590
3.40k
  if (!space)
591
0
    return NULL;
592
3.40k
593
3.40k
  
if (3.40k
isl_space_is_set(space)3.40k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
3.40k
      "expecting map space", goto error);
596
3.40k
597
3.40k
  n = isl_space_dim(space, isl_dim_out);
598
3.40k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
3.40k
      "number of input and output dimensions needs to be "
601
3.40k
      "the same", goto error);
602
3.40k
603
3.40k
  
multi = 3.40k
FN3.40k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
3.40k
605
3.40k
  if (
!n3.40k
)
{1.91k
606
1.91k
    isl_space_free(space);
607
1.91k
    return multi;
608
1.91k
  }
609
3.40k
610
1.49k
  space = isl_space_domain(space);
611
1.49k
  ls = isl_local_space_from_space(space);
612
1.49k
613
7.99k
  for (i = 0; 
i < n7.99k
;
++i6.50k
)
{6.50k
614
6.50k
    EL *el;
615
6.50k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
6.50k
            isl_dim_set, i);
617
6.50k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
6.50k
  }
619
1.49k
620
1.49k
  isl_local_space_free(ls);
621
1.49k
622
1.49k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
3.40k
}
627
#endif
628
629
#ifndef NO_ZERO
630
/* Construct a multi expression in the given space with value zero in
631
 * each of the output dimensions.
632
 */
633
__isl_give MULTI(BASE) *FN(MULTI(BASE),zero)(__isl_take isl_space *space)
634
4.05k
{
635
4.05k
  int n;
636
4.05k
  MULTI(BASE) *multi;
637
4.05k
638
4.05k
  if (!space)
639
0
    return NULL;
640
4.05k
641
4.05k
  n = isl_space_dim(space , isl_dim_out);
642
4.05k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
4.05k
644
4.05k
  if (!n)
645
1.03k
    isl_space_free(space);
646
3.02k
  else {
647
3.02k
    int i;
648
3.02k
    isl_local_space *ls;
649
3.02k
    EL *el;
650
3.02k
651
3.02k
    space = isl_space_domain(space);
652
3.02k
    ls = isl_local_space_from_space(space);
653
3.02k
    el = FN(EL,zero_on_domain)(ls);
654
3.02k
655
7.47k
    for (i = 0; 
i < n7.47k
;
++i4.44k
)
656
4.44k
      
multi = 4.44k
FN4.44k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
4.44k
                  FN(EL,copy)(el));
658
3.02k
659
3.02k
    FN(EL,free)(el);
660
3.02k
  }
661
4.05k
662
4.05k
  return multi;
663
4.05k
}
isl_multi_aff_zero
Line
Count
Source
634
2.08k
{
635
2.08k
  int n;
636
2.08k
  MULTI(BASE) *multi;
637
2.08k
638
2.08k
  if (!space)
639
0
    return NULL;
640
2.08k
641
2.08k
  n = isl_space_dim(space , isl_dim_out);
642
2.08k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.08k
644
2.08k
  if (!n)
645
1.00k
    isl_space_free(space);
646
1.07k
  else {
647
1.07k
    int i;
648
1.07k
    isl_local_space *ls;
649
1.07k
    EL *el;
650
1.07k
651
1.07k
    space = isl_space_domain(space);
652
1.07k
    ls = isl_local_space_from_space(space);
653
1.07k
    el = FN(EL,zero_on_domain)(ls);
654
1.07k
655
2.59k
    for (i = 0; 
i < n2.59k
;
++i1.52k
)
656
1.52k
      
multi = 1.52k
FN1.52k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
1.52k
                  FN(EL,copy)(el));
658
1.07k
659
1.07k
    FN(EL,free)(el);
660
1.07k
  }
661
2.08k
662
2.08k
  return multi;
663
2.08k
}
Unexecuted instantiation: isl_multi_pw_aff_zero
isl_multi_val_zero
Line
Count
Source
634
1.96k
{
635
1.96k
  int n;
636
1.96k
  MULTI(BASE) *multi;
637
1.96k
638
1.96k
  if (!space)
639
0
    return NULL;
640
1.96k
641
1.96k
  n = isl_space_dim(space , isl_dim_out);
642
1.96k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
1.96k
644
1.96k
  if (!n)
645
23
    isl_space_free(space);
646
1.94k
  else {
647
1.94k
    int i;
648
1.94k
    isl_local_space *ls;
649
1.94k
    EL *el;
650
1.94k
651
1.94k
    space = isl_space_domain(space);
652
1.94k
    ls = isl_local_space_from_space(space);
653
1.94k
    el = FN(EL,zero_on_domain)(ls);
654
1.94k
655
4.87k
    for (i = 0; 
i < n4.87k
;
++i2.92k
)
656
2.92k
      
multi = 2.92k
FN2.92k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
2.92k
                  FN(EL,copy)(el));
658
1.94k
659
1.94k
    FN(EL,free)(el);
660
1.94k
  }
661
1.96k
662
1.96k
  return multi;
663
1.96k
}
664
#endif
665
666
#ifndef NO_FROM_BASE
667
/* Create a multiple expression with a single output/set dimension
668
 * equal to "el".
669
 * For most multiple expression types, the base type has a single
670
 * output/set dimension and the space of the result is therefore
671
 * the same as the space of the input.
672
 * In the case of isl_multi_union_pw_aff, however, the base type
673
 * lives in a parameter space and we therefore need to add
674
 * a single set dimension.
675
 */
676
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),BASE)(__isl_take EL *el)
677
224
{
678
224
  isl_space *space;
679
224
  MULTI(BASE) *multi;
680
224
681
224
  space = FN(EL,get_space(el));
682
224
  if (
isl_space_is_params(space)224
)
{0
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
224
  multi = FN(MULTI(BASE),alloc)(space);
687
224
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
224
689
224
  return multi;
690
224
}
Unexecuted instantiation: isl_multi_union_pw_aff_from_union_pw_aff
Unexecuted instantiation: isl_multi_pw_aff_from_pw_aff
isl_multi_aff_from_aff
Line
Count
Source
677
224
{
678
224
  isl_space *space;
679
224
  MULTI(BASE) *multi;
680
224
681
224
  space = FN(EL,get_space(el));
682
224
  if (
isl_space_is_params(space)224
)
{0
683
0
    space = isl_space_set_from_params(space);
684
0
    space = isl_space_add_dims(space, isl_dim_set, 1);
685
0
  }
686
224
  multi = FN(MULTI(BASE),alloc)(space);
687
224
  multi = FN(FN(MULTI(BASE),set),BASE)(multi, 0, el);
688
224
689
224
  return multi;
690
224
}
691
#endif
692
693
__isl_give MULTI(BASE) *FN(MULTI(BASE),drop_dims)(
694
  __isl_take MULTI(BASE) *multi,
695
  enum isl_dim_type type, unsigned first, unsigned n)
696
745
{
697
745
  int i;
698
745
  unsigned dim;
699
745
700
745
  multi = FN(MULTI(BASE),cow)(multi);
701
745
  if (!multi)
702
0
    return NULL;
703
745
704
745
  
dim = 745
FN745
(MULTI(BASE),dim)(multi, type);
705
745
  if (
first + n > dim || 745
first + n < first745
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
745
      "index out of bounds",
708
745
      return FN(MULTI(BASE),cow)(multi));
709
745
710
745
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
745
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
745
714
745
  
if (745
type == isl_dim_out745
)
{709
715
1.49k
    for (i = 0; 
i < n1.49k
;
++i786
)
716
786
      
FN786
(EL,free)(multi->p[first + i])786
;
717
1.25k
    for (i = first; 
i + n < multi->n1.25k
;
++i547
)
718
547
      multi->p[i] = multi->p[i + n];
719
709
    multi->n -= n;
720
709
721
709
    return multi;
722
709
  }
723
745
724
180
  
for (i = 0; 36
i < multi->n180
;
++i144
)
{144
725
144
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
144
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
144
  }
729
36
730
36
  return multi;
731
36
}
isl_multi_union_pw_aff_drop_dims
Line
Count
Source
696
60
{
697
60
  int i;
698
60
  unsigned dim;
699
60
700
60
  multi = FN(MULTI(BASE),cow)(multi);
701
60
  if (!multi)
702
0
    return NULL;
703
60
704
60
  
dim = 60
FN60
(MULTI(BASE),dim)(multi, type);
705
60
  if (
first + n > dim || 60
first + n < first60
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
60
      "index out of bounds",
708
60
      return FN(MULTI(BASE),cow)(multi));
709
60
710
60
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
60
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
60
714
60
  
if (60
type == isl_dim_out60
)
{60
715
135
    for (i = 0; 
i < n135
;
++i75
)
716
75
      
FN75
(EL,free)(multi->p[first + i])75
;
717
96
    for (i = first; 
i + n < multi->n96
;
++i36
)
718
36
      multi->p[i] = multi->p[i + n];
719
60
    multi->n -= n;
720
60
721
60
    return multi;
722
60
  }
723
60
724
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
725
0
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
0
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
0
  }
729
0
730
0
  return multi;
731
0
}
Unexecuted instantiation: isl_multi_pw_aff_drop_dims
Unexecuted instantiation: isl_multi_val_drop_dims
isl_multi_aff_drop_dims
Line
Count
Source
696
685
{
697
685
  int i;
698
685
  unsigned dim;
699
685
700
685
  multi = FN(MULTI(BASE),cow)(multi);
701
685
  if (!multi)
702
0
    return NULL;
703
685
704
685
  
dim = 685
FN685
(MULTI(BASE),dim)(multi, type);
705
685
  if (
first + n > dim || 685
first + n < first685
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
685
      "index out of bounds",
708
685
      return FN(MULTI(BASE),cow)(multi));
709
685
710
685
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
685
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
685
714
685
  
if (685
type == isl_dim_out685
)
{649
715
1.36k
    for (i = 0; 
i < n1.36k
;
++i711
)
716
711
      
FN711
(EL,free)(multi->p[first + i])711
;
717
1.16k
    for (i = first; 
i + n < multi->n1.16k
;
++i511
)
718
511
      multi->p[i] = multi->p[i + n];
719
649
    multi->n -= n;
720
649
721
649
    return multi;
722
649
  }
723
685
724
180
  
for (i = 0; 36
i < multi->n180
;
++i144
)
{144
725
144
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
144
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
144
  }
729
36
730
36
  return multi;
731
36
}
732
733
/* Align the parameters of "multi1" and "multi2" (if needed) and call "fn".
734
 */
735
static __isl_give MULTI(BASE) *FN(MULTI(BASE),align_params_multi_multi_and)(
736
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2,
737
  __isl_give MULTI(BASE) *(*fn)(__isl_take MULTI(BASE) *multi1,
738
    __isl_take MULTI(BASE) *multi2))
739
4.07k
{
740
4.07k
  isl_ctx *ctx;
741
4.07k
  isl_bool equal_params;
742
4.07k
743
4.07k
  if (
!multi1 || 4.07k
!multi24.07k
)
744
0
    goto error;
745
4.07k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
4.07k
  if (equal_params < 0)
747
0
    goto error;
748
4.07k
  
if (4.07k
equal_params4.07k
)
749
4.07k
    return fn(multi1, multi2);
750
4
  
ctx = 4
FN4
(MULTI(BASE),get_ctx)(multi1);
751
4
  if (!isl_space_has_named_params(multi1->space) ||
752
4
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
4
      "unaligned unnamed parameters", goto error);
755
4
  
multi1 = 4
FN4
(MULTI(BASE),align_params)(multi1,
756
4
              FN(MULTI(BASE),get_space)(multi2));
757
4
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
4
              FN(MULTI(BASE),get_space)(multi1));
759
4
  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
}
Unexecuted instantiation: isl_val.c:isl_multi_val_align_params_multi_multi_and
isl_aff.c:isl_multi_aff_align_params_multi_multi_and
Line
Count
Source
739
3.10k
{
740
3.10k
  isl_ctx *ctx;
741
3.10k
  isl_bool equal_params;
742
3.10k
743
3.10k
  if (
!multi1 || 3.10k
!multi23.10k
)
744
0
    goto error;
745
3.10k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
3.10k
  if (equal_params < 0)
747
0
    goto error;
748
3.10k
  
if (3.10k
equal_params3.10k
)
749
3.10k
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  
multi1 = 0
FN0
(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
0
}
isl_aff.c:isl_multi_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
5
{
740
5
  isl_ctx *ctx;
741
5
  isl_bool equal_params;
742
5
743
5
  if (
!multi1 || 5
!multi25
)
744
0
    goto error;
745
5
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
5
  if (equal_params < 0)
747
0
    goto error;
748
5
  
if (5
equal_params5
)
749
5
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  
multi1 = 0
FN0
(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
0
}
isl_aff.c:isl_multi_union_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
970
{
740
970
  isl_ctx *ctx;
741
970
  isl_bool equal_params;
742
970
743
970
  if (
!multi1 || 970
!multi2970
)
744
0
    goto error;
745
970
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
970
  if (equal_params < 0)
747
0
    goto error;
748
970
  
if (970
equal_params970
)
749
966
    return fn(multi1, multi2);
750
4
  
ctx = 4
FN4
(MULTI(BASE),get_ctx)(multi1);
751
4
  if (!isl_space_has_named_params(multi1->space) ||
752
4
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
4
      "unaligned unnamed parameters", goto error);
755
4
  
multi1 = 4
FN4
(MULTI(BASE),align_params)(multi1,
756
4
              FN(MULTI(BASE),get_space)(multi2));
757
4
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
4
              FN(MULTI(BASE),get_space)(multi1));
759
4
  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
}
765
766
/* Given two MULTI(BASE)s A -> B and C -> D,
767
 * construct a MULTI(BASE) (A * C) -> [B -> D].
768
 *
769
 * The parameters are assumed to have been aligned.
770
 */
771
static __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product_aligned)(
772
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
773
1.04k
{
774
1.04k
  int i, n1, n2;
775
1.04k
  EL *el;
776
1.04k
  isl_space *space;
777
1.04k
  MULTI(BASE) *res;
778
1.04k
779
1.04k
  if (
!multi1 || 1.04k
!multi21.04k
)
780
0
    goto error;
781
1.04k
782
1.04k
  
space = isl_space_range_product(1.04k
FN1.04k
(MULTI(BASE),get_space)(multi1),
783
1.04k
          FN(MULTI(BASE),get_space)(multi2));
784
1.04k
  res = FN(MULTI(BASE),alloc)(space);
785
1.04k
786
1.04k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
1.04k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
1.04k
789
2.52k
  for (i = 0; 
i < n12.52k
;
++i1.47k
)
{1.47k
790
1.47k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
1.47k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
1.47k
  }
793
1.04k
794
2.02k
  for (i = 0; 
i < n22.02k
;
++i976
)
{976
795
976
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
976
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
976
  }
798
1.04k
799
1.04k
  FN(MULTI(BASE),free)(multi1);
800
1.04k
  FN(MULTI(BASE),free)(multi2);
801
1.04k
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
1.04k
}
isl_aff.c:isl_multi_aff_range_product_aligned
Line
Count
Source
773
214
{
774
214
  int i, n1, n2;
775
214
  EL *el;
776
214
  isl_space *space;
777
214
  MULTI(BASE) *res;
778
214
779
214
  if (
!multi1 || 214
!multi2214
)
780
0
    goto error;
781
214
782
214
  
space = isl_space_range_product(214
FN214
(MULTI(BASE),get_space)(multi1),
783
214
          FN(MULTI(BASE),get_space)(multi2));
784
214
  res = FN(MULTI(BASE),alloc)(space);
785
214
786
214
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
214
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
214
789
761
  for (i = 0; 
i < n1761
;
++i547
)
{547
790
547
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
547
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
547
  }
793
214
794
446
  for (i = 0; 
i < n2446
;
++i232
)
{232
795
232
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
232
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
232
  }
798
214
799
214
  FN(MULTI(BASE),free)(multi1);
800
214
  FN(MULTI(BASE),free)(multi2);
801
214
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
214
}
isl_aff.c:isl_multi_pw_aff_range_product_aligned
Line
Count
Source
773
5
{
774
5
  int i, n1, n2;
775
5
  EL *el;
776
5
  isl_space *space;
777
5
  MULTI(BASE) *res;
778
5
779
5
  if (
!multi1 || 5
!multi25
)
780
0
    goto error;
781
5
782
5
  
space = isl_space_range_product(5
FN5
(MULTI(BASE),get_space)(multi1),
783
5
          FN(MULTI(BASE),get_space)(multi2));
784
5
  res = FN(MULTI(BASE),alloc)(space);
785
5
786
5
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
5
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
5
789
14
  for (i = 0; 
i < n114
;
++i9
)
{9
790
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
9
  }
793
5
794
14
  for (i = 0; 
i < n214
;
++i9
)
{9
795
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
9
  }
798
5
799
5
  FN(MULTI(BASE),free)(multi1);
800
5
  FN(MULTI(BASE),free)(multi2);
801
5
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
5
}
isl_aff.c:isl_multi_union_pw_aff_range_product_aligned
Line
Count
Source
773
827
{
774
827
  int i, n1, n2;
775
827
  EL *el;
776
827
  isl_space *space;
777
827
  MULTI(BASE) *res;
778
827
779
827
  if (
!multi1 || 827
!multi2827
)
780
0
    goto error;
781
827
782
827
  
space = isl_space_range_product(827
FN827
(MULTI(BASE),get_space)(multi1),
783
827
          FN(MULTI(BASE),get_space)(multi2));
784
827
  res = FN(MULTI(BASE),alloc)(space);
785
827
786
827
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
827
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
827
789
1.74k
  for (i = 0; 
i < n11.74k
;
++i919
)
{919
790
919
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
919
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
919
  }
793
827
794
1.56k
  for (i = 0; 
i < n21.56k
;
++i735
)
{735
795
735
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
735
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
735
  }
798
827
799
827
  FN(MULTI(BASE),free)(multi1);
800
827
  FN(MULTI(BASE),free)(multi2);
801
827
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
827
}
Unexecuted instantiation: isl_val.c:isl_multi_val_range_product_aligned
807
808
/* Given two MULTI(BASE)s A -> B and C -> D,
809
 * construct a MULTI(BASE) (A * C) -> [B -> D].
810
 */
811
__isl_give MULTI(BASE) *FN(MULTI(BASE),range_product)(
812
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
813
1.04k
{
814
1.04k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
1.04k
          &FN(MULTI(BASE),range_product_aligned));
816
1.04k
}
isl_multi_union_pw_aff_range_product
Line
Count
Source
813
827
{
814
827
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
827
          &FN(MULTI(BASE),range_product_aligned));
816
827
}
isl_multi_pw_aff_range_product
Line
Count
Source
813
5
{
814
5
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
5
          &FN(MULTI(BASE),range_product_aligned));
816
5
}
Unexecuted instantiation: isl_multi_val_range_product
isl_multi_aff_range_product
Line
Count
Source
813
214
{
814
214
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
214
          &FN(MULTI(BASE),range_product_aligned));
816
214
}
817
818
/* Is the range of "multi" a wrapped relation?
819
 */
820
isl_bool FN(MULTI(BASE),range_is_wrapping)(__isl_keep MULTI(BASE) *multi)
821
743
{
822
743
  if (!multi)
823
0
    return isl_bool_error;
824
743
  return isl_space_range_is_wrapping(multi->space);
825
743
}
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
743
{
822
743
  if (!multi)
823
0
    return isl_bool_error;
824
743
  return isl_space_range_is_wrapping(multi->space);
825
743
}
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.65k
{
911
1.65k
  int i;
912
1.65k
  EL *el;
913
1.65k
  isl_space *space;
914
1.65k
  MULTI(BASE) *res;
915
1.65k
  int in1, in2, out1, out2;
916
1.65k
917
1.65k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.65k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.65k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.65k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.65k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.65k
          FN(MULTI(BASE),get_space)(multi2));
923
1.65k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.65k
  space = isl_space_domain(space);
925
1.65k
926
2.98k
  for (i = 0; 
i < out12.98k
;
++i1.33k
)
{1.33k
927
1.33k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.33k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.33k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.33k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.33k
  }
932
1.65k
933
3.87k
  for (i = 0; 
i < out23.87k
;
++i2.22k
)
{2.22k
934
2.22k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.22k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.22k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.22k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.22k
  }
939
1.65k
940
1.65k
  isl_space_free(space);
941
1.65k
  FN(MULTI(BASE),free)(multi1);
942
1.65k
  FN(MULTI(BASE),free)(multi2);
943
1.65k
  return res;
944
1.65k
}
Unexecuted instantiation: isl_multi_val_product_aligned
isl_multi_aff_product_aligned
Line
Count
Source
910
1.65k
{
911
1.65k
  int i;
912
1.65k
  EL *el;
913
1.65k
  isl_space *space;
914
1.65k
  MULTI(BASE) *res;
915
1.65k
  int in1, in2, out1, out2;
916
1.65k
917
1.65k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.65k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.65k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.65k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.65k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.65k
          FN(MULTI(BASE),get_space)(multi2));
923
1.65k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.65k
  space = isl_space_domain(space);
925
1.65k
926
2.98k
  for (i = 0; 
i < out12.98k
;
++i1.33k
)
{1.33k
927
1.33k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.33k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.33k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.33k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.33k
  }
932
1.65k
933
3.87k
  for (i = 0; 
i < out23.87k
;
++i2.22k
)
{2.22k
934
2.22k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.22k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.22k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.22k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.22k
  }
939
1.65k
940
1.65k
  isl_space_free(space);
941
1.65k
  FN(MULTI(BASE),free)(multi1);
942
1.65k
  FN(MULTI(BASE),free)(multi2);
943
1.65k
  return res;
944
1.65k
}
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.65k
{
952
1.65k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.65k
          &FN(MULTI(BASE),product_aligned));
954
1.65k
}
Unexecuted instantiation: isl_multi_val_product
isl_multi_aff_product
Line
Count
Source
951
1.65k
{
952
1.65k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.65k
          &FN(MULTI(BASE),product_aligned));
954
1.65k
}
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
1.48k
{
960
1.48k
  if (!multi)
961
0
    return NULL;
962
1.48k
963
1.48k
  
if (1.48k
!multi->space->nested[1]1.48k
)
964
0
    return multi;
965
1.48k
966
1.48k
  
multi = 1.48k
FN1.48k
(MULTI(BASE),cow)(multi);
967
1.48k
  if (!multi)
968
0
    return NULL;
969
1.48k
970
1.48k
  multi->space = isl_space_flatten_range(multi->space);
971
1.48k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
1.48k
974
1.48k
  return multi;
975
1.48k
}
Unexecuted instantiation: isl_multi_val_flatten_range
isl_multi_union_pw_aff_flatten_range
Line
Count
Source
959
827
{
960
827
  if (!multi)
961
0
    return NULL;
962
827
963
827
  
if (827
!multi->space->nested[1]827
)
964
0
    return multi;
965
827
966
827
  
multi = 827
FN827
(MULTI(BASE),cow)(multi);
967
827
  if (!multi)
968
0
    return NULL;
969
827
970
827
  multi->space = isl_space_flatten_range(multi->space);
971
827
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
827
974
827
  return multi;
975
827
}
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
658
{
960
658
  if (!multi)
961
0
    return NULL;
962
658
963
658
  
if (658
!multi->space->nested[1]658
)
964
0
    return multi;
965
658
966
658
  
multi = 658
FN658
(MULTI(BASE),cow)(multi);
967
658
  if (!multi)
968
0
    return NULL;
969
658
970
658
  multi->space = isl_space_flatten_range(multi->space);
971
658
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
658
974
658
  return multi;
975
658
}
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
936
{
983
936
  MULTI(BASE) *multi;
984
936
985
936
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
936
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
936
  return multi;
988
936
}
Unexecuted instantiation: isl_multi_val_flat_range_product
isl_multi_aff_flat_range_product
Line
Count
Source
982
108
{
983
108
  MULTI(BASE) *multi;
984
108
985
108
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
108
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
108
  return multi;
988
108
}
isl_multi_pw_aff_flat_range_product
Line
Count
Source
982
1
{
983
1
  MULTI(BASE) *multi;
984
1
985
1
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1
  return multi;
988
1
}
isl_multi_union_pw_aff_flat_range_product
Line
Count
Source
982
827
{
983
827
  MULTI(BASE) *multi;
984
827
985
827
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
827
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
827
  return multi;
988
827
}
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
146
{
1099
146
  int i;
1100
146
  isl_ctx *ctx;
1101
146
1102
146
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
146
  if (
!multi1 || 146
!multi2146
)
1104
0
    goto error;
1105
146
1106
146
  
ctx = 146
FN146
(MULTI(BASE),get_ctx)(multi1);
1107
146
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
146
      "spaces don't match", goto error);
1110
146
1111
392
  
for (i = 0; 146
i < multi1->n392
;
++i246
)
{246
1112
246
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
246
    if (!multi1->p[i])
1114
0
      goto error;
1115
246
  }
1116
146
1117
146
  
FN146
(MULTI(BASE),free)(multi2);146
1118
146
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
146
}
Unexecuted instantiation: isl_val.c:isl_multi_val_bin_op
isl_aff.c:isl_multi_aff_bin_op
Line
Count
Source
1098
3
{
1099
3
  int i;
1100
3
  isl_ctx *ctx;
1101
3
1102
3
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
3
  if (
!multi1 || 3
!multi23
)
1104
0
    goto error;
1105
3
1106
3
  
ctx = 3
FN3
(MULTI(BASE),get_ctx)(multi1);
1107
3
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
3
      "spaces don't match", goto error);
1110
3
1111
6
  
for (i = 0; 3
i < multi1->n6
;
++i3
)
{3
1112
3
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
3
    if (!multi1->p[i])
1114
0
      goto error;
1115
3
  }
1116
3
1117
3
  
FN3
(MULTI(BASE),free)(multi2);3
1118
3
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
3
}
isl_aff.c:isl_multi_union_pw_aff_bin_op
Line
Count
Source
1098
143
{
1099
143
  int i;
1100
143
  isl_ctx *ctx;
1101
143
1102
143
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
143
  if (
!multi1 || 143
!multi2143
)
1104
0
    goto error;
1105
143
1106
143
  
ctx = 143
FN143
(MULTI(BASE),get_ctx)(multi1);
1107
143
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
143
      "spaces don't match", goto error);
1110
143
1111
386
  
for (i = 0; 143
i < multi1->n386
;
++i243
)
{243
1112
243
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
243
    if (!multi1->p[i])
1114
0
      goto error;
1115
243
  }
1116
143
1117
143
  
FN143
(MULTI(BASE),free)(multi2);143
1118
143
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
143
}
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
66
{
1151
66
  return 
FN66
(MULTI(BASE),bin_op)(multi1, multi2, &
FN66
(EL,sub));
1152
66
}
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
66
{
1151
66
  return 
FN66
(MULTI(BASE),bin_op)(multi1, multi2, &
FN66
(EL,sub));
1152
66
}
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
66
{
1159
66
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
66
            &FN(MULTI(BASE),sub_aligned));
1161
66
}
Unexecuted instantiation: isl_multi_val_sub
isl_multi_union_pw_aff_sub
Line
Count
Source
1158
66
{
1159
66
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
66
            &FN(MULTI(BASE),sub_aligned));
1161
66
}
Unexecuted instantiation: isl_multi_pw_aff_sub
Unexecuted instantiation: isl_multi_aff_sub
1162
1163
/* Multiply the elements of "multi" by "v" and return the result.
1164
 */
1165
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_val)(__isl_take MULTI(BASE) *multi,
1166
  __isl_take isl_val *v)
1167
0
{
1168
0
  int i;
1169
0
1170
0
  if (
!multi || 0
!v0
)
1171
0
    goto error;
1172
0
1173
0
  
if (0
isl_val_is_one(v)0
)
{0
1174
0
    isl_val_free(v);
1175
0
    return multi;
1176
0
  }
1177
0
1178
0
  
if (0
!isl_val_is_rat(v)0
)
1179
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1180
0
      "expecting rational factor", goto error);
1181
0
1182
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1183
0
  if (!multi)
1184
0
    return NULL;
1185
0
1186
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1187
0
    multi->p[i] = FN(EL,scale_val)(multi->p[i], isl_val_copy(v));
1188
0
    if (!multi->p[i])
1189
0
      goto error;
1190
0
  }
1191
0
1192
0
  isl_val_free(v);
1193
0
  return multi;
1194
0
error:
1195
0
  isl_val_free(v);
1196
0
  return FN(MULTI(BASE),free)(multi);
1197
0
}
Unexecuted instantiation: isl_multi_aff_scale_val
Unexecuted instantiation: isl_multi_val_scale_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_val
Unexecuted instantiation: isl_multi_pw_aff_scale_val
1198
1199
/* Divide the elements of "multi" by "v" and return the result.
1200
 */
1201
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_val)(
1202
  __isl_take MULTI(BASE) *multi, __isl_take isl_val *v)
1203
0
{
1204
0
  int i;
1205
0
1206
0
  if (
!multi || 0
!v0
)
1207
0
    goto error;
1208
0
1209
0
  
if (0
isl_val_is_one(v)0
)
{0
1210
0
    isl_val_free(v);
1211
0
    return multi;
1212
0
  }
1213
0
1214
0
  
if (0
!isl_val_is_rat(v)0
)
1215
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1216
0
      "expecting rational factor", goto error);
1217
0
  
if (0
isl_val_is_zero(v)0
)
1218
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1219
0
      "cannot scale down by zero", goto error);
1220
0
1221
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1222
0
  if (!multi)
1223
0
    return NULL;
1224
0
1225
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1226
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i],
1227
0
                isl_val_copy(v));
1228
0
    if (!multi->p[i])
1229
0
      goto error;
1230
0
  }
1231
0
1232
0
  isl_val_free(v);
1233
0
  return multi;
1234
0
error:
1235
0
  isl_val_free(v);
1236
0
  return FN(MULTI(BASE),free)(multi);
1237
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_val
Unexecuted instantiation: isl_multi_aff_scale_down_val
Unexecuted instantiation: isl_multi_val_scale_down_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_val
1238
1239
/* Multiply the elements of "multi" by the corresponding element of "mv"
1240
 * and return the result.
1241
 */
1242
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_multi_val)(
1243
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1244
65
{
1245
65
  int i;
1246
65
1247
65
  if (
!multi || 65
!mv65
)
1248
0
    goto error;
1249
65
1250
65
  
if (65
!isl_space_tuple_is_equal(multi->space, isl_dim_out,65
1251
65
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
65
      "spaces don't match", goto error);
1254
65
1255
65
  
multi = 65
FN65
(MULTI(BASE),cow)(multi);
1256
65
  if (!multi)
1257
0
    goto error;
1258
65
1259
205
  
for (i = 0; 65
i < multi->n205
;
++i140
)
{140
1260
140
    isl_val *v;
1261
140
1262
140
    v = isl_multi_val_get_val(mv, i);
1263
140
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
140
    if (!multi->p[i])
1265
0
      goto error;
1266
140
  }
1267
65
1268
65
  isl_multi_val_free(mv);
1269
65
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
65
}
isl_multi_union_pw_aff_scale_multi_val
Line
Count
Source
1244
65
{
1245
65
  int i;
1246
65
1247
65
  if (
!multi || 65
!mv65
)
1248
0
    goto error;
1249
65
1250
65
  
if (65
!isl_space_tuple_is_equal(multi->space, isl_dim_out,65
1251
65
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
65
      "spaces don't match", goto error);
1254
65
1255
65
  
multi = 65
FN65
(MULTI(BASE),cow)(multi);
1256
65
  if (!multi)
1257
0
    goto error;
1258
65
1259
205
  
for (i = 0; 65
i < multi->n205
;
++i140
)
{140
1260
140
    isl_val *v;
1261
140
1262
140
    v = isl_multi_val_get_val(mv, i);
1263
140
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
140
    if (!multi->p[i])
1265
0
      goto error;
1266
140
  }
1267
65
1268
65
  isl_multi_val_free(mv);
1269
65
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
65
}
Unexecuted instantiation: isl_multi_aff_scale_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_multi_val
Unexecuted instantiation: isl_multi_val_scale_multi_val
1274
1275
/* Divide the elements of "multi" by the corresponding element of "mv"
1276
 * and return the result.
1277
 */
1278
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_multi_val)(
1279
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1280
0
{
1281
0
  int i;
1282
0
1283
0
  if (
!multi || 0
!mv0
)
1284
0
    goto error;
1285
0
1286
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
1287
0
          mv->space, isl_dim_set))
1288
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1289
0
      "spaces don't match", goto error);
1290
0
1291
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1292
0
  if (!multi)
1293
0
    return NULL;
1294
0
1295
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1296
0
    isl_val *v;
1297
0
1298
0
    v = isl_multi_val_get_val(mv, i);
1299
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i], v);
1300
0
    if (!multi->p[i])
1301
0
      goto error;
1302
0
  }
1303
0
1304
0
  isl_multi_val_free(mv);
1305
0
  return multi;
1306
0
error:
1307
0
  isl_multi_val_free(mv);
1308
0
  return FN(MULTI(BASE),free)(multi);
1309
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_val_scale_down_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_multi_val
1310
1311
/* Compute the residues of the elements of "multi" modulo
1312
 * the corresponding element of "mv" and return the result.
1313
 */
1314
__isl_give MULTI(BASE) *FN(MULTI(BASE),mod_multi_val)(
1315
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1316
0
{
1317
0
  int i;
1318
0
1319
0
  if (
!multi || 0
!mv0
)
1320
0
    goto error;
1321
0
1322
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
1323
0
          mv->space, isl_dim_set))
1324
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1325
0
      "spaces don't match", goto error);
1326
0
1327
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1328
0
  if (!multi)
1329
0
    return NULL;
1330
0
1331
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1332
0
    isl_val *v;
1333
0
1334
0
    v = isl_multi_val_get_val(mv, i);
1335
0
    multi->p[i] = FN(EL,mod_val)(multi->p[i], v);
1336
0
    if (!multi->p[i])
1337
0
      goto error;
1338
0
  }
1339
0
1340
0
  isl_multi_val_free(mv);
1341
0
  return multi;
1342
0
error:
1343
0
  isl_multi_val_free(mv);
1344
0
  return FN(MULTI(BASE),free)(multi);
1345
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_val_mod_multi_val
Unexecuted instantiation: isl_multi_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_aff_mod_multi_val
1346
1347
#ifndef NO_MOVE_DIMS
1348
/* Move the "n" dimensions of "src_type" starting at "src_pos" of "multi"
1349
 * to dimensions of "dst_type" at "dst_pos".
1350
 *
1351
 * We only support moving input dimensions to parameters and vice versa.
1352
 */
1353
__isl_give MULTI(BASE) *FN(MULTI(BASE),move_dims)(__isl_take MULTI(BASE) *multi,
1354
  enum isl_dim_type dst_type, unsigned dst_pos,
1355
  enum isl_dim_type src_type, unsigned src_pos, unsigned n)
1356
0
{
1357
0
  int i;
1358
0
1359
0
  if (!multi)
1360
0
    return NULL;
1361
0
1362
0
  
if (0
n == 0 &&0
1363
0
      !isl_space_is_named_or_nested(multi->space, src_type) &&
1364
0
      !isl_space_is_named_or_nested(multi->space, dst_type))
1365
0
    return multi;
1366
0
1367
0
  
if (0
dst_type == isl_dim_out || 0
src_type == isl_dim_out0
)
1368
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1369
0
      "cannot move output/set dimension",
1370
0
      return FN(MULTI(BASE),free)(multi));
1371
0
  
if (0
dst_type == isl_dim_div || 0
src_type == isl_dim_div0
)
1372
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1373
0
      "cannot move divs",
1374
0
      return FN(MULTI(BASE),free)(multi));
1375
0
  
if (0
src_pos + n > isl_space_dim(multi->space, src_type)0
)
1376
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1377
0
      "range out of bounds",
1378
0
      return FN(MULTI(BASE),free)(multi));
1379
0
  
if (0
dst_type == src_type0
)
1380
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_unsupported,
1381
0
      "moving dims within the same type not supported",
1382
0
      return FN(MULTI(BASE),free)(multi));
1383
0
1384
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1385
0
  if (!multi)
1386
0
    return NULL;
1387
0
1388
0
  multi->space = isl_space_move_dims(multi->space, dst_type, dst_pos,
1389
0
            src_type, src_pos, n);
1390
0
  if (!multi->space)
1391
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
1392
0
1393
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1394
0
    multi->p[i] = FN(EL,move_dims)(multi->p[i], dst_type, dst_pos,
1395
0
            src_type, src_pos, n);
1396
0
    if (!multi->p[i])
1397
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
1398
0
  }
1399
0
1400
0
  return multi;
1401
0
}
Unexecuted instantiation: isl_multi_pw_aff_move_dims
Unexecuted instantiation: isl_multi_aff_move_dims
1402
#endif
1403
1404
/* Convert a multiple expression defined over a parameter domain
1405
 * into one that is defined over a zero-dimensional set.
1406
 */
1407
__isl_give MULTI(BASE) *FN(MULTI(BASE),from_range)(
1408
  __isl_take MULTI(BASE) *multi)
1409
0
{
1410
0
  isl_space *space;
1411
0
1412
0
  if (!multi)
1413
0
    return NULL;
1414
0
  
if (0
!isl_space_is_set(multi->space)0
)
1415
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1416
0
      "not living in a set space",
1417
0
      return FN(MULTI(BASE),free)(multi));
1418
0
1419
0
  
space = 0
FN0
(MULTI(BASE),get_space)(multi);
1420
0
  space = isl_space_from_range(space);
1421
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
1422
0
1423
0
  return multi;
1424
0
}
Unexecuted instantiation: isl_multi_aff_from_range
Unexecuted instantiation: isl_multi_pw_aff_from_range
Unexecuted instantiation: isl_multi_val_from_range
Unexecuted instantiation: isl_multi_union_pw_aff_from_range
1425
1426
/* Are "multi1" and "multi2" obviously equal?
1427
 */
1428
isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1,
1429
  __isl_keep MULTI(BASE) *multi2)
1430
859
{
1431
859
  int i;
1432
859
  isl_bool equal;
1433
859
1434
859
  if (
!multi1 || 859
!multi2859
)
1435
0
    return isl_bool_error;
1436
859
  
if (859
multi1->n != multi2->n859
)
1437
0
    return isl_bool_false;
1438
859
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
859
  if (
equal < 0 || 859
!equal859
)
1440
0
    return equal;
1441
859
1442
1.02k
  
for (i = 0; 859
i < multi1->n1.02k
;
++i163
)
{947
1443
947
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
947
    if (
equal < 0 || 947
!equal947
)
1445
784
      return equal;
1446
947
  }
1447
859
1448
75
  return isl_bool_true;
1449
859
}
isl_multi_union_pw_aff_plain_is_equal
Line
Count
Source
1430
8
{
1431
8
  int i;
1432
8
  isl_bool equal;
1433
8
1434
8
  if (
!multi1 || 8
!multi28
)
1435
0
    return isl_bool_error;
1436
8
  
if (8
multi1->n != multi2->n8
)
1437
0
    return isl_bool_false;
1438
8
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
8
  if (
equal < 0 || 8
!equal8
)
1440
0
    return equal;
1441
8
1442
24
  
for (i = 0; 8
i < multi1->n24
;
++i16
)
{16
1443
16
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
16
    if (
equal < 0 || 16
!equal16
)
1445
0
      return equal;
1446
16
  }
1447
8
1448
8
  return isl_bool_true;
1449
8
}
isl_multi_aff_plain_is_equal
Line
Count
Source
1430
850
{
1431
850
  int i;
1432
850
  isl_bool equal;
1433
850
1434
850
  if (
!multi1 || 850
!multi2850
)
1435
0
    return isl_bool_error;
1436
850
  
if (850
multi1->n != multi2->n850
)
1437
0
    return isl_bool_false;
1438
850
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
850
  if (
equal < 0 || 850
!equal850
)
1440
0
    return equal;
1441
850
1442
995
  
for (i = 0; 850
i < multi1->n995
;
++i145
)
{929
1443
929
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
929
    if (
equal < 0 || 929
!equal929
)
1445
784
      return equal;
1446
929
  }
1447
850
1448
66
  return isl_bool_true;
1449
850
}
isl_multi_pw_aff_plain_is_equal
Line
Count
Source
1430
1
{
1431
1
  int i;
1432
1
  isl_bool equal;
1433
1
1434
1
  if (
!multi1 || 1
!multi21
)
1435
0
    return isl_bool_error;
1436
1
  
if (1
multi1->n != multi2->n1
)
1437
0
    return isl_bool_false;
1438
1
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1
  if (
equal < 0 || 1
!equal1
)
1440
0
    return equal;
1441
1
1442
3
  
for (i = 0; 1
i < multi1->n3
;
++i2
)
{2
1443
2
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
2
    if (
equal < 0 || 2
!equal2
)
1445
0
      return equal;
1446
2
  }
1447
1
1448
1
  return isl_bool_true;
1449
1
}
Unexecuted instantiation: isl_multi_val_plain_is_equal
1450
1451
/* Does "multi" involve any NaNs?
1452
 */
1453
isl_bool FN(MULTI(BASE),involves_nan)(__isl_keep MULTI(BASE) *multi)
1454
652
{
1455
652
  int i;
1456
652
1457
652
  if (!multi)
1458
0
    return isl_bool_error;
1459
652
  
if (652
multi->n == 0652
)
1460
0
    return isl_bool_false;
1461
652
1462
1.60k
  
for (i = 0; 652
i < multi->n1.60k
;
++i950
)
{952
1463
952
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
952
    if (
has_nan < 0 || 952
has_nan952
)
1465
2
      return has_nan;
1466
952
  }
1467
652
1468
650
  return isl_bool_false;
1469
652
}
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
652
{
1455
652
  int i;
1456
652
1457
652
  if (!multi)
1458
0
    return isl_bool_error;
1459
652
  
if (652
multi->n == 0652
)
1460
0
    return isl_bool_false;
1461
652
1462
1.60k
  
for (i = 0; 652
i < multi->n1.60k
;
++i950
)
{952
1463
952
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
952
    if (
has_nan < 0 || 952
has_nan952
)
1465
2
      return has_nan;
1466
952
  }
1467
652
1468
650
  return isl_bool_false;
1469
652
}
1470
1471
#ifndef NO_DOMAIN
1472
/* Return the shared domain of the elements of "multi".
1473
 */
1474
__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi)
1475
0
{
1476
0
  int i;
1477
0
  isl_set *dom;
1478
0
1479
0
  if (!multi)
1480
0
    return NULL;
1481
0
1482
0
  
dom = isl_set_universe(0
FN0
(MULTI(BASE),get_domain_space)(multi));
1483
0
  for (i = 0; 
i < multi->n0
;
++i0
)
{0
1484
0
    isl_set *dom_i;
1485
0
1486
0
    dom_i = 
FN0
(EL,domain)(
FN0
(FN(MULTI(BASE),get),BASE)(multi, i));
1487
0
    dom = isl_set_intersect(dom, dom_i);
1488
0
  }
1489
0
1490
0
  FN(MULTI(BASE),free)(multi);
1491
0
  return dom;
1492
0
}
1493
#endif
1494
1495
#ifndef NO_NEG
1496
/* Return the opposite of "multi".
1497
 */
1498
__isl_give MULTI(BASE) *FN(MULTI(BASE),neg)(__isl_take MULTI(BASE) *multi)
1499
0
{
1500
0
  int i;
1501
0
1502
0
  multi = FN(MULTI(BASE),cow)(multi);
1503
0
  if (!multi)
1504
0
    return NULL;
1505
0
1506
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1507
0
    multi->p[i] = FN(EL,neg)(multi->p[i]);
1508
0
    if (!multi->p[i])
1509
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
1510
0
  }
1511
0
1512
0
  return multi;
1513
0
}
Unexecuted instantiation: isl_multi_pw_aff_neg
Unexecuted instantiation: isl_multi_aff_neg
Unexecuted instantiation: isl_multi_union_pw_aff_neg
Unexecuted instantiation: isl_multi_val_neg
1514
#endif