[Mlir-commits] [mlir] a9a1b45 - [VectorToLLVM] Use std::optional in ConvertVectorToLLVM.cpp (NFC)

Kazu Hirata llvmlistbot at llvm.org
Sat Dec 10 10:43:46 PST 2022


Author: Kazu Hirata
Date: 2022-12-10T10:43:39-08:00
New Revision: a9a1b45b3c2ef0a44a56cb6e677e4daa4b29fbc6

URL: https://github.com/llvm/llvm-project/commit/a9a1b45b3c2ef0a44a56cb6e677e4daa4b29fbc6
DIFF: https://github.com/llvm/llvm-project/commit/a9a1b45b3c2ef0a44a56cb6e677e4daa4b29fbc6.diff

LOG: [VectorToLLVM] Use std::optional in ConvertVectorToLLVM.cpp (NFC)

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

Added: 
    

Modified: 
    mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
index f0166015425b8..35def299a73f1 100644
--- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
+++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
@@ -19,6 +19,7 @@
 #include "mlir/IR/TypeUtilities.h"
 #include "mlir/Target/LLVMIR/TypeToLLVM.h"
 #include "mlir/Transforms/DialectConversion.h"
+#include <optional>
 
 using namespace mlir;
 using namespace mlir::vector;
@@ -943,7 +944,7 @@ class VectorFMAOpNDRewritePattern : public OpRewritePattern<FMAOp> {
 
 /// Returns the strides if the memory underlying `memRefType` has a contiguous
 /// static layout.
-static llvm::Optional<SmallVector<int64_t, 4>>
+static std::optional<SmallVector<int64_t, 4>>
 computeContiguousStrides(MemRefType memRefType) {
   int64_t offset;
   SmallVector<int64_t, 4> strides;


        


More information about the Mlir-commits mailing list