The internal call to isl_basic_map_remove_dims may remove more divs
than explicitly asked for (or it may reorder them) because it involves
a simplification step. We therefore have to reconsider all the divs
after calling isl_basic_map_remove_dims.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
if (!div_involves_vars(bmap, i, first, n))
continue;
bmap = isl_basic_map_remove_dims(bmap, isl_dim_div, i, 1);
+ if (!bmap)
+ return NULL;
+ i = bmap->n_div;
}
return bmap;