isl_basic_map_remove_shifted_constraints: drop existentials from context
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Mon, 20 May 2024 21:37:25 +0000 (20 23:37 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 25 May 2024 13:04:53 +0000 (25 15:04 +0200)
The function isl_basic_map_align_divs currently does not support
existentially quantified variables in the basic map that prescribes
the order of the local variables.
However, even if it did, there could be no constraint in the input
basic map that is a shifted copy of a constraint in the context
that involves existentially quantified variables.

Remove the existentially quantified variables and the constraints
involving these variables from the context.

Note that a call to isl_basic_map_drop_constraints_involving_unknown_divs
usually also results in the removal of the existentially quantified
variables, but this is not guaranteed.
A call to isl_basic_map_remove_unknown_divs is therefore added as well.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_map_simplify.c

index 79a8a28..de7e20a 100644 (file)
@@ -2293,6 +2293,10 @@ static __isl_give isl_basic_map *isl_basic_map_remove_shifted_constraints(
                return bmap;
        }
 
+       context = isl_basic_map_drop_constraints_involving_unknown_divs(
+                                                               context);
+       context = isl_basic_map_remove_unknown_divs(context);
+
        bmap = isl_basic_map_order_divs(bmap);
        context = isl_basic_map_align_divs(context, bmap);
        bmap = isl_basic_map_align_divs(bmap, context);