isl_basic_set_full_compression: detect equalities in input first
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 1 Feb 2012 17:01:31 +0000 (18:01 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 1 Feb 2012 21:48:51 +0000 (22:48 +0100)
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>
isl_morph.c

index a888f4c..b4f984a 100644 (file)
@@ -784,12 +784,20 @@ __isl_give isl_morph *isl_morph_inverse(__isl_take isl_morph *morph)
        return morph;
 }
 
+/* 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);
+       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);