/// variable (pos^th), i.e., the smallest known constant that is greater
/// than or equal to 'exclusive upper bound' - 'lower bound' of the
/// variable. This constant bound is guaranteed to be non-negative. Returns
- /// None if it's not a constant. This method employs trivial (low complexity /
- /// cost) checks and detection. Symbolic variables are treated specially,
- /// i.e., it looks for constant differences between affine expressions
- /// involving only the symbolic variables. `lb` and `ub` (along with the
- /// `boundFloorDivisor`) are set to represent the lower and upper bound
- /// associated with the constant difference: `lb`, `ub` have the coefficients,
- /// and `boundFloorDivisor`, their divisor. `minLbPos` and `minUbPos` if
- /// non-null are set to the position of the constant lower bound and upper
- /// bound respectively (to the same if they are from an equality). Ex: if the
- /// lower bound is [(s0 + s2 - 1) floordiv 32] for a system with three
- /// symbolic variables, *lb = [1, 0, 1], lbDivisor = 32. See comments at
- /// function definition for examples.
+ /// std::nullopt if it's not a constant. This method employs trivial (low
+ /// complexity / cost) checks and detection. Symbolic variables are treated
+ /// specially, i.e., it looks for constant differences between affine
+ /// expressions involving only the symbolic variables. `lb` and `ub` (along
+ /// with the `boundFloorDivisor`) are set to represent the lower and upper
+ /// bound associated with the constant difference: `lb`, `ub` have the
+ /// coefficients, and `boundFloorDivisor`, their divisor. `minLbPos` and
+ /// `minUbPos` if non-null are set to the position of the constant lower bound
+ /// and upper bound respectively (to the same if they are from an
+ /// equality). Ex: if the lower bound is [(s0 + s2 - 1) floordiv 32] for a
+ /// system with three symbolic variables, *lb = [1, 0, 1], lbDivisor = 32. See
+ /// comments at function definition for examples.
Optional<MPInt> getConstantBoundOnDimSize(
unsigned pos, SmallVectorImpl<MPInt> *lb = nullptr,
MPInt *boundFloorDivisor = nullptr, SmallVectorImpl<MPInt> *ub = nullptr,
}
/// Returns the constant bound for the pos^th variable if there is one;
- /// None otherwise.
+ /// std::nullopt otherwise.
Optional<MPInt> getConstantBound(BoundType type, unsigned pos) const;
/// The same, but casts to int64_t. This is unsafe and will assert-fail if the
/// value does not fit in an int64_t.
bool isRationalSubsetOf(const IntegerRelation &rel);
/// Returns the current sample point if it is integral. Otherwise, returns
- /// None.
+ /// std::nullopt.
Optional<SmallVector<MPInt, 8>> getSamplePointIfIntegral() const;
/// Returns the current sample point, which may contain non-integer (rational)
/// If this difference is empty, the slice is declared to be valid. Otherwise,
/// return false as it implies that the effective fusion results in at least
/// one iteration of the slice that was not originally in the source's domain.
- /// If the validity cannot be determined, returns llvm:None.
+ /// If the validity cannot be determined, returns std::nullopt.
Optional<bool> isSliceValid();
void dump() const;
void setWrite(bool flag) { write = flag; }
/// Returns a constant upper bound on the number of elements in this region if
- /// bounded by a known constant (always possible for static shapes), None
- /// otherwise. Note that the symbols of the region are treated specially,
- /// i.e., the returned bounding constant holds for *any given* value of the
- /// symbol variables. The 'shape' vector is set to the corresponding
- /// dimension-wise bounds major to minor. The number of elements and all the
- /// dimension-wise bounds are guaranteed to be non-negative. We use int64_t
- /// instead of uint64_t since index types can be at most int64_t. `lbs` are
- /// set to the lower bounds for each of the rank dimensions, and lbDivisors
- /// contains the corresponding denominators for floorDivs.
+ /// bounded by a known constant (always possible for static shapes),
+ /// std::nullopt otherwise. Note that the symbols of the region are treated
+ /// specially, i.e., the returned bounding constant holds for *any given*
+ /// value of the symbol variables. The 'shape' vector is set to the
+ /// corresponding dimension-wise bounds major to minor. The number of elements
+ /// and all the dimension-wise bounds are guaranteed to be non-negative. We
+ /// use int64_t instead of uint64_t since index types can be at most
+ /// int64_t. `lbs` are set to the lower bounds for each of the rank
+ /// dimensions, and lbDivisors contains the corresponding denominators for
+ /// floorDivs.
Optional<int64_t> getConstantBoundingSizeAndShape(
SmallVectorImpl<int64_t> *shape = nullptr,
std::vector<SmallVector<int64_t, 4>> *lbs = nullptr,
/// A function to control pattern application and rewrite logic.
///
/// The function will be given the slice op and should return:
- /// - None: to fail the match and not apply the pattern;
+ /// - std::nullopt: to fail the match and not apply the pattern;
/// - true: to apply the pattern with zero slice guard;
/// - false: to apply the pattern without zero slice guard.
///
/// Return if this operation is registered.
bool isRegistered() const { return impl->isRegistered(); }
- /// If this operation is registered, returns the registered information, None
- /// otherwise.
+ /// If this operation is registered, returns the registered information,
+ /// std::nullopt otherwise.
Optional<RegisteredOperationName> getRegisteredInfo() const;
/// Returns true if the operation was registered with a particular trait, e.g.
// Registration
//===--------------------------------------------------------------------===//
- /// A replacement mapping function, which returns either None (to signal the
- /// element wasn't handled), or a pair of the replacement element and a
- /// WalkResult.
+ /// A replacement mapping function, which returns either std::nullopt (to
+ /// signal the element wasn't handled), or a pair of the replacement element
+ /// and a WalkResult.
template <typename T>
using ReplaceFnResult = Optional<std::pair<T, WalkResult>>;
template <typename T>
private:
/// The minimum number of times the successor region will be invoked.
unsigned lower;
- /// The maximum number of times the successor region will be invoked or `None`
- /// if an upper bound is not known.
+ /// The maximum number of times the successor region will be invoked or
+ /// `std::nullopt` if an upper bound is not known.
Optional<unsigned> upper;
};
StringRef getReturnType() const;
// Return the type constraint corresponding to the type of this attribute, or
- // None if this is not a TypedAttr.
+ // std::nullopt if this is not a TypedAttr.
std::optional<Type> getValueType() const;
// Returns the template getter method call which reads this attribute's
StringRef getCppType() const;
/// Return an optional string containing the name of this parameter. If
- /// None, no name was specified for this parameter by the user.
+ /// std::nullopt, no name was specified for this parameter by the user.
std::optional<StringRef> getName() const { return name; }
/// Return an optional string containing the default value to use for this
/// This function converts the type signature of the given block, by invoking
/// 'convertSignatureArg' for each argument. This function should return a
- /// valid conversion for the signature on success, None otherwise.
+ /// valid conversion for the signature on success, std::nullopt otherwise.
Optional<SignatureConversion> convertBlockSignature(Block *block);
/// Materialize a conversion from a set of types into one result type by
/// Returns a non-negative constant bound on the extent (upper bound - lower
/// bound) of the specified variable if it is found to be a constant; returns
-/// None if it's not a constant. This methods treats symbolic variables
+/// std::nullopt if it's not a constant. This methods treats symbolic variables
/// specially, i.e., it looks for constant differences between affine
-/// expressions involving only the symbolic variables. See comments at
-/// function definition for example. 'lb', if provided, is set to the lower
-/// bound associated with the constant difference. Note that 'lb' is purely
-/// symbolic and thus will contain the coefficients of the symbolic variables
-/// and the constant coefficient.
+/// expressions involving only the symbolic variables. See comments at function
+/// definition for example. 'lb', if provided, is set to the lower bound
+/// associated with the constant difference. Note that 'lb' is purely symbolic
+/// and thus will contain the coefficients of the symbolic variables and the
+/// constant coefficient.
// Egs: 0 <= i <= 15, return 16.
// s0 + 2 <= i <= s0 + 17, returns 16. (s0 has to be a symbol)
// s0 + s1 + 16 <= d0 <= s0 + s1 + 31, returns 16.
return *dialect;
}
- /// The loaded dialect entry. This field is None if we haven't attempted to
- /// load, nullptr if we failed to load, otherwise the loaded dialect.
+ /// The loaded dialect entry. This field is std::nullopt if we haven't
+ /// attempted to load, nullptr if we failed to load, otherwise the loaded
+ /// dialect.
std::optional<Dialect *> dialect;
/// The bytecode interface of the dialect, or nullptr if the dialect does not
}
// Extract the pointee type from the LLVM pointer type wrapped in MLIR. Return
-// the resulting type if any, null type if opaque pointers are used, and None
-// if the given type is not the pointer type.
+// the resulting type if any, null type if opaque pointers are used, and
+// std::nullopt if the given type is not the pointer type.
static Optional<Type> getLoadStoreElementType(OpAsmParser &parser, Type type,
SMLoc trailingTypeLoc) {
auto llvmTy = type.dyn_cast<LLVM::LLVMPointerType>();
/// symbol tables, and will also only return uses on 'from' if it does not
/// also define a symbol table. This is because we treat the region as the
/// boundary of the symbol table, and not the op itself. This function returns
-/// None if there are any unknown operations that may potentially be symbol
-/// tables.
+/// std::nullopt if there are any unknown operations that may potentially be
+/// symbol tables.
auto SymbolTable::getSymbolUses(Operation *from) -> Optional<UseRange> {
return getSymbolUsesImpl(from);
}
}
// Return the type constraint corresponding to the type of this attribute, or
-// None if this is not a TypedAttr.
+// std::nullopt if this is not a TypedAttr.
std::optional<Type> Attribute::getValueType() const {
if (auto *defInit = dyn_cast<llvm::DefInit>(def->getValueInit("valueType")))
return Type(defInit->getDef());
Block *origBlock;
/// The conversion information for each of the arguments. The information is
- /// None if the argument was dropped during conversion.
+ /// std::nullopt if the argument was dropped during conversion.
SmallVector<Optional<ConvertedArgInfo>, 1> argInfo;
/// The type converter used to convert the arguments.
/// element that satisfies `isInvalid`, skipping any optionally-parsed elements.
/// If an optional group is encountered, this function recurses into the 'then'
/// and 'else' elements to check if they are invalid. Returns `success` if the
-/// range is known to be valid or `None` if scanning reached the end.
+/// range is known to be valid or `std::nullopt` if scanning reached the end.
///
/// Since the guard element of an optional group is required, this function
/// accepts an optional element pointer to mark it as required.