Coverage Report

Created: 2018-02-20 12:54

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/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
16.1k
#define xSF(TYPE,SUFFIX) TYPE ## SUFFIX
15
16.1k
#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
229
{
53
229
  int i, n, k;
54
229
  int *list = NULL;
55
229
  unsigned n_in, n_out, n_div;
56
229
  isl_ctx *ctx;
57
229
  isl_vec *var = NULL;
58
229
  isl_mat *cst = NULL;
59
229
  isl_space *map_space, *set_space;
60
229
61
229
  map_space = isl_basic_map_get_space(bmap);
62
229
  set_space = empty ? 
isl_basic_set_get_space(dom)6
: NULL;
63
229
64
229
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
229
         isl_basic_map_dim(bmap, isl_dim_in);
66
229
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
229
68
229
  ctx = isl_basic_map_get_ctx(bmap);
69
229
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
229
  var = isl_vec_alloc(ctx, n_out);
71
229
  if ((bmap->n_ineq && !list) || (n_out && !var))
72
0
    goto error;
73
229
74
229
  list[0] = first;
75
229
  list[1] = second;
76
229
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
437
  for (i = second + 1, n = 2; i < bmap->n_ineq; 
++i208
) {
78
208
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
208
        
all_single_occurrence(bmap, i, n_in)0
)
80
0
      list[n++] = i;
81
208
  }
82
229
83
229
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
229
  if (!cst)
85
0
    goto error;
86
229
87
687
  
for (i = 0; 229
i < n;
++i458
)
88
458
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
229
90
229
  bmap = isl_basic_map_cow(bmap);
91
229
  if (!bmap)
92
0
    goto error;
93
687
  
for (i = n - 1; 229
i >= 0;
--i458
)
94
458
    if (isl_basic_map_drop_inequality(bmap, list[i]) < 0)
95
0
      goto error;
96
229
97
229
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
229
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
229
  k = isl_basic_map_alloc_inequality(bmap);
100
229
  if (k < 0)
101
0
    goto error;
102
229
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
229
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
229
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
229
  bmap = isl_basic_map_finalize(bmap);
106
229
107
229
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
229
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
229
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
687
  for (i = 0; i < n; 
++i458
) {
111
458
    k = isl_basic_set_alloc_inequality(dom);
112
458
    if (k < 0)
113
0
      goto error;
114
458
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
458
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
458
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
458
  }
118
229
119
229
  isl_vec_free(var);
120
229
  free(list);
121
229
122
229
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
229
            max, cst, map_space, set_space);
124
229
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
229
}
isl_tab_pip.c:basic_map_partial_lexopt_symm
Line
Count
Source
52
54
{
53
54
  int i, n, k;
54
54
  int *list = NULL;
55
54
  unsigned n_in, n_out, n_div;
56
54
  isl_ctx *ctx;
57
54
  isl_vec *var = NULL;
58
54
  isl_mat *cst = NULL;
59
54
  isl_space *map_space, *set_space;
60
54
61
54
  map_space = isl_basic_map_get_space(bmap);
62
54
  set_space = empty ? 
isl_basic_set_get_space(dom)6
: NULL;
63
54
64
54
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
54
         isl_basic_map_dim(bmap, isl_dim_in);
66
54
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
54
68
54
  ctx = isl_basic_map_get_ctx(bmap);
69
54
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
54
  var = isl_vec_alloc(ctx, n_out);
71
54
  if ((bmap->n_ineq && !list) || (n_out && !var))
72
0
    goto error;
73
54
74
54
  list[0] = first;
75
54
  list[1] = second;
76
54
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
134
  for (i = second + 1, n = 2; i < bmap->n_ineq; 
++i80
) {
78
80
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
80
        
all_single_occurrence(bmap, i, n_in)0
)
80
0
      list[n++] = i;
81
80
  }
82
54
83
54
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
54
  if (!cst)
85
0
    goto error;
86
54
87
162
  
for (i = 0; 54
i < n;
++i108
)
88
108
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
54
90
54
  bmap = isl_basic_map_cow(bmap);
91
54
  if (!bmap)
92
0
    goto error;
93
162
  
for (i = n - 1; 54
i >= 0;
--i108
)
94
108
    if (isl_basic_map_drop_inequality(bmap, list[i]) < 0)
95
0
      goto error;
96
54
97
54
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
54
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
54
  k = isl_basic_map_alloc_inequality(bmap);
100
54
  if (k < 0)
101
0
    goto error;
102
54
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
54
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
54
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
54
  bmap = isl_basic_map_finalize(bmap);
106
54
107
54
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
54
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
54
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
162
  for (i = 0; i < n; 
++i108
) {
111
108
    k = isl_basic_set_alloc_inequality(dom);
112
108
    if (k < 0)
113
0
      goto error;
114
108
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
108
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
108
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
108
  }
118
54
119
54
  isl_vec_free(var);
120
54
  free(list);
121
54
122
54
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
54
            max, cst, map_space, set_space);
124
54
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
54
}
isl_tab_pip.c:basic_map_partial_lexopt_symm_pw_multi_aff
Line
Count
Source
52
175
{
53
175
  int i, n, k;
54
175
  int *list = NULL;
55
175
  unsigned n_in, n_out, n_div;
56
175
  isl_ctx *ctx;
57
175
  isl_vec *var = NULL;
58
175
  isl_mat *cst = NULL;
59
175
  isl_space *map_space, *set_space;
60
175
61
175
  map_space = isl_basic_map_get_space(bmap);
62
175
  set_space = empty ? 
isl_basic_set_get_space(dom)0
: NULL;
63
175
64
175
  n_in = isl_basic_map_dim(bmap, isl_dim_param) +
65
175
         isl_basic_map_dim(bmap, isl_dim_in);
66
175
  n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in;
67
175
68
175
  ctx = isl_basic_map_get_ctx(bmap);
69
175
  list = isl_alloc_array(ctx, int, bmap->n_ineq);
70
175
  var = isl_vec_alloc(ctx, n_out);
71
175
  if ((bmap->n_ineq && !list) || (n_out && !var))
72
0
    goto error;
73
175
74
175
  list[0] = first;
75
175
  list[1] = second;
76
175
  isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out);
77
303
  for (i = second + 1, n = 2; i < bmap->n_ineq; 
++i128
) {
78
128
    if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) &&
79
128
        
all_single_occurrence(bmap, i, n_in)0
)
80
0
      list[n++] = i;
81
128
  }
82
175
83
175
  cst = isl_mat_alloc(ctx, n, 1 + n_in);
84
175
  if (!cst)
85
0
    goto error;
86
175
87
525
  
for (i = 0; 175
i < n;
++i350
)
88
350
    isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in);
89
175
90
175
  bmap = isl_basic_map_cow(bmap);
91
175
  if (!bmap)
92
0
    goto error;
93
525
  
for (i = n - 1; 175
i >= 0;
--i350
)
94
350
    if (isl_basic_map_drop_inequality(bmap, list[i]) < 0)
95
0
      goto error;
96
175
97
175
  bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1);
98
175
  bmap = isl_basic_map_extend_constraints(bmap, 0, 1);
99
175
  k = isl_basic_map_alloc_inequality(bmap);
100
175
  if (k < 0)
101
0
    goto error;
102
175
  isl_seq_clr(bmap->ineq[k], 1 + n_in);
103
175
  isl_int_set_si(bmap->ineq[k][1 + n_in], 1);
104
175
  isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out);
105
175
  bmap = isl_basic_map_finalize(bmap);
106
175
107
175
  n_div = isl_basic_set_dim(dom, isl_dim_div);
108
175
  dom = isl_basic_set_add_dims(dom, isl_dim_set, 1);
109
175
  dom = isl_basic_set_extend_constraints(dom, 0, n);
110
525
  for (i = 0; i < n; 
++i350
) {
111
350
    k = isl_basic_set_alloc_inequality(dom);
112
350
    if (k < 0)
113
0
      goto error;
114
350
    isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in);
115
350
    isl_int_set_si(dom->ineq[k][1 + n_in], -1);
116
350
    isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div);
117
350
  }
118
175
119
175
  isl_vec_free(var);
120
175
  free(list);
121
175
122
175
  return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty,
123
175
            max, cst, map_space, set_space);
124
175
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
175
}
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
8.05k
{
148
8.05k
  isl_bool par = isl_bool_false;
149
8.05k
  int first, second;
150
8.05k
151
8.05k
  if (!bmap)
152
0
    goto error;
153
8.05k
154
8.05k
  if (bmap->ctx->opt->pip_symmetry)
155
8.05k
    par = parallel_constraints(bmap, &first, &second);
156
8.05k
  if (par < 0)
157
0
    goto error;
158
8.05k
  if (!par)
159
7.83k
    return SF(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
7.83k
                empty, max);
161
229
162
229
  return SF(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
229
               first, second);
164
229
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
229
}
isl_tab_pip.c:basic_map_partial_lexopt
Line
Count
Source
147
3.62k
{
148
3.62k
  isl_bool par = isl_bool_false;
149
3.62k
  int first, second;
150
3.62k
151
3.62k
  if (!bmap)
152
0
    goto error;
153
3.62k
154
3.62k
  if (bmap->ctx->opt->pip_symmetry)
155
3.62k
    par = parallel_constraints(bmap, &first, &second);
156
3.62k
  if (par < 0)
157
0
    goto error;
158
3.62k
  if (!par)
159
3.56k
    return SF(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
3.56k
                empty, max);
161
54
162
54
  return SF(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
54
               first, second);
164
54
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
54
}
isl_tab_pip.c:basic_map_partial_lexopt_pw_multi_aff
Line
Count
Source
147
4.43k
{
148
4.43k
  isl_bool par = isl_bool_false;
149
4.43k
  int first, second;
150
4.43k
151
4.43k
  if (!bmap)
152
0
    goto error;
153
4.43k
154
4.43k
  if (bmap->ctx->opt->pip_symmetry)
155
4.43k
    par = parallel_constraints(bmap, &first, &second);
156
4.43k
  if (par < 0)
157
0
    goto error;
158
4.43k
  if (!par)
159
4.26k
    return SF(basic_map_partial_lexopt_base,SUFFIX)(bmap, dom,
160
4.26k
                empty, max);
161
175
162
175
  return SF(basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max,
163
175
               first, second);
164
175
error:
165
0
  isl_basic_set_free(dom);
166
0
  isl_basic_map_free(bmap);
167
0
  return NULL;
168
175
}
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
7.83k
{
198
7.83k
  int max, full;
199
7.83k
  isl_bool compatible;
200
7.83k
201
7.83k
  if (empty)
202
3.57k
    *empty = NULL;
203
7.83k
204
7.83k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
7.83k
  if (full)
206
4.25k
    dom = extract_domain(bmap, flags);
207
7.83k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
7.83k
  if (compatible < 0)
209
0
    goto error;
210
7.83k
  if (!compatible)
211
7.83k
    
isl_die0
(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
7.83k
      "domain does not match input", goto error);
213
7.83k
214
7.83k
  max = ISL_FL_ISSET(flags, ISL_OPT_MAX);
215
7.83k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
1.46k
    return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
1.46k
                  max);
218
6.36k
219
6.36k
  if (!full)
220
3.55k
    bmap = isl_basic_map_intersect_domain(bmap,
221
3.55k
                isl_basic_set_copy(dom));
222
6.36k
  bmap = isl_basic_map_detect_equalities(bmap);
223
6.36k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
6.36k
225
6.36k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
6.36k
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
6.36k
}
isl_tab_basic_map_partial_lexopt
Line
Count
Source
197
3.56k
{
198
3.56k
  int max, full;
199
3.56k
  isl_bool compatible;
200
3.56k
201
3.56k
  if (empty)
202
2.71k
    *empty = NULL;
203
3.56k
204
3.56k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
3.56k
  if (full)
206
853
    dom = extract_domain(bmap, flags);
207
3.56k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
3.56k
  if (compatible < 0)
209
0
    goto error;
210
3.56k
  if (!compatible)
211
3.56k
    
isl_die0
(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
3.56k
      "domain does not match input", goto error);
213
3.56k
214
3.56k
  max = ISL_FL_ISSET(flags, ISL_OPT_MAX);
215
3.56k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
95
    return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
95
                  max);
218
3.47k
219
3.47k
  if (!full)
220
2.69k
    bmap = isl_basic_map_intersect_domain(bmap,
221
2.69k
                isl_basic_set_copy(dom));
222
3.47k
  bmap = isl_basic_map_detect_equalities(bmap);
223
3.47k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
3.47k
225
3.47k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
3.47k
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
3.47k
}
isl_tab_basic_map_partial_lexopt_pw_multi_aff
Line
Count
Source
197
4.26k
{
198
4.26k
  int max, full;
199
4.26k
  isl_bool compatible;
200
4.26k
201
4.26k
  if (empty)
202
864
    *empty = NULL;
203
4.26k
204
4.26k
  full = ISL_FL_ISSET(flags, ISL_OPT_FULL);
205
4.26k
  if (full)
206
3.39k
    dom = extract_domain(bmap, flags);
207
4.26k
  compatible = isl_basic_map_compatible_domain(bmap, dom);
208
4.26k
  if (compatible < 0)
209
0
    goto error;
210
4.26k
  if (!compatible)
211
4.26k
    
isl_die0
(isl_basic_map_get_ctx(bmap), isl_error_invalid,
212
4.26k
      "domain does not match input", goto error);
213
4.26k
214
4.26k
  max = ISL_FL_ISSET(flags, ISL_OPT_MAX);
215
4.26k
  if (isl_basic_set_dim(dom, isl_dim_all) == 0)
216
1.36k
    return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty,
217
1.36k
                  max);
218
2.89k
219
2.89k
  if (!full)
220
864
    bmap = isl_basic_map_intersect_domain(bmap,
221
864
                isl_basic_set_copy(dom));
222
2.89k
  bmap = isl_basic_map_detect_equalities(bmap);
223
2.89k
  bmap = isl_basic_map_remove_redundancies(bmap);
224
2.89k
225
2.89k
  return SF(basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, max);
226
2.89k
error:
227
0
  isl_basic_set_free(dom);
228
0
  isl_basic_map_free(bmap);
229
0
  return NULL;
230
2.89k
}