[MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin
authorArjun P <arjunpitchanathan@gmail.com>
Mon, 4 Apr 2022 22:31:28 +0000 (23:31 +0100)
committerArjun P <arjunpitchanathan@gmail.com>
Tue, 5 Apr 2022 17:50:34 +0000 (18:50 +0100)
commit79ad5fb2959c076522e207433873bec4c1a48851
tree998d4ccffd4852f74fa8c983891a1501950594ae
parenta0e4ba4b4607267d96c3ab8bc1c38f5a09830692
[MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin

Add support for computing the symbolic integer lexmin of a polyhedron.
This finds, for every assignment to the symbols, the lexicographically
minimum value attained by the dimensions. For example, the symbolic lexmin
of the set

`(x, y)[a, b, c] : (a <= x, b <= x, x <= c)`

can be written as

```
x = a if b <= a, a <= c
x = b if a <  b, b <= c
```

This also finds the set of assignments to the symbols that make the lexmin unbounded.

This was previously landed in da92f92621e28a56fe8ad79d82eb60e436bf1d39 and
reverted in b238c252e8b1bbebc7ed79c08e06c23514d0dfb4 due to a build failure
in the code. Re-landing now with a fixed build.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D122985
mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
mlir/include/mlir/Analysis/Presburger/Matrix.h
mlir/include/mlir/Analysis/Presburger/PWMAFunction.h
mlir/include/mlir/Analysis/Presburger/Simplex.h
mlir/lib/Analysis/Presburger/IntegerRelation.cpp
mlir/lib/Analysis/Presburger/Matrix.cpp
mlir/lib/Analysis/Presburger/PWMAFunction.cpp
mlir/lib/Analysis/Presburger/Simplex.cpp
mlir/unittests/Analysis/Presburger/IntegerPolyhedronTest.cpp