Skip to content

Commit c72d7a5

Browse files
committed
[CachedBitsValue] Undo adding void return type computeKnownBits overloads to header
1 parent 3e13887 commit c72d7a5

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ KnownBits computeKnownBits(const Value *V, const APInt &DemandedElts,
9191
const DominatorTree *DT = nullptr,
9292
bool UseInstrInfo = true);
9393

94-
void computeKnownBits(const Value *V, const APInt &DemandedElts,
95-
KnownBits &Known, unsigned Depth, const SimplifyQuery &Q);
96-
97-
void computeKnownBits(const Value *V, KnownBits &Known, unsigned Depth,
98-
const SimplifyQuery &Q);
99-
10094
KnownBits computeKnownBits(const Value *V, const APInt &DemandedElts,
10195
unsigned Depth, const SimplifyQuery &Q);
10296

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,12 @@ static bool getShuffleDemandedElts(const ShuffleVectorInst *Shuf,
145145
DemandedElts, DemandedLHS, DemandedRHS);
146146
}
147147

148-
void llvm::computeKnownBits(const Value *V, KnownBits &Known, unsigned Depth,
149-
const SimplifyQuery &Q) {
148+
static void computeKnownBits(const Value *V, const APInt &DemandedElts,
149+
KnownBits &Known, unsigned Depth,
150+
const SimplifyQuery &Q);
151+
152+
static void computeKnownBits(const Value *V, KnownBits &Known, unsigned Depth,
153+
const SimplifyQuery &Q) {
150154
// Since the number of lanes in a scalable vector is unknown at compile time,
151155
// we track one bit which is implicitly broadcast to all lanes. This means
152156
// that all lanes in a scalable vector are considered demanded.
@@ -179,15 +183,15 @@ KnownBits llvm::computeKnownBits(const Value *V, const DataLayout &DL,
179183
unsigned Depth, AssumptionCache *AC,
180184
const Instruction *CxtI,
181185
const DominatorTree *DT, bool UseInstrInfo) {
182-
return ::computeKnownBits(
186+
return computeKnownBits(
183187
V, Depth, SimplifyQuery(DL, DT, AC, safeCxtI(V, CxtI), UseInstrInfo));
184188
}
185189

186190
KnownBits llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
187191
const DataLayout &DL, unsigned Depth,
188192
AssumptionCache *AC, const Instruction *CxtI,
189193
const DominatorTree *DT, bool UseInstrInfo) {
190-
return ::computeKnownBits(
194+
return computeKnownBits(
191195
V, DemandedElts, Depth,
192196
SimplifyQuery(DL, DT, AC, safeCxtI(V, CxtI), UseInstrInfo));
193197
}
@@ -1780,7 +1784,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
17801784
KnownBits llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
17811785
unsigned Depth, const SimplifyQuery &Q) {
17821786
KnownBits Known(getBitWidth(V->getType(), Q.DL));
1783-
computeKnownBits(V, DemandedElts, Known, Depth, Q);
1787+
::computeKnownBits(V, DemandedElts, Known, Depth, Q);
17841788
return Known;
17851789
}
17861790

@@ -1789,7 +1793,7 @@ KnownBits llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
17891793
KnownBits llvm::computeKnownBits(const Value *V, unsigned Depth,
17901794
const SimplifyQuery &Q) {
17911795
KnownBits Known(getBitWidth(V->getType(), Q.DL));
1792-
computeKnownBits(V, Known, Depth, Q);
1796+
::computeKnownBits(V, Known, Depth, Q);
17931797
return Known;
17941798
}
17951799

@@ -1808,9 +1812,9 @@ KnownBits llvm::computeKnownBits(const Value *V, unsigned Depth,
18081812
/// where V is a vector, known zero, and known one values are the
18091813
/// same width as the vector element, and the bit is set only if it is true
18101814
/// for all of the demanded elements in the vector specified by DemandedElts.
1811-
void llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
1812-
KnownBits &Known, unsigned Depth,
1813-
const SimplifyQuery &Q) {
1815+
void computeKnownBits(const Value *V, const APInt &DemandedElts,
1816+
KnownBits &Known, unsigned Depth,
1817+
const SimplifyQuery &Q) {
18141818
if (!DemandedElts) {
18151819
// No demanded elts, better to assume we don't know anything.
18161820
Known.resetAll();

0 commit comments

Comments
 (0)