File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#include " llvm/ADT/APInt.h"
13
13
#include " llvm/ADT/ArrayRef.h"
14
- #include " llvm/ADT/DenseMap.h"
15
14
#include " llvm/ADT/SmallVector.h"
16
15
17
16
#include < string>
18
17
19
18
namespace llvm {
20
- class Value ;
19
+
21
20
class ConstraintSystem {
22
21
// / Current linear constraints in the system.
23
22
// / An entry of the form c0, c1, ... cn represents the following constraint:
24
23
// / c0 >= v0 * c1 + .... + v{n-1} * cn
25
24
SmallVector<SmallVector<int64_t , 8 >, 4 > Constraints;
26
25
27
- // / a Map between variabled collected in ConstraintElimination and their
28
- // / corresponding index in the constraint system solver.
29
- DenseMap<Value *, unsigned > Value2Index;
30
-
31
26
// / Current greatest common divisor for all coefficients in the system.
32
27
uint32_t GCD = 1 ;
33
28
@@ -57,11 +52,6 @@ class ConstraintSystem {
57
52
return true ;
58
53
}
59
54
60
- DenseMap<Value *, unsigned > &getValue2Index () { return Value2Index; }
61
- const DenseMap<Value *, unsigned > &getValue2Index () const {
62
- return Value2Index;
63
- }
64
-
65
55
bool addVariableRowFill (ArrayRef<int64_t > R) {
66
56
// If all variable coefficients are 0, the constraint does not provide any
67
57
// usable information.
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ struct ConstraintTy {
123
123
// / based on signed-ness, certain conditions can be transferred between the two
124
124
// / systems.
125
125
class ConstraintInfo {
126
+ DenseMap<Value *, unsigned > UnsignedValue2Index;
127
+ DenseMap<Value *, unsigned > SignedValue2Index;
126
128
127
129
ConstraintSystem UnsignedCS;
128
130
ConstraintSystem SignedCS;
@@ -133,10 +135,10 @@ class ConstraintInfo {
133
135
ConstraintInfo (const DataLayout &DL) : DL(DL) {}
134
136
135
137
DenseMap<Value *, unsigned > &getValue2Index (bool Signed) {
136
- return Signed ? SignedCS. getValue2Index () : UnsignedCS. getValue2Index () ;
138
+ return Signed ? SignedValue2Index : UnsignedValue2Index ;
137
139
}
138
140
const DenseMap<Value *, unsigned > &getValue2Index (bool Signed) const {
139
- return Signed ? SignedCS. getValue2Index () : UnsignedCS. getValue2Index () ;
141
+ return Signed ? SignedValue2Index : UnsignedValue2Index ;
140
142
}
141
143
142
144
ConstraintSystem &getCS (bool Signed) {
You can’t perform that action at this time.
0 commit comments