[MLIR][Presburger] make sample test with integer lexmin use containsPointNoLocal

IntegerPolyhedron::findIntegerLexmin currently does not return values of
the local ids, so when a test for sampling includes a set with locals, the
result of findIntegerLexmin should be checked using containsPointNoLocal,
not containsPoint.
This commit is contained in:
Arjun P 2022-08-08 14:42:53 +01:00
parent 3354644aad
commit dc07d2c91d
2 changed files with 5 additions and 2 deletions

View File

@ -336,7 +336,7 @@ public:
/// additional processing using Simplex for unbounded sets.
///
/// Returns an integer sample point if one exists, or an empty Optional
/// otherwise.
/// otherwise. The returned value also includes values of local ids.
Optional<SmallVector<int64_t, 8>> findIntegerSample() const;
/// Compute an overapproximation of the number of integer points in the

View File

@ -86,7 +86,7 @@ static void checkSample(bool hasSample, const IntegerPolyhedron &poly,
EXPECT_TRUE(Simplex(poly).isUnbounded());
}
if (maybeLexMin.isBounded()) {
EXPECT_TRUE(poly.containsPoint(*maybeLexMin));
EXPECT_TRUE(poly.containsPointNoLocal(*maybeLexMin));
}
}
break;
@ -410,6 +410,9 @@ TEST(IntegerPolyhedronTest, FindSampleTest) {
checkSample(true, parsePoly("(x, y, z) : (2 * x - 1 >= 0, x - y - 1 == 0, "
"y - z == 0)"));
// Test with a local id.
checkSample(true, parsePoly("(x) : (x == 5*(x floordiv 2))"));
// Regression tests for the computation of dual coefficients.
checkSample(false, parsePoly("(x, y, z) : ("
"6*x - 4*y + 9*z + 2 >= 0,"