[MLIR][Presburger] skip IntegerPolyhedrons with LocalIds in coalesce

This patch makes coalesce skip the comparison of all pairs of IntegerPolyhedrons with LocalIds rather than crash. The heuristics to handle these cases will be upstreamed later on.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D120995
This commit is contained in:
Michel Weber 2022-03-04 15:04:37 +00:00 committed by Arjun P
parent 8e6d2fe4d4
commit 21dc4ad56a
2 changed files with 23 additions and 2 deletions

View File

@ -523,8 +523,10 @@ coalescePair(unsigned i, unsigned j,
IntegerPolyhedron &a = polyhedrons[i];
IntegerPolyhedron &b = polyhedrons[j];
assert(a.getNumLocalIds() == 0 && b.getNumLocalIds() == 0 &&
"Locals are not yet supported!");
/// Handling of local ids is not yet implemented, so these cases are skipped.
/// TODO: implement local id support.
if (a.getNumLocalIds() != 0 || b.getNumLocalIds() != 0)
return failure();
Simplex &simpA = simplices[i];
Simplex &simpB = simplices[j];

View File

@ -645,6 +645,25 @@ TEST(SetTest, coalesceDoubleIncrement) {
expectCoalesce(3, set);
}
TEST(SetTest, coalesceDiv) {
PresburgerSet set =
parsePresburgerSetFromPolyStrings(1, {
"(x) : (x floordiv 2 == 0)",
"(x) : (x floordiv 2 - 1 == 0)",
});
expectCoalesce(2, set);
}
TEST(SetTest, coalesceDivOtherContained) {
PresburgerSet set =
parsePresburgerSetFromPolyStrings(1, {
"(x) : (x floordiv 2 == 0)",
"(x) : (x == 0)",
"(x) : (x >= 0, -x + 1 >= 0)",
});
expectCoalesce(2, set);
}
static void
expectComputedVolumeIsValidOverapprox(const PresburgerSet &set,
Optional<uint64_t> trueVolume,