/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 | 14.0k | #define xSF(TYPE,SUFFIX) TYPE ## SUFFIX |
15 | 14.0k | #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 | 161 | { |
53 | 161 | int i, n, k; |
54 | 161 | int *list = NULL; |
55 | 161 | unsigned n_in, n_out, n_div; |
56 | 161 | isl_ctx *ctx; |
57 | 161 | isl_vec *var = NULL; |
58 | 161 | isl_mat *cst = NULL; |
59 | 161 | isl_space *map_space, *set_space; |
60 | 161 | |
61 | 161 | map_space = isl_basic_map_get_space(bmap); |
62 | 6 | set_space = empty ? isl_basic_set_get_space(dom) : NULL; |
63 | 161 | |
64 | 161 | n_in = isl_basic_map_dim(bmap, isl_dim_param) + |
65 | 161 | isl_basic_map_dim(bmap, isl_dim_in); |
66 | 161 | n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in; |
67 | 161 | |
68 | 161 | ctx = isl_basic_map_get_ctx(bmap); |
69 | 161 | list = isl_alloc_array(ctx, int, bmap->n_ineq); |
70 | 161 | var = isl_vec_alloc(ctx, n_out); |
71 | 161 | if ((bmap->n_ineq && 161 !list161 ) || (n_out && 161 !var161 )) |
72 | 0 | goto error; |
73 | 161 | |
74 | 161 | list[0] = first; |
75 | 161 | list[1] = second; |
76 | 161 | isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out); |
77 | 303 | for (i = second + 1, n = 2; i < bmap->n_ineq303 ; ++i142 ) { |
78 | 142 | if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) && |
79 | 3 | all_single_occurrence(bmap, i, n_in)) |
80 | 3 | list[n++] = i; |
81 | 142 | } |
82 | 161 | |
83 | 161 | cst = isl_mat_alloc(ctx, n, 1 + n_in); |
84 | 161 | if (!cst) |
85 | 0 | goto error; |
86 | 161 | |
87 | 486 | for (i = 0; 161 i < n486 ; ++i325 ) |
88 | 325 | isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in); |
89 | 161 | |
90 | 161 | bmap = isl_basic_map_cow(bmap); |
91 | 161 | if (!bmap) |
92 | 0 | goto error; |
93 | 486 | for (i = n - 1; 161 i >= 0486 ; --i325 ) |
94 | 325 | if (325 isl_basic_map_drop_inequality(bmap, list[i]) < 0325 ) |
95 | 0 | goto error; |
96 | 161 | |
97 | 161 | bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1); |
98 | 161 | bmap = isl_basic_map_extend_constraints(bmap, 0, 1); |
99 | 161 | k = isl_basic_map_alloc_inequality(bmap); |
100 | 161 | if (k < 0) |
101 | 0 | goto error; |
102 | 161 | isl_seq_clr(bmap->ineq[k], 1 + n_in); |
103 | 161 | isl_int_set_si(bmap->ineq[k][1 + n_in], 1); |
104 | 161 | isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out); |
105 | 161 | bmap = isl_basic_map_finalize(bmap); |
106 | 161 | |
107 | 161 | n_div = isl_basic_set_dim(dom, isl_dim_div); |
108 | 161 | dom = isl_basic_set_add_dims(dom, isl_dim_set, 1); |
109 | 161 | dom = isl_basic_set_extend_constraints(dom, 0, n); |
110 | 486 | for (i = 0; i < n486 ; ++i325 ) { |
111 | 325 | k = isl_basic_set_alloc_inequality(dom); |
112 | 325 | if (k < 0) |
113 | 0 | goto error; |
114 | 325 | isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in); |
115 | 325 | isl_int_set_si(dom->ineq[k][1 + n_in], -1); |
116 | 325 | isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div); |
117 | 325 | } |
118 | 161 | |
119 | 161 | isl_vec_free(var); |
120 | 161 | free(list); |
121 | 161 | |
122 | 161 | return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty, |
123 | 161 | 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 | 161 | } isl_tab_pip.c:basic_map_partial_lexopt_symm Line | Count | Source | 52 | 51 | { | 53 | 51 | int i, n, k; | 54 | 51 | int *list = NULL; | 55 | 51 | unsigned n_in, n_out, n_div; | 56 | 51 | isl_ctx *ctx; | 57 | 51 | isl_vec *var = NULL; | 58 | 51 | isl_mat *cst = NULL; | 59 | 51 | isl_space *map_space, *set_space; | 60 | 51 | | 61 | 51 | map_space = isl_basic_map_get_space(bmap); | 62 | 6 | set_space = empty ? isl_basic_set_get_space(dom) : NULL; | 63 | 51 | | 64 | 51 | n_in = isl_basic_map_dim(bmap, isl_dim_param) + | 65 | 51 | isl_basic_map_dim(bmap, isl_dim_in); | 66 | 51 | n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in; | 67 | 51 | | 68 | 51 | ctx = isl_basic_map_get_ctx(bmap); | 69 | 51 | list = isl_alloc_array(ctx, int, bmap->n_ineq); | 70 | 51 | var = isl_vec_alloc(ctx, n_out); | 71 | 51 | if ((bmap->n_ineq && 51 !list51 ) || (n_out && 51 !var51 )) | 72 | 0 | goto error; | 73 | 51 | | 74 | 51 | list[0] = first; | 75 | 51 | list[1] = second; | 76 | 51 | isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out); | 77 | 126 | for (i = second + 1, n = 2; i < bmap->n_ineq126 ; ++i75 ) { | 78 | 75 | 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 | 75 | } | 82 | 51 | | 83 | 51 | cst = isl_mat_alloc(ctx, n, 1 + n_in); | 84 | 51 | if (!cst) | 85 | 0 | goto error; | 86 | 51 | | 87 | 153 | for (i = 0; 51 i < n153 ; ++i102 ) | 88 | 102 | isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in); | 89 | 51 | | 90 | 51 | bmap = isl_basic_map_cow(bmap); | 91 | 51 | if (!bmap) | 92 | 0 | goto error; | 93 | 153 | for (i = n - 1; 51 i >= 0153 ; --i102 ) | 94 | 102 | if (102 isl_basic_map_drop_inequality(bmap, list[i]) < 0102 ) | 95 | 0 | goto error; | 96 | 51 | | 97 | 51 | bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1); | 98 | 51 | bmap = isl_basic_map_extend_constraints(bmap, 0, 1); | 99 | 51 | k = isl_basic_map_alloc_inequality(bmap); | 100 | 51 | if (k < 0) | 101 | 0 | goto error; | 102 | 51 | isl_seq_clr(bmap->ineq[k], 1 + n_in); | 103 | 51 | isl_int_set_si(bmap->ineq[k][1 + n_in], 1); | 104 | 51 | isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out); | 105 | 51 | bmap = isl_basic_map_finalize(bmap); | 106 | 51 | | 107 | 51 | n_div = isl_basic_set_dim(dom, isl_dim_div); | 108 | 51 | dom = isl_basic_set_add_dims(dom, isl_dim_set, 1); | 109 | 51 | dom = isl_basic_set_extend_constraints(dom, 0, n); | 110 | 153 | for (i = 0; i < n153 ; ++i102 ) { | 111 | 102 | k = isl_basic_set_alloc_inequality(dom); | 112 | 102 | if (k < 0) | 113 | 0 | goto error; | 114 | 102 | isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in); | 115 | 102 | isl_int_set_si(dom->ineq[k][1 + n_in], -1); | 116 | 102 | isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div); | 117 | 102 | } | 118 | 51 | | 119 | 51 | isl_vec_free(var); | 120 | 51 | free(list); | 121 | 51 | | 122 | 51 | return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty, | 123 | 51 | 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 | 51 | } |
isl_tab_pip.c:basic_map_partial_lexopt_symm_pw_multi_aff Line | Count | Source | 52 | 110 | { | 53 | 110 | int i, n, k; | 54 | 110 | int *list = NULL; | 55 | 110 | unsigned n_in, n_out, n_div; | 56 | 110 | isl_ctx *ctx; | 57 | 110 | isl_vec *var = NULL; | 58 | 110 | isl_mat *cst = NULL; | 59 | 110 | isl_space *map_space, *set_space; | 60 | 110 | | 61 | 110 | map_space = isl_basic_map_get_space(bmap); | 62 | 0 | set_space = empty ? isl_basic_set_get_space(dom) : NULL; | 63 | 110 | | 64 | 110 | n_in = isl_basic_map_dim(bmap, isl_dim_param) + | 65 | 110 | isl_basic_map_dim(bmap, isl_dim_in); | 66 | 110 | n_out = isl_basic_map_dim(bmap, isl_dim_all) - n_in; | 67 | 110 | | 68 | 110 | ctx = isl_basic_map_get_ctx(bmap); | 69 | 110 | list = isl_alloc_array(ctx, int, bmap->n_ineq); | 70 | 110 | var = isl_vec_alloc(ctx, n_out); | 71 | 110 | if ((bmap->n_ineq && 110 !list110 ) || (n_out && 110 !var110 )) | 72 | 0 | goto error; | 73 | 110 | | 74 | 110 | list[0] = first; | 75 | 110 | list[1] = second; | 76 | 110 | isl_seq_cpy(var->el, bmap->ineq[first] + 1 + n_in, n_out); | 77 | 177 | for (i = second + 1, n = 2; i < bmap->n_ineq177 ; ++i67 ) { | 78 | 67 | if (isl_seq_eq(var->el, bmap->ineq[i] + 1 + n_in, n_out) && | 79 | 3 | all_single_occurrence(bmap, i, n_in)) | 80 | 3 | list[n++] = i; | 81 | 67 | } | 82 | 110 | | 83 | 110 | cst = isl_mat_alloc(ctx, n, 1 + n_in); | 84 | 110 | if (!cst) | 85 | 0 | goto error; | 86 | 110 | | 87 | 333 | for (i = 0; 110 i < n333 ; ++i223 ) | 88 | 223 | isl_seq_cpy(cst->row[i], bmap->ineq[list[i]], 1 + n_in); | 89 | 110 | | 90 | 110 | bmap = isl_basic_map_cow(bmap); | 91 | 110 | if (!bmap) | 92 | 0 | goto error; | 93 | 333 | for (i = n - 1; 110 i >= 0333 ; --i223 ) | 94 | 223 | if (223 isl_basic_map_drop_inequality(bmap, list[i]) < 0223 ) | 95 | 0 | goto error; | 96 | 110 | | 97 | 110 | bmap = isl_basic_map_add_dims(bmap, isl_dim_in, 1); | 98 | 110 | bmap = isl_basic_map_extend_constraints(bmap, 0, 1); | 99 | 110 | k = isl_basic_map_alloc_inequality(bmap); | 100 | 110 | if (k < 0) | 101 | 0 | goto error; | 102 | 110 | isl_seq_clr(bmap->ineq[k], 1 + n_in); | 103 | 110 | isl_int_set_si(bmap->ineq[k][1 + n_in], 1); | 104 | 110 | isl_seq_cpy(bmap->ineq[k] + 1 + n_in + 1, var->el, n_out); | 105 | 110 | bmap = isl_basic_map_finalize(bmap); | 106 | 110 | | 107 | 110 | n_div = isl_basic_set_dim(dom, isl_dim_div); | 108 | 110 | dom = isl_basic_set_add_dims(dom, isl_dim_set, 1); | 109 | 110 | dom = isl_basic_set_extend_constraints(dom, 0, n); | 110 | 333 | for (i = 0; i < n333 ; ++i223 ) { | 111 | 223 | k = isl_basic_set_alloc_inequality(dom); | 112 | 223 | if (k < 0) | 113 | 0 | goto error; | 114 | 223 | isl_seq_cpy(dom->ineq[k], cst->row[i], 1 + n_in); | 115 | 223 | isl_int_set_si(dom->ineq[k][1 + n_in], -1); | 116 | 223 | isl_seq_clr(dom->ineq[k] + 1 + n_in + 1, n_div); | 117 | 223 | } | 118 | 110 | | 119 | 110 | isl_vec_free(var); | 120 | 110 | free(list); | 121 | 110 | | 122 | 110 | return SF(basic_map_partial_lexopt_symm_core,SUFFIX)(bmap, dom, empty, | 123 | 110 | 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 | 110 | } |
|
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 | 7.01k | { |
148 | 7.01k | isl_bool par = isl_bool_false; |
149 | 7.01k | int first, second; |
150 | 7.01k | |
151 | 7.01k | if (!bmap) |
152 | 0 | goto error; |
153 | 7.01k | |
154 | 7.01k | if (7.01k bmap->ctx->opt->pip_symmetry7.01k ) |
155 | 7.01k | par = parallel_constraints(bmap, &first, &second); |
156 | 7.01k | if (par < 0) |
157 | 0 | goto error; |
158 | 7.01k | if (7.01k !par7.01k ) |
159 | 6.85k | return 6.85k SF6.85k (basic_map_partial_lexopt_base,SUFFIX)(bmap, dom, |
160 | 6.85k | empty, max); |
161 | 7.01k | |
162 | 161 | return 161 SF161 (basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max, |
163 | 161 | first, second); |
164 | 0 | error: |
165 | 0 | isl_basic_set_free(dom); |
166 | 0 | isl_basic_map_free(bmap); |
167 | 0 | return NULL; |
168 | 7.01k | } isl_tab_pip.c:basic_map_partial_lexopt Line | Count | Source | 147 | 3.45k | { | 148 | 3.45k | isl_bool par = isl_bool_false; | 149 | 3.45k | int first, second; | 150 | 3.45k | | 151 | 3.45k | if (!bmap) | 152 | 0 | goto error; | 153 | 3.45k | | 154 | 3.45k | if (3.45k bmap->ctx->opt->pip_symmetry3.45k ) | 155 | 3.45k | par = parallel_constraints(bmap, &first, &second); | 156 | 3.45k | if (par < 0) | 157 | 0 | goto error; | 158 | 3.45k | if (3.45k !par3.45k ) | 159 | 3.40k | return 3.40k SF3.40k (basic_map_partial_lexopt_base,SUFFIX)(bmap, dom, | 160 | 3.40k | empty, max); | 161 | 3.45k | | 162 | 51 | return 51 SF51 (basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max, | 163 | 51 | 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.45k | } |
isl_tab_pip.c:basic_map_partial_lexopt_pw_multi_aff Line | Count | Source | 147 | 3.56k | { | 148 | 3.56k | isl_bool par = isl_bool_false; | 149 | 3.56k | int first, second; | 150 | 3.56k | | 151 | 3.56k | if (!bmap) | 152 | 0 | goto error; | 153 | 3.56k | | 154 | 3.56k | if (3.56k bmap->ctx->opt->pip_symmetry3.56k ) | 155 | 3.56k | par = parallel_constraints(bmap, &first, &second); | 156 | 3.56k | if (par < 0) | 157 | 0 | goto error; | 158 | 3.56k | if (3.56k !par3.56k ) | 159 | 3.45k | return 3.45k SF3.45k (basic_map_partial_lexopt_base,SUFFIX)(bmap, dom, | 160 | 3.45k | empty, max); | 161 | 3.56k | | 162 | 110 | return 110 SF110 (basic_map_partial_lexopt_symm,SUFFIX)(bmap, dom, empty, max, | 163 | 110 | 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.56k | } |
|
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 | 6.85k | { |
198 | 6.85k | int max, full; |
199 | 6.85k | isl_bool compatible; |
200 | 6.85k | |
201 | 6.85k | if (empty) |
202 | 3.68k | *empty = NULL; |
203 | 6.85k | |
204 | 6.85k | full = ISL_FL_ISSET(flags, ISL_OPT_FULL); |
205 | 6.85k | if (full) |
206 | 3.16k | dom = extract_domain(bmap, flags); |
207 | 6.85k | compatible = isl_basic_map_compatible_domain(bmap, dom); |
208 | 6.85k | if (compatible < 0) |
209 | 0 | goto error; |
210 | 6.85k | if (6.85k !compatible6.85k ) |
211 | 0 | isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, |
212 | 6.85k | "domain does not match input", goto error); |
213 | 6.85k | |
214 | 6.85k | max = 6.85k ISL_FL_ISSET6.85k (flags, ISL_OPT_MAX); |
215 | 6.85k | if (isl_basic_set_dim(dom, isl_dim_all) == 0) |
216 | 829 | return 829 SF829 (basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, |
217 | 829 | max); |
218 | 6.85k | |
219 | 6.02k | if (6.02k !full6.02k ) |
220 | 3.66k | bmap = isl_basic_map_intersect_domain(bmap, |
221 | 3.66k | isl_basic_set_copy(dom)); |
222 | 6.02k | bmap = isl_basic_map_detect_equalities(bmap); |
223 | 6.02k | bmap = isl_basic_map_remove_redundancies(bmap); |
224 | 6.02k | |
225 | 6.02k | 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 | 6.85k | } isl_tab_basic_map_partial_lexopt Line | Count | Source | 197 | 3.40k | { | 198 | 3.40k | int max, full; | 199 | 3.40k | isl_bool compatible; | 200 | 3.40k | | 201 | 3.40k | if (empty) | 202 | 2.60k | *empty = NULL; | 203 | 3.40k | | 204 | 3.40k | full = ISL_FL_ISSET(flags, ISL_OPT_FULL); | 205 | 3.40k | if (full) | 206 | 799 | dom = extract_domain(bmap, flags); | 207 | 3.40k | compatible = isl_basic_map_compatible_domain(bmap, dom); | 208 | 3.40k | if (compatible < 0) | 209 | 0 | goto error; | 210 | 3.40k | if (3.40k !compatible3.40k ) | 211 | 0 | isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, | 212 | 3.40k | "domain does not match input", goto error); | 213 | 3.40k | | 214 | 3.40k | max = 3.40k ISL_FL_ISSET3.40k (flags, ISL_OPT_MAX); | 215 | 3.40k | if (isl_basic_set_dim(dom, isl_dim_all) == 0) | 216 | 92 | return 92 SF92 (basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, | 217 | 92 | max); | 218 | 3.40k | | 219 | 3.30k | if (3.30k !full3.30k ) | 220 | 2.58k | bmap = isl_basic_map_intersect_domain(bmap, | 221 | 2.58k | isl_basic_set_copy(dom)); | 222 | 3.30k | bmap = isl_basic_map_detect_equalities(bmap); | 223 | 3.30k | bmap = isl_basic_map_remove_redundancies(bmap); | 224 | 3.30k | | 225 | 3.30k | 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.40k | } |
isl_tab_basic_map_partial_lexopt_pw_multi_aff Line | Count | Source | 197 | 3.45k | { | 198 | 3.45k | int max, full; | 199 | 3.45k | isl_bool compatible; | 200 | 3.45k | | 201 | 3.45k | if (empty) | 202 | 1.08k | *empty = NULL; | 203 | 3.45k | | 204 | 3.45k | full = ISL_FL_ISSET(flags, ISL_OPT_FULL); | 205 | 3.45k | if (full) | 206 | 2.36k | dom = extract_domain(bmap, flags); | 207 | 3.45k | compatible = isl_basic_map_compatible_domain(bmap, dom); | 208 | 3.45k | if (compatible < 0) | 209 | 0 | goto error; | 210 | 3.45k | if (3.45k !compatible3.45k ) | 211 | 0 | isl_die(isl_basic_map_get_ctx(bmap), isl_error_invalid, | 212 | 3.45k | "domain does not match input", goto error); | 213 | 3.45k | | 214 | 3.45k | max = 3.45k ISL_FL_ISSET3.45k (flags, ISL_OPT_MAX); | 215 | 3.45k | if (isl_basic_set_dim(dom, isl_dim_all) == 0) | 216 | 737 | return 737 SF737 (basic_map_partial_lexopt,SUFFIX)(bmap, dom, empty, | 217 | 737 | max); | 218 | 3.45k | | 219 | 2.71k | if (2.71k !full2.71k ) | 220 | 1.08k | bmap = isl_basic_map_intersect_domain(bmap, | 221 | 1.08k | isl_basic_set_copy(dom)); | 222 | 2.71k | bmap = isl_basic_map_detect_equalities(bmap); | 223 | 2.71k | bmap = isl_basic_map_remove_redundancies(bmap); | 224 | 2.71k | | 225 | 2.71k | 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.45k | } |
|