Skip to content

Commit b238c25

Browse files
committed
Revert "[MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin"
This reverts commit da92f92.
1 parent da92f92 commit b238c25

File tree

9 files changed

+128
-970
lines changed

9 files changed

+128
-970
lines changed

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ class IntegerRelation : public PresburgerSpace {
536536
Matrix inequalities;
537537
};
538538

539-
struct SymbolicLexMin;
540539
/// An IntegerPolyhedron is a PresburgerSpace subject to affine
541540
/// constraints. Affine constraints can be inequalities or equalities in the
542541
/// form:
@@ -594,28 +593,6 @@ class IntegerPolyhedron : public IntegerRelation {
594593
/// column position (i.e., not relative to the kind of identifier) of the
595594
/// first added identifier.
596595
unsigned insertId(IdKind kind, unsigned pos, unsigned num = 1) override;
597-
598-
/// Compute the symbolic integer lexmin of the polyhedron.
599-
/// This finds, for every assignment to the symbols, the lexicographically
600-
/// minimum value attained by the dimensions. For example, the symbolic lexmin
601-
/// of the set
602-
///
603-
/// (x, y)[a, b, c] : (a <= x, b <= x, x <= c)
604-
///
605-
/// can be written as
606-
///
607-
/// x = a if b <= a, a <= c
608-
/// x = b if a < b, b <= c
609-
///
610-
/// This function is stored in the `lexmin` function in the result.
611-
/// Some assignments to the symbols might make the set empty.
612-
/// Such points are not part of the function's domain.
613-
/// In the above example, this happens when max(a, b) > c.
614-
///
615-
/// For some values of the symbols, the lexmin may be unbounded.
616-
/// `SymbolicLexMin` stores these parts of the symbolic domain in a separate
617-
/// `PresburgerSet`, `unboundedDomain`.
618-
SymbolicLexMin findSymbolicIntegerLexMin() const;
619596
};
620597

621598
} // namespace presburger

mlir/include/mlir/Analysis/Presburger/Matrix.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ class Matrix {
151151

152152
/// Add an extra row at the bottom of the matrix and return its position.
153153
unsigned appendExtraRow();
154-
/// Same as above, but copy the given elements into the row. The length of
155-
/// `elems` must be equal to the number of columns.
156-
unsigned appendExtraRow(ArrayRef<int64_t> elems);
157154

158155
/// Print the matrix.
159156
void print(raw_ostream &os) const;

mlir/include/mlir/Analysis/Presburger/PWMAFunction.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ class MultiAffineFunction : protected IntegerPolyhedron {
106106
/// outside the domain, an empty optional is returned.
107107
Optional<SmallVector<int64_t, 8>> valueAt(ArrayRef<int64_t> point) const;
108108

109-
/// Truncate the output dimensions to the first `count` dimensions.
110-
///
111-
/// TODO: refactor so that this can be accomplished through removeIdRange.
112-
void truncateOutput(unsigned count);
113-
114109
void print(raw_ostream &os) const;
115110
void dump() const;
116111

@@ -170,11 +165,6 @@ class PWMAFunction : public PresburgerSpace {
170165
/// value at every point in the domain.
171166
bool isEqual(const PWMAFunction &other) const;
172167

173-
/// Truncate the output dimensions to the first `count` dimensions.
174-
///
175-
/// TODO: refactor so that this can be accomplished through removeIdRange.
176-
void truncateOutput(unsigned count);
177-
178168
void print(raw_ostream &os) const;
179169
void dump() const;
180170

mlir/include/mlir/Analysis/Presburger/Simplex.h

Lines changed: 84 additions & 210 deletions
Large diffs are not rendered by default.

mlir/lib/Analysis/Presburger/IntegerRelation.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#include "mlir/Analysis/Presburger/IntegerRelation.h"
1616
#include "mlir/Analysis/Presburger/LinearTransform.h"
17-
#include "mlir/Analysis/Presburger/PWMAFunction.h"
1817
#include "mlir/Analysis/Presburger/PresburgerRelation.h"
1918
#include "mlir/Analysis/Presburger/Simplex.h"
2019
#include "mlir/Analysis/Presburger/Utils.h"
@@ -146,21 +145,6 @@ void IntegerRelation::truncate(const CountsSnapshot &counts) {
146145
removeEqualityRange(counts.getNumEqs(), getNumEqualities());
147146
}
148147

149-
SymbolicLexMin IntegerPolyhedron::findSymbolicIntegerLexMin() const {
150-
// Compute the symbolic lexmin of the dims and locals, with the symbols being
151-
// the actual symbols of this set.
152-
SymbolicLexMin result =
153-
SymbolicLexSimplex(
154-
*this, PresburgerSpace::getSetSpace(/*numDims=*/getNumSymbolIds()))
155-
.computeSymbolicIntegerLexMin();
156-
157-
// We want to return only the lexmin over the dims, so strip the locals from
158-
// the computed lexmin.
159-
result.lexmin.truncateOutput(result.lexmin.getNumOutputs() -
160-
getNumLocalIds());
161-
return result;
162-
}
163-
164148
unsigned IntegerRelation::insertId(IdKind kind, unsigned pos, unsigned num) {
165149
assert(pos <= getNumIdKind(kind));
166150

mlir/lib/Analysis/Presburger/Matrix.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ unsigned Matrix::appendExtraRow() {
6666
return nRows - 1;
6767
}
6868

69-
unsigned Matrix::appendExtraRow(ArrayRef<int64_t> elems) {
70-
assert(elems.size() == nColumns && "elems must match row length!");
71-
unsigned row = appendExtraRow();
72-
for (unsigned col = 0; col < nColumns; ++col)
73-
at(row, col) = elems[col];
74-
return row;
75-
}
76-
7769
void Matrix::resizeHorizontally(unsigned newNColumns) {
7870
if (newNColumns < nColumns)
7971
removeColumns(newNColumns, nColumns - newNColumns);

mlir/lib/Analysis/Presburger/PWMAFunction.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ void MultiAffineFunction::eliminateRedundantLocalId(unsigned posA,
114114
IntegerPolyhedron::eliminateRedundantLocalId(posA, posB);
115115
}
116116

117-
void MultiAffineFunction::truncateOutput(unsigned count) {
118-
assert(count <= output.getNumRows());
119-
output.resizeVertically(count);
120-
}
121-
122-
void PWMAFunction::truncateOutput(unsigned count) {
123-
assert(count <= numOutputs);
124-
for (MultiAffineFunction &piece : pieces)
125-
piece.truncateOutput(count);
126-
numOutputs = count;
127-
}
128-
129117
bool MultiAffineFunction::isEqualWhereDomainsOverlap(
130118
MultiAffineFunction other) const {
131119
if (!isSpaceCompatible(other))

0 commit comments

Comments
 (0)