Skip to content

Commit 75eae19

Browse files
committed
[CachedBitsValue] Remove Depth parameter
1 parent 85b77d9 commit 75eae19

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

llvm/include/llvm/Analysis/CachedBitsValue.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ template <bool ConstPointer = true> class ImplCachedBitsValue {
5050
mutable PointerIntPair<ValuePointerType, 1, bool> Pointer;
5151
mutable KnownBits Known;
5252

53-
void calculateKnownBits(unsigned Depth, const SimplifyQuery &Q) const {
54-
Known = computeKnownBits(Pointer.getPointer(), Depth, Q);
53+
void calculateKnownBits(const SimplifyQuery &Q) const {
54+
Known = computeKnownBits(Pointer.getPointer(), 0, Q);
5555
Pointer.setInt(true);
5656
}
5757

@@ -73,17 +73,15 @@ template <bool ConstPointer = true> class ImplCachedBitsValue {
7373
[[nodiscard]] ValuePointerType getValue() { return Pointer.getPointer(); }
7474
[[nodiscard]] ValuePointerType getValue() const { return Pointer.getPointer(); }
7575

76-
[[nodiscard]] const KnownBits &getKnownBits(unsigned Depth,
77-
const SimplifyQuery &Q) const {
76+
[[nodiscard]] const KnownBits &getKnownBits(const SimplifyQuery &Q) const {
7877
if (!hasKnownBits())
79-
calculateKnownBits(Depth, Q);
78+
calculateKnownBits(Q);
8079
return Known;
8180
}
8281

83-
[[nodiscard]] KnownBits &getKnownBits(unsigned Depth,
84-
const SimplifyQuery &Q) {
82+
[[nodiscard]] KnownBits &getKnownBits(const SimplifyQuery &Q) {
8583
if (!hasKnownBits())
86-
calculateKnownBits(Depth, Q);
84+
calculateKnownBits(Q);
8785
return Known;
8886
}
8987

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ bool llvm::haveNoCommonBitsSet(const CachedBitsConstValue &LHSCache,
247247
}
248248

249249
return KnownBits::haveNoCommonBitsSet(
250-
LHSCache.getKnownBits(0, SQ),
251-
RHSCache.getKnownBits(0, SQ));
250+
LHSCache.getKnownBits(SQ),
251+
RHSCache.getKnownBits(SQ));
252252
}
253253

254254
bool llvm::isOnlyUsedInZeroEqualityComparison(const Instruction *I) {
@@ -6251,7 +6251,7 @@ static OverflowResult mapOverflowResult(ConstantRange::OverflowResult OR) {
62516251
static ConstantRange computeConstantRangeIncludingKnownBits(
62526252
const CachedBitsConstValue &V, bool ForSigned, const SimplifyQuery &SQ) {
62536253
ConstantRange CR1 = ConstantRange::fromKnownBits(
6254-
V.getKnownBits(0, SQ),
6254+
V.getKnownBits(SQ),
62556255
ForSigned);
62566256
ConstantRange CR2 = computeConstantRange(V, ForSigned, SQ.IIQ.UseInstrInfo);
62576257
ConstantRange::PreferredRangeType RangeType =

0 commit comments

Comments
 (0)