6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
//
9
- // A class to represent unions of FlatAffineConstraints .
9
+ // A class to represent unions of IntegerPolyhedrons .
10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
13
#ifndef MLIR_ANALYSIS_PRESBURGERSET_H
14
14
#define MLIR_ANALYSIS_PRESBURGERSET_H
15
15
16
- #include " mlir/Analysis/AffineStructures .h"
16
+ #include " mlir/Analysis/Presburger/IntegerPolyhedron .h"
17
17
18
18
namespace mlir {
19
19
20
- // / This class can represent a union of FlatAffineConstraints , with support for
20
+ // / This class can represent a union of IntegerPolyhedrons , with support for
21
21
// / union, intersection, subtraction and complement operations, as well as
22
22
// / sampling.
23
23
// /
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
26
26
// / set.
27
27
// /
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
29
29
// / 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.
31
31
class PresburgerSet {
32
32
public:
33
- explicit PresburgerSet (const FlatAffineConstraints &fac );
33
+ explicit PresburgerSet (const IntegerPolyhedron &poly );
34
34
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 ;
37
37
38
38
// / Return the number of real dimensions.
39
39
unsigned getNumDims () const ;
40
40
41
41
// / Return the number of symbolic dimensions.
42
42
unsigned getNumSyms () const ;
43
43
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 ;
46
46
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 ;
49
49
50
50
// / 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 );
53
53
54
54
// / Mutate this set, turning it into the union of this set and the given set.
55
55
void unionSetInPlace (const PresburgerSet &set);
@@ -91,12 +91,12 @@ class PresburgerSet {
91
91
bool isIntegerEmpty () const ;
92
92
93
93
// / 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.
95
95
bool findIntegerSample (SmallVectorImpl<int64_t > &sample);
96
96
97
97
// / Simplifies the representation of a PresburgerSet.
98
98
// /
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
100
100
// / union.
101
101
PresburgerSet coalesce () const ;
102
102
@@ -105,19 +105,19 @@ class PresburgerSet {
105
105
PresburgerSet (unsigned nDim = 0 , unsigned nSym = 0 )
106
106
: nDim(nDim), nSym(nSym) {}
107
107
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 ,
110
110
const PresburgerSet &set);
111
111
112
112
// / Number of identifiers corresponding to real dimensions.
113
113
unsigned nDim;
114
114
115
115
// / Number of symbolic dimensions, unknown but constant for analysis, as in
116
- // / FlatAffineConstraints .
116
+ // / IntegerPolyhedron .
117
117
unsigned nSym;
118
118
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 ;
121
121
};
122
122
123
123
} // namespace mlir
0 commit comments