Coverage Report

Created: 2017-06-28 17:40

/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
65.7k
{
23
65.7k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
65.7k
}
isl_multi_val_get_ctx
Line
Count
Source
22
6.51k
{
23
6.51k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
6.51k
}
isl_multi_union_pw_aff_get_ctx
Line
Count
Source
22
21.2k
{
23
21.2k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
21.2k
}
isl_multi_pw_aff_get_ctx
Line
Count
Source
22
15.0k
{
23
15.0k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
15.0k
}
isl_multi_aff_get_ctx
Line
Count
Source
22
22.9k
{
23
22.9k
  return multi ? isl_space_get_ctx(multi->space) : NULL;
24
22.9k
}
25
26
__isl_give isl_space *FN(MULTI(BASE),get_space)(__isl_keep MULTI(BASE) *multi)
27
625k
{
28
625k
  return multi ? isl_space_copy(multi->space) : NULL;
29
625k
}
isl_multi_pw_aff_get_space
Line
Count
Source
27
23.0k
{
28
23.0k
  return multi ? isl_space_copy(multi->space) : NULL;
29
23.0k
}
isl_multi_val_get_space
Line
Count
Source
27
13.6k
{
28
13.6k
  return multi ? isl_space_copy(multi->space) : NULL;
29
13.6k
}
isl_multi_aff_get_space
Line
Count
Source
27
569k
{
28
569k
  return multi ? isl_space_copy(multi->space) : NULL;
29
569k
}
isl_multi_union_pw_aff_get_space
Line
Count
Source
27
19.1k
{
28
19.1k
  return multi ? isl_space_copy(multi->space) : NULL;
29
19.1k
}
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
44.2k
{
46
44.2k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
44.2k
}
isl_multi_aff_get_domain_space
Line
Count
Source
45
44.0k
{
46
44.0k
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
44.0k
}
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
115
{
46
115
  return multi ? isl_space_domain(isl_space_copy(multi->space)) : NULL;
47
115
}
Unexecuted instantiation: isl_multi_val_get_domain_space
48
49
__isl_give MULTI(BASE) *FN(MULTI(BASE),alloc)(__isl_take isl_space *space)
50
111k
{
51
111k
  isl_ctx *ctx;
52
111k
  int n;
53
111k
  MULTI(BASE) *multi;
54
111k
55
111k
  if (!space)
56
0
    return NULL;
57
111k
58
111k
  ctx = isl_space_get_ctx(space);
59
111k
  n = isl_space_dim(space, isl_dim_out);
60
111k
  multi = isl_calloc(ctx, MULTI(BASE),
61
111k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
111k
  if (!multi)
63
0
    goto error;
64
111k
65
111k
  multi->space = space;
66
111k
  multi->n = n;
67
111k
  multi->ref = 1;
68
111k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
111k
}
isl_multi_union_pw_aff_alloc
Line
Count
Source
50
7.69k
{
51
7.69k
  isl_ctx *ctx;
52
7.69k
  int n;
53
7.69k
  MULTI(BASE) *multi;
54
7.69k
55
7.69k
  if (!space)
56
0
    return NULL;
57
7.69k
58
7.69k
  ctx = isl_space_get_ctx(space);
59
7.69k
  n = isl_space_dim(space, isl_dim_out);
60
7.69k
  multi = isl_calloc(ctx, MULTI(BASE),
61
7.69k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
7.69k
  if (!multi)
63
0
    goto error;
64
7.69k
65
7.69k
  multi->space = space;
66
7.69k
  multi->n = n;
67
7.69k
  multi->ref = 1;
68
7.69k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
7.69k
}
isl_multi_val_alloc
Line
Count
Source
50
2.28k
{
51
2.28k
  isl_ctx *ctx;
52
2.28k
  int n;
53
2.28k
  MULTI(BASE) *multi;
54
2.28k
55
2.28k
  if (!space)
56
0
    return NULL;
57
2.28k
58
2.28k
  ctx = isl_space_get_ctx(space);
59
2.28k
  n = isl_space_dim(space, isl_dim_out);
60
2.28k
  multi = isl_calloc(ctx, MULTI(BASE),
61
2.28k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
2.28k
  if (!multi)
63
0
    goto error;
64
2.28k
65
2.28k
  multi->space = space;
66
2.28k
  multi->n = n;
67
2.28k
  multi->ref = 1;
68
2.28k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
2.28k
}
isl_multi_aff_alloc
Line
Count
Source
50
94.3k
{
51
94.3k
  isl_ctx *ctx;
52
94.3k
  int n;
53
94.3k
  MULTI(BASE) *multi;
54
94.3k
55
94.3k
  if (!space)
56
0
    return NULL;
57
94.3k
58
94.3k
  ctx = isl_space_get_ctx(space);
59
94.3k
  n = isl_space_dim(space, isl_dim_out);
60
94.3k
  multi = isl_calloc(ctx, MULTI(BASE),
61
94.3k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
94.3k
  if (!multi)
63
0
    goto error;
64
94.3k
65
94.3k
  multi->space = space;
66
94.3k
  multi->n = n;
67
94.3k
  multi->ref = 1;
68
94.3k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
94.3k
}
isl_multi_pw_aff_alloc
Line
Count
Source
50
7.03k
{
51
7.03k
  isl_ctx *ctx;
52
7.03k
  int n;
53
7.03k
  MULTI(BASE) *multi;
54
7.03k
55
7.03k
  if (!space)
56
0
    return NULL;
57
7.03k
58
7.03k
  ctx = isl_space_get_ctx(space);
59
7.03k
  n = isl_space_dim(space, isl_dim_out);
60
7.03k
  multi = isl_calloc(ctx, MULTI(BASE),
61
7.03k
       sizeof(MULTI(BASE)) + (n - 1) * sizeof(struct EL *));
62
7.03k
  if (!multi)
63
0
    goto error;
64
7.03k
65
7.03k
  multi->space = space;
66
7.03k
  multi->n = n;
67
7.03k
  multi->ref = 1;
68
7.03k
  return multi;
69
0
error:
70
0
  isl_space_free(space);
71
0
  return NULL;
72
7.03k
}
73
74
__isl_give MULTI(BASE) *FN(MULTI(BASE),dup)(__isl_keep MULTI(BASE) *multi)
75
69.2k
{
76
69.2k
  int i;
77
69.2k
  MULTI(BASE) *dup;
78
69.2k
79
69.2k
  if (!multi)
80
0
    return NULL;
81
69.2k
82
69.2k
  
dup = 69.2k
FN69.2k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
69.2k
  if (!dup)
84
0
    return NULL;
85
69.2k
86
461k
  
for (i = 0; 69.2k
i < multi->n461k
;
++i392k
)
87
392k
    
dup = 392k
FN392k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
392k
                FN(EL,copy)(multi->p[i]));
89
69.2k
90
69.2k
  return dup;
91
69.2k
}
Unexecuted instantiation: isl_multi_pw_aff_dup
isl_multi_union_pw_aff_dup
Line
Count
Source
75
838
{
76
838
  int i;
77
838
  MULTI(BASE) *dup;
78
838
79
838
  if (!multi)
80
0
    return NULL;
81
838
82
838
  
dup = 838
FN838
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
838
  if (!dup)
84
0
    return NULL;
85
838
86
2.12k
  
for (i = 0; 838
i < multi->n2.12k
;
++i1.29k
)
87
1.29k
    
dup = 1.29k
FN1.29k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
1.29k
                FN(EL,copy)(multi->p[i]));
89
838
90
838
  return dup;
91
838
}
isl_multi_aff_dup
Line
Count
Source
75
68.4k
{
76
68.4k
  int i;
77
68.4k
  MULTI(BASE) *dup;
78
68.4k
79
68.4k
  if (!multi)
80
0
    return NULL;
81
68.4k
82
68.4k
  
dup = 68.4k
FN68.4k
(MULTI(BASE),alloc)(isl_space_copy(multi->space));
83
68.4k
  if (!dup)
84
0
    return NULL;
85
68.4k
86
459k
  
for (i = 0; 68.4k
i < multi->n459k
;
++i391k
)
87
391k
    
dup = 391k
FN391k
(FN(MULTI(BASE),set),BASE)(dup, i,
88
391k
                FN(EL,copy)(multi->p[i]));
89
68.4k
90
68.4k
  return dup;
91
68.4k
}
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
558k
{
95
558k
  if (!multi)
96
0
    return NULL;
97
558k
98
558k
  
if (558k
multi->ref == 1558k
)
99
489k
    return multi;
100
558k
101
69.2k
  multi->ref--;
102
69.2k
  return FN(MULTI(BASE),dup)(multi);
103
558k
}
isl_multi_union_pw_aff_cow
Line
Count
Source
94
11.1k
{
95
11.1k
  if (!multi)
96
0
    return NULL;
97
11.1k
98
11.1k
  
if (11.1k
multi->ref == 111.1k
)
99
10.3k
    return multi;
100
11.1k
101
838
  multi->ref--;
102
838
  return FN(MULTI(BASE),dup)(multi);
103
11.1k
}
isl_multi_pw_aff_cow
Line
Count
Source
94
23.9k
{
95
23.9k
  if (!multi)
96
0
    return NULL;
97
23.9k
98
23.9k
  
if (23.9k
multi->ref == 123.9k
)
99
23.9k
    return multi;
100
23.9k
101
0
  multi->ref--;
102
0
  return FN(MULTI(BASE),dup)(multi);
103
23.9k
}
isl_multi_val_cow
Line
Count
Source
94
8.31k
{
95
8.31k
  if (!multi)
96
0
    return NULL;
97
8.31k
98
8.31k
  
if (8.31k
multi->ref == 18.31k
)
99
8.30k
    return multi;
100
8.31k
101
3
  multi->ref--;
102
3
  return FN(MULTI(BASE),dup)(multi);
103
8.31k
}
isl_multi_aff_cow
Line
Count
Source
94
514k
{
95
514k
  if (!multi)
96
0
    return NULL;
97
514k
98
514k
  
if (514k
multi->ref == 1514k
)
99
446k
    return multi;
100
514k
101
68.4k
  multi->ref--;
102
68.4k
  return FN(MULTI(BASE),dup)(multi);
103
514k
}
104
105
__isl_give MULTI(BASE) *FN(MULTI(BASE),copy)(__isl_keep MULTI(BASE) *multi)
106
172k
{
107
172k
  if (!multi)
108
378
    return NULL;
109
172k
110
172k
  multi->ref++;
111
172k
  return multi;
112
172k
}
isl_multi_aff_copy
Line
Count
Source
106
149k
{
107
149k
  if (!multi)
108
378
    return NULL;
109
149k
110
149k
  multi->ref++;
111
149k
  return multi;
112
149k
}
Unexecuted instantiation: isl_multi_pw_aff_copy
isl_multi_union_pw_aff_copy
Line
Count
Source
106
13.1k
{
107
13.1k
  if (!multi)
108
0
    return NULL;
109
13.1k
110
13.1k
  multi->ref++;
111
13.1k
  return multi;
112
13.1k
}
isl_multi_val_copy
Line
Count
Source
106
10.0k
{
107
10.0k
  if (!multi)
108
0
    return NULL;
109
10.0k
110
10.0k
  multi->ref++;
111
10.0k
  return multi;
112
10.0k
}
113
114
__isl_null MULTI(BASE) *FN(MULTI(BASE),free)(__isl_take MULTI(BASE) *multi)
115
243k
{
116
243k
  int i;
117
243k
118
243k
  if (!multi)
119
28.6k
    return NULL;
120
243k
121
214k
  
if (214k
--multi->ref > 0214k
)
122
103k
    return NULL;
123
214k
124
111k
  isl_space_free(multi->space);
125
563k
  for (i = 0; 
i < multi->n563k
;
++i451k
)
126
451k
    
FN451k
(EL,free)(multi->p[i])451k
;
127
111k
  free(multi);
128
111k
129
111k
  return NULL;
130
214k
}
isl_multi_union_pw_aff_free
Line
Count
Source
115
20.0k
{
116
20.0k
  int i;
117
20.0k
118
20.0k
  if (!multi)
119
0
    return NULL;
120
20.0k
121
20.0k
  
if (20.0k
--multi->ref > 020.0k
)
122
12.3k
    return NULL;
123
20.0k
124
7.69k
  isl_space_free(multi->space);
125
14.1k
  for (i = 0; 
i < multi->n14.1k
;
++i6.43k
)
126
6.43k
    
FN6.43k
(EL,free)(multi->p[i])6.43k
;
127
7.69k
  free(multi);
128
7.69k
129
7.69k
  return NULL;
130
20.0k
}
isl_multi_val_free
Line
Count
Source
115
12.2k
{
116
12.2k
  int i;
117
12.2k
118
12.2k
  if (!multi)
119
4
    return NULL;
120
12.2k
121
12.2k
  
if (12.2k
--multi->ref > 012.2k
)
122
10.0k
    return NULL;
123
12.2k
124
2.28k
  isl_space_free(multi->space);
125
5.61k
  for (i = 0; 
i < multi->n5.61k
;
++i3.33k
)
126
3.33k
    
FN3.33k
(EL,free)(multi->p[i])3.33k
;
127
2.28k
  free(multi);
128
2.28k
129
2.28k
  return NULL;
130
12.2k
}
isl_multi_aff_free
Line
Count
Source
115
203k
{
116
203k
  int i;
117
203k
118
203k
  if (!multi)
119
28.6k
    return NULL;
120
203k
121
175k
  
if (175k
--multi->ref > 0175k
)
122
80.8k
    return NULL;
123
175k
124
94.3k
  isl_space_free(multi->space);
125
525k
  for (i = 0; 
i < multi->n525k
;
++i431k
)
126
431k
    
FN431k
(EL,free)(multi->p[i])431k
;
127
94.3k
  free(multi);
128
94.3k
129
94.3k
  return NULL;
130
175k
}
isl_multi_pw_aff_free
Line
Count
Source
115
7.03k
{
116
7.03k
  int i;
117
7.03k
118
7.03k
  if (!multi)
119
0
    return NULL;
120
7.03k
121
7.03k
  
if (7.03k
--multi->ref > 07.03k
)
122
0
    return NULL;
123
7.03k
124
7.03k
  isl_space_free(multi->space);
125
17.7k
  for (i = 0; 
i < multi->n17.7k
;
++i10.7k
)
126
10.7k
    
FN10.7k
(EL,free)(multi->p[i])10.7k
;
127
7.03k
  free(multi);
128
7.03k
129
7.03k
  return NULL;
130
7.03k
}
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
612k
{
204
612k
  return multi ? 
isl_space_dim(multi->space, type)612k
:
00
;
205
612k
}
isl_multi_aff_dim
Line
Count
Source
203
577k
{
204
577k
  return multi ? 
isl_space_dim(multi->space, type)577k
:
00
;
205
577k
}
isl_multi_val_dim
Line
Count
Source
203
6.10k
{
204
6.10k
  return multi ? 
isl_space_dim(multi->space, type)6.10k
:
00
;
205
6.10k
}
isl_multi_union_pw_aff_dim
Line
Count
Source
203
19.8k
{
204
19.8k
  return multi ? 
isl_space_dim(multi->space, type)19.8k
:
00
;
205
19.8k
}
isl_multi_pw_aff_dim
Line
Count
Source
203
9.10k
{
204
9.10k
  return multi ? 
isl_space_dim(multi->space, type)9.10k
:
00
;
205
9.10k
}
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
4.27k
{
262
4.27k
  if (!multi)
263
0
    return isl_bool_error;
264
4.27k
  return isl_space_has_tuple_id(multi->space, type);
265
4.27k
}
Unexecuted instantiation: isl_multi_val_has_tuple_id
Unexecuted instantiation: isl_multi_aff_has_tuple_id
isl_multi_pw_aff_has_tuple_id
Line
Count
Source
261
2.12k
{
262
2.12k
  if (!multi)
263
0
    return isl_bool_error;
264
2.12k
  return isl_space_has_tuple_id(multi->space, type);
265
2.12k
}
isl_multi_union_pw_aff_has_tuple_id
Line
Count
Source
261
2.14k
{
262
2.14k
  if (!multi)
263
0
    return isl_bool_error;
264
2.14k
  return isl_space_has_tuple_id(multi->space, type);
265
2.14k
}
266
267
/* Return the id of the specified tuple.
268
 */
269
__isl_give isl_id *FN(MULTI(BASE),get_tuple_id)(__isl_keep MULTI(BASE) *multi,
270
  enum isl_dim_type type)
271
2.12k
{
272
2.12k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
2.12k
}
Unexecuted instantiation: isl_multi_aff_get_tuple_id
isl_multi_pw_aff_get_tuple_id
Line
Count
Source
271
2.12k
{
272
2.12k
  return multi ? isl_space_get_tuple_id(multi->space, type) : NULL;
273
2.12k
}
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
56.6k
{
278
56.6k
  isl_ctx *ctx;
279
56.6k
280
56.6k
  if (!multi)
281
0
    return NULL;
282
56.6k
  
ctx = 56.6k
FN56.6k
(MULTI(BASE),get_ctx)(multi);
283
56.6k
  if (
pos < 0 || 56.6k
pos >= multi->n56.6k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
56.6k
      "index out of bounds", return NULL);
286
56.6k
  
return 56.6k
FN56.6k
(EL,copy)(multi->p[pos]);
287
56.6k
}
isl_multi_val_get_val
Line
Count
Source
277
6.44k
{
278
6.44k
  isl_ctx *ctx;
279
6.44k
280
6.44k
  if (!multi)
281
0
    return NULL;
282
6.44k
  
ctx = 6.44k
FN6.44k
(MULTI(BASE),get_ctx)(multi);
283
6.44k
  if (
pos < 0 || 6.44k
pos >= multi->n6.44k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
6.44k
      "index out of bounds", return NULL);
286
6.44k
  
return 6.44k
FN6.44k
(EL,copy)(multi->p[pos]);
287
6.44k
}
isl_multi_union_pw_aff_get_union_pw_aff
Line
Count
Source
277
16.4k
{
278
16.4k
  isl_ctx *ctx;
279
16.4k
280
16.4k
  if (!multi)
281
0
    return NULL;
282
16.4k
  
ctx = 16.4k
FN16.4k
(MULTI(BASE),get_ctx)(multi);
283
16.4k
  if (
pos < 0 || 16.4k
pos >= multi->n16.4k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
16.4k
      "index out of bounds", return NULL);
286
16.4k
  
return 16.4k
FN16.4k
(EL,copy)(multi->p[pos]);
287
16.4k
}
isl_multi_pw_aff_get_pw_aff
Line
Count
Source
277
10.7k
{
278
10.7k
  isl_ctx *ctx;
279
10.7k
280
10.7k
  if (!multi)
281
0
    return NULL;
282
10.7k
  
ctx = 10.7k
FN10.7k
(MULTI(BASE),get_ctx)(multi);
283
10.7k
  if (
pos < 0 || 10.7k
pos >= multi->n10.7k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
10.7k
      "index out of bounds", return NULL);
286
10.7k
  
return 10.7k
FN10.7k
(EL,copy)(multi->p[pos]);
287
10.7k
}
isl_multi_aff_get_aff
Line
Count
Source
277
22.9k
{
278
22.9k
  isl_ctx *ctx;
279
22.9k
280
22.9k
  if (!multi)
281
0
    return NULL;
282
22.9k
  
ctx = 22.9k
FN22.9k
(MULTI(BASE),get_ctx)(multi);
283
22.9k
  if (
pos < 0 || 22.9k
pos >= multi->n22.9k
)
284
0
    isl_die(ctx, isl_error_invalid,
285
22.9k
      "index out of bounds", return NULL);
286
22.9k
  
return 22.9k
FN22.9k
(EL,copy)(multi->p[pos]);
287
22.9k
}
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
461k
{
292
461k
  isl_space *multi_space = NULL;
293
461k
  isl_space *el_space = NULL;
294
461k
  isl_bool match;
295
461k
296
461k
  multi = FN(MULTI(BASE),cow)(multi);
297
461k
  if (
!multi || 461k
!el461k
)
298
0
    goto error;
299
461k
300
461k
  
multi_space = 461k
FN461k
(MULTI(BASE),get_space)(multi);
301
461k
  match = FN(EL,matching_params)(el, multi_space);
302
461k
  if (match < 0)
303
0
    goto error;
304
461k
  
if (461k
!match461k
)
{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
461k
  if (
FN461k
(EL,check_match_domain_space)(el, multi_space) < 0461k
)
312
0
    goto error;
313
461k
314
461k
  
if (461k
pos < 0 || 461k
pos >= multi->n461k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
461k
      "index out of bounds", goto error);
317
461k
318
461k
  
FN461k
(EL,free)(multi->p[pos]);461k
319
461k
  multi->p[pos] = el;
320
461k
321
461k
  isl_space_free(multi_space);
322
461k
  isl_space_free(el_space);
323
461k
324
461k
  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
461k
}
isl_multi_val_set_val
Line
Count
Source
291
8.30k
{
292
8.30k
  isl_space *multi_space = NULL;
293
8.30k
  isl_space *el_space = NULL;
294
8.30k
  isl_bool match;
295
8.30k
296
8.30k
  multi = FN(MULTI(BASE),cow)(multi);
297
8.30k
  if (
!multi || 8.30k
!el8.30k
)
298
0
    goto error;
299
8.30k
300
8.30k
  
multi_space = 8.30k
FN8.30k
(MULTI(BASE),get_space)(multi);
301
8.30k
  match = FN(EL,matching_params)(el, multi_space);
302
8.30k
  if (match < 0)
303
0
    goto error;
304
8.30k
  
if (8.30k
!match8.30k
)
{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
8.30k
  if (
FN8.30k
(EL,check_match_domain_space)(el, multi_space) < 08.30k
)
312
0
    goto error;
313
8.30k
314
8.30k
  
if (8.30k
pos < 0 || 8.30k
pos >= multi->n8.30k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
8.30k
      "index out of bounds", goto error);
317
8.30k
318
8.30k
  
FN8.30k
(EL,free)(multi->p[pos]);8.30k
319
8.30k
  multi->p[pos] = el;
320
8.30k
321
8.30k
  isl_space_free(multi_space);
322
8.30k
  isl_space_free(el_space);
323
8.30k
324
8.30k
  return multi;
325
0
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
8.30k
}
isl_multi_aff_set_aff
Line
Count
Source
291
435k
{
292
435k
  isl_space *multi_space = NULL;
293
435k
  isl_space *el_space = NULL;
294
435k
  isl_bool match;
295
435k
296
435k
  multi = FN(MULTI(BASE),cow)(multi);
297
435k
  if (
!multi || 435k
!el435k
)
298
0
    goto error;
299
435k
300
435k
  
multi_space = 435k
FN435k
(MULTI(BASE),get_space)(multi);
301
435k
  match = FN(EL,matching_params)(el, multi_space);
302
435k
  if (match < 0)
303
0
    goto error;
304
435k
  
if (435k
!match435k
)
{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
435k
  if (
FN435k
(EL,check_match_domain_space)(el, multi_space) < 0435k
)
312
0
    goto error;
313
435k
314
435k
  
if (435k
pos < 0 || 435k
pos >= multi->n435k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
435k
      "index out of bounds", goto error);
317
435k
318
435k
  
FN435k
(EL,free)(multi->p[pos]);435k
319
435k
  multi->p[pos] = el;
320
435k
321
435k
  isl_space_free(multi_space);
322
435k
  isl_space_free(el_space);
323
435k
324
435k
  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
435k
}
isl_multi_union_pw_aff_set_union_pw_aff
Line
Count
Source
291
7.05k
{
292
7.05k
  isl_space *multi_space = NULL;
293
7.05k
  isl_space *el_space = NULL;
294
7.05k
  isl_bool match;
295
7.05k
296
7.05k
  multi = FN(MULTI(BASE),cow)(multi);
297
7.05k
  if (
!multi || 7.05k
!el7.05k
)
298
0
    goto error;
299
7.05k
300
7.05k
  
multi_space = 7.05k
FN7.05k
(MULTI(BASE),get_space)(multi);
301
7.05k
  match = FN(EL,matching_params)(el, multi_space);
302
7.05k
  if (match < 0)
303
0
    goto error;
304
7.05k
  
if (7.05k
!match7.05k
)
{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
7.05k
  if (
FN7.05k
(EL,check_match_domain_space)(el, multi_space) < 07.05k
)
312
0
    goto error;
313
7.05k
314
7.05k
  
if (7.05k
pos < 0 || 7.05k
pos >= multi->n7.05k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
7.05k
      "index out of bounds", goto error);
317
7.05k
318
7.05k
  
FN7.05k
(EL,free)(multi->p[pos]);7.05k
319
7.05k
  multi->p[pos] = el;
320
7.05k
321
7.05k
  isl_space_free(multi_space);
322
7.05k
  isl_space_free(el_space);
323
7.05k
324
7.05k
  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
7.05k
}
isl_multi_pw_aff_set_pw_aff
Line
Count
Source
291
10.7k
{
292
10.7k
  isl_space *multi_space = NULL;
293
10.7k
  isl_space *el_space = NULL;
294
10.7k
  isl_bool match;
295
10.7k
296
10.7k
  multi = FN(MULTI(BASE),cow)(multi);
297
10.7k
  if (
!multi || 10.7k
!el10.7k
)
298
0
    goto error;
299
10.7k
300
10.7k
  
multi_space = 10.7k
FN10.7k
(MULTI(BASE),get_space)(multi);
301
10.7k
  match = FN(EL,matching_params)(el, multi_space);
302
10.7k
  if (match < 0)
303
0
    goto error;
304
10.7k
  
if (10.7k
!match10.7k
)
{0
305
0
    multi = FN(MULTI(BASE),align_params)(multi,
306
0
                FN(EL,get_space)(el));
307
0
    isl_space_free(multi_space);
308
0
    multi_space = FN(MULTI(BASE),get_space)(multi);
309
0
    el = FN(EL,align_params)(el, isl_space_copy(multi_space));
310
0
  }
311
10.7k
  if (
FN10.7k
(EL,check_match_domain_space)(el, multi_space) < 010.7k
)
312
0
    goto error;
313
10.7k
314
10.7k
  
if (10.7k
pos < 0 || 10.7k
pos >= multi->n10.7k
)
315
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
316
10.7k
      "index out of bounds", goto error);
317
10.7k
318
10.7k
  
FN10.7k
(EL,free)(multi->p[pos]);10.7k
319
10.7k
  multi->p[pos] = el;
320
10.7k
321
10.7k
  isl_space_free(multi_space);
322
10.7k
  isl_space_free(el_space);
323
10.7k
324
10.7k
  return multi;
325
0
error:
326
0
  FN(MULTI(BASE),free)(multi);
327
0
  FN(EL,free)(el);
328
0
  isl_space_free(multi_space);
329
0
  isl_space_free(el_space);
330
0
  return NULL;
331
10.7k
}
332
333
/* Reset the space of "multi".  This function is called from isl_pw_templ.c
334
 * and doesn't know if the space of an element object is represented
335
 * directly or through its domain.  It therefore passes along both,
336
 * which we pass along to the element function since we don't how
337
 * that is represented either.
338
 */
339
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_space_and_domain)(
340
  __isl_take MULTI(BASE) *multi, __isl_take isl_space *space,
341
  __isl_take isl_space *domain)
342
9.76k
{
343
9.76k
  int i;
344
9.76k
345
9.76k
  multi = FN(MULTI(BASE),cow)(multi);
346
9.76k
  if (
!multi || 9.76k
!space9.76k
||
!domain9.76k
)
347
0
    goto error;
348
9.76k
349
34.2k
  
for (i = 0; 9.76k
i < multi->n34.2k
;
++i24.4k
)
{24.4k
350
24.4k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
24.4k
         isl_space_copy(domain));
352
24.4k
    if (!multi->p[i])
353
0
      goto error;
354
24.4k
  }
355
9.76k
  isl_space_free(domain);
356
9.76k
  isl_space_free(multi->space);
357
9.76k
  multi->space = space;
358
9.76k
359
9.76k
  return multi;
360
0
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
9.76k
}
isl_multi_union_pw_aff_reset_space_and_domain
Line
Count
Source
342
129
{
343
129
  int i;
344
129
345
129
  multi = FN(MULTI(BASE),cow)(multi);
346
129
  if (
!multi || 129
!space129
||
!domain129
)
347
0
    goto error;
348
129
349
280
  
for (i = 0; 129
i < multi->n280
;
++i151
)
{151
350
151
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
151
         isl_space_copy(domain));
352
151
    if (!multi->p[i])
353
0
      goto error;
354
151
  }
355
129
  isl_space_free(domain);
356
129
  isl_space_free(multi->space);
357
129
  multi->space = space;
358
129
359
129
  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
129
}
isl_multi_pw_aff_reset_space_and_domain
Line
Count
Source
342
6.59k
{
343
6.59k
  int i;
344
6.59k
345
6.59k
  multi = FN(MULTI(BASE),cow)(multi);
346
6.59k
  if (
!multi || 6.59k
!space6.59k
||
!domain6.59k
)
347
0
    goto error;
348
6.59k
349
24.7k
  
for (i = 0; 6.59k
i < multi->n24.7k
;
++i18.1k
)
{18.1k
350
18.1k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
18.1k
         isl_space_copy(domain));
352
18.1k
    if (!multi->p[i])
353
0
      goto error;
354
18.1k
  }
355
6.59k
  isl_space_free(domain);
356
6.59k
  isl_space_free(multi->space);
357
6.59k
  multi->space = space;
358
6.59k
359
6.59k
  return multi;
360
0
error:
361
0
  isl_space_free(domain);
362
0
  isl_space_free(space);
363
0
  FN(MULTI(BASE),free)(multi);
364
0
  return NULL;
365
6.59k
}
isl_multi_aff_reset_space_and_domain
Line
Count
Source
342
3.03k
{
343
3.03k
  int i;
344
3.03k
345
3.03k
  multi = FN(MULTI(BASE),cow)(multi);
346
3.03k
  if (
!multi || 3.03k
!space3.03k
||
!domain3.03k
)
347
0
    goto error;
348
3.03k
349
9.23k
  
for (i = 0; 3.03k
i < multi->n9.23k
;
++i6.19k
)
{6.19k
350
6.19k
    multi->p[i] = FN(EL,reset_domain_space)(multi->p[i],
351
6.19k
         isl_space_copy(domain));
352
6.19k
    if (!multi->p[i])
353
0
      goto error;
354
6.19k
  }
355
3.03k
  isl_space_free(domain);
356
3.03k
  isl_space_free(multi->space);
357
3.03k
  multi->space = space;
358
3.03k
359
3.03k
  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
3.03k
}
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
125
{
370
125
  isl_space *space;
371
125
372
125
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
125
            isl_space_copy(multi->space));
374
125
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
125
}
isl_multi_union_pw_aff_reset_domain_space
Line
Count
Source
369
115
{
370
115
  isl_space *space;
371
115
372
115
  space = isl_space_extend_domain_with_range(isl_space_copy(domain),
373
115
            isl_space_copy(multi->space));
374
115
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
375
115
}
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
8.15k
{
380
8.15k
  isl_space *domain;
381
8.15k
382
8.15k
  domain = isl_space_domain(isl_space_copy(space));
383
8.15k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
8.15k
}
isl_multi_aff_reset_space
Line
Count
Source
379
1.54k
{
380
1.54k
  isl_space *domain;
381
1.54k
382
1.54k
  domain = isl_space_domain(isl_space_copy(space));
383
1.54k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
1.54k
}
isl_multi_pw_aff_reset_space
Line
Count
Source
379
6.59k
{
380
6.59k
  isl_space *domain;
381
6.59k
382
6.59k
  domain = isl_space_domain(isl_space_copy(space));
383
6.59k
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
6.59k
}
isl_multi_union_pw_aff_reset_space
Line
Count
Source
379
14
{
380
14
  isl_space *domain;
381
14
382
14
  domain = isl_space_domain(isl_space_copy(space));
383
14
  return FN(MULTI(BASE),reset_space_and_domain)(multi, space, domain);
384
14
}
Unexecuted instantiation: isl_multi_val_reset_space
385
386
/* Set the id of the given dimension of "multi" to "id".
387
 */
388
__isl_give MULTI(BASE) *FN(MULTI(BASE),set_dim_id)(
389
  __isl_take MULTI(BASE) *multi,
390
  enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
391
6.59k
{
392
6.59k
  isl_space *space;
393
6.59k
394
6.59k
  multi = FN(MULTI(BASE),cow)(multi);
395
6.59k
  if (
!multi || 6.59k
!id6.59k
)
396
0
    goto error;
397
6.59k
398
6.59k
  
space = 6.59k
FN6.59k
(MULTI(BASE),get_space)(multi);
399
6.59k
  space = isl_space_set_dim_id(space, type, pos, id);
400
6.59k
401
6.59k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
6.59k
}
Unexecuted instantiation: isl_multi_union_pw_aff_set_dim_id
Unexecuted instantiation: isl_multi_aff_set_dim_id
Unexecuted instantiation: isl_multi_val_set_dim_id
isl_multi_pw_aff_set_dim_id
Line
Count
Source
391
6.59k
{
392
6.59k
  isl_space *space;
393
6.59k
394
6.59k
  multi = FN(MULTI(BASE),cow)(multi);
395
6.59k
  if (
!multi || 6.59k
!id6.59k
)
396
0
    goto error;
397
6.59k
398
6.59k
  
space = 6.59k
FN6.59k
(MULTI(BASE),get_space)(multi);
399
6.59k
  space = isl_space_set_dim_id(space, type, pos, id);
400
6.59k
401
6.59k
  return FN(MULTI(BASE),reset_space)(multi, space);
402
0
error:
403
0
  isl_id_free(id);
404
0
  FN(MULTI(BASE),free)(multi);
405
0
  return NULL;
406
6.59k
}
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
88
{
428
88
  isl_space *space;
429
88
430
88
  multi = FN(MULTI(BASE),cow)(multi);
431
88
  if (!multi)
432
0
    goto error;
433
88
434
88
  
space = 88
FN88
(MULTI(BASE),get_space)(multi);
435
88
  space = isl_space_set_tuple_id(space, type, id);
436
88
437
88
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
88
}
isl_multi_aff_set_tuple_id
Line
Count
Source
427
85
{
428
85
  isl_space *space;
429
85
430
85
  multi = FN(MULTI(BASE),cow)(multi);
431
85
  if (!multi)
432
0
    goto error;
433
85
434
85
  
space = 85
FN85
(MULTI(BASE),get_space)(multi);
435
85
  space = isl_space_set_tuple_id(space, type, id);
436
85
437
85
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
85
}
Unexecuted instantiation: isl_multi_pw_aff_set_tuple_id
Unexecuted instantiation: isl_multi_val_set_tuple_id
isl_multi_union_pw_aff_set_tuple_id
Line
Count
Source
427
3
{
428
3
  isl_space *space;
429
3
430
3
  multi = FN(MULTI(BASE),cow)(multi);
431
3
  if (!multi)
432
0
    goto error;
433
3
434
3
  
space = 3
FN3
(MULTI(BASE),get_space)(multi);
435
3
  space = isl_space_set_tuple_id(space, type, id);
436
3
437
3
  return FN(MULTI(BASE),reset_space)(multi, space);
438
0
error:
439
0
  isl_id_free(id);
440
0
  return NULL;
441
3
}
442
443
/* Drop the id on the specified tuple.
444
 */
445
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_tuple_id)(
446
  __isl_take MULTI(BASE) *multi, enum isl_dim_type type)
447
2.14k
{
448
2.14k
  isl_space *space;
449
2.14k
450
2.14k
  if (!multi)
451
0
    return NULL;
452
2.14k
  
if (2.14k
!2.14k
FN2.14k
(MULTI(BASE),has_tuple_id)(multi, type))
453
2.13k
    return multi;
454
2.14k
455
11
  
multi = 11
FN11
(MULTI(BASE),cow)(multi);
456
11
  if (!multi)
457
0
    return NULL;
458
11
459
11
  
space = 11
FN11
(MULTI(BASE),get_space)(multi);
460
11
  space = isl_space_reset_tuple_id(space, type);
461
11
462
11
  return FN(MULTI(BASE),reset_space)(multi, space);
463
11
}
Unexecuted instantiation: isl_multi_pw_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_aff_reset_tuple_id
Unexecuted instantiation: isl_multi_val_reset_tuple_id
isl_multi_union_pw_aff_reset_tuple_id
Line
Count
Source
447
2.14k
{
448
2.14k
  isl_space *space;
449
2.14k
450
2.14k
  if (!multi)
451
0
    return NULL;
452
2.14k
  
if (2.14k
!2.14k
FN2.14k
(MULTI(BASE),has_tuple_id)(multi, type))
453
2.13k
    return multi;
454
2.14k
455
11
  
multi = 11
FN11
(MULTI(BASE),cow)(multi);
456
11
  if (!multi)
457
0
    return NULL;
458
11
459
11
  
space = 11
FN11
(MULTI(BASE),get_space)(multi);
460
11
  space = isl_space_reset_tuple_id(space, type);
461
11
462
11
  return FN(MULTI(BASE),reset_space)(multi, space);
463
11
}
464
465
/* Reset the user pointer on all identifiers of parameters and tuples
466
 * of the space of "multi".
467
 */
468
__isl_give MULTI(BASE) *FN(MULTI(BASE),reset_user)(
469
  __isl_take MULTI(BASE) *multi)
470
0
{
471
0
  isl_space *space;
472
0
473
0
  space = FN(MULTI(BASE),get_space)(multi);
474
0
  space = isl_space_reset_user(space);
475
0
476
0
  return FN(MULTI(BASE),reset_space)(multi, space);
477
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_reset_user
Unexecuted instantiation: isl_multi_pw_aff_reset_user
Unexecuted instantiation: isl_multi_val_reset_user
Unexecuted instantiation: isl_multi_aff_reset_user
478
479
__isl_give MULTI(BASE) *FN(MULTI(BASE),realign_domain)(
480
  __isl_take MULTI(BASE) *multi, __isl_take isl_reordering *exp)
481
125
{
482
125
  int i;
483
125
484
125
  multi = FN(MULTI(BASE),cow)(multi);
485
125
  if (
!multi || 125
!exp125
)
486
0
    goto error;
487
125
488
240
  
for (i = 0; 125
i < multi->n240
;
++i115
)
{115
489
115
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
115
            isl_reordering_copy(exp));
491
115
    if (!multi->p[i])
492
0
      goto error;
493
115
  }
494
125
495
125
  
multi = 125
FN125
(MULTI(BASE),reset_domain_space)(multi,
496
125
                isl_space_copy(exp->dim));
497
125
498
125
  isl_reordering_free(exp);
499
125
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
125
}
Unexecuted instantiation: isl_multi_pw_aff_realign_domain
isl_multi_union_pw_aff_realign_domain
Line
Count
Source
481
115
{
482
115
  int i;
483
115
484
115
  multi = FN(MULTI(BASE),cow)(multi);
485
115
  if (
!multi || 115
!exp115
)
486
0
    goto error;
487
115
488
230
  
for (i = 0; 115
i < multi->n230
;
++i115
)
{115
489
115
    multi->p[i] = FN(EL,realign_domain)(multi->p[i],
490
115
            isl_reordering_copy(exp));
491
115
    if (!multi->p[i])
492
0
      goto error;
493
115
  }
494
115
495
115
  
multi = 115
FN115
(MULTI(BASE),reset_domain_space)(multi,
496
115
                isl_space_copy(exp->dim));
497
115
498
115
  isl_reordering_free(exp);
499
115
  return multi;
500
0
error:
501
0
  isl_reordering_free(exp);
502
0
  FN(MULTI(BASE),free)(multi);
503
0
  return NULL;
504
115
}
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.53k
{
511
2.53k
  isl_ctx *ctx;
512
2.53k
  isl_bool equal_params;
513
2.53k
  isl_reordering *exp;
514
2.53k
515
2.53k
  if (
!multi || 2.53k
!model2.53k
)
516
0
    goto error;
517
2.53k
518
2.53k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
2.53k
  if (equal_params < 0)
520
0
    goto error;
521
2.53k
  
if (2.53k
equal_params2.53k
)
{2.41k
522
2.41k
    isl_space_free(model);
523
2.41k
    return multi;
524
2.41k
  }
525
2.53k
526
125
  ctx = isl_space_get_ctx(model);
527
125
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
125
      "model has unnamed parameters", goto error);
530
125
  
if (125
!isl_space_has_named_params(multi->space)125
)
531
0
    isl_die(ctx, isl_error_invalid,
532
125
      "input has unnamed parameters", goto error);
533
125
534
125
  model = isl_space_params(model);
535
125
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
125
  exp = isl_reordering_extend_space(exp,
537
125
            FN(MULTI(BASE),get_domain_space)(multi));
538
125
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
125
540
125
  isl_space_free(model);
541
125
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
125
}
isl_multi_union_pw_aff_align_params
Line
Count
Source
510
912
{
511
912
  isl_ctx *ctx;
512
912
  isl_bool equal_params;
513
912
  isl_reordering *exp;
514
912
515
912
  if (
!multi || 912
!model912
)
516
0
    goto error;
517
912
518
912
  equal_params = isl_space_has_equal_params(multi->space, model);
519
912
  if (equal_params < 0)
520
0
    goto error;
521
912
  
if (912
equal_params912
)
{797
522
797
    isl_space_free(model);
523
797
    return multi;
524
797
  }
525
912
526
115
  ctx = isl_space_get_ctx(model);
527
115
  if (!isl_space_has_named_params(model))
528
0
    isl_die(ctx, isl_error_invalid,
529
115
      "model has unnamed parameters", goto error);
530
115
  
if (115
!isl_space_has_named_params(multi->space)115
)
531
0
    isl_die(ctx, isl_error_invalid,
532
115
      "input has unnamed parameters", goto error);
533
115
534
115
  model = isl_space_params(model);
535
115
  exp = isl_parameter_alignment_reordering(multi->space, model);
536
115
  exp = isl_reordering_extend_space(exp,
537
115
            FN(MULTI(BASE),get_domain_space)(multi));
538
115
  multi = FN(MULTI(BASE),realign_domain)(multi, exp);
539
115
540
115
  isl_space_free(model);
541
115
  return multi;
542
0
error:
543
0
  isl_space_free(model);
544
0
  FN(MULTI(BASE),free)(multi);
545
0
  return NULL;
546
115
}
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.62k
{
511
1.62k
  isl_ctx *ctx;
512
1.62k
  isl_bool equal_params;
513
1.62k
  isl_reordering *exp;
514
1.62k
515
1.62k
  if (
!multi || 1.62k
!model1.62k
)
516
0
    goto error;
517
1.62k
518
1.62k
  equal_params = isl_space_has_equal_params(multi->space, model);
519
1.62k
  if (equal_params < 0)
520
0
    goto error;
521
1.62k
  
if (1.62k
equal_params1.62k
)
{1.61k
522
1.61k
    isl_space_free(model);
523
1.61k
    return multi;
524
1.61k
  }
525
1.62k
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.65k
{
551
4.65k
  int i;
552
4.65k
  int n;
553
4.65k
  isl_ctx *ctx;
554
4.65k
  MULTI(BASE) *multi;
555
4.65k
556
4.65k
  if (
!space || 4.65k
!list4.64k
)
557
2
    goto error;
558
4.65k
559
4.64k
  ctx = isl_space_get_ctx(space);
560
4.64k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.64k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.64k
      "invalid number of elements in list", goto error);
564
4.64k
565
4.64k
  
multi = 4.64k
FN4.64k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
11.3k
  for (i = 0; 
i < n11.3k
;
++i6.67k
)
{6.67k
567
6.67k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.67k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.67k
  }
570
4.64k
571
4.64k
  isl_space_free(space);
572
4.64k
  FN(LIST(EL),free)(list);
573
4.64k
  return multi;
574
2
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
4.64k
}
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.62k
{
551
4.62k
  int i;
552
4.62k
  int n;
553
4.62k
  isl_ctx *ctx;
554
4.62k
  MULTI(BASE) *multi;
555
4.62k
556
4.62k
  if (
!space || 4.62k
!list4.62k
)
557
2
    goto error;
558
4.62k
559
4.62k
  ctx = isl_space_get_ctx(space);
560
4.62k
  n = FN(FN(LIST(EL),n),BASE)(list);
561
4.62k
  if (n != isl_space_dim(space, isl_dim_out))
562
0
    isl_die(ctx, isl_error_invalid,
563
4.62k
      "invalid number of elements in list", goto error);
564
4.62k
565
4.62k
  
multi = 4.62k
FN4.62k
(MULTI(BASE),alloc)(isl_space_copy(space));
566
11.2k
  for (i = 0; 
i < n11.2k
;
++i6.62k
)
{6.62k
567
6.62k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
568
6.62k
          FN(FN(LIST(EL),get),BASE)(list, i));
569
6.62k
  }
570
4.62k
571
4.62k
  isl_space_free(space);
572
4.62k
  FN(LIST(EL),free)(list);
573
4.62k
  return multi;
574
2
error:
575
2
  isl_space_free(space);
576
2
  FN(LIST(EL),free)(list);
577
2
  return NULL;
578
4.62k
}
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
4.27k
{
586
4.27k
  int i, n;
587
4.27k
  isl_local_space *ls;
588
4.27k
  MULTI(BASE) *multi;
589
4.27k
590
4.27k
  if (!space)
591
0
    return NULL;
592
4.27k
593
4.27k
  
if (4.27k
isl_space_is_set(space)4.27k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
4.27k
      "expecting map space", goto error);
596
4.27k
597
4.27k
  n = isl_space_dim(space, isl_dim_out);
598
4.27k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
4.27k
      "number of input and output dimensions needs to be "
601
4.27k
      "the same", goto error);
602
4.27k
603
4.27k
  
multi = 4.27k
FN4.27k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
4.27k
605
4.27k
  if (
!n4.27k
)
{2.06k
606
2.06k
    isl_space_free(space);
607
2.06k
    return multi;
608
2.06k
  }
609
4.27k
610
2.20k
  space = isl_space_domain(space);
611
2.20k
  ls = isl_local_space_from_space(space);
612
2.20k
613
10.4k
  for (i = 0; 
i < n10.4k
;
++i8.24k
)
{8.24k
614
8.24k
    EL *el;
615
8.24k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
8.24k
            isl_dim_set, i);
617
8.24k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
8.24k
  }
619
2.20k
620
2.20k
  isl_local_space_free(ls);
621
2.20k
622
2.20k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
4.27k
}
Unexecuted instantiation: isl_multi_pw_aff_identity
isl_multi_aff_identity
Line
Count
Source
585
4.27k
{
586
4.27k
  int i, n;
587
4.27k
  isl_local_space *ls;
588
4.27k
  MULTI(BASE) *multi;
589
4.27k
590
4.27k
  if (!space)
591
0
    return NULL;
592
4.27k
593
4.27k
  
if (4.27k
isl_space_is_set(space)4.27k
)
594
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
595
4.27k
      "expecting map space", goto error);
596
4.27k
597
4.27k
  n = isl_space_dim(space, isl_dim_out);
598
4.27k
  if (n != isl_space_dim(space, isl_dim_in))
599
0
    isl_die(isl_space_get_ctx(space), isl_error_invalid,
600
4.27k
      "number of input and output dimensions needs to be "
601
4.27k
      "the same", goto error);
602
4.27k
603
4.27k
  
multi = 4.27k
FN4.27k
(MULTI(BASE),alloc)(isl_space_copy(space));
604
4.27k
605
4.27k
  if (
!n4.27k
)
{2.06k
606
2.06k
    isl_space_free(space);
607
2.06k
    return multi;
608
2.06k
  }
609
4.27k
610
2.20k
  space = isl_space_domain(space);
611
2.20k
  ls = isl_local_space_from_space(space);
612
2.20k
613
10.4k
  for (i = 0; 
i < n10.4k
;
++i8.24k
)
{8.24k
614
8.24k
    EL *el;
615
8.24k
    el = FN(EL,var_on_domain)(isl_local_space_copy(ls),
616
8.24k
            isl_dim_set, i);
617
8.24k
    multi = FN(FN(MULTI(BASE),set),BASE)(multi, i, el);
618
8.24k
  }
619
2.20k
620
2.20k
  isl_local_space_free(ls);
621
2.20k
622
2.20k
  return multi;
623
0
error:
624
0
  isl_space_free(space);
625
0
  return NULL;
626
4.27k
}
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.71k
{
635
4.71k
  int n;
636
4.71k
  MULTI(BASE) *multi;
637
4.71k
638
4.71k
  if (!space)
639
0
    return NULL;
640
4.71k
641
4.71k
  n = isl_space_dim(space , isl_dim_out);
642
4.71k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
4.71k
644
4.71k
  if (!n)
645
1.19k
    isl_space_free(space);
646
3.52k
  else {
647
3.52k
    int i;
648
3.52k
    isl_local_space *ls;
649
3.52k
    EL *el;
650
3.52k
651
3.52k
    space = isl_space_domain(space);
652
3.52k
    ls = isl_local_space_from_space(space);
653
3.52k
    el = FN(EL,zero_on_domain)(ls);
654
3.52k
655
8.58k
    for (i = 0; 
i < n8.58k
;
++i5.05k
)
656
5.05k
      
multi = 5.05k
FN5.05k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
5.05k
                  FN(EL,copy)(el));
658
3.52k
659
3.52k
    FN(EL,free)(el);
660
3.52k
  }
661
4.71k
662
4.71k
  return multi;
663
4.71k
}
isl_multi_aff_zero
Line
Count
Source
634
2.45k
{
635
2.45k
  int n;
636
2.45k
  MULTI(BASE) *multi;
637
2.45k
638
2.45k
  if (!space)
639
0
    return NULL;
640
2.45k
641
2.45k
  n = isl_space_dim(space , isl_dim_out);
642
2.45k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.45k
644
2.45k
  if (!n)
645
1.17k
    isl_space_free(space);
646
1.27k
  else {
647
1.27k
    int i;
648
1.27k
    isl_local_space *ls;
649
1.27k
    EL *el;
650
1.27k
651
1.27k
    space = isl_space_domain(space);
652
1.27k
    ls = isl_local_space_from_space(space);
653
1.27k
    el = FN(EL,zero_on_domain)(ls);
654
1.27k
655
3.03k
    for (i = 0; 
i < n3.03k
;
++i1.75k
)
656
1.75k
      
multi = 1.75k
FN1.75k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
1.75k
                  FN(EL,copy)(el));
658
1.27k
659
1.27k
    FN(EL,free)(el);
660
1.27k
  }
661
2.45k
662
2.45k
  return multi;
663
2.45k
}
Unexecuted instantiation: isl_multi_pw_aff_zero
isl_multi_val_zero
Line
Count
Source
634
2.26k
{
635
2.26k
  int n;
636
2.26k
  MULTI(BASE) *multi;
637
2.26k
638
2.26k
  if (!space)
639
0
    return NULL;
640
2.26k
641
2.26k
  n = isl_space_dim(space , isl_dim_out);
642
2.26k
  multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
643
2.26k
644
2.26k
  if (!n)
645
23
    isl_space_free(space);
646
2.24k
  else {
647
2.24k
    int i;
648
2.24k
    isl_local_space *ls;
649
2.24k
    EL *el;
650
2.24k
651
2.24k
    space = isl_space_domain(space);
652
2.24k
    ls = isl_local_space_from_space(space);
653
2.24k
    el = FN(EL,zero_on_domain)(ls);
654
2.24k
655
5.54k
    for (i = 0; 
i < n5.54k
;
++i3.30k
)
656
3.30k
      
multi = 3.30k
FN3.30k
(FN(MULTI(BASE),set),BASE)(multi, i,
657
3.30k
                  FN(EL,copy)(el));
658
2.24k
659
2.24k
    FN(EL,free)(el);
660
2.24k
  }
661
2.26k
662
2.26k
  return multi;
663
2.26k
}
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
870
{
697
870
  int i;
698
870
  unsigned dim;
699
870
700
870
  multi = FN(MULTI(BASE),cow)(multi);
701
870
  if (!multi)
702
0
    return NULL;
703
870
704
870
  
dim = 870
FN870
(MULTI(BASE),dim)(multi, type);
705
870
  if (
first + n > dim || 870
first + n < first870
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
870
      "index out of bounds",
708
870
      return FN(MULTI(BASE),cow)(multi));
709
870
710
870
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
870
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
870
714
870
  
if (870
type == isl_dim_out870
)
{808
715
1.68k
    for (i = 0; 
i < n1.68k
;
++i880
)
716
880
      
FN880
(EL,free)(multi->p[first + i])880
;
717
1.41k
    for (i = first; 
i + n < multi->n1.41k
;
++i611
)
718
611
      multi->p[i] = multi->p[i + n];
719
808
    multi->n -= n;
720
808
721
808
    return multi;
722
808
  }
723
870
724
296
  
for (i = 0; 62
i < multi->n296
;
++i234
)
{234
725
234
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
234
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
234
  }
729
62
730
62
  return multi;
731
62
}
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
810
{
697
810
  int i;
698
810
  unsigned dim;
699
810
700
810
  multi = FN(MULTI(BASE),cow)(multi);
701
810
  if (!multi)
702
0
    return NULL;
703
810
704
810
  
dim = 810
FN810
(MULTI(BASE),dim)(multi, type);
705
810
  if (
first + n > dim || 810
first + n < first810
)
706
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
707
810
      "index out of bounds",
708
810
      return FN(MULTI(BASE),cow)(multi));
709
810
710
810
  multi->space = isl_space_drop_dims(multi->space, type, first, n);
711
810
  if (!multi->space)
712
0
    
return 0
FN0
(MULTI(BASE),cow)(multi);
713
810
714
810
  
if (810
type == isl_dim_out810
)
{748
715
1.55k
    for (i = 0; 
i < n1.55k
;
++i805
)
716
805
      
FN805
(EL,free)(multi->p[first + i])805
;
717
1.32k
    for (i = first; 
i + n < multi->n1.32k
;
++i575
)
718
575
      multi->p[i] = multi->p[i + n];
719
748
    multi->n -= n;
720
748
721
748
    return multi;
722
748
  }
723
810
724
296
  
for (i = 0; 62
i < multi->n296
;
++i234
)
{234
725
234
    multi->p[i] = FN(EL,drop_dims)(multi->p[i], type, first, n);
726
234
    if (!multi->p[i])
727
0
      
return 0
FN0
(MULTI(BASE),cow)(multi);
728
234
  }
729
62
730
62
  return multi;
731
62
}
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
5.32k
{
740
5.32k
  isl_ctx *ctx;
741
5.32k
  isl_bool equal_params;
742
5.32k
743
5.32k
  if (
!multi1 || 5.32k
!multi25.32k
)
744
0
    goto error;
745
5.32k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
5.32k
  if (equal_params < 0)
747
0
    goto error;
748
5.32k
  
if (5.32k
equal_params5.32k
)
749
5.32k
    return fn(multi1, multi2);
750
8
  
ctx = 8
FN8
(MULTI(BASE),get_ctx)(multi1);
751
8
  if (!isl_space_has_named_params(multi1->space) ||
752
8
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
8
      "unaligned unnamed parameters", goto error);
755
8
  
multi1 = 8
FN8
(MULTI(BASE),align_params)(multi1,
756
8
              FN(MULTI(BASE),get_space)(multi2));
757
8
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
8
              FN(MULTI(BASE),get_space)(multi1));
759
8
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
8
}
Unexecuted instantiation: isl_val.c:isl_multi_val_align_params_multi_multi_and
isl_aff.c:isl_multi_aff_align_params_multi_multi_and
Line
Count
Source
739
3.47k
{
740
3.47k
  isl_ctx *ctx;
741
3.47k
  isl_bool equal_params;
742
3.47k
743
3.47k
  if (
!multi1 || 3.47k
!multi23.47k
)
744
0
    goto error;
745
3.47k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
3.47k
  if (equal_params < 0)
747
0
    goto error;
748
3.47k
  
if (3.47k
equal_params3.47k
)
749
3.47k
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  
multi1 = 0
FN0
(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
0
}
isl_aff.c:isl_multi_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
5
{
740
5
  isl_ctx *ctx;
741
5
  isl_bool equal_params;
742
5
743
5
  if (
!multi1 || 5
!multi25
)
744
0
    goto error;
745
5
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
5
  if (equal_params < 0)
747
0
    goto error;
748
5
  
if (5
equal_params5
)
749
5
    return fn(multi1, multi2);
750
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi1);
751
0
  if (!isl_space_has_named_params(multi1->space) ||
752
0
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
0
      "unaligned unnamed parameters", goto error);
755
0
  
multi1 = 0
FN0
(MULTI(BASE),align_params)(multi1,
756
0
              FN(MULTI(BASE),get_space)(multi2));
757
0
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
0
              FN(MULTI(BASE),get_space)(multi1));
759
0
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
0
}
isl_aff.c:isl_multi_union_pw_aff_align_params_multi_multi_and
Line
Count
Source
739
1.85k
{
740
1.85k
  isl_ctx *ctx;
741
1.85k
  isl_bool equal_params;
742
1.85k
743
1.85k
  if (
!multi1 || 1.85k
!multi21.85k
)
744
0
    goto error;
745
1.85k
  equal_params = isl_space_has_equal_params(multi1->space, multi2->space);
746
1.85k
  if (equal_params < 0)
747
0
    goto error;
748
1.85k
  
if (1.85k
equal_params1.85k
)
749
1.84k
    return fn(multi1, multi2);
750
8
  
ctx = 8
FN8
(MULTI(BASE),get_ctx)(multi1);
751
8
  if (!isl_space_has_named_params(multi1->space) ||
752
8
      !isl_space_has_named_params(multi2->space))
753
0
    isl_die(ctx, isl_error_invalid,
754
8
      "unaligned unnamed parameters", goto error);
755
8
  
multi1 = 8
FN8
(MULTI(BASE),align_params)(multi1,
756
8
              FN(MULTI(BASE),get_space)(multi2));
757
8
  multi2 = FN(MULTI(BASE),align_params)(multi2,
758
8
              FN(MULTI(BASE),get_space)(multi1));
759
8
  return fn(multi1, multi2);
760
0
error:
761
0
  FN(MULTI(BASE),free)(multi1);
762
0
  FN(MULTI(BASE),free)(multi2);
763
0
  return NULL;
764
8
}
765
766
/* Given two MULTI(BASE)s A -> B and C -> D,
767
 * construct a MULTI(BASE) (A * C) -> [B -> D].
768
 *
769
 * The parameters are assumed to have been aligned.
770
 */
771
static __isl_give MULTI(BASE) *FN(MULTI(BASE),range_product_aligned)(
772
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
773
1.92k
{
774
1.92k
  int i, n1, n2;
775
1.92k
  EL *el;
776
1.92k
  isl_space *space;
777
1.92k
  MULTI(BASE) *res;
778
1.92k
779
1.92k
  if (
!multi1 || 1.92k
!multi21.92k
)
780
0
    goto error;
781
1.92k
782
1.92k
  
space = isl_space_range_product(1.92k
FN1.92k
(MULTI(BASE),get_space)(multi1),
783
1.92k
          FN(MULTI(BASE),get_space)(multi2));
784
1.92k
  res = FN(MULTI(BASE),alloc)(space);
785
1.92k
786
1.92k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
1.92k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
1.92k
789
4.27k
  for (i = 0; 
i < n14.27k
;
++i2.35k
)
{2.35k
790
2.35k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
2.35k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
2.35k
  }
793
1.92k
794
3.44k
  for (i = 0; 
i < n23.44k
;
++i1.51k
)
{1.51k
795
1.51k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.51k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.51k
  }
798
1.92k
799
1.92k
  FN(MULTI(BASE),free)(multi1);
800
1.92k
  FN(MULTI(BASE),free)(multi2);
801
1.92k
  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.92k
}
isl_aff.c:isl_multi_aff_range_product_aligned
Line
Count
Source
773
214
{
774
214
  int i, n1, n2;
775
214
  EL *el;
776
214
  isl_space *space;
777
214
  MULTI(BASE) *res;
778
214
779
214
  if (
!multi1 || 214
!multi2214
)
780
0
    goto error;
781
214
782
214
  
space = isl_space_range_product(214
FN214
(MULTI(BASE),get_space)(multi1),
783
214
          FN(MULTI(BASE),get_space)(multi2));
784
214
  res = FN(MULTI(BASE),alloc)(space);
785
214
786
214
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
214
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
214
789
761
  for (i = 0; 
i < n1761
;
++i547
)
{547
790
547
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
547
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
547
  }
793
214
794
446
  for (i = 0; 
i < n2446
;
++i232
)
{232
795
232
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
232
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
232
  }
798
214
799
214
  FN(MULTI(BASE),free)(multi1);
800
214
  FN(MULTI(BASE),free)(multi2);
801
214
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
214
}
isl_aff.c:isl_multi_pw_aff_range_product_aligned
Line
Count
Source
773
5
{
774
5
  int i, n1, n2;
775
5
  EL *el;
776
5
  isl_space *space;
777
5
  MULTI(BASE) *res;
778
5
779
5
  if (
!multi1 || 5
!multi25
)
780
0
    goto error;
781
5
782
5
  
space = isl_space_range_product(5
FN5
(MULTI(BASE),get_space)(multi1),
783
5
          FN(MULTI(BASE),get_space)(multi2));
784
5
  res = FN(MULTI(BASE),alloc)(space);
785
5
786
5
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
5
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
5
789
14
  for (i = 0; 
i < n114
;
++i9
)
{9
790
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
9
  }
793
5
794
14
  for (i = 0; 
i < n214
;
++i9
)
{9
795
9
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
9
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
9
  }
798
5
799
5
  FN(MULTI(BASE),free)(multi1);
800
5
  FN(MULTI(BASE),free)(multi2);
801
5
  return res;
802
0
error:
803
0
  FN(MULTI(BASE),free)(multi1);
804
0
  FN(MULTI(BASE),free)(multi2);
805
0
  return NULL;
806
5
}
isl_aff.c:isl_multi_union_pw_aff_range_product_aligned
Line
Count
Source
773
1.70k
{
774
1.70k
  int i, n1, n2;
775
1.70k
  EL *el;
776
1.70k
  isl_space *space;
777
1.70k
  MULTI(BASE) *res;
778
1.70k
779
1.70k
  if (
!multi1 || 1.70k
!multi21.70k
)
780
0
    goto error;
781
1.70k
782
1.70k
  
space = isl_space_range_product(1.70k
FN1.70k
(MULTI(BASE),get_space)(multi1),
783
1.70k
          FN(MULTI(BASE),get_space)(multi2));
784
1.70k
  res = FN(MULTI(BASE),alloc)(space);
785
1.70k
786
1.70k
  n1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
787
1.70k
  n2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
788
1.70k
789
3.50k
  for (i = 0; 
i < n13.50k
;
++i1.79k
)
{1.79k
790
1.79k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
791
1.79k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
792
1.79k
  }
793
1.70k
794
2.98k
  for (i = 0; 
i < n22.98k
;
++i1.27k
)
{1.27k
795
1.27k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
796
1.27k
    res = FN(FN(MULTI(BASE),set),BASE)(res, n1 + i, el);
797
1.27k
  }
798
1.70k
799
1.70k
  FN(MULTI(BASE),free)(multi1);
800
1.70k
  FN(MULTI(BASE),free)(multi2);
801
1.70k
  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.70k
}
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.92k
{
814
1.92k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
1.92k
          &FN(MULTI(BASE),range_product_aligned));
816
1.92k
}
isl_multi_union_pw_aff_range_product
Line
Count
Source
813
1.70k
{
814
1.70k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
815
1.70k
          &FN(MULTI(BASE),range_product_aligned));
816
1.70k
}
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
798
{
822
798
  if (!multi)
823
0
    return isl_bool_error;
824
798
  return isl_space_range_is_wrapping(multi->space);
825
798
}
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
798
{
822
798
  if (!multi)
823
0
    return isl_bool_error;
824
798
  return isl_space_range_is_wrapping(multi->space);
825
798
}
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.79k
{
911
1.79k
  int i;
912
1.79k
  EL *el;
913
1.79k
  isl_space *space;
914
1.79k
  MULTI(BASE) *res;
915
1.79k
  int in1, in2, out1, out2;
916
1.79k
917
1.79k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.79k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.79k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.79k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.79k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.79k
          FN(MULTI(BASE),get_space)(multi2));
923
1.79k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.79k
  space = isl_space_domain(space);
925
1.79k
926
3.14k
  for (i = 0; 
i < out13.14k
;
++i1.34k
)
{1.34k
927
1.34k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.34k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.34k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.34k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.34k
  }
932
1.79k
933
4.23k
  for (i = 0; 
i < out24.23k
;
++i2.43k
)
{2.43k
934
2.43k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.43k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.43k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.43k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.43k
  }
939
1.79k
940
1.79k
  isl_space_free(space);
941
1.79k
  FN(MULTI(BASE),free)(multi1);
942
1.79k
  FN(MULTI(BASE),free)(multi2);
943
1.79k
  return res;
944
1.79k
}
Unexecuted instantiation: isl_multi_val_product_aligned
isl_multi_aff_product_aligned
Line
Count
Source
910
1.79k
{
911
1.79k
  int i;
912
1.79k
  EL *el;
913
1.79k
  isl_space *space;
914
1.79k
  MULTI(BASE) *res;
915
1.79k
  int in1, in2, out1, out2;
916
1.79k
917
1.79k
  in1 = FN(MULTI(BASE),dim)(multi1, isl_dim_in);
918
1.79k
  in2 = FN(MULTI(BASE),dim)(multi2, isl_dim_in);
919
1.79k
  out1 = FN(MULTI(BASE),dim)(multi1, isl_dim_out);
920
1.79k
  out2 = FN(MULTI(BASE),dim)(multi2, isl_dim_out);
921
1.79k
  space = isl_space_product(FN(MULTI(BASE),get_space)(multi1),
922
1.79k
          FN(MULTI(BASE),get_space)(multi2));
923
1.79k
  res = FN(MULTI(BASE),alloc)(isl_space_copy(space));
924
1.79k
  space = isl_space_domain(space);
925
1.79k
926
3.14k
  for (i = 0; 
i < out13.14k
;
++i1.34k
)
{1.34k
927
1.34k
    el = FN(FN(MULTI(BASE),get),BASE)(multi1, i);
928
1.34k
    el = FN(EL,insert_dims)(el, isl_dim_in, in1, in2);
929
1.34k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
930
1.34k
    res = FN(FN(MULTI(BASE),set),BASE)(res, i, el);
931
1.34k
  }
932
1.79k
933
4.23k
  for (i = 0; 
i < out24.23k
;
++i2.43k
)
{2.43k
934
2.43k
    el = FN(FN(MULTI(BASE),get),BASE)(multi2, i);
935
2.43k
    el = FN(EL,insert_dims)(el, isl_dim_in, 0, in1);
936
2.43k
    el = FN(EL,reset_domain_space)(el, isl_space_copy(space));
937
2.43k
    res = FN(FN(MULTI(BASE),set),BASE)(res, out1 + i, el);
938
2.43k
  }
939
1.79k
940
1.79k
  isl_space_free(space);
941
1.79k
  FN(MULTI(BASE),free)(multi1);
942
1.79k
  FN(MULTI(BASE),free)(multi2);
943
1.79k
  return res;
944
1.79k
}
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.79k
{
952
1.79k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.79k
          &FN(MULTI(BASE),product_aligned));
954
1.79k
}
Unexecuted instantiation: isl_multi_val_product
isl_multi_aff_product
Line
Count
Source
951
1.79k
{
952
1.79k
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
953
1.79k
          &FN(MULTI(BASE),product_aligned));
954
1.79k
}
Unexecuted instantiation: isl_multi_pw_aff_product
955
#endif
956
957
__isl_give MULTI(BASE) *FN(MULTI(BASE),flatten_range)(
958
  __isl_take MULTI(BASE) *multi)
959
2.41k
{
960
2.41k
  if (!multi)
961
0
    return NULL;
962
2.41k
963
2.41k
  
if (2.41k
!multi->space->nested[1]2.41k
)
964
0
    return multi;
965
2.41k
966
2.41k
  
multi = 2.41k
FN2.41k
(MULTI(BASE),cow)(multi);
967
2.41k
  if (!multi)
968
0
    return NULL;
969
2.41k
970
2.41k
  multi->space = isl_space_flatten_range(multi->space);
971
2.41k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
2.41k
974
2.41k
  return multi;
975
2.41k
}
Unexecuted instantiation: isl_multi_val_flatten_range
isl_multi_union_pw_aff_flatten_range
Line
Count
Source
959
1.70k
{
960
1.70k
  if (!multi)
961
0
    return NULL;
962
1.70k
963
1.70k
  
if (1.70k
!multi->space->nested[1]1.70k
)
964
0
    return multi;
965
1.70k
966
1.70k
  
multi = 1.70k
FN1.70k
(MULTI(BASE),cow)(multi);
967
1.70k
  if (!multi)
968
0
    return NULL;
969
1.70k
970
1.70k
  multi->space = isl_space_flatten_range(multi->space);
971
1.70k
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
1.70k
974
1.70k
  return multi;
975
1.70k
}
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
706
{
960
706
  if (!multi)
961
0
    return NULL;
962
706
963
706
  
if (706
!multi->space->nested[1]706
)
964
0
    return multi;
965
706
966
706
  
multi = 706
FN706
(MULTI(BASE),cow)(multi);
967
706
  if (!multi)
968
0
    return NULL;
969
706
970
706
  multi->space = isl_space_flatten_range(multi->space);
971
706
  if (!multi->space)
972
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
973
706
974
706
  return multi;
975
706
}
976
977
/* Given two MULTI(BASE)s A -> B and C -> D,
978
 * construct a MULTI(BASE) (A * C) -> (B, D).
979
 */
980
__isl_give MULTI(BASE) *FN(MULTI(BASE),flat_range_product)(
981
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
982
1.81k
{
983
1.81k
  MULTI(BASE) *multi;
984
1.81k
985
1.81k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1.81k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1.81k
  return multi;
988
1.81k
}
Unexecuted instantiation: isl_multi_val_flat_range_product
isl_multi_aff_flat_range_product
Line
Count
Source
982
108
{
983
108
  MULTI(BASE) *multi;
984
108
985
108
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
108
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
108
  return multi;
988
108
}
isl_multi_pw_aff_flat_range_product
Line
Count
Source
982
1
{
983
1
  MULTI(BASE) *multi;
984
1
985
1
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1
  return multi;
988
1
}
isl_multi_union_pw_aff_flat_range_product
Line
Count
Source
982
1.70k
{
983
1.70k
  MULTI(BASE) *multi;
984
1.70k
985
1.70k
  multi = FN(MULTI(BASE),range_product)(multi1, multi2);
986
1.70k
  multi = FN(MULTI(BASE),flatten_range)(multi);
987
1.70k
  return multi;
988
1.70k
}
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
149
{
1099
149
  int i;
1100
149
  isl_ctx *ctx;
1101
149
1102
149
  multi1 = FN(MULTI(BASE),cow)(multi1);
1103
149
  if (
!multi1 || 149
!multi2149
)
1104
0
    goto error;
1105
149
1106
149
  
ctx = 149
FN149
(MULTI(BASE),get_ctx)(multi1);
1107
149
  if (!isl_space_is_equal(multi1->space, multi2->space))
1108
0
    isl_die(ctx, isl_error_invalid,
1109
149
      "spaces don't match", goto error);
1110
149
1111
401
  
for (i = 0; 149
i < multi1->n401
;
++i252
)
{252
1112
252
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
252
    if (!multi1->p[i])
1114
0
      goto error;
1115
252
  }
1116
149
1117
149
  
FN149
(MULTI(BASE),free)(multi2);149
1118
149
  return multi1;
1119
0
error:
1120
0
  FN(MULTI(BASE),free)(multi1);
1121
0
  FN(MULTI(BASE),free)(multi2);
1122
0
  return NULL;
1123
149
}
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
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
395
  
for (i = 0; 146
i < multi1->n395
;
++i249
)
{249
1112
249
    multi1->p[i] = fn(multi1->p[i], FN(EL,copy)(multi2->p[i]));
1113
249
    if (!multi1->p[i])
1114
0
      goto error;
1115
249
  }
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_aff.c:isl_multi_pw_aff_bin_op
1124
1125
/* Add "multi2" from "multi1" and return the result.
1126
 *
1127
 * The parameters of "multi1" and "multi2" are assumed to have been aligned.
1128
 */
1129
static __isl_give MULTI(BASE) *FN(MULTI(BASE),add_aligned)(
1130
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
1131
3
{
1132
3
  return 
FN3
(MULTI(BASE),bin_op)(multi1, multi2, &
FN3
(EL,add));
1133
3
}
Unexecuted instantiation: isl_aff.c:isl_multi_union_pw_aff_add_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_add_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_add_aligned
isl_aff.c:isl_multi_aff_add_aligned
Line
Count
Source
1131
3
{
1132
3
  return 
FN3
(MULTI(BASE),bin_op)(multi1, multi2, &
FN3
(EL,add));
1133
3
}
1134
1135
/* Add "multi2" from "multi1" and return the result.
1136
 */
1137
__isl_give MULTI(BASE) *FN(MULTI(BASE),add)(__isl_take MULTI(BASE) *multi1,
1138
  __isl_take MULTI(BASE) *multi2)
1139
3
{
1140
3
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1141
3
            &FN(MULTI(BASE),add_aligned));
1142
3
}
isl_multi_aff_add
Line
Count
Source
1139
3
{
1140
3
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1141
3
            &FN(MULTI(BASE),add_aligned));
1142
3
}
Unexecuted instantiation: isl_multi_union_pw_aff_add
Unexecuted instantiation: isl_multi_val_add
Unexecuted instantiation: isl_multi_pw_aff_add
1143
1144
/* Subtract "multi2" from "multi1" and return the result.
1145
 *
1146
 * The parameters of "multi1" and "multi2" are assumed to have been aligned.
1147
 */
1148
static __isl_give MULTI(BASE) *FN(MULTI(BASE),sub_aligned)(
1149
  __isl_take MULTI(BASE) *multi1, __isl_take MULTI(BASE) *multi2)
1150
68
{
1151
68
  return 
FN68
(MULTI(BASE),bin_op)(multi1, multi2, &
FN68
(EL,sub));
1152
68
}
Unexecuted instantiation: isl_aff.c:isl_multi_aff_sub_aligned
Unexecuted instantiation: isl_aff.c:isl_multi_pw_aff_sub_aligned
Unexecuted instantiation: isl_val.c:isl_multi_val_sub_aligned
isl_aff.c:isl_multi_union_pw_aff_sub_aligned
Line
Count
Source
1150
68
{
1151
68
  return 
FN68
(MULTI(BASE),bin_op)(multi1, multi2, &
FN68
(EL,sub));
1152
68
}
1153
1154
/* Subtract "multi2" from "multi1" and return the result.
1155
 */
1156
__isl_give MULTI(BASE) *FN(MULTI(BASE),sub)(__isl_take MULTI(BASE) *multi1,
1157
  __isl_take MULTI(BASE) *multi2)
1158
68
{
1159
68
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
68
            &FN(MULTI(BASE),sub_aligned));
1161
68
}
Unexecuted instantiation: isl_multi_val_sub
isl_multi_union_pw_aff_sub
Line
Count
Source
1158
68
{
1159
68
  return FN(MULTI(BASE),align_params_multi_multi_and)(multi1, multi2,
1160
68
            &FN(MULTI(BASE),sub_aligned));
1161
68
}
Unexecuted instantiation: isl_multi_pw_aff_sub
Unexecuted instantiation: isl_multi_aff_sub
1162
1163
/* Multiply the elements of "multi" by "v" and return the result.
1164
 */
1165
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_val)(__isl_take MULTI(BASE) *multi,
1166
  __isl_take isl_val *v)
1167
0
{
1168
0
  int i;
1169
0
1170
0
  if (
!multi || 0
!v0
)
1171
0
    goto error;
1172
0
1173
0
  
if (0
isl_val_is_one(v)0
)
{0
1174
0
    isl_val_free(v);
1175
0
    return multi;
1176
0
  }
1177
0
1178
0
  
if (0
!isl_val_is_rat(v)0
)
1179
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1180
0
      "expecting rational factor", goto error);
1181
0
1182
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1183
0
  if (!multi)
1184
0
    return NULL;
1185
0
1186
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1187
0
    multi->p[i] = FN(EL,scale_val)(multi->p[i], isl_val_copy(v));
1188
0
    if (!multi->p[i])
1189
0
      goto error;
1190
0
  }
1191
0
1192
0
  isl_val_free(v);
1193
0
  return multi;
1194
0
error:
1195
0
  isl_val_free(v);
1196
0
  return FN(MULTI(BASE),free)(multi);
1197
0
}
Unexecuted instantiation: isl_multi_aff_scale_val
Unexecuted instantiation: isl_multi_val_scale_val
Unexecuted instantiation: isl_multi_union_pw_aff_scale_val
Unexecuted instantiation: isl_multi_pw_aff_scale_val
1198
1199
/* Divide the elements of "multi" by "v" and return the result.
1200
 */
1201
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_val)(
1202
  __isl_take MULTI(BASE) *multi, __isl_take isl_val *v)
1203
0
{
1204
0
  int i;
1205
0
1206
0
  if (
!multi || 0
!v0
)
1207
0
    goto error;
1208
0
1209
0
  
if (0
isl_val_is_one(v)0
)
{0
1210
0
    isl_val_free(v);
1211
0
    return multi;
1212
0
  }
1213
0
1214
0
  
if (0
!isl_val_is_rat(v)0
)
1215
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1216
0
      "expecting rational factor", goto error);
1217
0
  
if (0
isl_val_is_zero(v)0
)
1218
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
1219
0
      "cannot scale down by zero", goto error);
1220
0
1221
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1222
0
  if (!multi)
1223
0
    return NULL;
1224
0
1225
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1226
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i],
1227
0
                isl_val_copy(v));
1228
0
    if (!multi->p[i])
1229
0
      goto error;
1230
0
  }
1231
0
1232
0
  isl_val_free(v);
1233
0
  return multi;
1234
0
error:
1235
0
  isl_val_free(v);
1236
0
  return FN(MULTI(BASE),free)(multi);
1237
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_val
Unexecuted instantiation: isl_multi_aff_scale_down_val
Unexecuted instantiation: isl_multi_val_scale_down_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_val
1238
1239
/* Multiply the elements of "multi" by the corresponding element of "mv"
1240
 * and return the result.
1241
 */
1242
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_multi_val)(
1243
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1244
67
{
1245
67
  int i;
1246
67
1247
67
  if (
!multi || 67
!mv67
)
1248
0
    goto error;
1249
67
1250
67
  
if (67
!isl_space_tuple_is_equal(multi->space, isl_dim_out,67
1251
67
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
67
      "spaces don't match", goto error);
1254
67
1255
67
  
multi = 67
FN67
(MULTI(BASE),cow)(multi);
1256
67
  if (!multi)
1257
0
    goto error;
1258
67
1259
212
  
for (i = 0; 67
i < multi->n212
;
++i145
)
{145
1260
145
    isl_val *v;
1261
145
1262
145
    v = isl_multi_val_get_val(mv, i);
1263
145
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
145
    if (!multi->p[i])
1265
0
      goto error;
1266
145
  }
1267
67
1268
67
  isl_multi_val_free(mv);
1269
67
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
67
}
isl_multi_union_pw_aff_scale_multi_val
Line
Count
Source
1244
67
{
1245
67
  int i;
1246
67
1247
67
  if (
!multi || 67
!mv67
)
1248
0
    goto error;
1249
67
1250
67
  
if (67
!isl_space_tuple_is_equal(multi->space, isl_dim_out,67
1251
67
          mv->space, isl_dim_set))
1252
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1253
67
      "spaces don't match", goto error);
1254
67
1255
67
  
multi = 67
FN67
(MULTI(BASE),cow)(multi);
1256
67
  if (!multi)
1257
0
    goto error;
1258
67
1259
212
  
for (i = 0; 67
i < multi->n212
;
++i145
)
{145
1260
145
    isl_val *v;
1261
145
1262
145
    v = isl_multi_val_get_val(mv, i);
1263
145
    multi->p[i] = FN(EL,scale_val)(multi->p[i], v);
1264
145
    if (!multi->p[i])
1265
0
      goto error;
1266
145
  }
1267
67
1268
67
  isl_multi_val_free(mv);
1269
67
  return multi;
1270
0
error:
1271
0
  isl_multi_val_free(mv);
1272
0
  return FN(MULTI(BASE),free)(multi);
1273
67
}
Unexecuted instantiation: isl_multi_aff_scale_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_multi_val
Unexecuted instantiation: isl_multi_val_scale_multi_val
1274
1275
/* Divide the elements of "multi" by the corresponding element of "mv"
1276
 * and return the result.
1277
 */
1278
__isl_give MULTI(BASE) *FN(MULTI(BASE),scale_down_multi_val)(
1279
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1280
0
{
1281
0
  int i;
1282
0
1283
0
  if (
!multi || 0
!mv0
)
1284
0
    goto error;
1285
0
1286
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
1287
0
          mv->space, isl_dim_set))
1288
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1289
0
      "spaces don't match", goto error);
1290
0
1291
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1292
0
  if (!multi)
1293
0
    return NULL;
1294
0
1295
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1296
0
    isl_val *v;
1297
0
1298
0
    v = isl_multi_val_get_val(mv, i);
1299
0
    multi->p[i] = FN(EL,scale_down_val)(multi->p[i], v);
1300
0
    if (!multi->p[i])
1301
0
      goto error;
1302
0
  }
1303
0
1304
0
  isl_multi_val_free(mv);
1305
0
  return multi;
1306
0
error:
1307
0
  isl_multi_val_free(mv);
1308
0
  return FN(MULTI(BASE),free)(multi);
1309
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_aff_scale_down_multi_val
Unexecuted instantiation: isl_multi_val_scale_down_multi_val
Unexecuted instantiation: isl_multi_pw_aff_scale_down_multi_val
1310
1311
/* Compute the residues of the elements of "multi" modulo
1312
 * the corresponding element of "mv" and return the result.
1313
 */
1314
__isl_give MULTI(BASE) *FN(MULTI(BASE),mod_multi_val)(
1315
  __isl_take MULTI(BASE) *multi, __isl_take isl_multi_val *mv)
1316
0
{
1317
0
  int i;
1318
0
1319
0
  if (
!multi || 0
!mv0
)
1320
0
    goto error;
1321
0
1322
0
  
if (0
!isl_space_tuple_is_equal(multi->space, isl_dim_out,0
1323
0
          mv->space, isl_dim_set))
1324
0
    isl_die(isl_multi_val_get_ctx(mv), isl_error_invalid,
1325
0
      "spaces don't match", goto error);
1326
0
1327
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1328
0
  if (!multi)
1329
0
    return NULL;
1330
0
1331
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1332
0
    isl_val *v;
1333
0
1334
0
    v = isl_multi_val_get_val(mv, i);
1335
0
    multi->p[i] = FN(EL,mod_val)(multi->p[i], v);
1336
0
    if (!multi->p[i])
1337
0
      goto error;
1338
0
  }
1339
0
1340
0
  isl_multi_val_free(mv);
1341
0
  return multi;
1342
0
error:
1343
0
  isl_multi_val_free(mv);
1344
0
  return FN(MULTI(BASE),free)(multi);
1345
0
}
Unexecuted instantiation: isl_multi_union_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_val_mod_multi_val
Unexecuted instantiation: isl_multi_pw_aff_mod_multi_val
Unexecuted instantiation: isl_multi_aff_mod_multi_val
1346
1347
#ifndef NO_MOVE_DIMS
1348
/* Move the "n" dimensions of "src_type" starting at "src_pos" of "multi"
1349
 * to dimensions of "dst_type" at "dst_pos".
1350
 *
1351
 * We only support moving input dimensions to parameters and vice versa.
1352
 */
1353
__isl_give MULTI(BASE) *FN(MULTI(BASE),move_dims)(__isl_take MULTI(BASE) *multi,
1354
  enum isl_dim_type dst_type, unsigned dst_pos,
1355
  enum isl_dim_type src_type, unsigned src_pos, unsigned n)
1356
0
{
1357
0
  int i;
1358
0
1359
0
  if (!multi)
1360
0
    return NULL;
1361
0
1362
0
  
if (0
n == 0 &&0
1363
0
      !isl_space_is_named_or_nested(multi->space, src_type) &&
1364
0
      !isl_space_is_named_or_nested(multi->space, dst_type))
1365
0
    return multi;
1366
0
1367
0
  
if (0
dst_type == isl_dim_out || 0
src_type == isl_dim_out0
)
1368
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1369
0
      "cannot move output/set dimension",
1370
0
      return FN(MULTI(BASE),free)(multi));
1371
0
  
if (0
dst_type == isl_dim_div || 0
src_type == isl_dim_div0
)
1372
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1373
0
      "cannot move divs",
1374
0
      return FN(MULTI(BASE),free)(multi));
1375
0
  
if (0
src_pos + n > isl_space_dim(multi->space, src_type)0
)
1376
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1377
0
      "range out of bounds",
1378
0
      return FN(MULTI(BASE),free)(multi));
1379
0
  
if (0
dst_type == src_type0
)
1380
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_unsupported,
1381
0
      "moving dims within the same type not supported",
1382
0
      return FN(MULTI(BASE),free)(multi));
1383
0
1384
0
  
multi = 0
FN0
(MULTI(BASE),cow)(multi);
1385
0
  if (!multi)
1386
0
    return NULL;
1387
0
1388
0
  multi->space = isl_space_move_dims(multi->space, dst_type, dst_pos,
1389
0
            src_type, src_pos, n);
1390
0
  if (!multi->space)
1391
0
    
return 0
FN0
(MULTI(BASE),free)(multi);
1392
0
1393
0
  
for (i = 0; 0
i < multi->n0
;
++i0
)
{0
1394
0
    multi->p[i] = FN(EL,move_dims)(multi->p[i], dst_type, dst_pos,
1395
0
            src_type, src_pos, n);
1396
0
    if (!multi->p[i])
1397
0
      
return 0
FN0
(MULTI(BASE),free)(multi);
1398
0
  }
1399
0
1400
0
  return multi;
1401
0
}
Unexecuted instantiation: isl_multi_pw_aff_move_dims
Unexecuted instantiation: isl_multi_aff_move_dims
1402
#endif
1403
1404
/* Convert a multiple expression defined over a parameter domain
1405
 * into one that is defined over a zero-dimensional set.
1406
 */
1407
__isl_give MULTI(BASE) *FN(MULTI(BASE),from_range)(
1408
  __isl_take MULTI(BASE) *multi)
1409
0
{
1410
0
  isl_space *space;
1411
0
1412
0
  if (!multi)
1413
0
    return NULL;
1414
0
  
if (0
!isl_space_is_set(multi->space)0
)
1415
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
1416
0
      "not living in a set space",
1417
0
      return FN(MULTI(BASE),free)(multi));
1418
0
1419
0
  
space = 0
FN0
(MULTI(BASE),get_space)(multi);
1420
0
  space = isl_space_from_range(space);
1421
0
  multi = FN(MULTI(BASE),reset_space)(multi, space);
1422
0
1423
0
  return multi;
1424
0
}
Unexecuted instantiation: isl_multi_aff_from_range
Unexecuted instantiation: isl_multi_pw_aff_from_range
Unexecuted instantiation: isl_multi_val_from_range
Unexecuted instantiation: isl_multi_union_pw_aff_from_range
1425
1426
/* Are "multi1" and "multi2" obviously equal?
1427
 */
1428
isl_bool FN(MULTI(BASE),plain_is_equal)(__isl_keep MULTI(BASE) *multi1,
1429
  __isl_keep MULTI(BASE) *multi2)
1430
1.47k
{
1431
1.47k
  int i;
1432
1.47k
  isl_bool equal;
1433
1.47k
1434
1.47k
  if (
!multi1 || 1.47k
!multi21.47k
)
1435
0
    return isl_bool_error;
1436
1.47k
  
if (1.47k
multi1->n != multi2->n1.47k
)
1437
0
    return isl_bool_false;
1438
1.47k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.47k
  if (
equal < 0 || 1.47k
!equal1.47k
)
1440
0
    return equal;
1441
1.47k
1442
1.73k
  
for (i = 0; 1.47k
i < multi1->n1.73k
;
++i261
)
{1.61k
1443
1.61k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
1.61k
    if (
equal < 0 || 1.61k
!equal1.61k
)
1445
1.35k
      return equal;
1446
1.61k
  }
1447
1.47k
1448
122
  return isl_bool_true;
1449
1.47k
}
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
1.46k
{
1431
1.46k
  int i;
1432
1.46k
  isl_bool equal;
1433
1.46k
1434
1.46k
  if (
!multi1 || 1.46k
!multi21.46k
)
1435
0
    return isl_bool_error;
1436
1.46k
  
if (1.46k
multi1->n != multi2->n1.46k
)
1437
0
    return isl_bool_false;
1438
1.46k
  equal = isl_space_is_equal(multi1->space, multi2->space);
1439
1.46k
  if (
equal < 0 || 1.46k
!equal1.46k
)
1440
0
    return equal;
1441
1.46k
1442
1.71k
  
for (i = 0; 1.46k
i < multi1->n1.71k
;
++i243
)
{1.59k
1443
1.59k
    equal = FN(EL,plain_is_equal)(multi1->p[i], multi2->p[i]);
1444
1.59k
    if (
equal < 0 || 1.59k
!equal1.59k
)
1445
1.35k
      return equal;
1446
1.59k
  }
1447
1.46k
1448
113
  return isl_bool_true;
1449
1.46k
}
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
1.01k
{
1455
1.01k
  int i;
1456
1.01k
1457
1.01k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.01k
  
if (1.01k
multi->n == 01.01k
)
1460
0
    return isl_bool_false;
1461
1.01k
1462
2.33k
  
for (i = 0; 1.01k
i < multi->n2.33k
;
++i1.32k
)
{1.32k
1463
1.32k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
1.32k
    if (
has_nan < 0 || 1.32k
has_nan1.32k
)
1465
2
      return has_nan;
1466
1.32k
  }
1467
1.01k
1468
1.01k
  return isl_bool_false;
1469
1.01k
}
Unexecuted instantiation: isl_multi_union_pw_aff_involves_nan
Unexecuted instantiation: isl_multi_val_involves_nan
Unexecuted instantiation: isl_multi_pw_aff_involves_nan
isl_multi_aff_involves_nan
Line
Count
Source
1454
1.01k
{
1455
1.01k
  int i;
1456
1.01k
1457
1.01k
  if (!multi)
1458
0
    return isl_bool_error;
1459
1.01k
  
if (1.01k
multi->n == 01.01k
)
1460
0
    return isl_bool_false;
1461
1.01k
1462
2.33k
  
for (i = 0; 1.01k
i < multi->n2.33k
;
++i1.32k
)
{1.32k
1463
1.32k
    isl_bool has_nan = FN(EL,involves_nan)(multi->p[i]);
1464
1.32k
    if (
has_nan < 0 || 1.32k
has_nan1.32k
)
1465
2
      return has_nan;
1466
1.32k
  }
1467
1.01k
1468
1.01k
  return isl_bool_false;
1469
1.01k
}
1470
1471
#ifndef NO_DOMAIN
1472
/* Return the shared domain of the elements of "multi".
1473
 */
1474
__isl_give isl_set *FN(MULTI(BASE),domain)(__isl_take MULTI(BASE) *multi)
1475
0
{
1476
0
  int i;
1477
0
  isl_set *dom;
1478
0
1479
0
  if (!multi)
1480
0
    return NULL;
1481
0
1482
0
  
dom = isl_set_universe(0
FN0
(MULTI(BASE),get_domain_space)(multi));
1483
0
  for (i = 0; 
i < multi->n0
;
++i0
)
{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