/* Remove divs that don't occur in any of the constraints or other divs. These can arise when dropping some of the variables in a quast returned by piplib.  */
static struct isl_basic_map* remove_redundant_divs(struct isl_basic_map *bmap)
/* Remove divs that don't occur in any of the constraints or other divs. These can arise when dropping some of the variables in a quast returned by piplib.  */
static struct isl_basic_map* remove_redundant_divs(struct isl_basic_map *bmap)
{
	int i;
	if (!bmap)
		return NULL;
	for (i = bmap->n_div-1; i >= 0; --i) {
		if (!div_is_redundant(bmap, i))
			continue;
		bmap = isl_basic_map_drop_div(bmap, i);
	}
	return bmap;
}