[mlir] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
This commit is contained in:
@@ -948,9 +948,9 @@ computeContiguousStrides(MemRefType memRefType) {
|
||||
int64_t offset;
|
||||
SmallVector<int64_t, 4> strides;
|
||||
if (failed(getStridesAndOffset(memRefType, strides, offset)))
|
||||
return None;
|
||||
return std::nullopt;
|
||||
if (!strides.empty() && strides.back() != 1)
|
||||
return None;
|
||||
return std::nullopt;
|
||||
// If no layout or identity layout, this is contiguous by definition.
|
||||
if (memRefType.getLayout().isIdentity())
|
||||
return strides;
|
||||
@@ -964,9 +964,9 @@ computeContiguousStrides(MemRefType memRefType) {
|
||||
if (ShapedType::isDynamic(sizes[index + 1]) ||
|
||||
ShapedType::isDynamic(strides[index]) ||
|
||||
ShapedType::isDynamic(strides[index + 1]))
|
||||
return None;
|
||||
return std::nullopt;
|
||||
if (strides[index] != strides[index + 1] * sizes[index + 1])
|
||||
return None;
|
||||
return std::nullopt;
|
||||
}
|
||||
return strides;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user