Skip to content

Commit 665ee0c

Browse files
author
Zain Jaffal
committed
Revert "[ConstraintElimination] Move Value2Index map to ConstraintSystem (NFC)"
This reverts commit 40ffe9c. Reverted because some comments where missed in the review https://reviews.llvm.org/D142647
1 parent c6ac7e9 commit 665ee0c

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

llvm/include/llvm/Analysis/ConstraintSystem.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,18 @@
1111

1212
#include "llvm/ADT/APInt.h"
1313
#include "llvm/ADT/ArrayRef.h"
14-
#include "llvm/ADT/DenseMap.h"
1514
#include "llvm/ADT/SmallVector.h"
1615

1716
#include <string>
1817

1918
namespace llvm {
20-
class Value;
19+
2120
class ConstraintSystem {
2221
/// Current linear constraints in the system.
2322
/// An entry of the form c0, c1, ... cn represents the following constraint:
2423
/// c0 >= v0 * c1 + .... + v{n-1} * cn
2524
SmallVector<SmallVector<int64_t, 8>, 4> Constraints;
2625

27-
/// a Map between variabled collected in ConstraintElimination and their
28-
/// corresponding index in the constraint system solver.
29-
DenseMap<Value *, unsigned> Value2Index;
30-
3126
/// Current greatest common divisor for all coefficients in the system.
3227
uint32_t GCD = 1;
3328

@@ -57,11 +52,6 @@ class ConstraintSystem {
5752
return true;
5853
}
5954

60-
DenseMap<Value *, unsigned> &getValue2Index() { return Value2Index; }
61-
const DenseMap<Value *, unsigned> &getValue2Index() const {
62-
return Value2Index;
63-
}
64-
6555
bool addVariableRowFill(ArrayRef<int64_t> R) {
6656
// If all variable coefficients are 0, the constraint does not provide any
6757
// usable information.

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ struct ConstraintTy {
123123
/// based on signed-ness, certain conditions can be transferred between the two
124124
/// systems.
125125
class ConstraintInfo {
126+
DenseMap<Value *, unsigned> UnsignedValue2Index;
127+
DenseMap<Value *, unsigned> SignedValue2Index;
126128

127129
ConstraintSystem UnsignedCS;
128130
ConstraintSystem SignedCS;
@@ -133,10 +135,10 @@ class ConstraintInfo {
133135
ConstraintInfo(const DataLayout &DL) : DL(DL) {}
134136

135137
DenseMap<Value *, unsigned> &getValue2Index(bool Signed) {
136-
return Signed ? SignedCS.getValue2Index() : UnsignedCS.getValue2Index();
138+
return Signed ? SignedValue2Index : UnsignedValue2Index;
137139
}
138140
const DenseMap<Value *, unsigned> &getValue2Index(bool Signed) const {
139-
return Signed ? SignedCS.getValue2Index() : UnsignedCS.getValue2Index();
141+
return Signed ? SignedValue2Index : UnsignedValue2Index;
140142
}
141143

142144
ConstraintSystem &getCS(bool Signed) {

0 commit comments

Comments
 (0)