aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 878177e..2459429 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2742,7 +2742,7 @@ bool isKnownNonZero(const Value* V, unsigned Depth, const Query& Q) {
/// If the pair of operators are the same invertible function, return the
/// the operands of the function corresponding to each input. Otherwise,
-/// return None. An invertible function is one that is 1-to-1 and maps
+/// return std::nullopt. An invertible function is one that is 1-to-1 and maps
/// every input value to exactly one output value. This is equivalent to
/// saying that Op1 and Op2 are equal exactly when the specified pair of
/// operands are equal, (except that Op1 and Op2 may be poison more often.)
@@ -6657,7 +6657,7 @@ static bool isTruePredicate(CmpInst::Predicate Pred, const Value *LHS,
}
/// Return true if "icmp Pred BLHS BRHS" is true whenever "icmp Pred
-/// ALHS ARHS" is true. Otherwise, return None.
+/// ALHS ARHS" is true. Otherwise, return std::nullopt.
static Optional<bool>
isImpliedCondOperands(CmpInst::Predicate Pred, const Value *ALHS,
const Value *ARHS, const Value *BLHS, const Value *BRHS,
@@ -6694,7 +6694,7 @@ static bool areMatchingOperands(const Value *L0, const Value *L1, const Value *R
/// Return true if "icmp1 LPred X, Y" implies "icmp2 RPred X, Y" is true.
/// Return false if "icmp1 LPred X, Y" implies "icmp2 RPred X, Y" is false.
-/// Otherwise, return None if we can't infer anything.
+/// Otherwise, return std::nullopt if we can't infer anything.
static Optional<bool> isImpliedCondMatchingOperands(CmpInst::Predicate LPred,
CmpInst::Predicate RPred,
bool AreSwappedOps) {
@@ -6712,7 +6712,7 @@ static Optional<bool> isImpliedCondMatchingOperands(CmpInst::Predicate LPred,
/// Return true if "icmp LPred X, LC" implies "icmp RPred X, RC" is true.
/// Return false if "icmp LPred X, LC" implies "icmp RPred X, RC" is false.
-/// Otherwise, return None if we can't infer anything.
+/// Otherwise, return std::nullopt if we can't infer anything.
static Optional<bool> isImpliedCondCommonOperandWithConstants(
CmpInst::Predicate LPred, const APInt &LC, CmpInst::Predicate RPred,
const APInt &RC) {
@@ -6728,8 +6728,8 @@ static Optional<bool> isImpliedCondCommonOperandWithConstants(
}
/// Return true if LHS implies RHS (expanded to its components as "R0 RPred R1")
-/// is true. Return false if LHS implies RHS is false. Otherwise, return None
-/// if we can't infer anything.
+/// is true. Return false if LHS implies RHS is false. Otherwise, return
+/// std::nullopt if we can't infer anything.
static Optional<bool> isImpliedCondICmps(const ICmpInst *LHS,
CmpInst::Predicate RPred,
const Value *R0, const Value *R1,
@@ -6761,8 +6761,9 @@ static Optional<bool> isImpliedCondICmps(const ICmpInst *LHS,
}
/// Return true if LHS implies RHS is true. Return false if LHS implies RHS is
-/// false. Otherwise, return None if we can't infer anything. We expect the
-/// RHS to be an icmp and the LHS to be an 'and', 'or', or a 'select' instruction.
+/// false. Otherwise, return std::nullopt if we can't infer anything. We
+/// expect the RHS to be an icmp and the LHS to be an 'and', 'or', or a 'select'
+/// instruction.
static Optional<bool>
isImpliedCondAndOr(const Instruction *LHS, CmpInst::Predicate RHSPred,
const Value *RHSOp0, const Value *RHSOp1,