diff --git a/mlir/lib/Analysis/Presburger/PresburgerSet.cpp b/mlir/lib/Analysis/Presburger/PresburgerSet.cpp --- a/mlir/lib/Analysis/Presburger/PresburgerSet.cpp +++ b/mlir/lib/Analysis/Presburger/PresburgerSet.cpp @@ -523,8 +523,10 @@ 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]; diff --git a/mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp b/mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp --- a/mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp +++ b/mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp @@ -645,6 +645,25 @@ 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 trueVolume,