Coverage Report

Created: 2017-03-28 09:59

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/lib/External/isl/isl_tab_lexopt_templ.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2008-2009 Katholieke Universiteit Leuven
3
 * Copyright 2010      INRIA Saclay
4
 * Copyright 2011      Sven Verdoolaege
5
 *
6
 * Use of this software is governed by the MIT license
7
 *
8
 * Written by Sven Verdoolaege, K.U.Leuven, Departement
9
 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
10
 * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
11
 * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
12
 */
13
14
6.13k
#define xSF(TYPE,SUFFIX) TYPE ## SUFFIX
15
6.13k
#define SF(TYPE,SUFFIX) xSF(TYPE,SUFFIX)
16
17
/* Given a basic map with at least two parallel constraints (as found
18
 * by the function parallel_constraints), first look for more constraints
19
 * parallel to the two constraint and replace the found list of parallel
20
 * constraints by a single constraint with as "input" part the minimum
21
 * of the input parts of the list of constraints.  Then, recursively call
22
 * basic_map_partial_lexopt (possibly finding more parallel constraints)
23
 * and plug in the definition of the minimum in the result.
24
 *
25
 * As in parallel_constraints, only inequality constraints that only
26
 * involve input variables that do not occur in any other inequality
27
 * constraints are considered.
28
 *
29
 * More specifically, given a set of constraints
30
 *
31
 *  a x + b_i(p) >= 0
32
 *
33
 * Replace this set by a single constraint
34
 *
35
 *  a x + u >= 0
36
 *
37
 * with u a new parameter with constraints
38
 *
39
 *  u <= b_i(p)
40
 *
41
 * Any solution to the new system is also a solution for the original system
42
 * since
43
 *
44
 *  a x >= -u >= -b_i(p)
45
 *
46
 * Moreover, m = min_i(b_i(p)) satisfies the constraints on u and can
47
 * therefore be plugged into the solution.
48
 */
49
static TYPE *SF(basic_map_partial_lexopt_symm,SUFFIX)(
50
  __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom,
51
  __isl_give isl_set **empty, int max, int first, int second)
52
27
{
53
27
  int i, n, k;
54
27
  int *list = NULL;
55
27
  unsigned n_in, n_out, n_div;
56
27
  isl_ctx *ctx;
57
27
  isl_vec *var = NULL;
58
27
  isl_mat *cst = NULL;
59
27
  isl_space *map_space, *set_space;
60
27
61
27
  map_space = isl_basic_map_get_space(bmap);
62
2
  set_space = empty ? isl_basic_set_get_space(dom) : NULL;
63
27
64
27
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
27
         isl_basic_map_dim(bmap, isl_dim_in);
66
27
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
27
68
27
  ctx = isl_basic_map_get_ctx(bmap);
69
27
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
27
  var = isl_vec_alloc(ctx, n_out);
71
27
  if (
(bmap->n_ineq && 27
!list27
) ||
(n_out && 27
!var27
))
72
0
    goto error;
73
27
74
27
  list[0] = first;
75
27
  list[1] = second;
76
27
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
53
  for (i = second + 1, n = 2; 
i < bmap->n_ineq53
;
++i26
)
{26
78
26
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
0
        all_single_occurrence(bmap, i, n_in))
80
0
      list[n++] = i;
81
26
  }
82
27
83
27
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
27
  if (!cst)
85
0
    goto error;
86
27
87
81
  
for (i = 0; 27
i < n81
;
++i54
)
88
54
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
27
90
27
  bmap = isl_basic_map_cow(bmap);
91
27
  if (!bmap)
92
0
    goto error;
93
81
  
for (i = n - 1; 27
i >= 081
;
--i54
)
94
54
    
if (54
isl_basic_map_drop_inequality(bmap, list[i]) < 054
)
95
0
      goto error;
96
27
97
27
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
27
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
27
  k = isl_basic_map_alloc_inequality(bmap);
100
27
  if (k < 0)
101
0
    goto error;
102
27
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
27
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
27
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
27
  bmap = isl_basic_map_finalize(bmap);
106
27
107
27
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
27
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
27
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
81
  for (i = 0; 
i < n81
;
++i54
)
{54
111
54
    k = isl_basic_set_alloc_inequality(dom);
112
54
    if (k < 0)
113
0
      goto error;
114
54
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
54
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
54
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
54
  }
118
27
119
27
  isl_vec_free(var);
120
27
  free(list);
121
27
122
27
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
27
            max, cst, map_space, set_space);
124
0
error:
125
0
  isl_space_free(map_space);
126
0
  isl_space_free(set_space);
127
0
  isl_mat_free(cst);
128
0
  isl_vec_free(var);
129
0
  free(list);
130
0
  isl_basic_set_free(dom);
131
0
  isl_basic_map_free(bmap);
132
0
  return NULL;
133
27
}
isl_tab_pip.c:basic_map_partial_lexopt_symm
Line
Count
Source
52
9
{
53
9
  int i, n, k;
54
9
  int *list = NULL;
55
9
  unsigned n_in, n_out, n_div;
56
9
  isl_ctx *ctx;
57
9
  isl_vec *var = NULL;
58
9
  isl_mat *cst = NULL;
59
9
  isl_space *map_space, *set_space;
60
9
61
9
  map_space = isl_basic_map_get_space(bmap);
62
2
  set_space = empty ? isl_basic_set_get_space(dom) : NULL;
63
9
64
9
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
9
         isl_basic_map_dim(bmap, isl_dim_in);
66
9
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
9
68
9
  ctx = isl_basic_map_get_ctx(bmap);
69
9
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
9
  var = isl_vec_alloc(ctx, n_out);
71
9
  if (
(bmap->n_ineq && 9
!list9
) ||
(n_out && 9
!var9
))
72
0
    goto error;
73
9
74
9
  list[0] = first;
75
9
  list[1] = second;
76
9
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
17
  for (i = second + 1, n = 2; 
i < bmap->n_ineq17
;
++i8
)
{8
78
8
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
0
        all_single_occurrence(bmap, i, n_in))
80
0
      list[n++] = i;
81
8
  }
82
9
83
9
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
9
  if (!cst)
85
0
    goto error;
86
9
87
27
  
for (i = 0; 9
i < n27
;
++i18
)
88
18
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
9
90
9
  bmap = isl_basic_map_cow(bmap);
91
9
  if (!bmap)
92
0
    goto error;
93
27
  
for (i = n - 1; 9
i >= 027
;
--i18
)
94
18
    
if (18
isl_basic_map_drop_inequality(bmap, list[i]) < 018
)
95
0
      goto error;
96
9
97
9
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
9
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
9
  k = isl_basic_map_alloc_inequality(bmap);
100
9
  if (k < 0)
101
0
    goto error;
102
9
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
9
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
9
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
9
  bmap = isl_basic_map_finalize(bmap);
106
9
107
9
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
9
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
9
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
27
  for (i = 0; 
i < n27
;
++i18
)
{18
111
18
    k = isl_basic_set_alloc_inequality(dom);
112
18
    if (k < 0)
113
0
      goto error;
114
18
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
18
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
18
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
18
  }
118
9
119
9
  isl_vec_free(var);
120
9
  free(list);
121
9
122
9
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
9
            max, cst, map_space, set_space);
124
0
error:
125
0
  isl_space_free(map_space);
126
0
  isl_space_free(set_space);
127
0
  isl_mat_free(cst);
128
0
  isl_vec_free(var);
129
0
  free(list);
130
0
  isl_basic_set_free(dom);
131
0
  isl_basic_map_free(bmap);
132
0
  return NULL;
133
9
}
isl_tab_pip.c:basic_map_partial_lexopt_symm_pw_multi_aff
Line
Count
Source
52
18
{
53
18
  int i, n, k;
54
18
  int *list = NULL;
55
18
  unsigned n_in, n_out, n_div;
56
18
  isl_ctx *ctx;
57
18
  isl_vec *var = NULL;
58
18
  isl_mat *cst = NULL;
59
18
  isl_space *map_space, *set_space;
60
18
61
18
  map_space = isl_basic_map_get_space(bmap);
62
0
  set_space = empty ? isl_basic_set_get_space(dom) : NULL;
63
18
64
18
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
18
         isl_basic_map_dim(bmap, isl_dim_in);
66
18
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
18
68
18
  ctx = isl_basic_map_get_ctx(bmap);
69
18
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
18
  var = isl_vec_alloc(ctx, n_out);
71
18
  if (
(bmap->n_ineq && 18
!list18
) ||
(n_out && 18
!var18
))
72
0
    goto error;
73
18
74
18
  list[0] = first;
75
18
  list[1] = second;
76
18
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
36
  for (i = second + 1, n = 2; 
i < bmap->n_ineq36
;
++i18
)
{18
78
18
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
0
        all_single_occurrence(bmap, i, n_in))
80
0
      list[n++] = i;
81
18
  }
82
18
83
18
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
18
  if (!cst)
85
0
    goto error;
86
18
87
54
  
for (i = 0; 18
i < n54
;
++i36
)
88
36
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
18
90
18
  bmap = isl_basic_map_cow(bmap);
91
18
  if (!bmap)
92
0
    goto error;
93
54
  
for (i = n - 1; 18
i >= 054
;
--i36
)
94
36
    
if (36
isl_basic_map_drop_inequality(bmap, list[i]) < 036
)
95
0
      goto error;
96
18
97
18
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
18
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
18
  k = isl_basic_map_alloc_inequality(bmap);
100
18
  if (k < 0)
101
0
    goto error;
102
18
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
18
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
18
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
18
  bmap = isl_basic_map_finalize(bmap);
106
18
107
18
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
18
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
18
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
54
  for (i = 0; 
i < n54
;
++i36
)
{36
111
36
    k = isl_basic_set_alloc_inequality(dom);
112
36
    if (k < 0)
113
0
      goto error;
114
36
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
36
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
36
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
36
  }
118
18
119
18
  isl_vec_free(var);
120
18
  free(list);
121
18
122
18
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
18
            max, cst, map_space, set_space);
124
0
error:
125
0
  isl_space_free(map_space);
126
0
  isl_space_free(set_space);
127
0
  isl_mat_free(cst);
128
0
  isl_vec_free(var);
129
0
  free(list);
130
0
  isl_basic_set_free(dom);
131
0
  isl_basic_map_free(bmap);
132
0
  return NULL;
133
18
}
134
135
/* Recursive part of isl_tab_basic_map_partial_lexopt*, after detecting
136
 * equalities and removing redundant constraints.
137
 *
138
 * We first check if there are any parallel constraints (left).
139
 * If not, we are in the base case.
140
 * If there are parallel constraints, we replace them by a single
141
 * constraint in basic_map_partial_lexopt_symm_pma and then call
142
 * this function recursively to look for more parallel constraints.
143
 */
144
static __isl_give TYPE *SF(basic_map_partial_lexopt,SUFFIX)(
145
  __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom,
146
  __isl_give isl_set **empty, int max)
147
3.06k
{
148
3.06k
  isl_bool par = isl_bool_false;
149
3.06k
  int first, second;
150
3.06k
151
3.06k
  if (!bmap)
152
0
    goto error;
153
3.06k
154
3.06k
  
if (3.06k
bmap->ctx->opt->pip_symmetry3.06k
)
155
3.06k
    par = parallel_constraints(bmap, &first, &second);
156
3.06k
  if (par < 0)
157
0
    goto error;
158
3.06k
  
if (3.06k
!par3.06k
)
159
3.04k
    
return 3.04k
SF3.04k
(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
3.04k
                empty, max);
161
3.06k
162
27
  
return 27
SF27
(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
27
               first, second);
164
0
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
3.06k
}
isl_tab_pip.c:basic_map_partial_lexopt
Line
Count
Source
147
1.28k
{
148
1.28k
  isl_bool par = isl_bool_false;
149
1.28k
  int first, second;
150
1.28k
151
1.28k
  if (!bmap)
152
0
    goto error;
153
1.28k
154
1.28k
  
if (1.28k
bmap->ctx->opt->pip_symmetry1.28k
)
155
1.28k
    par = parallel_constraints(bmap, &first, &second);
156
1.28k
  if (par < 0)
157
0
    goto error;
158
1.28k
  
if (1.28k
!par1.28k
)
159
1.27k
    
return 1.27k
SF1.27k
(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
1.27k
                empty, max);
161
1.28k
162
9
  
return 9
SF9
(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
9
               first, second);
164
0
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
1.28k
}
isl_tab_pip.c:basic_map_partial_lexopt_pw_multi_aff
Line
Count
Source
147
1.78k
{
148
1.78k
  isl_bool par = isl_bool_false;
149
1.78k
  int first, second;
150
1.78k
151
1.78k
  if (!bmap)
152
0
    goto error;
153
1.78k
154
1.78k
  
if (1.78k
bmap->ctx->opt->pip_symmetry1.78k
)
155
1.78k
    par = parallel_constraints(bmap, &first, &second);
156
1.78k
  if (par < 0)
157
0
    goto error;
158
1.78k
  
if (1.78k
!par1.78k
)
159
1.76k
    
return 1.76k
SF1.76k
(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
1.76k
                empty, max);
161
1.78k
162
18
  
return 18
SF18
(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
18
               first, second);
164
0
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
1.78k
}
169
170
/* Compute the lexicographic minimum (or maximum if "flags" includes
171
 * ISL_OPT_MAX) of "bmap" over the domain "dom" and return the result as
172
 * either a map or a piecewise multi-affine expression depending on TYPE.
173
 * If "empty" is not NULL, then *empty is assigned a set that
174
 * contains those parts of the domain where there is no solution.
175
 * If "flags" includes ISL_OPT_FULL, then "dom" is NULL and the optimum
176
 * should be computed over the domain of "bmap".  "empty" is also NULL
177
 * in this case.
178
 * If "bmap" is marked as rational (ISL_BASIC_MAP_RATIONAL),
179
 * then we compute the rational optimum.  Otherwise, we compute
180
 * the integral optimum.
181
 *
182
 * We perform some preprocessing.  As the PILP solver does not
183
 * handle implicit equalities very well, we first make sure all
184
 * the equalities are explicitly available.
185
 *
186
 * We also add context constraints to the basic map and remove
187
 * redundant constraints.  This is only needed because of the
188
 * way we handle simple symmetries.  In particular, we currently look
189
 * for symmetries on the constraints, before we set up the main tableau.
190
 * It is then no good to look for symmetries on possibly redundant constraints.
191
 * If the domain was extracted from the basic map, then there is
192
 * no need to add back those constraints again.
193
 */
194
__isl_give TYPE *SF(isl_tab_basic_map_partial_lexopt,SUFFIX)(
195
  __isl_take isl_basic_map *bmap, __isl_take isl_basic_set *dom,
196
  __isl_give isl_set **empty, unsigned flags)
197
3.04k
{
198
3.04k
  int max, full;
199
3.04k
  isl_bool compatible;
200
3.04k
201
3.04k
  if (empty)
202
1.41k
    *empty = NULL;
203
3.04k
204
3.04k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
3.04k
  if (full)
206
1.62k
    dom = extract_domain(bmap, flags);
207
3.04k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
3.04k
  if (compatible < 0)
209
0
    goto error;
210
3.04k
  
if (3.04k
!compatible3.04k
)
211
0
    isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
3.04k
      "domain does not match input", goto error);
213
3.04k
214
3.04k
  
max = 3.04k
ISL_FL_ISSET3.04k
(flags, ISL_OPT_MAX);
215
3.04k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
449
    
return 449
SF449
(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
449
                  max);
218
3.04k
219
2.59k
  
if (2.59k
!full2.59k
)
220
1.40k
    bmap = isl_basic_map_intersect_domain(bmap,
221
1.40k
                isl_basic_set_copy(dom));
222
2.59k
  bmap = isl_basic_map_detect_equalities(bmap);
223
2.59k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
2.59k
225
2.59k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
0
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
3.04k
}
isl_tab_basic_map_partial_lexopt
Line
Count
Source
197
1.27k
{
198
1.27k
  int max, full;
199
1.27k
  isl_bool compatible;
200
1.27k
201
1.27k
  if (empty)
202
941
    *empty = NULL;
203
1.27k
204
1.27k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
1.27k
  if (full)
206
337
    dom = extract_domain(bmap, flags);
207
1.27k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
1.27k
  if (compatible < 0)
209
0
    goto error;
210
1.27k
  
if (1.27k
!compatible1.27k
)
211
0
    isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
1.27k
      "domain does not match input", goto error);
213
1.27k
214
1.27k
  
max = 1.27k
ISL_FL_ISSET1.27k
(flags, ISL_OPT_MAX);
215
1.27k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
40
    
return 40
SF40
(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
40
                  max);
218
1.27k
219
1.23k
  
if (1.23k
!full1.23k
)
220
933
    bmap = isl_basic_map_intersect_domain(bmap,
221
933
                isl_basic_set_copy(dom));
222
1.23k
  bmap = isl_basic_map_detect_equalities(bmap);
223
1.23k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
1.23k
225
1.23k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
0
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
1.27k
}
isl_tab_basic_map_partial_lexopt_pw_multi_aff
Line
Count
Source
197
1.76k
{
198
1.76k
  int max, full;
199
1.76k
  isl_bool compatible;
200
1.76k
201
1.76k
  if (empty)
202
471
    *empty = NULL;
203
1.76k
204
1.76k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
1.76k
  if (full)
206
1.29k
    dom = extract_domain(bmap, flags);
207
1.76k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
1.76k
  if (compatible < 0)
209
0
    goto error;
210
1.76k
  
if (1.76k
!compatible1.76k
)
211
0
    isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
1.76k
      "domain does not match input", goto error);
213
1.76k
214
1.76k
  
max = 1.76k
ISL_FL_ISSET1.76k
(flags, ISL_OPT_MAX);
215
1.76k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
409
    
return 409
SF409
(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
409
                  max);
218
1.76k
219
1.35k
  
if (1.35k
!full1.35k
)
220
471
    bmap = isl_basic_map_intersect_domain(bmap,
221
471
                isl_basic_set_copy(dom));
222
1.35k
  bmap = isl_basic_map_detect_equalities(bmap);
223
1.35k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
1.35k
225
1.35k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
0
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
1.76k
}