forked from OSchip/llvm-project
[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:
parent
8e6d2fe4d4
commit
21dc4ad56a
|
@ -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];
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue