diff options
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 09b8131..28463bb 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -74,6 +74,7 @@ #include <algorithm> #include <cassert> #include <cstdint> +#include <optional> #include <utility> using namespace llvm; @@ -1016,7 +1017,7 @@ static void computeKnownBitsFromShiftOperator( // If we know the shifter operand is nonzero, we can sometimes infer more // known bits. However this is expensive to compute, so be lazy about it and // only compute it when absolutely necessary. - Optional<bool> ShifterOperandIsNonZero; + std::optional<bool> ShifterOperandIsNonZero; // Early exit if we can't constrain any well-defined shift amount. if (!(ShiftAmtKZ & (PowerOf2Ceil(BitWidth) - 1)) && @@ -2745,7 +2746,7 @@ bool isKnownNonZero(const Value* V, unsigned Depth, const Query& Q) { /// 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.) -static Optional<std::pair<Value*, Value*>> +static std::optional<std::pair<Value*, Value*>> getInvertibleOperands(const Operator *Op1, const Operator *Op2) { if (Op1->getOpcode() != Op2->getOpcode()) @@ -7322,7 +7323,7 @@ ConstantRange llvm::computeConstantRange(const Value *V, bool ForSigned, return CR; } -static Optional<int64_t> +static std::optional<int64_t> getOffsetFromIndex(const GEPOperator *GEP, unsigned Idx, const DataLayout &DL) { // Skip over the first indices. gep_type_iterator GTI = gep_type_begin(GEP); |