*/
#include "isl_map_private.h"
-#include "isl_seq.h"
+#include <isl/seq.h>
#include "isl_tab.h"
#include <isl_mat_private.h>
unsigned total = isl_basic_map_total_dim(map->p[i]);
unsigned extra_rows = extra ? extra->n_row : 0;
- fused = isl_basic_map_alloc_dim(isl_dim_copy(map->p[i]->dim),
+ fused = isl_basic_map_alloc_space(isl_space_copy(map->p[i]->dim),
map->p[i]->n_div,
map->p[i]->n_eq + map->p[j]->n_eq,
map->p[i]->n_ineq + map->p[j]->n_ineq + extra_rows);
ISL_F_ISSET(map->p[j], ISL_BASIC_MAP_RATIONAL))
ISL_F_SET(fused, ISL_BASIC_MAP_RATIONAL);
- fused_tab = isl_tab_from_basic_map(fused);
+ fused_tab = isl_tab_from_basic_map(fused, 0);
if (isl_tab_detect_redundant(fused_tab) < 0)
goto error;
set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 1);
isl_seq_neg(bound->el, map->p[i]->ineq[cuts[k]], 1 + total);
- if (add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
+ if (!tabs[i]->empty &&
+ add_wraps(wraps, map->p[i], tabs[i], bound->el, set) < 0)
goto error;
set_is_redundant(tabs[i], map->p[i]->n_eq, cuts, n, k, 0);
if (isl_tab_rollback(tabs[i], snap_i) < 0)
goto error;
+ if (tabs[i]->empty)
+ break;
if (!wraps->n_row)
break;
if (any(ineq_i, map->p[i]->n_ineq, STATUS_CUT))
/* ADJ EQ CUT */
return 0;
- if (count(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ) != 1 ||
- count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) != 1 ||
+ if (count(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_EQ) != 1 ||
any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_EQ) ||
any(ineq_i, map->p[i]->n_ineq, STATUS_ADJ_INEQ) ||
any(ineq_j, map->p[j]->n_ineq, STATUS_ADJ_INEQ))
if (changed)
return changed;
+ if (count(eq_j, 2 * map->p[j]->n_eq, STATUS_ADJ_INEQ) != 1)
+ return 0;
+
changed = can_wrap_in_facet(map, i, j, k, tabs, eq_i, ineq_i, eq_j, ineq_j);
return changed;
n = map->n;
for (i = 0; i < map->n; ++i) {
- tabs[i] = isl_tab_from_basic_map(map->p[i]);
+ tabs[i] = isl_tab_from_basic_map(map->p[i], 0);
if (!tabs[i])
goto error;
if (!ISL_F_ISSET(map->p[i], ISL_BASIC_MAP_NO_IMPLICIT))
for (i = 0; i < n; ++i)
isl_tab_free(tabs[i]);
free(tabs);
+ isl_map_free(map);
return NULL;
}