Coverage Report

Created: 2017-08-18 19:41

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/lib/External/isl/isl_union_templ.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2010      INRIA Saclay
3
 * Copyright 2013      Ecole Normale Superieure
4
 *
5
 * Use of this software is governed by the MIT license
6
 *
7
 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
8
 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
9
 * 91893 Orsay, France 
10
 * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
11
 */
12
13
__isl_give UNION *FN(UNION,cow)(__isl_take UNION *u);
14
15
isl_ctx *FN(UNION,get_ctx)(__isl_keep UNION *u)
16
30.2k
{
17
30.2k
  return u ? u->space->ctx : NULL;
18
30.2k
}
isl_union_pw_aff_get_ctx
Line
Count
Source
16
9.61k
{
17
9.61k
  return u ? u->space->ctx : NULL;
18
9.61k
}
isl_union_pw_multi_aff_get_ctx
Line
Count
Source
16
20.6k
{
17
20.6k
  return u ? u->space->ctx : NULL;
18
20.6k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_get_ctx
isl_union_pw_qpolynomial_get_ctx
Line
Count
Source
16
7
{
17
7
  return u ? u->space->ctx : NULL;
18
7
}
19
20
__isl_give isl_space *FN(UNION,get_space)(__isl_keep UNION *u)
21
62.3k
{
22
62.3k
  if (!u)
23
0
    return NULL;
24
62.3k
  return isl_space_copy(u->space);
25
62.3k
}
isl_union_pw_aff_get_space
Line
Count
Source
21
41.1k
{
22
41.1k
  if (!u)
23
0
    return NULL;
24
41.1k
  return isl_space_copy(u->space);
25
41.1k
}
isl_union_pw_multi_aff_get_space
Line
Count
Source
21
21.2k
{
22
21.2k
  if (!u)
23
0
    return NULL;
24
21.2k
  return isl_space_copy(u->space);
25
21.2k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_get_space
isl_union_pw_qpolynomial_get_space
Line
Count
Source
21
12
{
22
12
  if (!u)
23
0
    return NULL;
24
12
  return isl_space_copy(u->space);
25
12
}
26
27
/* Return the number of parameters of "u", where "type"
28
 * is required to be set to isl_dim_param.
29
 */
30
unsigned FN(UNION,dim)(__isl_keep UNION *u, enum isl_dim_type type)
31
0
{
32
0
  if (!u)
33
0
    return 0;
34
0
35
0
  
if (0
type != isl_dim_param0
)
36
0
    isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
37
0
      "can only reference parameters", return 0);
38
0
39
0
  return isl_space_dim(u->space, type);
40
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_dim
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_dim
Unexecuted instantiation: isl_union_pw_multi_aff_dim
Unexecuted instantiation: isl_union_pw_aff_dim
41
42
/* Return the position of the parameter with the given name
43
 * in "u".
44
 * Return -1 if no such dimension can be found.
45
 */
46
int FN(UNION,find_dim_by_name)(__isl_keep UNION *u, enum isl_dim_type type,
47
  const char *name)
48
0
{
49
0
  if (!u)
50
0
    return -1;
51
0
  return isl_space_find_dim_by_name(u->space, type, name);
52
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_find_dim_by_name
Unexecuted instantiation: isl_union_pw_aff_find_dim_by_name
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_find_dim_by_name
Unexecuted instantiation: isl_union_pw_multi_aff_find_dim_by_name
53
54
#ifdef HAS_TYPE
55
static __isl_give UNION *FN(UNION,alloc)(__isl_take isl_space *dim,
56
  enum isl_fold type, int size)
57
#else
58
static __isl_give UNION *FN(UNION,alloc)(__isl_take isl_space *dim, int size)
59
#endif
60
14.5k
{
61
14.5k
  UNION *u;
62
14.5k
63
14.5k
  dim = isl_space_params(dim);
64
14.5k
  if (!dim)
65
0
    return NULL;
66
14.5k
67
14.5k
  
u = 14.5k
isl_calloc_type14.5k
(dim->ctx, UNION);
68
14.5k
  if (!u)
69
0
    goto error;
70
14.5k
71
14.5k
  u->ref = 1;
72
14.5k
#ifdef HAS_TYPE
73
  u->type = type;
74
#endif
75
14.5k
  u->space = dim;
76
14.5k
  if (isl_hash_table_init(dim->ctx, &u->table, size) < 0)
77
0
    
return 0
FN0
(UNION,free)(u);
78
14.5k
79
14.5k
  return u;
80
14.5k
error:
81
0
  isl_space_free(dim);
82
14.5k
  return NULL;
83
14.5k
}
isl_aff.c:isl_union_pw_multi_aff_alloc
Line
Count
Source
60
9.97k
{
61
9.97k
  UNION *u;
62
9.97k
63
9.97k
  dim = isl_space_params(dim);
64
9.97k
  if (!dim)
65
0
    return NULL;
66
9.97k
67
9.97k
  
u = 9.97k
isl_calloc_type9.97k
(dim->ctx, UNION);
68
9.97k
  if (!u)
69
0
    goto error;
70
9.97k
71
9.97k
  u->ref = 1;
72
9.97k
#ifdef HAS_TYPE
73
  u->type = type;
74
#endif
75
9.97k
  u->space = dim;
76
9.97k
  if (isl_hash_table_init(dim->ctx, &u->table, size) < 0)
77
0
    
return 0
FN0
(UNION,free)(u);
78
9.97k
79
9.97k
  return u;
80
9.97k
error:
81
0
  isl_space_free(dim);
82
9.97k
  return NULL;
83
9.97k
}
isl_aff.c:isl_union_pw_aff_alloc
Line
Count
Source
60
4.54k
{
61
4.54k
  UNION *u;
62
4.54k
63
4.54k
  dim = isl_space_params(dim);
64
4.54k
  if (!dim)
65
0
    return NULL;
66
4.54k
67
4.54k
  
u = 4.54k
isl_calloc_type4.54k
(dim->ctx, UNION);
68
4.54k
  if (!u)
69
0
    goto error;
70
4.54k
71
4.54k
  u->ref = 1;
72
4.54k
#ifdef HAS_TYPE
73
  u->type = type;
74
#endif
75
4.54k
  u->space = dim;
76
4.54k
  if (isl_hash_table_init(dim->ctx, &u->table, size) < 0)
77
0
    
return 0
FN0
(UNION,free)(u);
78
4.54k
79
4.54k
  return u;
80
4.54k
error:
81
0
  isl_space_free(dim);
82
4.54k
  return NULL;
83
4.54k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_alloc
isl_polynomial.c:isl_union_pw_qpolynomial_alloc
Line
Count
Source
60
4
{
61
4
  UNION *u;
62
4
63
4
  dim = isl_space_params(dim);
64
4
  if (!dim)
65
0
    return NULL;
66
4
67
4
  
u = 4
isl_calloc_type4
(dim->ctx, UNION);
68
4
  if (!u)
69
0
    goto error;
70
4
71
4
  u->ref = 1;
72
4
#ifdef HAS_TYPE
73
  u->type = type;
74
#endif
75
4
  u->space = dim;
76
4
  if (isl_hash_table_init(dim->ctx, &u->table, size) < 0)
77
0
    
return 0
FN0
(UNION,free)(u);
78
4
79
4
  return u;
80
4
error:
81
0
  isl_space_free(dim);
82
4
  return NULL;
83
4
}
84
85
#ifdef HAS_TYPE
86
__isl_give UNION *FN(UNION,ZERO)(__isl_take isl_space *dim, enum isl_fold type)
87
0
{
88
0
  return FN(UNION,alloc)(dim, type, 16);
89
0
}
90
#else
91
__isl_give UNION *FN(UNION,ZERO)(__isl_take isl_space *dim)
92
10.4k
{
93
10.4k
  return FN(UNION,alloc)(dim, 16);
94
10.4k
}
isl_union_pw_aff_empty
Line
Count
Source
92
2.69k
{
93
2.69k
  return FN(UNION,alloc)(dim, 16);
94
2.69k
}
isl_union_pw_qpolynomial_zero
Line
Count
Source
92
3
{
93
3
  return FN(UNION,alloc)(dim, 16);
94
3
}
isl_union_pw_multi_aff_empty
Line
Count
Source
92
7.71k
{
93
7.71k
  return FN(UNION,alloc)(dim, 16);
94
7.71k
}
95
#endif
96
97
__isl_give UNION *FN(UNION,copy)(__isl_keep UNION *u)
98
28.6k
{
99
28.6k
  if (!u)
100
0
    return NULL;
101
28.6k
102
28.6k
  u->ref++;
103
28.6k
  return u;
104
28.6k
}
isl_union_pw_multi_aff_copy
Line
Count
Source
98
7.26k
{
99
7.26k
  if (!u)
100
0
    return NULL;
101
7.26k
102
7.26k
  u->ref++;
103
7.26k
  return u;
104
7.26k
}
isl_union_pw_qpolynomial_copy
Line
Count
Source
98
4
{
99
4
  if (!u)
100
0
    return NULL;
101
4
102
4
  u->ref++;
103
4
  return u;
104
4
}
isl_union_pw_aff_copy
Line
Count
Source
98
21.3k
{
99
21.3k
  if (!u)
100
0
    return NULL;
101
21.3k
102
21.3k
  u->ref++;
103
21.3k
  return u;
104
21.3k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_copy
105
106
/* Extract the element of "u" living in "space" (ignoring parameters).
107
 *
108
 * Return the ZERO element if "u" does not contain any element
109
 * living in "space".
110
 */
111
__isl_give PART *FN(FN(UNION,extract),PARTS)(__isl_keep UNION *u,
112
  __isl_take isl_space *space)
113
0
{
114
0
  struct isl_hash_table_entry *entry;
115
0
  isl_bool equal_params;
116
0
117
0
  if (
!u || 0
!space0
)
118
0
    goto error;
119
0
  equal_params = isl_space_has_equal_params(u->space, space);
120
0
  if (equal_params < 0)
121
0
    goto error;
122
0
  
if (0
!equal_params0
)
{0
123
0
    space = isl_space_drop_dims(space, isl_dim_param,
124
0
          0, isl_space_dim(space, isl_dim_param));
125
0
    space = isl_space_align_params(space,
126
0
          FN(UNION,get_space)(u));
127
0
    if (!space)
128
0
      goto error;
129
0
  }
130
0
131
0
  
entry = 0
FN0
(UNION,find_part_entry)(u, space, 0);
132
0
  if (!entry)
133
0
    goto error;
134
0
  
if (0
entry == isl_hash_table_entry_none0
)
135
0
#ifdef HAS_TYPE
136
0
    
return 0
FN0
(PART,ZERO)(space, u->type);
137
#else
138
0
    
return 0
FN0
(PART,ZERO)(space);
139
#endif
140
0
  isl_space_free(space);
141
0
  return FN(PART,copy)(entry->data);
142
0
error:
143
0
  isl_space_free(space);
144
0
  return NULL;
145
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_extract_pw_qpolynomial
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold
Unexecuted instantiation: isl_union_pw_multi_aff_extract_pw_multi_aff
Unexecuted instantiation: isl_union_pw_aff_extract_pw_aff
146
147
/* Add "part" to "u".
148
 * If "disjoint" is set, then "u" is not allowed to already have
149
 * a part that is defined over a domain that overlaps with the domain
150
 * of "part".
151
 * Otherwise, compute the union sum of "part" and the part in "u"
152
 * defined on the same space.
153
 */
154
static __isl_give UNION *FN(UNION,add_part_generic)(__isl_take UNION *u,
155
  __isl_take PART *part, int disjoint)
156
17.1k
{
157
17.1k
  int empty;
158
17.1k
  struct isl_hash_table_entry *entry;
159
17.1k
160
17.1k
  if (!part)
161
0
    goto error;
162
17.1k
163
17.1k
  
empty = 17.1k
FN17.1k
(PART,IS_ZERO)(part);
164
17.1k
  if (empty < 0)
165
0
    goto error;
166
17.1k
  
if (17.1k
empty17.1k
)
{1
167
1
    FN(PART,free)(part);
168
1
    return u;
169
17.1k
  }
170
17.1k
171
17.1k
  
u = 17.1k
FN17.1k
(UNION,align_params)(u,
FN17.1k
(PART,get_space)(part));
172
17.1k
  part = 
FN17.1k
(PART,align_params)(part,
FN17.1k
(UNION,get_space)(u));
173
17.1k
174
17.1k
  u = FN(UNION,cow)(u);
175
17.1k
176
17.1k
  if (!u)
177
0
    goto error;
178
17.1k
179
17.1k
  
if (17.1k
FN17.1k
(UNION,check_disjoint_domain_other)(u, part) < 017.1k
)
180
1
    goto error;
181
17.1k
  
entry = 17.1k
FN17.1k
(UNION,find_part_entry)(u, part->dim, 1);
182
17.1k
  if (!entry)
183
0
    goto error;
184
17.1k
185
17.1k
  
if (17.1k
!entry->data17.1k
)
186
17.1k
    entry->data = part;
187
17.1k
  else {
188
3
    if (disjoint &&
189
1
        
FN1
(UNION,check_disjoint_domain)(entry->data, part) < 01
)
190
0
      goto error;
191
3
    
entry->data = 3
FN3
(PART,union_add_)(entry->data,
192
3
            FN(PART,copy)(part));
193
3
    if (!entry->data)
194
0
      goto error;
195
3
    
empty = 3
FN3
(PART,IS_ZERO)(part);
196
3
    if (empty < 0)
197
0
      goto error;
198
3
    
if (3
empty3
)
199
0
      
u = 0
FN0
(UNION,remove_part_entry)(u, entry);
200
3
    FN(PART,free)(part);
201
17.1k
  }
202
17.1k
203
17.1k
  return u;
204
17.1k
error:
205
1
  FN(PART,free)(part);
206
1
  FN(UNION,free)(u);
207
17.1k
  return NULL;
208
17.1k
}
isl_polynomial.c:isl_union_pw_qpolynomial_add_part_generic
Line
Count
Source
156
5
{
157
5
  int empty;
158
5
  struct isl_hash_table_entry *entry;
159
5
160
5
  if (!part)
161
0
    goto error;
162
5
163
5
  
empty = 5
FN5
(PART,IS_ZERO)(part);
164
5
  if (empty < 0)
165
0
    goto error;
166
5
  
if (5
empty5
)
{0
167
0
    FN(PART,free)(part);
168
0
    return u;
169
5
  }
170
5
171
5
  
u = 5
FN5
(UNION,align_params)(u,
FN5
(PART,get_space)(part));
172
5
  part = 
FN5
(PART,align_params)(part,
FN5
(UNION,get_space)(u));
173
5
174
5
  u = FN(UNION,cow)(u);
175
5
176
5
  if (!u)
177
0
    goto error;
178
5
179
5
  
if (5
FN5
(UNION,check_disjoint_domain_other)(u, part) < 05
)
180
0
    goto error;
181
5
  
entry = 5
FN5
(UNION,find_part_entry)(u, part->dim, 1);
182
5
  if (!entry)
183
0
    goto error;
184
5
185
5
  
if (5
!entry->data5
)
186
5
    entry->data = part;
187
5
  else {
188
0
    if (disjoint &&
189
0
        
FN0
(UNION,check_disjoint_domain)(entry->data, part) < 00
)
190
0
      goto error;
191
0
    
entry->data = 0
FN0
(PART,union_add_)(entry->data,
192
0
            FN(PART,copy)(part));
193
0
    if (!entry->data)
194
0
      goto error;
195
0
    
empty = 0
FN0
(PART,IS_ZERO)(part);
196
0
    if (empty < 0)
197
0
      goto error;
198
0
    
if (0
empty0
)
199
0
      
u = 0
FN0
(UNION,remove_part_entry)(u, entry);
200
0
    FN(PART,free)(part);
201
5
  }
202
5
203
5
  return u;
204
5
error:
205
0
  FN(PART,free)(part);
206
0
  FN(UNION,free)(u);
207
5
  return NULL;
208
5
}
isl_aff.c:isl_union_pw_aff_add_part_generic
Line
Count
Source
156
6.85k
{
157
6.85k
  int empty;
158
6.85k
  struct isl_hash_table_entry *entry;
159
6.85k
160
6.85k
  if (!part)
161
0
    goto error;
162
6.85k
163
6.85k
  
empty = 6.85k
FN6.85k
(PART,IS_ZERO)(part);
164
6.85k
  if (empty < 0)
165
0
    goto error;
166
6.85k
  
if (6.85k
empty6.85k
)
{0
167
0
    FN(PART,free)(part);
168
0
    return u;
169
6.85k
  }
170
6.85k
171
6.85k
  
u = 6.85k
FN6.85k
(UNION,align_params)(u,
FN6.85k
(PART,get_space)(part));
172
6.85k
  part = 
FN6.85k
(PART,align_params)(part,
FN6.85k
(UNION,get_space)(u));
173
6.85k
174
6.85k
  u = FN(UNION,cow)(u);
175
6.85k
176
6.85k
  if (!u)
177
0
    goto error;
178
6.85k
179
6.85k
  
if (6.85k
FN6.85k
(UNION,check_disjoint_domain_other)(u, part) < 06.85k
)
180
0
    goto error;
181
6.85k
  
entry = 6.85k
FN6.85k
(UNION,find_part_entry)(u, part->dim, 1);
182
6.85k
  if (!entry)
183
0
    goto error;
184
6.85k
185
6.85k
  
if (6.85k
!entry->data6.85k
)
186
6.85k
    entry->data = part;
187
6.85k
  else {
188
0
    if (disjoint &&
189
0
        
FN0
(UNION,check_disjoint_domain)(entry->data, part) < 00
)
190
0
      goto error;
191
0
    
entry->data = 0
FN0
(PART,union_add_)(entry->data,
192
0
            FN(PART,copy)(part));
193
0
    if (!entry->data)
194
0
      goto error;
195
0
    
empty = 0
FN0
(PART,IS_ZERO)(part);
196
0
    if (empty < 0)
197
0
      goto error;
198
0
    
if (0
empty0
)
199
0
      
u = 0
FN0
(UNION,remove_part_entry)(u, entry);
200
0
    FN(PART,free)(part);
201
6.85k
  }
202
6.85k
203
6.85k
  return u;
204
6.85k
error:
205
0
  FN(PART,free)(part);
206
0
  FN(UNION,free)(u);
207
6.85k
  return NULL;
208
6.85k
}
isl_aff.c:isl_union_pw_multi_aff_add_part_generic
Line
Count
Source
156
10.3k
{
157
10.3k
  int empty;
158
10.3k
  struct isl_hash_table_entry *entry;
159
10.3k
160
10.3k
  if (!part)
161
0
    goto error;
162
10.3k
163
10.3k
  
empty = 10.3k
FN10.3k
(PART,IS_ZERO)(part);
164
10.3k
  if (empty < 0)
165
0
    goto error;
166
10.3k
  
if (10.3k
empty10.3k
)
{1
167
1
    FN(PART,free)(part);
168
1
    return u;
169
10.3k
  }
170
10.3k
171
10.3k
  
u = 10.3k
FN10.3k
(UNION,align_params)(u,
FN10.3k
(PART,get_space)(part));
172
10.3k
  part = 
FN10.3k
(PART,align_params)(part,
FN10.3k
(UNION,get_space)(u));
173
10.3k
174
10.3k
  u = FN(UNION,cow)(u);
175
10.3k
176
10.3k
  if (!u)
177
0
    goto error;
178
10.3k
179
10.3k
  
if (10.3k
FN10.3k
(UNION,check_disjoint_domain_other)(u, part) < 010.3k
)
180
1
    goto error;
181
10.3k
  
entry = 10.3k
FN10.3k
(UNION,find_part_entry)(u, part->dim, 1);
182
10.3k
  if (!entry)
183
0
    goto error;
184
10.3k
185
10.3k
  
if (10.3k
!entry->data10.3k
)
186
10.2k
    entry->data = part;
187
10.3k
  else {
188
3
    if (disjoint &&
189
1
        
FN1
(UNION,check_disjoint_domain)(entry->data, part) < 01
)
190
0
      goto error;
191
3
    
entry->data = 3
FN3
(PART,union_add_)(entry->data,
192
3
            FN(PART,copy)(part));
193
3
    if (!entry->data)
194
0
      goto error;
195
3
    
empty = 3
FN3
(PART,IS_ZERO)(part);
196
3
    if (empty < 0)
197
0
      goto error;
198
3
    
if (3
empty3
)
199
0
      
u = 0
FN0
(UNION,remove_part_entry)(u, entry);
200
3
    FN(PART,free)(part);
201
10.3k
  }
202
10.3k
203
10.3k
  return u;
204
10.3k
error:
205
1
  FN(PART,free)(part);
206
1
  FN(UNION,free)(u);
207
10.3k
  return NULL;
208
10.3k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_add_part_generic
209
210
/* Add "part" to "u", where "u" is assumed not to already have
211
 * a part that is defined on the same space as "part".
212
 */
213
__isl_give UNION *FN(FN(UNION,add),PARTS)(__isl_take UNION *u,
214
  __isl_take PART *part)
215
16.7k
{
216
16.7k
  return FN(UNION,add_part_generic)(u, part, 1);
217
16.7k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_add_pw_qpolynomial_fold
isl_union_pw_multi_aff_add_pw_multi_aff
Line
Count
Source
215
10.1k
{
216
10.1k
  return FN(UNION,add_part_generic)(u, part, 1);
217
10.1k
}
isl_union_pw_qpolynomial_add_pw_qpolynomial
Line
Count
Source
215
4
{
216
4
  return FN(UNION,add_part_generic)(u, part, 1);
217
4
}
isl_union_pw_aff_add_pw_aff
Line
Count
Source
215
6.61k
{
216
6.61k
  return FN(UNION,add_part_generic)(u, part, 1);
217
6.61k
}
218
219
#ifdef HAS_TYPE
220
/* Allocate a UNION with the same type and the same size as "u" and
221
 * with space "space".
222
 */
223
static __isl_give UNION *FN(UNION,alloc_same_size_on_space)(__isl_keep UNION *u,
224
  __isl_take isl_space *space)
225
0
{
226
0
  if (!u)
227
0
    goto error;
228
0
  
return 0
FN0
(UNION,alloc)(space, u->type, u->table.n);
229
0
error:
230
0
  isl_space_free(space);
231
0
  return NULL;
232
0
}
233
#else
234
/* Allocate a UNION with the same size as "u" and with space "space".
235
 */
236
static __isl_give UNION *FN(UNION,alloc_same_size_on_space)(__isl_keep UNION *u,
237
  __isl_take isl_space *space)
238
4.11k
{
239
4.11k
  if (!u)
240
0
    goto error;
241
4.11k
  
return 4.11k
FN4.11k
(UNION,alloc)(space, u->table.n);
242
4.11k
error:
243
0
  isl_space_free(space);
244
4.11k
  return NULL;
245
4.11k
}
isl_polynomial.c:isl_union_pw_qpolynomial_alloc_same_size_on_space
Line
Count
Source
238
1
{
239
1
  if (!u)
240
0
    goto error;
241
1
  
return 1
FN1
(UNION,alloc)(space, u->table.n);
242
1
error:
243
0
  isl_space_free(space);
244
1
  return NULL;
245
1
}
isl_aff.c:isl_union_pw_multi_aff_alloc_same_size_on_space
Line
Count
Source
238
2.25k
{
239
2.25k
  if (!u)
240
0
    goto error;
241
2.25k
  
return 2.25k
FN2.25k
(UNION,alloc)(space, u->table.n);
242
2.25k
error:
243
0
  isl_space_free(space);
244
2.25k
  return NULL;
245
2.25k
}
isl_aff.c:isl_union_pw_aff_alloc_same_size_on_space
Line
Count
Source
238
1.85k
{
239
1.85k
  if (!u)
240
0
    goto error;
241
1.85k
  
return 1.85k
FN1.85k
(UNION,alloc)(space, u->table.n);
242
1.85k
error:
243
0
  isl_space_free(space);
244
1.85k
  return NULL;
245
1.85k
}
246
#endif
247
248
/* Allocate a UNION with the same space, the same type (if any) and
249
 * the same size as "u".
250
 */
251
static __isl_give UNION *FN(UNION,alloc_same_size)(__isl_keep UNION *u)
252
1.15k
{
253
1.15k
  return 
FN1.15k
(UNION,alloc_same_size_on_space)(u,
FN1.15k
(UNION,get_space)(u));
254
1.15k
}
isl_aff.c:isl_union_pw_multi_aff_alloc_same_size
Line
Count
Source
252
131
{
253
131
  return 
FN131
(UNION,alloc_same_size_on_space)(u,
FN131
(UNION,get_space)(u));
254
131
}
isl_aff.c:isl_union_pw_aff_alloc_same_size
Line
Count
Source
252
1.02k
{
253
1.02k
  return 
FN1.02k
(UNION,alloc_same_size_on_space)(u,
FN1.02k
(UNION,get_space)(u));
254
1.02k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_alloc_same_size
isl_polynomial.c:isl_union_pw_qpolynomial_alloc_same_size
Line
Count
Source
252
1
{
253
1
  return 
FN1
(UNION,alloc_same_size_on_space)(u,
FN1
(UNION,get_space)(u));
254
1
}
255
256
/* Internal data structure for isl_union_*_transform_space.
257
 * "fn' is applied to each entry in the input.
258
 * "res" collects the results.
259
 */
260
S(UNION,transform_data)
261
{
262
  __isl_give PART *(*fn)(__isl_take PART *part, void *user);
263
  void *user;
264
265
  UNION *res;
266
};
267
268
/* Apply data->fn to "part" and add the result to data->res.
269
 */
270
static isl_stat FN(UNION,transform_entry)(__isl_take PART *part, void *user)
271
2.23k
{
272
2.23k
  S(UNION,transform_data) *data = (S(UNION,transform_data) *)user;
273
2.23k
274
2.23k
  part = data->fn(part, data->user);
275
2.23k
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
276
2.23k
  if (!data->res)
277
0
    return isl_stat_error;
278
2.23k
279
2.23k
  return isl_stat_ok;
280
2.23k
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_transform_entry
isl_aff.c:isl_union_pw_aff_transform_entry
Line
Count
Source
271
928
{
272
928
  S(UNION,transform_data) *data = (S(UNION,transform_data) *)user;
273
928
274
928
  part = data->fn(part, data->user);
275
928
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
276
928
  if (!data->res)
277
0
    return isl_stat_error;
278
928
279
928
  return isl_stat_ok;
280
928
}
isl_aff.c:isl_union_pw_multi_aff_transform_entry
Line
Count
Source
271
1.30k
{
272
1.30k
  S(UNION,transform_data) *data = (S(UNION,transform_data) *)user;
273
1.30k
274
1.30k
  part = data->fn(part, data->user);
275
1.30k
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
276
1.30k
  if (!data->res)
277
0
    return isl_stat_error;
278
1.30k
279
1.30k
  return isl_stat_ok;
280
1.30k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_transform_entry
281
282
/* Return a UNION living in "space" that is obtained by applying "fn"
283
 * to each of the entries in "u".
284
 */
285
static __isl_give UNION *FN(UNION,transform_space)(__isl_take UNION *u,
286
  isl_space *space,
287
  __isl_give PART *(*fn)(__isl_take PART *part, void *user), void *user)
288
2.96k
{
289
2.96k
  S(UNION,transform_data) data = { fn, user };
290
2.96k
291
2.96k
  data.res = FN(UNION,alloc_same_size_on_space)(u, space);
292
2.96k
  if (
FN2.96k
(FN(UNION,foreach),PARTS)(u,2.96k
293
2.96k
          &FN(UNION,transform_entry), &data) < 0)
294
0
    
data.res = 0
FN0
(UNION,free)(data.res);
295
2.96k
  FN(UNION,free)(u);
296
2.96k
  return data.res;
297
2.96k
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_transform_space
isl_aff.c:isl_union_pw_multi_aff_transform_space
Line
Count
Source
288
2.12k
{
289
2.12k
  S(UNION,transform_data) data = { fn, user };
290
2.12k
291
2.12k
  data.res = FN(UNION,alloc_same_size_on_space)(u, space);
292
2.12k
  if (
FN2.12k
(FN(UNION,foreach),PARTS)(u,2.12k
293
2.12k
          &FN(UNION,transform_entry), &data) < 0)
294
0
    
data.res = 0
FN0
(UNION,free)(data.res);
295
2.12k
  FN(UNION,free)(u);
296
2.12k
  return data.res;
297
2.12k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_transform_space
isl_aff.c:isl_union_pw_aff_transform_space
Line
Count
Source
288
834
{
289
834
  S(UNION,transform_data) data = { fn, user };
290
834
291
834
  data.res = FN(UNION,alloc_same_size_on_space)(u, space);
292
834
  if (
FN834
(FN(UNION,foreach),PARTS)(u,834
293
834
          &FN(UNION,transform_entry), &data) < 0)
294
0
    
data.res = 0
FN0
(UNION,free)(data.res);
295
834
  FN(UNION,free)(u);
296
834
  return data.res;
297
834
}
298
299
/* Return a UNION that lives in the same space as "u" and that is obtained
300
 * by applying "fn" to each of the entries in "u".
301
 */
302
static __isl_give UNION *FN(UNION,transform)(__isl_take UNION *u,
303
  __isl_give PART *(*fn)(__isl_take PART *part, void *user), void *user)
304
2.84k
{
305
2.84k
  return 
FN2.84k
(UNION,transform_space)(u,
FN2.84k
(UNION,get_space)(u), fn, user);
306
2.84k
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_transform
isl_aff.c:isl_union_pw_multi_aff_transform
Line
Count
Source
304
2.11k
{
305
2.11k
  return 
FN2.11k
(UNION,transform_space)(u,
FN2.11k
(UNION,get_space)(u), fn, user);
306
2.11k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_transform
isl_aff.c:isl_union_pw_aff_transform
Line
Count
Source
304
728
{
305
728
  return 
FN728
(UNION,transform_space)(u,
FN728
(UNION,get_space)(u), fn, user);
306
728
}
307
308
/* Apply data->fn to *part and store the result back into *part.
309
 */
310
static isl_stat FN(UNION,transform_inplace_entry)(void **part, void *user)
311
3.07k
{
312
3.07k
  S(UNION,transform_data) *data = (S(UNION,transform_data) *) user;
313
3.07k
314
3.07k
  *part = data->fn(*part, data->user);
315
3.07k
  if (!*part)
316
0
    return isl_stat_error;
317
3.07k
  return isl_stat_ok;
318
3.07k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_transform_inplace_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_transform_inplace_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_transform_inplace_entry
isl_aff.c:isl_union_pw_aff_transform_inplace_entry
Line
Count
Source
311
3.07k
{
312
3.07k
  S(UNION,transform_data) *data = (S(UNION,transform_data) *) user;
313
3.07k
314
3.07k
  *part = data->fn(*part, data->user);
315
3.07k
  if (!*part)
316
0
    return isl_stat_error;
317
3.07k
  return isl_stat_ok;
318
3.07k
}
319
320
/* Update "u" by applying "fn" to each entry.
321
 * This operation is assumed not to change the number of entries nor
322
 * the spaces of the entries.
323
 *
324
 * If there is only one reference to "u", then change "u" inplace.
325
 * Otherwise, create a new UNION from "u" and discard the original.
326
 */
327
static __isl_give UNION *FN(UNION,transform_inplace)(__isl_take UNION *u,
328
  __isl_give PART *(*fn)(__isl_take PART *part, void *user), void *user)
329
2.74k
{
330
2.74k
  isl_bool single_ref;
331
2.74k
332
2.74k
  single_ref = FN(UNION,has_single_reference)(u);
333
2.74k
  if (single_ref < 0)
334
0
    
return 0
FN0
(UNION,free)(u);
335
2.74k
  
if (2.74k
single_ref2.74k
)
{2.15k
336
2.15k
    S(UNION,transform_data) data = { fn, user };
337
2.15k
    if (
FN2.15k
(UNION,foreach_inplace)(u,2.15k
338
2.15k
        &FN(UNION,transform_inplace_entry), &data) < 0)
339
0
      
return 0
FN0
(UNION,free)(u);
340
2.15k
    return u;
341
2.74k
  }
342
596
  
return 596
FN596
(UNION,transform)(u, fn, user);
343
2.74k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_transform_inplace
isl_aff.c:isl_union_pw_aff_transform_inplace
Line
Count
Source
329
2.74k
{
330
2.74k
  isl_bool single_ref;
331
2.74k
332
2.74k
  single_ref = FN(UNION,has_single_reference)(u);
333
2.74k
  if (single_ref < 0)
334
0
    
return 0
FN0
(UNION,free)(u);
335
2.74k
  
if (2.74k
single_ref2.74k
)
{2.15k
336
2.15k
    S(UNION,transform_data) data = { fn, user };
337
2.15k
    if (
FN2.15k
(UNION,foreach_inplace)(u,2.15k
338
2.15k
        &FN(UNION,transform_inplace_entry), &data) < 0)
339
0
      
return 0
FN0
(UNION,free)(u);
340
2.15k
    return u;
341
2.74k
  }
342
596
  
return 596
FN596
(UNION,transform)(u, fn, user);
343
2.74k
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_transform_inplace
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_transform_inplace
344
345
/* An isl_union_*_transform callback for use in isl_union_*_dup
346
 * that simply returns "part".
347
 */
348
static __isl_give PART *FN(UNION,copy_part)(__isl_take PART *part, void *user)
349
1.50k
{
350
1.50k
  return part;
351
1.50k
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_copy_part
isl_aff.c:isl_union_pw_multi_aff_copy_part
Line
Count
Source
349
1.30k
{
350
1.30k
  return part;
351
1.30k
}
isl_aff.c:isl_union_pw_aff_copy_part
Line
Count
Source
349
198
{
350
198
  return part;
351
198
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_copy_part
352
353
__isl_give UNION *FN(UNION,dup)(__isl_keep UNION *u)
354
2.24k
{
355
2.24k
  u = FN(UNION,copy)(u);
356
2.24k
  return 
FN2.24k
(UNION,transform)(u, &
FN2.24k
(UNION,copy_part), NULL);
357
2.24k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_dup
isl_union_pw_aff_dup
Line
Count
Source
354
132
{
355
132
  u = FN(UNION,copy)(u);
356
132
  return 
FN132
(UNION,transform)(u, &
FN132
(UNION,copy_part), NULL);
357
132
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_dup
isl_union_pw_multi_aff_dup
Line
Count
Source
354
2.11k
{
355
2.11k
  u = FN(UNION,copy)(u);
356
2.11k
  return 
FN2.11k
(UNION,transform)(u, &
FN2.11k
(UNION,copy_part), NULL);
357
2.11k
}
358
359
__isl_give UNION *FN(UNION,cow)(__isl_take UNION *u)
360
17.5k
{
361
17.5k
  if (!u)
362
0
    return NULL;
363
17.5k
364
17.5k
  
if (17.5k
u->ref == 117.5k
)
365
15.2k
    return u;
366
17.5k
  u->ref--;
367
2.24k
  return FN(UNION,dup)(u);
368
17.5k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_cow
isl_union_pw_aff_cow
Line
Count
Source
360
7.10k
{
361
7.10k
  if (!u)
362
0
    return NULL;
363
7.10k
364
7.10k
  
if (7.10k
u->ref == 17.10k
)
365
6.96k
    return u;
366
7.10k
  u->ref--;
367
132
  return FN(UNION,dup)(u);
368
7.10k
}
isl_union_pw_multi_aff_cow
Line
Count
Source
360
10.4k
{
361
10.4k
  if (!u)
362
0
    return NULL;
363
10.4k
364
10.4k
  
if (10.4k
u->ref == 110.4k
)
365
8.31k
    return u;
366
10.4k
  u->ref--;
367
2.11k
  return FN(UNION,dup)(u);
368
10.4k
}
isl_union_pw_qpolynomial_cow
Line
Count
Source
360
6
{
361
6
  if (!u)
362
0
    return NULL;
363
6
364
6
  
if (6
u->ref == 16
)
365
6
    return u;
366
6
  u->ref--;
367
0
  return FN(UNION,dup)(u);
368
6
}
369
370
__isl_null UNION *FN(UNION,free)(__isl_take UNION *u)
371
48.6k
{
372
48.6k
  if (!u)
373
7.78k
    return NULL;
374
48.6k
375
40.8k
  
if (40.8k
--u->ref > 040.8k
)
376
26.4k
    return NULL;
377
40.8k
378
40.8k
  isl_hash_table_foreach(u->space->ctx, &u->table,
379
14.4k
        &FN(UNION,free_u_entry), NULL);
380
14.4k
  isl_hash_table_clear(&u->table);
381
14.4k
  isl_space_free(u->space);
382
14.4k
  free(u);
383
40.8k
  return NULL;
384
48.6k
}
isl_union_pw_qpolynomial_free
Line
Count
Source
371
8
{
372
8
  if (!u)
373
0
    return NULL;
374
8
375
8
  
if (8
--u->ref > 08
)
376
4
    return NULL;
377
8
378
8
  isl_hash_table_foreach(u->space->ctx, &u->table,
379
4
        &FN(UNION,free_u_entry), NULL);
380
4
  isl_hash_table_clear(&u->table);
381
4
  isl_space_free(u->space);
382
4
  free(u);
383
8
  return NULL;
384
8
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_free
isl_union_pw_multi_aff_free
Line
Count
Source
371
15.1k
{
372
15.1k
  if (!u)
373
1
    return NULL;
374
15.1k
375
15.1k
  
if (15.1k
--u->ref > 015.1k
)
376
5.15k
    return NULL;
377
15.1k
378
15.1k
  isl_hash_table_foreach(u->space->ctx, &u->table,
379
9.97k
        &FN(UNION,free_u_entry), NULL);
380
9.97k
  isl_hash_table_clear(&u->table);
381
9.97k
  isl_space_free(u->space);
382
9.97k
  free(u);
383
15.1k
  return NULL;
384
15.1k
}
isl_union_pw_aff_free
Line
Count
Source
371
33.5k
{
372
33.5k
  if (!u)
373
7.78k
    return NULL;
374
33.5k
375
25.7k
  
if (25.7k
--u->ref > 025.7k
)
376
21.2k
    return NULL;
377
25.7k
378
25.7k
  isl_hash_table_foreach(u->space->ctx, &u->table,
379
4.49k
        &FN(UNION,free_u_entry), NULL);
380
4.49k
  isl_hash_table_clear(&u->table);
381
4.49k
  isl_space_free(u->space);
382
4.49k
  free(u);
383
25.7k
  return NULL;
384
33.5k
}
385
386
static __isl_give PART *FN(UNION,align_entry)(__isl_take PART *part, void *user)
387
128
{
388
128
  isl_reordering *exp = user;
389
128
390
128
  exp = isl_reordering_extend_space(isl_reordering_copy(exp),
391
128
            FN(PART,get_domain_space)(part));
392
128
  return FN(PART,realign_domain)(part, exp);
393
128
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_align_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_align_entry
isl_aff.c:isl_union_pw_aff_align_entry
Line
Count
Source
387
128
{
388
128
  isl_reordering *exp = user;
389
128
390
128
  exp = isl_reordering_extend_space(isl_reordering_copy(exp),
391
128
            FN(PART,get_domain_space)(part));
392
128
  return FN(PART,realign_domain)(part, exp);
393
128
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_align_entry
394
395
/* Reorder the parameters of "u" according to the given reordering.
396
 */
397
static __isl_give UNION *FN(UNION,realign_domain)(__isl_take UNION *u,
398
  __isl_take isl_reordering *r)
399
114
{
400
114
  isl_space *space;
401
114
402
114
  if (
!u || 114
!r114
)
403
0
    goto error;
404
114
405
114
  space = isl_space_copy(r->dim);
406
114
  u = 
FN114
(UNION,transform_space)(u, space, &
FN114
(UNION,align_entry), r);
407
114
  isl_reordering_free(r);
408
114
  return u;
409
114
error:
410
0
  FN(UNION,free)(u);
411
0
  isl_reordering_free(r);
412
114
  return NULL;
413
114
}
isl_aff.c:isl_union_pw_multi_aff_realign_domain
Line
Count
Source
399
8
{
400
8
  isl_space *space;
401
8
402
8
  if (
!u || 8
!r8
)
403
0
    goto error;
404
8
405
8
  space = isl_space_copy(r->dim);
406
8
  u = 
FN8
(UNION,transform_space)(u, space, &
FN8
(UNION,align_entry), r);
407
8
  isl_reordering_free(r);
408
8
  return u;
409
8
error:
410
0
  FN(UNION,free)(u);
411
0
  isl_reordering_free(r);
412
8
  return NULL;
413
8
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_realign_domain
isl_aff.c:isl_union_pw_aff_realign_domain
Line
Count
Source
399
106
{
400
106
  isl_space *space;
401
106
402
106
  if (
!u || 106
!r106
)
403
0
    goto error;
404
106
405
106
  space = isl_space_copy(r->dim);
406
106
  u = 
FN106
(UNION,transform_space)(u, space, &
FN106
(UNION,align_entry), r);
407
106
  isl_reordering_free(r);
408
106
  return u;
409
106
error:
410
0
  FN(UNION,free)(u);
411
0
  isl_reordering_free(r);
412
106
  return NULL;
413
106
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_realign_domain
414
415
/* Align the parameters of "u" to those of "model".
416
 */
417
__isl_give UNION *FN(UNION,align_params)(__isl_take UNION *u,
418
  __isl_take isl_space *model)
419
20.3k
{
420
20.3k
  isl_bool equal_params;
421
20.3k
  isl_reordering *r;
422
20.3k
423
20.3k
  if (
!u || 20.3k
!model20.3k
)
424
0
    goto error;
425
20.3k
426
20.3k
  equal_params = isl_space_has_equal_params(u->space, model);
427
20.3k
  if (equal_params < 0)
428
0
    goto error;
429
20.3k
  
if (20.3k
equal_params20.3k
)
{20.3k
430
20.3k
    isl_space_free(model);
431
20.3k
    return u;
432
20.3k
  }
433
20.3k
434
20.3k
  model = isl_space_params(model);
435
8
  r = isl_parameter_alignment_reordering(u->space, model);
436
8
  isl_space_free(model);
437
8
438
8
  return FN(UNION,realign_domain)(u, r);
439
20.3k
error:
440
0
  isl_space_free(model);
441
0
  FN(UNION,free)(u);
442
20.3k
  return NULL;
443
20.3k
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_align_params
isl_union_pw_aff_align_params
Line
Count
Source
419
8.78k
{
420
8.78k
  isl_bool equal_params;
421
8.78k
  isl_reordering *r;
422
8.78k
423
8.78k
  if (
!u || 8.78k
!model8.78k
)
424
0
    goto error;
425
8.78k
426
8.78k
  equal_params = isl_space_has_equal_params(u->space, model);
427
8.78k
  if (equal_params < 0)
428
0
    goto error;
429
8.78k
  
if (8.78k
equal_params8.78k
)
{8.78k
430
8.78k
    isl_space_free(model);
431
8.78k
    return u;
432
8.78k
  }
433
8.78k
434
8.78k
  model = isl_space_params(model);
435
0
  r = isl_parameter_alignment_reordering(u->space, model);
436
0
  isl_space_free(model);
437
0
438
0
  return FN(UNION,realign_domain)(u, r);
439
8.78k
error:
440
0
  isl_space_free(model);
441
0
  FN(UNION,free)(u);
442
8.78k
  return NULL;
443
8.78k
}
isl_union_pw_qpolynomial_align_params
Line
Count
Source
419
10
{
420
10
  isl_bool equal_params;
421
10
  isl_reordering *r;
422
10
423
10
  if (
!u || 10
!model10
)
424
0
    goto error;
425
10
426
10
  equal_params = isl_space_has_equal_params(u->space, model);
427
10
  if (equal_params < 0)
428
0
    goto error;
429
10
  
if (10
equal_params10
)
{10
430
10
    isl_space_free(model);
431
10
    return u;
432
10
  }
433
10
434
10
  model = isl_space_params(model);
435
0
  r = isl_parameter_alignment_reordering(u->space, model);
436
0
  isl_space_free(model);
437
0
438
0
  return FN(UNION,realign_domain)(u, r);
439
10
error:
440
0
  isl_space_free(model);
441
0
  FN(UNION,free)(u);
442
10
  return NULL;
443
10
}
isl_union_pw_multi_aff_align_params
Line
Count
Source
419
11.5k
{
420
11.5k
  isl_bool equal_params;
421
11.5k
  isl_reordering *r;
422
11.5k
423
11.5k
  if (
!u || 11.5k
!model11.5k
)
424
0
    goto error;
425
11.5k
426
11.5k
  equal_params = isl_space_has_equal_params(u->space, model);
427
11.5k
  if (equal_params < 0)
428
0
    goto error;
429
11.5k
  
if (11.5k
equal_params11.5k
)
{11.5k
430
11.5k
    isl_space_free(model);
431
11.5k
    return u;
432
11.5k
  }
433
11.5k
434
11.5k
  model = isl_space_params(model);
435
8
  r = isl_parameter_alignment_reordering(u->space, model);
436
8
  isl_space_free(model);
437
8
438
8
  return FN(UNION,realign_domain)(u, r);
439
11.5k
error:
440
0
  isl_space_free(model);
441
0
  FN(UNION,free)(u);
442
11.5k
  return NULL;
443
11.5k
}
444
445
/* Add "part" to *u, taking the union sum if "u" already has
446
 * a part defined on the same space as "part".
447
 */
448
static isl_stat FN(UNION,union_add_part)(__isl_take PART *part, void *user)
449
445
{
450
445
  UNION **u = (UNION **)user;
451
445
452
445
  *u = FN(UNION,add_part_generic)(*u, part, 0);
453
445
454
445
  return isl_stat_ok;
455
445
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_union_add_part
isl_aff.c:isl_union_pw_aff_union_add_part
Line
Count
Source
449
242
{
450
242
  UNION **u = (UNION **)user;
451
242
452
242
  *u = FN(UNION,add_part_generic)(*u, part, 0);
453
242
454
242
  return isl_stat_ok;
455
242
}
isl_polynomial.c:isl_union_pw_qpolynomial_union_add_part
Line
Count
Source
449
1
{
450
1
  UNION **u = (UNION **)user;
451
1
452
1
  *u = FN(UNION,add_part_generic)(*u, part, 0);
453
1
454
1
  return isl_stat_ok;
455
1
}
isl_aff.c:isl_union_pw_multi_aff_union_add_part
Line
Count
Source
449
202
{
450
202
  UNION **u = (UNION **)user;
451
202
452
202
  *u = FN(UNION,add_part_generic)(*u, part, 0);
453
202
454
202
  return isl_stat_ok;
455
202
}
456
457
/* Compute the sum of "u1" and "u2" on the union of their domains,
458
 * with the actual sum on the shared domain and
459
 * the defined expression on the symmetric difference of the domains.
460
 *
461
 * This is an internal function that is exposed under different
462
 * names depending on whether the base expressions have a zero default
463
 * value.
464
 * If they do, then this function is called "add".
465
 * Otherwise, it is called "union_add".
466
 */
467
static __isl_give UNION *FN(UNION,union_add_)(__isl_take UNION *u1,
468
  __isl_take UNION *u2)
469
369
{
470
369
  u1 = 
FN369
(UNION,align_params)(u1,
FN369
(UNION,get_space)(u2));
471
369
  u2 = 
FN369
(UNION,align_params)(u2,
FN369
(UNION,get_space)(u1));
472
369
473
369
  u1 = FN(UNION,cow)(u1);
474
369
475
369
  if (
!u1 || 369
!u2369
)
476
0
    goto error;
477
369
478
369
  
if (369
FN369
(FN(UNION,foreach),PARTS)(u2, &369
FN369
(UNION,union_add_part), &u1) < 0)
479
0
    goto error;
480
369
481
369
  
FN369
(UNION,free)(u2);369
482
369
483
369
  return u1;
484
369
error:
485
0
  FN(UNION,free)(u1);
486
0
  FN(UNION,free)(u2);
487
369
  return NULL;
488
369
}
isl_aff.c:isl_union_pw_aff_union_add_
Line
Count
Source
469
242
{
470
242
  u1 = 
FN242
(UNION,align_params)(u1,
FN242
(UNION,get_space)(u2));
471
242
  u2 = 
FN242
(UNION,align_params)(u2,
FN242
(UNION,get_space)(u1));
472
242
473
242
  u1 = FN(UNION,cow)(u1);
474
242
475
242
  if (
!u1 || 242
!u2242
)
476
0
    goto error;
477
242
478
242
  
if (242
FN242
(FN(UNION,foreach),PARTS)(u2, &242
FN242
(UNION,union_add_part), &u1) < 0)
479
0
    goto error;
480
242
481
242
  
FN242
(UNION,free)(u2);242
482
242
483
242
  return u1;
484
242
error:
485
0
  FN(UNION,free)(u1);
486
0
  FN(UNION,free)(u2);
487
242
  return NULL;
488
242
}
isl_polynomial.c:isl_union_pw_qpolynomial_union_add_
Line
Count
Source
469
1
{
470
1
  u1 = 
FN1
(UNION,align_params)(u1,
FN1
(UNION,get_space)(u2));
471
1
  u2 = 
FN1
(UNION,align_params)(u2,
FN1
(UNION,get_space)(u1));
472
1
473
1
  u1 = FN(UNION,cow)(u1);
474
1
475
1
  if (
!u1 || 1
!u21
)
476
0
    goto error;
477
1
478
1
  
if (1
FN1
(FN(UNION,foreach),PARTS)(u2, &1
FN1
(UNION,union_add_part), &u1) < 0)
479
0
    goto error;
480
1
481
1
  
FN1
(UNION,free)(u2);1
482
1
483
1
  return u1;
484
1
error:
485
0
  FN(UNION,free)(u1);
486
0
  FN(UNION,free)(u2);
487
1
  return NULL;
488
1
}
isl_aff.c:isl_union_pw_multi_aff_union_add_
Line
Count
Source
469
126
{
470
126
  u1 = 
FN126
(UNION,align_params)(u1,
FN126
(UNION,get_space)(u2));
471
126
  u2 = 
FN126
(UNION,align_params)(u2,
FN126
(UNION,get_space)(u1));
472
126
473
126
  u1 = FN(UNION,cow)(u1);
474
126
475
126
  if (
!u1 || 126
!u2126
)
476
0
    goto error;
477
126
478
126
  
if (126
FN126
(FN(UNION,foreach),PARTS)(u2, &126
FN126
(UNION,union_add_part), &u1) < 0)
479
0
    goto error;
480
126
481
126
  
FN126
(UNION,free)(u2);126
482
126
483
126
  return u1;
484
126
error:
485
0
  FN(UNION,free)(u1);
486
0
  FN(UNION,free)(u2);
487
126
  return NULL;
488
126
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_union_add_
489
490
__isl_give UNION *FN(FN(UNION,from),PARTS)(__isl_take PART *part)
491
733
{
492
733
  isl_space *dim;
493
733
  UNION *u;
494
733
495
733
  if (!part)
496
0
    return NULL;
497
733
498
733
  
dim = 733
FN733
(PART,get_space)(part);
499
733
  dim = isl_space_drop_dims(dim, isl_dim_in, 0, isl_space_dim(dim, isl_dim_in));
500
733
  dim = isl_space_drop_dims(dim, isl_dim_out, 0, isl_space_dim(dim, isl_dim_out));
501
733
#ifdef HAS_TYPE
502
0
  u = FN(UNION,ZERO)(dim, part->type);
503
#else
504
733
  u = FN(UNION,ZERO)(dim);
505
#endif
506
733
  u = FN(FN(UNION,add),PARTS)(u, part);
507
733
508
733
  return u;
509
733
}
isl_union_pw_aff_from_pw_aff
Line
Count
Source
491
730
{
492
730
  isl_space *dim;
493
730
  UNION *u;
494
730
495
730
  if (!part)
496
0
    return NULL;
497
730
498
730
  
dim = 730
FN730
(PART,get_space)(part);
499
730
  dim = isl_space_drop_dims(dim, isl_dim_in, 0, isl_space_dim(dim, isl_dim_in));
500
730
  dim = isl_space_drop_dims(dim, isl_dim_out, 0, isl_space_dim(dim, isl_dim_out));
501
730
#ifdef HAS_TYPE
502
  u = FN(UNION,ZERO)(dim, part->type);
503
#else
504
730
  u = FN(UNION,ZERO)(dim);
505
730
#endif
506
730
  u = FN(FN(UNION,add),PARTS)(u, part);
507
730
508
730
  return u;
509
730
}
Unexecuted instantiation: isl_union_pw_multi_aff_from_pw_multi_aff
isl_union_pw_qpolynomial_from_pw_qpolynomial
Line
Count
Source
491
3
{
492
3
  isl_space *dim;
493
3
  UNION *u;
494
3
495
3
  if (!part)
496
0
    return NULL;
497
3
498
3
  
dim = 3
FN3
(PART,get_space)(part);
499
3
  dim = isl_space_drop_dims(dim, isl_dim_in, 0, isl_space_dim(dim, isl_dim_in));
500
3
  dim = isl_space_drop_dims(dim, isl_dim_out, 0, isl_space_dim(dim, isl_dim_out));
501
3
#ifdef HAS_TYPE
502
  u = FN(UNION,ZERO)(dim, part->type);
503
#else
504
3
  u = FN(UNION,ZERO)(dim);
505
3
#endif
506
3
  u = FN(FN(UNION,add),PARTS)(u, part);
507
3
508
3
  return u;
509
3
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_from_pw_qpolynomial_fold
510
511
S(UNION,match_bin_data) {
512
  UNION *u2;
513
  UNION *res;
514
  __isl_give PART *(*fn)(__isl_take PART *, __isl_take PART *);
515
};
516
517
/* Check if data->u2 has an element living in the same space as "part".
518
 * If so, call data->fn on the two elements and add the result to
519
 * data->res.
520
 */
521
static isl_stat FN(UNION,match_bin_entry)(__isl_take PART *part, void *user)
522
573
{
523
573
  S(UNION,match_bin_data) *data = user;
524
573
  struct isl_hash_table_entry *entry2;
525
573
  isl_space *space;
526
573
  PART *part2;
527
573
528
573
  space = FN(PART,get_space)(part);
529
573
  entry2 = FN(UNION,find_part_entry)(data->u2, space, 0);
530
573
  isl_space_free(space);
531
573
  if (!entry2)
532
0
    goto error;
533
573
  
if (573
entry2 == isl_hash_table_entry_none573
)
{1
534
1
    FN(PART,free)(part);
535
1
    return isl_stat_ok;
536
573
  }
537
573
538
573
  part2 = entry2->data;
539
572
  if (!isl_space_tuple_is_equal(part->dim, isl_dim_out,
540
572
          part2->dim, isl_dim_out))
541
0
    isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid,
542
572
      "entries should have the same range space",
543
572
      goto error);
544
572
545
572
  
part = data->fn(part, 572
FN572
(PART, copy)(entry2->data));
546
572
547
572
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
548
572
  if (!data->res)
549
0
    return isl_stat_error;
550
572
551
572
  return isl_stat_ok;
552
572
error:
553
0
  FN(PART,free)(part);
554
572
  return isl_stat_error;
555
573
}
isl_aff.c:isl_union_pw_multi_aff_match_bin_entry
Line
Count
Source
522
2
{
523
2
  S(UNION,match_bin_data) *data = user;
524
2
  struct isl_hash_table_entry *entry2;
525
2
  isl_space *space;
526
2
  PART *part2;
527
2
528
2
  space = FN(PART,get_space)(part);
529
2
  entry2 = FN(UNION,find_part_entry)(data->u2, space, 0);
530
2
  isl_space_free(space);
531
2
  if (!entry2)
532
0
    goto error;
533
2
  
if (2
entry2 == isl_hash_table_entry_none2
)
{1
534
1
    FN(PART,free)(part);
535
1
    return isl_stat_ok;
536
2
  }
537
2
538
2
  part2 = entry2->data;
539
1
  if (!isl_space_tuple_is_equal(part->dim, isl_dim_out,
540
1
          part2->dim, isl_dim_out))
541
0
    isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid,
542
1
      "entries should have the same range space",
543
1
      goto error);
544
1
545
1
  
part = data->fn(part, 1
FN1
(PART, copy)(entry2->data));
546
1
547
1
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
548
1
  if (!data->res)
549
0
    return isl_stat_error;
550
1
551
1
  return isl_stat_ok;
552
1
error:
553
0
  FN(PART,free)(part);
554
1
  return isl_stat_error;
555
2
}
isl_aff.c:isl_union_pw_aff_match_bin_entry
Line
Count
Source
522
571
{
523
571
  S(UNION,match_bin_data) *data = user;
524
571
  struct isl_hash_table_entry *entry2;
525
571
  isl_space *space;
526
571
  PART *part2;
527
571
528
571
  space = FN(PART,get_space)(part);
529
571
  entry2 = FN(UNION,find_part_entry)(data->u2, space, 0);
530
571
  isl_space_free(space);
531
571
  if (!entry2)
532
0
    goto error;
533
571
  
if (571
entry2 == isl_hash_table_entry_none571
)
{0
534
0
    FN(PART,free)(part);
535
0
    return isl_stat_ok;
536
571
  }
537
571
538
571
  part2 = entry2->data;
539
571
  if (!isl_space_tuple_is_equal(part->dim, isl_dim_out,
540
571
          part2->dim, isl_dim_out))
541
0
    isl_die(FN(UNION,get_ctx)(data->u2), isl_error_invalid,
542
571
      "entries should have the same range space",
543
571
      goto error);
544
571
545
571
  
part = data->fn(part, 571
FN571
(PART, copy)(entry2->data));
546
571
547
571
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
548
571
  if (!data->res)
549
0
    return isl_stat_error;
550
571
551
571
  return isl_stat_ok;
552
571
error:
553
0
  FN(PART,free)(part);
554
571
  return isl_stat_error;
555
571
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_match_bin_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_match_bin_entry
556
557
/* This function is currently only used from isl_polynomial.c
558
 * and not from isl_fold.c.
559
 */
560
static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1,
561
  __isl_take UNION *u2,
562
  __isl_give PART *(*fn)(__isl_take PART *, __isl_take PART *))
563
  __attribute__ ((unused));
564
/* For each pair of elements in "u1" and "u2" living in the same space,
565
 * call "fn" and collect the results.
566
 */
567
static __isl_give UNION *FN(UNION,match_bin_op)(__isl_take UNION *u1,
568
  __isl_take UNION *u2,
569
  __isl_give PART *(*fn)(__isl_take PART *, __isl_take PART *))
570
391
{
571
391
  S(UNION,match_bin_data) data = { NULL, NULL, fn };
572
391
573
391
  u1 = 
FN391
(UNION,align_params)(u1,
FN391
(UNION,get_space)(u2));
574
391
  u2 = 
FN391
(UNION,align_params)(u2,
FN391
(UNION,get_space)(u1));
575
391
576
391
  if (
!u1 || 391
!u2391
)
577
0
    goto error;
578
391
579
391
  data.u2 = u2;
580
391
  data.res = FN(UNION,alloc_same_size)(u1);
581
391
  if (
FN391
(FN(UNION,foreach),PARTS)(u1,391
582
391
            &FN(UNION,match_bin_entry), &data) < 0)
583
0
    goto error;
584
391
585
391
  
FN391
(UNION,free)(u1);391
586
391
  FN(UNION,free)(u2);
587
391
  return data.res;
588
391
error:
589
0
  FN(UNION,free)(u1);
590
0
  FN(UNION,free)(u2);
591
0
  FN(UNION,free)(data.res);
592
391
  return NULL;
593
391
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_match_bin_op
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_match_bin_op
isl_aff.c:isl_union_pw_aff_match_bin_op
Line
Count
Source
570
390
{
571
390
  S(UNION,match_bin_data) data = { NULL, NULL, fn };
572
390
573
390
  u1 = 
FN390
(UNION,align_params)(u1,
FN390
(UNION,get_space)(u2));
574
390
  u2 = 
FN390
(UNION,align_params)(u2,
FN390
(UNION,get_space)(u1));
575
390
576
390
  if (
!u1 || 390
!u2390
)
577
0
    goto error;
578
390
579
390
  data.u2 = u2;
580
390
  data.res = FN(UNION,alloc_same_size)(u1);
581
390
  if (
FN390
(FN(UNION,foreach),PARTS)(u1,390
582
390
            &FN(UNION,match_bin_entry), &data) < 0)
583
0
    goto error;
584
390
585
390
  
FN390
(UNION,free)(u1);390
586
390
  FN(UNION,free)(u2);
587
390
  return data.res;
588
390
error:
589
0
  FN(UNION,free)(u1);
590
0
  FN(UNION,free)(u2);
591
0
  FN(UNION,free)(data.res);
592
390
  return NULL;
593
390
}
isl_aff.c:isl_union_pw_multi_aff_match_bin_op
Line
Count
Source
570
1
{
571
1
  S(UNION,match_bin_data) data = { NULL, NULL, fn };
572
1
573
1
  u1 = 
FN1
(UNION,align_params)(u1,
FN1
(UNION,get_space)(u2));
574
1
  u2 = 
FN1
(UNION,align_params)(u2,
FN1
(UNION,get_space)(u1));
575
1
576
1
  if (
!u1 || 1
!u21
)
577
0
    goto error;
578
1
579
1
  data.u2 = u2;
580
1
  data.res = FN(UNION,alloc_same_size)(u1);
581
1
  if (
FN1
(FN(UNION,foreach),PARTS)(u1,1
582
1
            &FN(UNION,match_bin_entry), &data) < 0)
583
0
    goto error;
584
1
585
1
  
FN1
(UNION,free)(u1);1
586
1
  FN(UNION,free)(u2);
587
1
  return data.res;
588
1
error:
589
0
  FN(UNION,free)(u1);
590
0
  FN(UNION,free)(u2);
591
0
  FN(UNION,free)(data.res);
592
1
  return NULL;
593
1
}
594
595
/* Compute the sum of "u1" and "u2".
596
 *
597
 * If the base expressions have a default zero value, then the sum
598
 * is computed on the union of the domains of "u1" and "u2".
599
 * Otherwise, it is computed on their shared domains.
600
 */
601
__isl_give UNION *FN(UNION,add)(__isl_take UNION *u1, __isl_take UNION *u2)
602
133
{
603
133
#if DEFAULT_IS_ZERO
604
1
  return FN(UNION,union_add_)(u1, u2);
605
#else
606
132
  return 
FN132
(UNION,match_bin_op)(u1, u2, &
FN132
(PART,add));
607
#endif
608
133
}
isl_union_pw_aff_add
Line
Count
Source
602
131
{
603
131
#if DEFAULT_IS_ZERO
604
  return FN(UNION,union_add_)(u1, u2);
605
#else
606
131
  return 
FN131
(UNION,match_bin_op)(u1, u2, &
FN131
(PART,add));
607
131
#endif
608
131
}
isl_union_pw_qpolynomial_add
Line
Count
Source
602
1
{
603
1
#if DEFAULT_IS_ZERO
604
1
  return FN(UNION,union_add_)(u1, u2);
605
1
#else
606
  return FN(UNION,match_bin_op)(u1, u2, &FN(PART,add));
607
#endif
608
1
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_add
isl_union_pw_multi_aff_add
Line
Count
Source
602
1
{
603
1
#if DEFAULT_IS_ZERO
604
  return FN(UNION,union_add_)(u1, u2);
605
#else
606
1
  return 
FN1
(UNION,match_bin_op)(u1, u2, &
FN1
(PART,add));
607
1
#endif
608
1
}
609
610
#ifndef NO_SUB
611
/* Subtract "u2" from "u1" and return the result.
612
 */
613
__isl_give UNION *FN(UNION,sub)(__isl_take UNION *u1, __isl_take UNION *u2)
614
259
{
615
259
  return 
FN259
(UNION,match_bin_op)(u1, u2, &
FN259
(PART,sub));
616
259
}
isl_union_pw_aff_sub
Line
Count
Source
614
259
{
615
259
  return 
FN259
(UNION,match_bin_op)(u1, u2, &
FN259
(PART,sub));
616
259
}
Unexecuted instantiation: isl_union_pw_multi_aff_sub
Unexecuted instantiation: isl_union_pw_qpolynomial_sub
617
#endif
618
619
S(UNION,any_set_data) {
620
  isl_set *set;
621
  __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*);
622
};
623
624
static __isl_give PART *FN(UNION,any_set_entry)(__isl_take PART *part,
625
  void *user)
626
0
{
627
0
  S(UNION,any_set_data) *data = user;
628
0
629
0
  return data->fn(part, isl_set_copy(data->set));
630
0
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_any_set_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_any_set_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_any_set_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_any_set_entry
631
632
/* Update each element of "u" by calling "fn" on the element and "set".
633
 */
634
static __isl_give UNION *FN(UNION,any_set_op)(__isl_take UNION *u,
635
  __isl_take isl_set *set,
636
  __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*))
637
0
{
638
0
  S(UNION,any_set_data) data = { NULL, fn };
639
0
640
0
  u = FN(UNION,align_params)(u, isl_set_get_space(set));
641
0
  set = isl_set_align_params(set, FN(UNION,get_space)(u));
642
0
643
0
  if (
!u || 0
!set0
)
644
0
    goto error;
645
0
646
0
  data.set = set;
647
0
  u = 
FN0
(UNION,transform)(u, &
FN0
(UNION,any_set_entry), &data);
648
0
  isl_set_free(set);
649
0
  return u;
650
0
error:
651
0
  FN(UNION,free)(u);
652
0
  isl_set_free(set);
653
0
  return NULL;
654
0
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_any_set_op
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_any_set_op
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_any_set_op
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_any_set_op
655
656
/* Intersect the domain of "u" with the parameter domain "context".
657
 */
658
__isl_give UNION *FN(UNION,intersect_params)(__isl_take UNION *u,
659
  __isl_take isl_set *set)
660
0
{
661
0
  return 
FN0
(UNION,any_set_op)(u, set, &
FN0
(PW,intersect_params));
662
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_intersect_params
Unexecuted instantiation: isl_union_pw_aff_intersect_params
Unexecuted instantiation: isl_union_pw_multi_aff_intersect_params
Unexecuted instantiation: isl_union_pw_qpolynomial_intersect_params
663
664
/* Compute the gist of the domain of "u" with respect to
665
 * the parameter domain "context".
666
 */
667
__isl_give UNION *FN(UNION,gist_params)(__isl_take UNION *u,
668
  __isl_take isl_set *set)
669
0
{
670
0
  return 
FN0
(UNION,any_set_op)(u, set, &
FN0
(PW,gist_params));
671
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_gist_params
Unexecuted instantiation: isl_union_pw_multi_aff_gist_params
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_gist_params
Unexecuted instantiation: isl_union_pw_aff_gist_params
672
673
S(UNION,match_domain_data) {
674
  isl_union_set *uset;
675
  UNION *res;
676
  __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*);
677
};
678
679
static int FN(UNION,set_has_dim)(const void *entry, const void *val)
680
212
{
681
212
  isl_set *set = (isl_set *)entry;
682
212
  isl_space *dim = (isl_space *)val;
683
212
684
212
  return isl_space_is_equal(set->dim, dim);
685
212
}
isl_aff.c:isl_union_pw_multi_aff_set_has_dim
Line
Count
Source
680
29
{
681
29
  isl_set *set = (isl_set *)entry;
682
29
  isl_space *dim = (isl_space *)val;
683
29
684
29
  return isl_space_is_equal(set->dim, dim);
685
29
}
isl_polynomial.c:isl_union_pw_qpolynomial_set_has_dim
Line
Count
Source
680
1
{
681
1
  isl_set *set = (isl_set *)entry;
682
1
  isl_space *dim = (isl_space *)val;
683
1
684
1
  return isl_space_is_equal(set->dim, dim);
685
1
}
isl_aff.c:isl_union_pw_aff_set_has_dim
Line
Count
Source
680
182
{
681
182
  isl_set *set = (isl_set *)entry;
682
182
  isl_space *dim = (isl_space *)val;
683
182
684
182
  return isl_space_is_equal(set->dim, dim);
685
182
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_set_has_dim
686
687
/* Find the set in data->uset that lives in the same space as the domain
688
 * of "part", apply data->fn to *entry and this set (if any), and add
689
 * the result to data->res.
690
 */
691
static isl_stat FN(UNION,match_domain_entry)(__isl_take PART *part, void *user)
692
320
{
693
320
  S(UNION,match_domain_data) *data = user;
694
320
  uint32_t hash;
695
320
  struct isl_hash_table_entry *entry2;
696
320
  isl_space *space;
697
320
698
320
  space = FN(PART,get_domain_space)(part);
699
320
  hash = isl_space_get_hash(space);
700
320
  entry2 = isl_hash_table_find(data->uset->dim->ctx, &data->uset->table,
701
320
             hash, &FN(UNION,set_has_dim), space, 0);
702
320
  isl_space_free(space);
703
320
  if (
!entry2320
)
{108
704
108
    FN(PART,free)(part);
705
108
    return isl_stat_ok;
706
320
  }
707
320
708
320
  part = data->fn(part, isl_set_copy(entry2->data));
709
212
710
212
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
711
212
  if (!data->res)
712
0
    return isl_stat_error;
713
212
714
212
  return isl_stat_ok;
715
320
}
isl_aff.c:isl_union_pw_aff_match_domain_entry
Line
Count
Source
692
288
{
693
288
  S(UNION,match_domain_data) *data = user;
694
288
  uint32_t hash;
695
288
  struct isl_hash_table_entry *entry2;
696
288
  isl_space *space;
697
288
698
288
  space = FN(PART,get_domain_space)(part);
699
288
  hash = isl_space_get_hash(space);
700
288
  entry2 = isl_hash_table_find(data->uset->dim->ctx, &data->uset->table,
701
288
             hash, &FN(UNION,set_has_dim), space, 0);
702
288
  isl_space_free(space);
703
288
  if (
!entry2288
)
{106
704
106
    FN(PART,free)(part);
705
106
    return isl_stat_ok;
706
288
  }
707
288
708
288
  part = data->fn(part, isl_set_copy(entry2->data));
709
182
710
182
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
711
182
  if (!data->res)
712
0
    return isl_stat_error;
713
182
714
182
  return isl_stat_ok;
715
288
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_match_domain_entry
isl_polynomial.c:isl_union_pw_qpolynomial_match_domain_entry
Line
Count
Source
692
1
{
693
1
  S(UNION,match_domain_data) *data = user;
694
1
  uint32_t hash;
695
1
  struct isl_hash_table_entry *entry2;
696
1
  isl_space *space;
697
1
698
1
  space = FN(PART,get_domain_space)(part);
699
1
  hash = isl_space_get_hash(space);
700
1
  entry2 = isl_hash_table_find(data->uset->dim->ctx, &data->uset->table,
701
1
             hash, &FN(UNION,set_has_dim), space, 0);
702
1
  isl_space_free(space);
703
1
  if (
!entry21
)
{0
704
0
    FN(PART,free)(part);
705
0
    return isl_stat_ok;
706
1
  }
707
1
708
1
  part = data->fn(part, isl_set_copy(entry2->data));
709
1
710
1
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
711
1
  if (!data->res)
712
0
    return isl_stat_error;
713
1
714
1
  return isl_stat_ok;
715
1
}
isl_aff.c:isl_union_pw_multi_aff_match_domain_entry
Line
Count
Source
692
31
{
693
31
  S(UNION,match_domain_data) *data = user;
694
31
  uint32_t hash;
695
31
  struct isl_hash_table_entry *entry2;
696
31
  isl_space *space;
697
31
698
31
  space = FN(PART,get_domain_space)(part);
699
31
  hash = isl_space_get_hash(space);
700
31
  entry2 = isl_hash_table_find(data->uset->dim->ctx, &data->uset->table,
701
31
             hash, &FN(UNION,set_has_dim), space, 0);
702
31
  isl_space_free(space);
703
31
  if (
!entry231
)
{2
704
2
    FN(PART,free)(part);
705
2
    return isl_stat_ok;
706
31
  }
707
31
708
31
  part = data->fn(part, isl_set_copy(entry2->data));
709
29
710
29
  data->res = FN(FN(UNION,add),PARTS)(data->res, part);
711
29
  if (!data->res)
712
0
    return isl_stat_error;
713
29
714
29
  return isl_stat_ok;
715
31
}
716
717
/* Apply fn to each pair of PW in u and set in uset such that
718
 * the set lives in the same space as the domain of PW
719
 * and collect the results.
720
 */
721
static __isl_give UNION *FN(UNION,match_domain_op)(__isl_take UNION *u,
722
  __isl_take isl_union_set *uset,
723
  __isl_give PW *(*fn)(__isl_take PW*, __isl_take isl_set*))
724
191
{
725
191
  S(UNION,match_domain_data) data = { NULL, NULL, fn };
726
191
727
191
  u = FN(UNION,align_params)(u, isl_union_set_get_space(uset));
728
191
  uset = isl_union_set_align_params(uset, FN(UNION,get_space)(u));
729
191
730
191
  if (
!u || 191
!uset191
)
731
0
    goto error;
732
191
733
191
  data.uset = uset;
734
191
  data.res = FN(UNION,alloc_same_size)(u);
735
191
  if (
FN191
(FN(UNION,foreach),PARTS)(u,191
736
191
           &FN(UNION,match_domain_entry), &data) < 0)
737
0
    goto error;
738
191
739
191
  
FN191
(UNION,free)(u);191
740
191
  isl_union_set_free(uset);
741
191
  return data.res;
742
191
error:
743
0
  FN(UNION,free)(u);
744
0
  isl_union_set_free(uset);
745
0
  FN(UNION,free)(data.res);
746
191
  return NULL;
747
191
}
isl_aff.c:isl_union_pw_aff_match_domain_op
Line
Count
Source
724
169
{
725
169
  S(UNION,match_domain_data) data = { NULL, NULL, fn };
726
169
727
169
  u = FN(UNION,align_params)(u, isl_union_set_get_space(uset));
728
169
  uset = isl_union_set_align_params(uset, FN(UNION,get_space)(u));
729
169
730
169
  if (
!u || 169
!uset169
)
731
0
    goto error;
732
169
733
169
  data.uset = uset;
734
169
  data.res = FN(UNION,alloc_same_size)(u);
735
169
  if (
FN169
(FN(UNION,foreach),PARTS)(u,169
736
169
           &FN(UNION,match_domain_entry), &data) < 0)
737
0
    goto error;
738
169
739
169
  
FN169
(UNION,free)(u);169
740
169
  isl_union_set_free(uset);
741
169
  return data.res;
742
169
error:
743
0
  FN(UNION,free)(u);
744
0
  isl_union_set_free(uset);
745
0
  FN(UNION,free)(data.res);
746
169
  return NULL;
747
169
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_match_domain_op
isl_polynomial.c:isl_union_pw_qpolynomial_match_domain_op
Line
Count
Source
724
1
{
725
1
  S(UNION,match_domain_data) data = { NULL, NULL, fn };
726
1
727
1
  u = FN(UNION,align_params)(u, isl_union_set_get_space(uset));
728
1
  uset = isl_union_set_align_params(uset, FN(UNION,get_space)(u));
729
1
730
1
  if (
!u || 1
!uset1
)
731
0
    goto error;
732
1
733
1
  data.uset = uset;
734
1
  data.res = FN(UNION,alloc_same_size)(u);
735
1
  if (
FN1
(FN(UNION,foreach),PARTS)(u,1
736
1
           &FN(UNION,match_domain_entry), &data) < 0)
737
0
    goto error;
738
1
739
1
  
FN1
(UNION,free)(u);1
740
1
  isl_union_set_free(uset);
741
1
  return data.res;
742
1
error:
743
0
  FN(UNION,free)(u);
744
0
  isl_union_set_free(uset);
745
0
  FN(UNION,free)(data.res);
746
1
  return NULL;
747
1
}
isl_aff.c:isl_union_pw_multi_aff_match_domain_op
Line
Count
Source
724
21
{
725
21
  S(UNION,match_domain_data) data = { NULL, NULL, fn };
726
21
727
21
  u = FN(UNION,align_params)(u, isl_union_set_get_space(uset));
728
21
  uset = isl_union_set_align_params(uset, FN(UNION,get_space)(u));
729
21
730
21
  if (
!u || 21
!uset21
)
731
0
    goto error;
732
21
733
21
  data.uset = uset;
734
21
  data.res = FN(UNION,alloc_same_size)(u);
735
21
  if (
FN21
(FN(UNION,foreach),PARTS)(u,21
736
21
           &FN(UNION,match_domain_entry), &data) < 0)
737
0
    goto error;
738
21
739
21
  
FN21
(UNION,free)(u);21
740
21
  isl_union_set_free(uset);
741
21
  return data.res;
742
21
error:
743
0
  FN(UNION,free)(u);
744
0
  isl_union_set_free(uset);
745
0
  FN(UNION,free)(data.res);
746
21
  return NULL;
747
21
}
748
749
/* Intersect the domain of "u" with "uset".
750
 * If "uset" is a parameters domain, then intersect the parameter
751
 * domain of "u" with this set.
752
 */
753
__isl_give UNION *FN(UNION,intersect_domain)(__isl_take UNION *u,
754
  __isl_take isl_union_set *uset)
755
26
{
756
26
  if (isl_union_set_is_params(uset))
757
0
    
return 0
FN0
(UNION,intersect_params)(u,
758
26
            isl_set_from_union_set(uset));
759
26
  
return 26
FN26
(UNION,match_domain_op)(u, uset, &
FN26
(PW,intersect_domain));
760
26
}
isl_union_pw_qpolynomial_intersect_domain
Line
Count
Source
755
1
{
756
1
  if (isl_union_set_is_params(uset))
757
0
    
return 0
FN0
(UNION,intersect_params)(u,
758
1
            isl_set_from_union_set(uset));
759
1
  
return 1
FN1
(UNION,match_domain_op)(u, uset, &
FN1
(PW,intersect_domain));
760
1
}
isl_union_pw_multi_aff_intersect_domain
Line
Count
Source
755
20
{
756
20
  if (isl_union_set_is_params(uset))
757
0
    
return 0
FN0
(UNION,intersect_params)(u,
758
20
            isl_set_from_union_set(uset));
759
20
  
return 20
FN20
(UNION,match_domain_op)(u, uset, &
FN20
(PW,intersect_domain));
760
20
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_intersect_domain
isl_union_pw_aff_intersect_domain
Line
Count
Source
755
5
{
756
5
  if (isl_union_set_is_params(uset))
757
0
    
return 0
FN0
(UNION,intersect_params)(u,
758
5
            isl_set_from_union_set(uset));
759
5
  
return 5
FN5
(UNION,match_domain_op)(u, uset, &
FN5
(PW,intersect_domain));
760
5
}
761
762
/* Take the set (which may be empty) in data->uset that lives
763
 * in the same space as the domain of "pw", subtract it from the domain
764
 * of "part" and return the result.
765
 */
766
static __isl_give PART *FN(UNION,subtract_domain_entry)(__isl_take PART *part,
767
  void *user)
768
3
{
769
3
  isl_union_set *uset = user;
770
3
  isl_space *space;
771
3
  isl_set *set;
772
3
773
3
  space = FN(PART,get_domain_space)(part);
774
3
  set = isl_union_set_extract_set(uset, space);
775
3
  return FN(PART,subtract_domain)(part, set);
776
3
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_subtract_domain_entry
isl_aff.c:isl_union_pw_multi_aff_subtract_domain_entry
Line
Count
Source
768
3
{
769
3
  isl_union_set *uset = user;
770
3
  isl_space *space;
771
3
  isl_set *set;
772
3
773
3
  space = FN(PART,get_domain_space)(part);
774
3
  set = isl_union_set_extract_set(uset, space);
775
3
  return FN(PART,subtract_domain)(part, set);
776
3
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_subtract_domain_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_subtract_domain_entry
777
778
/* Subtract "uset' from the domain of "u".
779
 */
780
__isl_give UNION *FN(UNION,subtract_domain)(__isl_take UNION *u,
781
  __isl_take isl_union_set *uset)
782
3
{
783
3
  u = 
FN3
(UNION,transform)(u, &
FN3
(UNION,subtract_domain_entry), uset);
784
3
  isl_union_set_free(uset);
785
3
  return u;
786
3
}
Unexecuted instantiation: isl_union_pw_aff_subtract_domain
Unexecuted instantiation: isl_union_pw_qpolynomial_subtract_domain
isl_union_pw_multi_aff_subtract_domain
Line
Count
Source
782
3
{
783
3
  u = 
FN3
(UNION,transform)(u, &
FN3
(UNION,subtract_domain_entry), uset);
784
3
  isl_union_set_free(uset);
785
3
  return u;
786
3
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_subtract_domain
787
788
__isl_give UNION *FN(UNION,gist)(__isl_take UNION *u,
789
  __isl_take isl_union_set *uset)
790
165
{
791
165
  if (isl_union_set_is_params(uset))
792
0
    
return 0
FN0
(UNION,gist_params)(u, isl_set_from_union_set(uset));
793
165
  
return 165
FN165
(UNION,match_domain_op)(u, uset, &
FN165
(PW,gist));
794
165
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_gist
isl_union_pw_aff_gist
Line
Count
Source
790
164
{
791
164
  if (isl_union_set_is_params(uset))
792
0
    
return 0
FN0
(UNION,gist_params)(u, isl_set_from_union_set(uset));
793
164
  
return 164
FN164
(UNION,match_domain_op)(u, uset, &
FN164
(PW,gist));
794
164
}
isl_union_pw_multi_aff_gist
Line
Count
Source
790
1
{
791
1
  if (isl_union_set_is_params(uset))
792
0
    
return 0
FN0
(UNION,gist_params)(u, isl_set_from_union_set(uset));
793
1
  
return 1
FN1
(UNION,match_domain_op)(u, uset, &
FN1
(PW,gist));
794
1
}
Unexecuted instantiation: isl_union_pw_qpolynomial_gist
795
796
/* Coalesce an entry in a UNION.  Coalescing is performed in-place.
797
 * Since the UNION may have several references, the entry is only
798
 * replaced if the coalescing is successful.
799
 */
800
static isl_stat FN(UNION,coalesce_entry)(void **entry, void *user)
801
0
{
802
0
  PART **part_p = (PART **) entry;
803
0
  PART *part;
804
0
805
0
  part = FN(PART,copy)(*part_p);
806
0
  part = FN(PW,coalesce)(part);
807
0
  if (!part)
808
0
    return isl_stat_error;
809
0
  
FN0
(PART,free)(*part_p);0
810
0
  *part_p = part;
811
0
812
0
  return isl_stat_ok;
813
0
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_coalesce_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_coalesce_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_coalesce_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_coalesce_entry
814
815
__isl_give UNION *FN(UNION,coalesce)(__isl_take UNION *u)
816
0
{
817
0
  if (
FN0
(UNION,foreach_inplace)(u, &0
FN0
(UNION,coalesce_entry), NULL) < 0)
818
0
    goto error;
819
0
820
0
  return u;
821
0
error:
822
0
  FN(UNION,free)(u);
823
0
  return NULL;
824
0
}
Unexecuted instantiation: isl_union_pw_multi_aff_coalesce
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_coalesce
Unexecuted instantiation: isl_union_pw_qpolynomial_coalesce
Unexecuted instantiation: isl_union_pw_aff_coalesce
825
826
static isl_stat FN(UNION,domain_entry)(__isl_take PART *part, void *user)
827
8.47k
{
828
8.47k
  isl_union_set **uset = (isl_union_set **)user;
829
8.47k
830
8.47k
  *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part));
831
8.47k
832
8.47k
  return isl_stat_ok;
833
8.47k
}
isl_polynomial.c:isl_union_pw_qpolynomial_domain_entry
Line
Count
Source
827
1
{
828
1
  isl_union_set **uset = (isl_union_set **)user;
829
1
830
1
  *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part));
831
1
832
1
  return isl_stat_ok;
833
1
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_domain_entry
isl_aff.c:isl_union_pw_multi_aff_domain_entry
Line
Count
Source
827
5
{
828
5
  isl_union_set **uset = (isl_union_set **)user;
829
5
830
5
  *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part));
831
5
832
5
  return isl_stat_ok;
833
5
}
isl_aff.c:isl_union_pw_aff_domain_entry
Line
Count
Source
827
8.46k
{
828
8.46k
  isl_union_set **uset = (isl_union_set **)user;
829
8.46k
830
8.46k
  *uset = isl_union_set_add_set(*uset, FN(PART,domain)(part));
831
8.46k
832
8.46k
  return isl_stat_ok;
833
8.46k
}
834
835
__isl_give isl_union_set *FN(UNION,domain)(__isl_take UNION *u)
836
5.61k
{
837
5.61k
  isl_union_set *uset;
838
5.61k
839
5.61k
  uset = isl_union_set_empty(FN(UNION,get_space)(u));
840
5.61k
  if (
FN5.61k
(FN(UNION,foreach),PARTS)(u, &5.61k
FN5.61k
(UNION,domain_entry), &uset) < 0)
841
0
    goto error;
842
5.61k
843
5.61k
  
FN5.61k
(UNION,free)(u);5.61k
844
5.61k
  
845
5.61k
  return uset;
846
5.61k
error:
847
0
  isl_union_set_free(uset);
848
0
  FN(UNION,free)(u);
849
5.61k
  return NULL;
850
5.61k
}
isl_union_pw_qpolynomial_domain
Line
Count
Source
836
1
{
837
1
  isl_union_set *uset;
838
1
839
1
  uset = isl_union_set_empty(FN(UNION,get_space)(u));
840
1
  if (
FN1
(FN(UNION,foreach),PARTS)(u, &1
FN1
(UNION,domain_entry), &uset) < 0)
841
0
    goto error;
842
1
843
1
  
FN1
(UNION,free)(u);1
844
1
  
845
1
  return uset;
846
1
error:
847
0
  isl_union_set_free(uset);
848
0
  FN(UNION,free)(u);
849
1
  return NULL;
850
1
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_domain
isl_union_pw_multi_aff_domain
Line
Count
Source
836
5
{
837
5
  isl_union_set *uset;
838
5
839
5
  uset = isl_union_set_empty(FN(UNION,get_space)(u));
840
5
  if (
FN5
(FN(UNION,foreach),PARTS)(u, &5
FN5
(UNION,domain_entry), &uset) < 0)
841
0
    goto error;
842
5
843
5
  
FN5
(UNION,free)(u);5
844
5
  
845
5
  return uset;
846
5
error:
847
0
  isl_union_set_free(uset);
848
0
  FN(UNION,free)(u);
849
5
  return NULL;
850
5
}
isl_union_pw_aff_domain
Line
Count
Source
836
5.61k
{
837
5.61k
  isl_union_set *uset;
838
5.61k
839
5.61k
  uset = isl_union_set_empty(FN(UNION,get_space)(u));
840
5.61k
  if (
FN5.61k
(FN(UNION,foreach),PARTS)(u, &5.61k
FN5.61k
(UNION,domain_entry), &uset) < 0)
841
0
    goto error;
842
5.61k
843
5.61k
  
FN5.61k
(UNION,free)(u);5.61k
844
5.61k
  
845
5.61k
  return uset;
846
5.61k
error:
847
0
  isl_union_set_free(uset);
848
0
  FN(UNION,free)(u);
849
5.61k
  return NULL;
850
5.61k
}
851
852
#ifdef HAS_TYPE
853
/* Negate the type of "u".
854
 */
855
static __isl_give UNION *FN(UNION,negate_type)(__isl_take UNION *u)
856
0
{
857
0
  u = FN(UNION,cow)(u);
858
0
  if (!u)
859
0
    return NULL;
860
0
  u->type = isl_fold_type_negate(u->type);
861
0
  return u;
862
0
}
863
#else
864
/* Negate the type of "u".
865
 * Since "u" does not have a type, do nothing.
866
 */
867
static __isl_give UNION *FN(UNION,negate_type)(__isl_take UNION *u)
868
0
{
869
0
  return u;
870
0
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_negate_type
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_negate_type
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_negate_type
871
#endif
872
873
static __isl_give PART *FN(UNION,mul_isl_int_entry)(__isl_take PART *part,
874
  void *user)
875
0
{
876
0
  isl_int *v = user;
877
0
878
0
  return FN(PW,mul_isl_int)(part, *v);
879
0
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_mul_isl_int_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_mul_isl_int_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_mul_isl_int_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_mul_isl_int_entry
880
881
__isl_give UNION *FN(UNION,mul_isl_int)(__isl_take UNION *u, isl_int v)
882
0
{
883
0
  if (isl_int_is_one(v))
884
0
    return u;
885
0
886
0
  
if (0
DEFAULT_IS_ZERO0
&& 0
u0
&&
isl_int_is_zero0
(v))
{0
887
0
    UNION *zero;
888
0
    isl_space *dim = FN(UNION,get_space)(u);
889
0
#ifdef HAS_TYPE
890
0
    zero = FN(UNION,ZERO)(dim, u->type);
891
#else
892
0
    zero = FN(UNION,ZERO)(dim);
893
#endif
894
0
    FN(UNION,free)(u);
895
0
    return zero;
896
0
  }
897
0
898
0
  
u = 0
FN0
(UNION,transform_inplace)(u, &
FN0
(UNION,mul_isl_int_entry), &v);
899
0
  if (isl_int_is_neg(v))
900
0
    
u = 0
FN0
(UNION,negate_type)(u);
901
0
902
0
  return u;
903
0
}
Unexecuted instantiation: isl_union_pw_aff_mul_isl_int
Unexecuted instantiation: isl_union_pw_multi_aff_mul_isl_int
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_mul_isl_int
Unexecuted instantiation: isl_union_pw_qpolynomial_mul_isl_int
904
905
/* Multiply "part" by the isl_val "user" and return the result.
906
 */
907
static __isl_give PART *FN(UNION,scale_val_entry)(__isl_take PART *part,
908
  void *user)
909
152
{
910
152
  isl_val *v = user;
911
152
912
152
  return FN(PART,scale_val)(part, isl_val_copy(v));
913
152
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_scale_val_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_scale_val_entry
isl_aff.c:isl_union_pw_aff_scale_val_entry
Line
Count
Source
909
152
{
910
152
  isl_val *v = user;
911
152
912
152
  return FN(PART,scale_val)(part, isl_val_copy(v));
913
152
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_scale_val_entry
914
915
/* Multiply "u" by "v" and return the result.
916
 */
917
__isl_give UNION *FN(UNION,scale_val)(__isl_take UNION *u,
918
  __isl_take isl_val *v)
919
167
{
920
167
  if (
!u || 167
!v167
)
921
0
    goto error;
922
167
  
if (167
isl_val_is_one(v)167
)
{18
923
18
    isl_val_free(v);
924
18
    return u;
925
167
  }
926
167
927
149
  
if (149
DEFAULT_IS_ZERO149
&& 149
u0
&&
isl_val_is_zero(v)0
)
{0
928
0
    UNION *zero;
929
0
    isl_space *space = FN(UNION,get_space)(u);
930
0
#ifdef HAS_TYPE
931
0
    zero = FN(UNION,ZERO)(space, u->type);
932
#else
933
0
    zero = FN(UNION,ZERO)(space);
934
#endif
935
0
    FN(UNION,free)(u);
936
0
    isl_val_free(v);
937
0
    return zero;
938
149
  }
939
149
940
149
  
if (149
!isl_val_is_rat(v)149
)
941
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
942
149
      "expecting rational factor", goto error);
943
149
944
149
  
u = 149
FN149
(UNION,transform_inplace)(u, &
FN149
(UNION,scale_val_entry), v);
945
149
  if (isl_val_is_neg(v))
946
0
    
u = 0
FN0
(UNION,negate_type)(u);
947
149
948
149
  isl_val_free(v);
949
149
  return u;
950
149
error:
951
0
  isl_val_free(v);
952
0
  FN(UNION,free)(u);
953
149
  return NULL;
954
167
}
Unexecuted instantiation: isl_union_pw_qpolynomial_scale_val
isl_union_pw_aff_scale_val
Line
Count
Source
919
167
{
920
167
  if (
!u || 167
!v167
)
921
0
    goto error;
922
167
  
if (167
isl_val_is_one(v)167
)
{18
923
18
    isl_val_free(v);
924
18
    return u;
925
167
  }
926
167
927
149
  
if (149
DEFAULT_IS_ZERO149
&& 149
u0
&&
isl_val_is_zero(v)0
)
{0
928
0
    UNION *zero;
929
0
    isl_space *space = FN(UNION,get_space)(u);
930
0
#ifdef HAS_TYPE
931
    zero = FN(UNION,ZERO)(space, u->type);
932
#else
933
0
    zero = FN(UNION,ZERO)(space);
934
0
#endif
935
0
    FN(UNION,free)(u);
936
0
    isl_val_free(v);
937
0
    return zero;
938
149
  }
939
149
940
149
  
if (149
!isl_val_is_rat(v)149
)
941
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
942
149
      "expecting rational factor", goto error);
943
149
944
149
  
u = 149
FN149
(UNION,transform_inplace)(u, &
FN149
(UNION,scale_val_entry), v);
945
149
  if (isl_val_is_neg(v))
946
0
    
u = 0
FN0
(UNION,negate_type)(u);
947
149
948
149
  isl_val_free(v);
949
149
  return u;
950
149
error:
951
0
  isl_val_free(v);
952
0
  FN(UNION,free)(u);
953
149
  return NULL;
954
167
}
Unexecuted instantiation: isl_union_pw_multi_aff_scale_val
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_scale_val
955
956
/* Divide "part" by the isl_val "user" and return the result.
957
 */
958
static __isl_give PART *FN(UNION,scale_down_val_entry)(__isl_take PART *part,
959
  void *user)
960
154
{
961
154
  isl_val *v = user;
962
154
963
154
  return FN(PART,scale_down_val)(part, isl_val_copy(v));
964
154
}
isl_aff.c:isl_union_pw_aff_scale_down_val_entry
Line
Count
Source
960
154
{
961
154
  isl_val *v = user;
962
154
963
154
  return FN(PART,scale_down_val)(part, isl_val_copy(v));
964
154
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_scale_down_val_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_scale_down_val_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_scale_down_val_entry
965
966
/* Divide "u" by "v" and return the result.
967
 */
968
__isl_give UNION *FN(UNION,scale_down_val)(__isl_take UNION *u,
969
  __isl_take isl_val *v)
970
169
{
971
169
  if (
!u || 169
!v169
)
972
0
    goto error;
973
169
  
if (169
isl_val_is_one(v)169
)
{18
974
18
    isl_val_free(v);
975
18
    return u;
976
169
  }
977
169
978
151
  
if (151
!isl_val_is_rat(v)151
)
979
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
980
151
      "expecting rational factor", goto error);
981
151
  
if (151
isl_val_is_zero(v)151
)
982
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
983
151
      "cannot scale down by zero", goto error);
984
151
985
151
  
u = 151
FN151
(UNION,transform_inplace)(u, &
FN151
(UNION,scale_down_val_entry), v);
986
151
  if (isl_val_is_neg(v))
987
0
    
u = 0
FN0
(UNION,negate_type)(u);
988
151
989
151
  isl_val_free(v);
990
151
  return u;
991
151
error:
992
0
  isl_val_free(v);
993
0
  FN(UNION,free)(u);
994
151
  return NULL;
995
169
}
isl_union_pw_aff_scale_down_val
Line
Count
Source
970
169
{
971
169
  if (
!u || 169
!v169
)
972
0
    goto error;
973
169
  
if (169
isl_val_is_one(v)169
)
{18
974
18
    isl_val_free(v);
975
18
    return u;
976
169
  }
977
169
978
151
  
if (151
!isl_val_is_rat(v)151
)
979
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
980
151
      "expecting rational factor", goto error);
981
151
  
if (151
isl_val_is_zero(v)151
)
982
0
    isl_die(isl_val_get_ctx(v), isl_error_invalid,
983
151
      "cannot scale down by zero", goto error);
984
151
985
151
  
u = 151
FN151
(UNION,transform_inplace)(u, &
FN151
(UNION,scale_down_val_entry), v);
986
151
  if (isl_val_is_neg(v))
987
0
    
u = 0
FN0
(UNION,negate_type)(u);
988
151
989
151
  isl_val_free(v);
990
151
  return u;
991
151
error:
992
0
  isl_val_free(v);
993
0
  FN(UNION,free)(u);
994
151
  return NULL;
995
169
}
Unexecuted instantiation: isl_union_pw_qpolynomial_scale_down_val
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_scale_down_val
Unexecuted instantiation: isl_union_pw_multi_aff_scale_down_val
996
997
S(UNION,plain_is_equal_data)
998
{
999
  UNION *u2;
1000
  isl_bool is_equal;
1001
};
1002
1003
static isl_stat FN(UNION,plain_is_equal_entry)(void **entry, void *user)
1004
28
{
1005
28
  S(UNION,plain_is_equal_data) *data = user;
1006
28
  struct isl_hash_table_entry *entry2;
1007
28
  PW *pw = *entry;
1008
28
1009
28
  entry2 = FN(UNION,find_part_entry)(data->u2, pw->dim, 0);
1010
28
  if (
!entry2 || 28
entry2 == isl_hash_table_entry_none28
)
{0
1011
0
    if (!entry2)
1012
0
      data->is_equal = isl_bool_error;
1013
0
    else
1014
0
      data->is_equal = isl_bool_false;
1015
0
    return isl_stat_error;
1016
28
  }
1017
28
1018
28
  
data->is_equal = 28
FN28
(PW,plain_is_equal)(pw, entry2->data);
1019
28
  if (
data->is_equal < 0 || 28
!data->is_equal28
)
1020
0
    return isl_stat_error;
1021
28
1022
28
  return isl_stat_ok;
1023
28
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_plain_is_equal_entry
isl_polynomial.c:isl_union_pw_qpolynomial_plain_is_equal_entry
Line
Count
Source
1004
1
{
1005
1
  S(UNION,plain_is_equal_data) *data = user;
1006
1
  struct isl_hash_table_entry *entry2;
1007
1
  PW *pw = *entry;
1008
1
1009
1
  entry2 = FN(UNION,find_part_entry)(data->u2, pw->dim, 0);
1010
1
  if (
!entry2 || 1
entry2 == isl_hash_table_entry_none1
)
{0
1011
0
    if (!entry2)
1012
0
      data->is_equal = isl_bool_error;
1013
0
    else
1014
0
      data->is_equal = isl_bool_false;
1015
0
    return isl_stat_error;
1016
1
  }
1017
1
1018
1
  
data->is_equal = 1
FN1
(PW,plain_is_equal)(pw, entry2->data);
1019
1
  if (
data->is_equal < 0 || 1
!data->is_equal1
)
1020
0
    return isl_stat_error;
1021
1
1022
1
  return isl_stat_ok;
1023
1
}
isl_aff.c:isl_union_pw_aff_plain_is_equal_entry
Line
Count
Source
1004
16
{
1005
16
  S(UNION,plain_is_equal_data) *data = user;
1006
16
  struct isl_hash_table_entry *entry2;
1007
16
  PW *pw = *entry;
1008
16
1009
16
  entry2 = FN(UNION,find_part_entry)(data->u2, pw->dim, 0);
1010
16
  if (
!entry2 || 16
entry2 == isl_hash_table_entry_none16
)
{0
1011
0
    if (!entry2)
1012
0
      data->is_equal = isl_bool_error;
1013
0
    else
1014
0
      data->is_equal = isl_bool_false;
1015
0
    return isl_stat_error;
1016
16
  }
1017
16
1018
16
  
data->is_equal = 16
FN16
(PW,plain_is_equal)(pw, entry2->data);
1019
16
  if (
data->is_equal < 0 || 16
!data->is_equal16
)
1020
0
    return isl_stat_error;
1021
16
1022
16
  return isl_stat_ok;
1023
16
}
isl_aff.c:isl_union_pw_multi_aff_plain_is_equal_entry
Line
Count
Source
1004
11
{
1005
11
  S(UNION,plain_is_equal_data) *data = user;
1006
11
  struct isl_hash_table_entry *entry2;
1007
11
  PW *pw = *entry;
1008
11
1009
11
  entry2 = FN(UNION,find_part_entry)(data->u2, pw->dim, 0);
1010
11
  if (
!entry2 || 11
entry2 == isl_hash_table_entry_none11
)
{0
1011
0
    if (!entry2)
1012
0
      data->is_equal = isl_bool_error;
1013
0
    else
1014
0
      data->is_equal = isl_bool_false;
1015
0
    return isl_stat_error;
1016
11
  }
1017
11
1018
11
  
data->is_equal = 11
FN11
(PW,plain_is_equal)(pw, entry2->data);
1019
11
  if (
data->is_equal < 0 || 11
!data->is_equal11
)
1020
0
    return isl_stat_error;
1021
11
1022
11
  return isl_stat_ok;
1023
11
}
1024
1025
isl_bool FN(UNION,plain_is_equal)(__isl_keep UNION *u1, __isl_keep UNION *u2)
1026
26
{
1027
26
  S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true };
1028
26
  int n1, n2;
1029
26
1030
26
  if (
!u1 || 26
!u226
)
1031
0
    return isl_bool_error;
1032
26
  
if (26
u1 == u226
)
1033
0
    return isl_bool_true;
1034
26
  
if (26
u1->table.n != u2->table.n26
)
1035
0
    return isl_bool_false;
1036
26
  
n1 = 26
FN26
(FN(UNION,n),PARTS)(u1);
1037
26
  n2 = FN(FN(UNION,n),PARTS)(u2);
1038
26
  if (
n1 < 0 || 26
n2 < 026
)
1039
0
    return isl_bool_error;
1040
26
  
if (26
n1 != n226
)
1041
0
    return isl_bool_false;
1042
26
1043
26
  
u1 = 26
FN26
(UNION,copy)(u1);
1044
26
  u2 = FN(UNION,copy)(u2);
1045
26
  u1 = 
FN26
(UNION,align_params)(u1,
FN26
(UNION,get_space)(u2));
1046
26
  u2 = 
FN26
(UNION,align_params)(u2,
FN26
(UNION,get_space)(u1));
1047
26
  if (
!u1 || 26
!u226
)
1048
0
    goto error;
1049
26
1050
26
  data.u2 = u2;
1051
26
  if (
FN26
(UNION,foreach_inplace)(u1,26
1052
26
             &FN(UNION,plain_is_equal_entry), &data) < 0 &&
1053
0
      data.is_equal)
1054
0
    goto error;
1055
26
1056
26
  
FN26
(UNION,free)(u1);26
1057
26
  FN(UNION,free)(u2);
1058
26
1059
26
  return data.is_equal;
1060
26
error:
1061
0
  FN(UNION,free)(u1);
1062
0
  FN(UNION,free)(u2);
1063
26
  return isl_bool_error;
1064
26
}
isl_union_pw_aff_plain_is_equal
Line
Count
Source
1026
16
{
1027
16
  S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true };
1028
16
  int n1, n2;
1029
16
1030
16
  if (
!u1 || 16
!u216
)
1031
0
    return isl_bool_error;
1032
16
  
if (16
u1 == u216
)
1033
0
    return isl_bool_true;
1034
16
  
if (16
u1->table.n != u2->table.n16
)
1035
0
    return isl_bool_false;
1036
16
  
n1 = 16
FN16
(FN(UNION,n),PARTS)(u1);
1037
16
  n2 = FN(FN(UNION,n),PARTS)(u2);
1038
16
  if (
n1 < 0 || 16
n2 < 016
)
1039
0
    return isl_bool_error;
1040
16
  
if (16
n1 != n216
)
1041
0
    return isl_bool_false;
1042
16
1043
16
  
u1 = 16
FN16
(UNION,copy)(u1);
1044
16
  u2 = FN(UNION,copy)(u2);
1045
16
  u1 = 
FN16
(UNION,align_params)(u1,
FN16
(UNION,get_space)(u2));
1046
16
  u2 = 
FN16
(UNION,align_params)(u2,
FN16
(UNION,get_space)(u1));
1047
16
  if (
!u1 || 16
!u216
)
1048
0
    goto error;
1049
16
1050
16
  data.u2 = u2;
1051
16
  if (
FN16
(UNION,foreach_inplace)(u1,16
1052
16
             &FN(UNION,plain_is_equal_entry), &data) < 0 &&
1053
0
      data.is_equal)
1054
0
    goto error;
1055
16
1056
16
  
FN16
(UNION,free)(u1);16
1057
16
  FN(UNION,free)(u2);
1058
16
1059
16
  return data.is_equal;
1060
16
error:
1061
0
  FN(UNION,free)(u1);
1062
0
  FN(UNION,free)(u2);
1063
16
  return isl_bool_error;
1064
16
}
isl_union_pw_multi_aff_plain_is_equal
Line
Count
Source
1026
9
{
1027
9
  S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true };
1028
9
  int n1, n2;
1029
9
1030
9
  if (
!u1 || 9
!u29
)
1031
0
    return isl_bool_error;
1032
9
  
if (9
u1 == u29
)
1033
0
    return isl_bool_true;
1034
9
  
if (9
u1->table.n != u2->table.n9
)
1035
0
    return isl_bool_false;
1036
9
  
n1 = 9
FN9
(FN(UNION,n),PARTS)(u1);
1037
9
  n2 = FN(FN(UNION,n),PARTS)(u2);
1038
9
  if (
n1 < 0 || 9
n2 < 09
)
1039
0
    return isl_bool_error;
1040
9
  
if (9
n1 != n29
)
1041
0
    return isl_bool_false;
1042
9
1043
9
  
u1 = 9
FN9
(UNION,copy)(u1);
1044
9
  u2 = FN(UNION,copy)(u2);
1045
9
  u1 = 
FN9
(UNION,align_params)(u1,
FN9
(UNION,get_space)(u2));
1046
9
  u2 = 
FN9
(UNION,align_params)(u2,
FN9
(UNION,get_space)(u1));
1047
9
  if (
!u1 || 9
!u29
)
1048
0
    goto error;
1049
9
1050
9
  data.u2 = u2;
1051
9
  if (
FN9
(UNION,foreach_inplace)(u1,9
1052
9
             &FN(UNION,plain_is_equal_entry), &data) < 0 &&
1053
0
      data.is_equal)
1054
0
    goto error;
1055
9
1056
9
  
FN9
(UNION,free)(u1);9
1057
9
  FN(UNION,free)(u2);
1058
9
1059
9
  return data.is_equal;
1060
9
error:
1061
0
  FN(UNION,free)(u1);
1062
0
  FN(UNION,free)(u2);
1063
9
  return isl_bool_error;
1064
9
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_plain_is_equal
isl_union_pw_qpolynomial_plain_is_equal
Line
Count
Source
1026
1
{
1027
1
  S(UNION,plain_is_equal_data) data = { NULL, isl_bool_true };
1028
1
  int n1, n2;
1029
1
1030
1
  if (
!u1 || 1
!u21
)
1031
0
    return isl_bool_error;
1032
1
  
if (1
u1 == u21
)
1033
0
    return isl_bool_true;
1034
1
  
if (1
u1->table.n != u2->table.n1
)
1035
0
    return isl_bool_false;
1036
1
  
n1 = 1
FN1
(FN(UNION,n),PARTS)(u1);
1037
1
  n2 = FN(FN(UNION,n),PARTS)(u2);
1038
1
  if (
n1 < 0 || 1
n2 < 01
)
1039
0
    return isl_bool_error;
1040
1
  
if (1
n1 != n21
)
1041
0
    return isl_bool_false;
1042
1
1043
1
  
u1 = 1
FN1
(UNION,copy)(u1);
1044
1
  u2 = FN(UNION,copy)(u2);
1045
1
  u1 = 
FN1
(UNION,align_params)(u1,
FN1
(UNION,get_space)(u2));
1046
1
  u2 = 
FN1
(UNION,align_params)(u2,
FN1
(UNION,get_space)(u1));
1047
1
  if (
!u1 || 1
!u21
)
1048
0
    goto error;
1049
1
1050
1
  data.u2 = u2;
1051
1
  if (
FN1
(UNION,foreach_inplace)(u1,1
1052
1
             &FN(UNION,plain_is_equal_entry), &data) < 0 &&
1053
0
      data.is_equal)
1054
0
    goto error;
1055
1
1056
1
  
FN1
(UNION,free)(u1);1
1057
1
  FN(UNION,free)(u2);
1058
1
1059
1
  return data.is_equal;
1060
1
error:
1061
0
  FN(UNION,free)(u1);
1062
0
  FN(UNION,free)(u2);
1063
1
  return isl_bool_error;
1064
1
}
1065
1066
/* Check whether the element that "entry" points to involves any NaNs and
1067
 * store the result in *nan.
1068
 * Abort as soon as one such element has been found.
1069
 */
1070
static isl_stat FN(UNION,involves_nan_entry)(void **entry, void *user)
1071
0
{
1072
0
  isl_bool *nan = user;
1073
0
  PW *pw = *entry;
1074
0
1075
0
  *nan = FN(PW,involves_nan)(pw);
1076
0
  if (
*nan < 0 || 0
!nan0
)
1077
0
    return isl_stat_error;
1078
0
1079
0
  return isl_stat_ok;
1080
0
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_involves_nan_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_involves_nan_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_involves_nan_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_involves_nan_entry
1081
1082
/* Does "u" involve any NaNs?
1083
 */
1084
isl_bool FN(UNION,involves_nan)(__isl_keep UNION *u)
1085
0
{
1086
0
  isl_bool nan = isl_bool_false;
1087
0
1088
0
  if (!u)
1089
0
    return isl_bool_error;
1090
0
1091
0
  
if (0
FN0
(UNION,foreach_inplace)(u,0
1092
0
            &FN(UNION,involves_nan_entry), &nan) < 0 &&
1093
0
      !nan)
1094
0
    return isl_bool_error;
1095
0
1096
0
  return nan;
1097
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_involves_nan
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_involves_nan
Unexecuted instantiation: isl_union_pw_multi_aff_involves_nan
Unexecuted instantiation: isl_union_pw_aff_involves_nan
1098
1099
/* Internal data structure for isl_union_*_drop_dims.
1100
 * type, first and n are passed to isl_*_drop_dims.
1101
 */
1102
S(UNION,drop_dims_data) {
1103
  enum isl_dim_type type;
1104
  unsigned first;
1105
  unsigned n;
1106
};
1107
1108
/* Drop the parameters specified by "data" from "part" and return the result.
1109
 */
1110
static __isl_give PART *FN(UNION,drop_dims_entry)(__isl_take PART *part,
1111
  void *user)
1112
0
{
1113
0
  S(UNION,drop_dims_data) *data = user;
1114
0
1115
0
  return FN(PART,drop_dims)(part, data->type, data->first, data->n);
1116
0
}
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_drop_dims_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_drop_dims_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_drop_dims_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_drop_dims_entry
1117
1118
/* Drop the specified parameters from "u".
1119
 * That is, type is required to be isl_dim_param.
1120
 */
1121
__isl_give UNION *FN(UNION,drop_dims)( __isl_take UNION *u,
1122
  enum isl_dim_type type, unsigned first, unsigned n)
1123
0
{
1124
0
  isl_space *space;
1125
0
  S(UNION,drop_dims_data) data = { type, first, n };
1126
0
1127
0
  if (!u)
1128
0
    return NULL;
1129
0
1130
0
  
if (0
type != isl_dim_param0
)
1131
0
    isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
1132
0
      "can only project out parameters",
1133
0
      return FN(UNION,free)(u));
1134
0
1135
0
  
space = 0
FN0
(UNION,get_space)(u);
1136
0
  space = isl_space_drop_dims(space, type, first, n);
1137
0
  return 
FN0
(UNION,transform_space)(u, space, &
FN0
(UNION,drop_dims_entry),
1138
0
          &data);
1139
0
}
Unexecuted instantiation: isl_union_pw_qpolynomial_drop_dims
Unexecuted instantiation: isl_union_pw_aff_drop_dims
Unexecuted instantiation: isl_union_pw_multi_aff_drop_dims
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_drop_dims
1140
1141
/* Internal data structure for isl_union_*_set_dim_name.
1142
 * pos is the position of the parameter that needs to be renamed.
1143
 * s is the new name.
1144
 */
1145
S(UNION,set_dim_name_data) {
1146
  unsigned pos;
1147
  const char *s;
1148
};
1149
1150
/* Change the name of the parameter at position data->pos of "part" to data->s
1151
 * and return the result.
1152
 */
1153
static __isl_give PART *FN(UNION,set_dim_name_entry)(__isl_take PART *part,
1154
  void *user)
1155
0
{
1156
0
  S(UNION,set_dim_name_data) *data = user;
1157
0
1158
0
  return FN(PART,set_dim_name)(part, isl_dim_param, data->pos, data->s);
1159
0
}
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_set_dim_name_entry
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_set_dim_name_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_set_dim_name_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_set_dim_name_entry
1160
1161
/* Change the name of the parameter at position "pos" to "s".
1162
 * That is, type is required to be isl_dim_param.
1163
 */
1164
__isl_give UNION *FN(UNION,set_dim_name)(__isl_take UNION *u,
1165
  enum isl_dim_type type, unsigned pos, const char *s)
1166
0
{
1167
0
  S(UNION,set_dim_name_data) data = { pos, s };
1168
0
  isl_space *space;
1169
0
1170
0
  if (!u)
1171
0
    return NULL;
1172
0
1173
0
  
if (0
type != isl_dim_param0
)
1174
0
    isl_die(FN(UNION,get_ctx)(u), isl_error_invalid,
1175
0
      "can only set parameter names",
1176
0
      return FN(UNION,free)(u));
1177
0
1178
0
  
space = 0
FN0
(UNION,get_space)(u);
1179
0
  space = isl_space_set_dim_name(space, type, pos, s);
1180
0
  return FN(UNION,transform_space)(u, space,
1181
0
          &FN(UNION,set_dim_name_entry), &data);
1182
0
}
Unexecuted instantiation: isl_union_pw_aff_set_dim_name
Unexecuted instantiation: isl_union_pw_qpolynomial_set_dim_name
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_set_dim_name
Unexecuted instantiation: isl_union_pw_multi_aff_set_dim_name
1183
1184
/* Reset the user pointer on all identifiers of parameters and tuples
1185
 * of the space of "part" and return the result.
1186
 */
1187
static __isl_give PART *FN(UNION,reset_user_entry)(__isl_take PART *part,
1188
  void *user)
1189
0
{
1190
0
  return FN(PART,reset_user)(part);
1191
0
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_reset_user_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_aff_reset_user_entry
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_reset_user_entry
Unexecuted instantiation: isl_aff.c:isl_union_pw_multi_aff_reset_user_entry
1192
1193
/* Reset the user pointer on all identifiers of parameters and tuples
1194
 * of the spaces of "u".
1195
 */
1196
__isl_give UNION *FN(UNION,reset_user)(__isl_take UNION *u)
1197
0
{
1198
0
  isl_space *space;
1199
0
1200
0
  space = FN(UNION,get_space)(u);
1201
0
  space = isl_space_reset_user(space);
1202
0
  return 
FN0
(UNION,transform_space)(u, space, &
FN0
(UNION,reset_user_entry),
1203
0
          NULL);
1204
0
}
Unexecuted instantiation: isl_union_pw_aff_reset_user
Unexecuted instantiation: isl_union_pw_qpolynomial_reset_user
Unexecuted instantiation: isl_union_pw_multi_aff_reset_user
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_reset_user