Without this explicit detection of equalities, some equalities
may be discovered in the middle of the computation, possibly
leading to the introduction of existentially quantified variables,
while callers of isl_basic_set_full_compression typically do not
want such variables.
Since the detection of equalities can in some cases be fairly expensive,
we may have to find a better way of dealing with this problem at some point.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
+/* We detect all the equalities first to avoid implicit equalties
+ * being discovered during the computations. In particular,
+ * the compression on the variables could expose additional stride
+ * constraints on the parameters. This would result in existentially
+ * quantified variables after applying the resulting morph, which
+ * in turn could break invariants of the calling functions.
+ */
__isl_give isl_morph *isl_basic_set_full_compression(
__isl_keep isl_basic_set *bset)
{
isl_morph *morph, *morph2;
bset = isl_basic_set_copy(bset);
__isl_give isl_morph *isl_basic_set_full_compression(
__isl_keep isl_basic_set *bset)
{
isl_morph *morph, *morph2;
bset = isl_basic_set_copy(bset);
+ bset = isl_basic_set_detect_equalities(bset);
morph = isl_basic_set_variable_compression(bset, isl_dim_param);
bset = isl_morph_basic_set(isl_morph_copy(morph), bset);
morph = isl_basic_set_variable_compression(bset, isl_dim_param);
bset = isl_morph_basic_set(isl_morph_copy(morph), bset);