[llvm] dd55ece - [ValueTracking] Remove unused Depth parameter (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 02:12:23 PDT 2023
Author: Nikita Popov
Date: 2023-09-18T11:12:12+02:00
New Revision: dd55ece63832f3a609c03f1b12995df5c105d53d
URL: https://github.com/llvm/llvm-project/commit/dd55ece63832f3a609c03f1b12995df5c105d53d
DIFF: https://github.com/llvm/llvm-project/commit/dd55ece63832f3a609c03f1b12995df5c105d53d.diff
LOG: [ValueTracking] Remove unused Depth parameter (NFC)
Clarify that the Depth is always 0 in this function for a future
change.
Added:
Modified:
llvm/lib/Analysis/ValueTracking.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c4153b824c37e0a..973943790c0aad2 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -6251,10 +6251,11 @@ static OverflowResult mapOverflowResult(ConstantRange::OverflowResult OR) {
/// Combine constant ranges from computeConstantRange() and computeKnownBits().
static ConstantRange computeConstantRangeIncludingKnownBits(
- const Value *V, bool ForSigned, const DataLayout &DL, unsigned Depth,
- AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT,
+ const Value *V, bool ForSigned, const DataLayout &DL, AssumptionCache *AC,
+ const Instruction *CxtI, const DominatorTree *DT,
bool UseInstrInfo = true) {
- KnownBits Known = computeKnownBits(V, DL, Depth, AC, CxtI, DT, UseInstrInfo);
+ KnownBits Known =
+ computeKnownBits(V, DL, /*Depth=*/0, AC, CxtI, DT, UseInstrInfo);
ConstantRange CR1 = ConstantRange::fromKnownBits(Known, ForSigned);
ConstantRange CR2 = computeConstantRange(V, ForSigned, UseInstrInfo);
ConstantRange::PreferredRangeType RangeType =
@@ -6323,9 +6324,9 @@ OverflowResult llvm::computeOverflowForUnsignedAdd(
AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT,
bool UseInstrInfo) {
ConstantRange LHSRange = computeConstantRangeIncludingKnownBits(
- LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, UseInstrInfo);
+ LHS, /*ForSigned=*/false, DL, AC, CxtI, DT, UseInstrInfo);
ConstantRange RHSRange = computeConstantRangeIncludingKnownBits(
- RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT, UseInstrInfo);
+ RHS, /*ForSigned=*/false, DL, AC, CxtI, DT, UseInstrInfo);
return mapOverflowResult(LHSRange.unsignedAddMayOverflow(RHSRange));
}
@@ -6359,9 +6360,9 @@ static OverflowResult computeOverflowForSignedAdd(const Value *LHS,
return OverflowResult::NeverOverflows;
ConstantRange LHSRange = computeConstantRangeIncludingKnownBits(
- LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT);
+ LHS, /*ForSigned=*/true, DL, AC, CxtI, DT);
ConstantRange RHSRange = computeConstantRangeIncludingKnownBits(
- RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT);
+ RHS, /*ForSigned=*/true, DL, AC, CxtI, DT);
OverflowResult OR =
mapOverflowResult(LHSRange.signedAddMayOverflow(RHSRange));
if (OR != OverflowResult::MayOverflow)
@@ -6426,9 +6427,9 @@ OverflowResult llvm::computeOverflowForUnsignedSub(const Value *LHS,
return OverflowResult::AlwaysOverflowsLow;
}
ConstantRange LHSRange = computeConstantRangeIncludingKnownBits(
- LHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT);
+ LHS, /*ForSigned=*/false, DL, AC, CxtI, DT);
ConstantRange RHSRange = computeConstantRangeIncludingKnownBits(
- RHS, /*ForSigned=*/false, DL, /*Depth=*/0, AC, CxtI, DT);
+ RHS, /*ForSigned=*/false, DL, AC, CxtI, DT);
return mapOverflowResult(LHSRange.unsignedSubMayOverflow(RHSRange));
}
@@ -6458,9 +6459,9 @@ OverflowResult llvm::computeOverflowForSignedSub(const Value *LHS,
return OverflowResult::NeverOverflows;
ConstantRange LHSRange = computeConstantRangeIncludingKnownBits(
- LHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT);
+ LHS, /*ForSigned=*/true, DL, AC, CxtI, DT);
ConstantRange RHSRange = computeConstantRangeIncludingKnownBits(
- RHS, /*ForSigned=*/true, DL, /*Depth=*/0, AC, CxtI, DT);
+ RHS, /*ForSigned=*/true, DL, AC, CxtI, DT);
return mapOverflowResult(LHSRange.signedSubMayOverflow(RHSRange));
}
More information about the llvm-commits
mailing list