Skip to content

Commit 0e19186

Browse files
committed
[MLIR][NFC] Move PresburgerSet to Presburger/ directory
This patch moves PresburgerSet to Presburger/ directory. This patch is purely mechincal, it only moves and renames functionality and tests. This patch is part of a series of patches to move presburger functionality to Presburger/ directory. Reviewed By: arjunp Differential Revision: https://reviews.llvm.org/D116836
1 parent 50fb44e commit 0e19186

File tree

9 files changed

+190
-193
lines changed

9 files changed

+190
-193
lines changed

mlir/include/mlir/Analysis/PresburgerSet.h renamed to mlir/include/mlir/Analysis/Presburger/PresburgerSet.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,50 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// A class to represent unions of FlatAffineConstraints.
9+
// A class to represent unions of IntegerPolyhedrons.
1010
//
1111
//===----------------------------------------------------------------------===//
1212

1313
#ifndef MLIR_ANALYSIS_PRESBURGERSET_H
1414
#define MLIR_ANALYSIS_PRESBURGERSET_H
1515

16-
#include "mlir/Analysis/AffineStructures.h"
16+
#include "mlir/Analysis/Presburger/IntegerPolyhedron.h"
1717

1818
namespace mlir {
1919

20-
/// This class can represent a union of FlatAffineConstraints, with support for
20+
/// This class can represent a union of IntegerPolyhedrons, with support for
2121
/// union, intersection, subtraction and complement operations, as well as
2222
/// sampling.
2323
///
24-
/// The FlatAffineConstraints (FACs) are stored in a vector, and the set
25-
/// represents the union of these FACs. An empty list corresponds to the empty
24+
/// The IntegerPolyhedrons (Polys) are stored in a vector, and the set
25+
/// represents the union of these Polys. An empty list corresponds to the empty
2626
/// set.
2727
///
28-
/// Note that there are no invariants guaranteed on the list of FACs other than
28+
/// Note that there are no invariants guaranteed on the list of Poly other than
2929
/// that they are all in the same space, i.e., they all have the same number of
30-
/// dimensions and symbols. For example, the FACs may overlap each other.
30+
/// dimensions and symbols. For example, the Polys may overlap each other.
3131
class PresburgerSet {
3232
public:
33-
explicit PresburgerSet(const FlatAffineConstraints &fac);
33+
explicit PresburgerSet(const IntegerPolyhedron &poly);
3434

35-
/// Return the number of FACs in the union.
36-
unsigned getNumFACs() const;
35+
/// Return the number of Polys in the union.
36+
unsigned getNumPolys() const;
3737

3838
/// Return the number of real dimensions.
3939
unsigned getNumDims() const;
4040

4141
/// Return the number of symbolic dimensions.
4242
unsigned getNumSyms() const;
4343

44-
/// Return a reference to the list of FlatAffineConstraints.
45-
ArrayRef<FlatAffineConstraints> getAllFlatAffineConstraints() const;
44+
/// Return a reference to the list of IntegerPolyhedrons.
45+
ArrayRef<IntegerPolyhedron> getAllIntegerPolyhedron() const;
4646

47-
/// Return the FlatAffineConstraints at the specified index.
48-
const FlatAffineConstraints &getFlatAffineConstraints(unsigned index) const;
47+
/// Return the IntegerPolyhedron at the specified index.
48+
const IntegerPolyhedron &getIntegerPolyhedron(unsigned index) const;
4949

5050
/// Mutate this set, turning it into the union of this set and the given
51-
/// FlatAffineConstraints.
52-
void unionFACInPlace(const FlatAffineConstraints &fac);
51+
/// IntegerPolyhedron.
52+
void unionPolyInPlace(const IntegerPolyhedron &poly);
5353

5454
/// Mutate this set, turning it into the union of this set and the given set.
5555
void unionSetInPlace(const PresburgerSet &set);
@@ -91,12 +91,12 @@ class PresburgerSet {
9191
bool isIntegerEmpty() const;
9292

9393
/// Find an integer sample from the given set. This should not be called if
94-
/// any of the FACs in the union are unbounded.
94+
/// any of the Polys in the union are unbounded.
9595
bool findIntegerSample(SmallVectorImpl<int64_t> &sample);
9696

9797
/// Simplifies the representation of a PresburgerSet.
9898
///
99-
/// In particular, removes all FACs which are subsets of other FACs in the
99+
/// In particular, removes all Polys which are subsets of other Polys in the
100100
/// union.
101101
PresburgerSet coalesce() const;
102102

@@ -105,19 +105,19 @@ class PresburgerSet {
105105
PresburgerSet(unsigned nDim = 0, unsigned nSym = 0)
106106
: nDim(nDim), nSym(nSym) {}
107107

108-
/// Return the set difference fac \ set.
109-
static PresburgerSet getSetDifference(FlatAffineConstraints fac,
108+
/// Return the set difference poly \ set.
109+
static PresburgerSet getSetDifference(IntegerPolyhedron poly,
110110
const PresburgerSet &set);
111111

112112
/// Number of identifiers corresponding to real dimensions.
113113
unsigned nDim;
114114

115115
/// Number of symbolic dimensions, unknown but constant for analysis, as in
116-
/// FlatAffineConstraints.
116+
/// IntegerPolyhedron.
117117
unsigned nSym;
118118

119-
/// The list of flatAffineConstraints that this set is the union of.
120-
SmallVector<FlatAffineConstraints, 2> flatAffineConstraints;
119+
/// The list of integerPolyhedrons that this set is the union of.
120+
SmallVector<IntegerPolyhedron, 2> integerPolyhedrons;
121121
};
122122

123123
} // namespace mlir

mlir/lib/Analysis/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set(LLVM_OPTIONAL_SOURCES
1010
LoopAnalysis.cpp
1111
NestedMatcher.cpp
1212
NumberOfExecutions.cpp
13-
PresburgerSet.cpp
1413
SliceAnalysis.cpp
1514
Utils.cpp
1615

@@ -49,7 +48,6 @@ add_mlir_library(MLIRLoopAnalysis
4948
AffineStructures.cpp
5049
LoopAnalysis.cpp
5150
NestedMatcher.cpp
52-
PresburgerSet.cpp
5351
Utils.cpp
5452

5553
ADDITIONAL_HEADER_DIRS

mlir/lib/Analysis/Presburger/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ add_mlir_library(MLIRPresburger
22
IntegerPolyhedron.cpp
33
LinearTransform.cpp
44
Matrix.cpp
5+
PresburgerSet.cpp
56
Simplex.cpp
67
Utils.cpp
78

0 commit comments

Comments
 (0)