[Mlir-commits] [mlir] 2010269 - [mlir] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata
llvmlistbot at llvm.org
Thu Mar 2 13:19:49 PST 2023
Author: Kazu Hirata
Date: 2023-03-02T13:19:42-08:00
New Revision: 2010269c0f4694d68f3c9a87971049f4586bb940
URL: https://github.com/llvm/llvm-project/commit/2010269c0f4694d68f3c9a87971049f4586bb940
DIFF: https://github.com/llvm/llvm-project/commit/2010269c0f4694d68f3c9a87971049f4586bb940.diff
LOG: [mlir] Use std::optional instead of llvm::Optional (NFC)
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index b379616d8c12e..4dd7641e8193b 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -531,10 +531,10 @@ FailureOr<LinalgOp> promoteSubViews(OpBuilder &b, LinalgOp op,
const LinalgPromotionOptions &options);
/// Allocate the subview in the GPU workgroup memory.
-Optional<Value> allocateWorkgroupMemory(OpBuilder &builder,
- memref::SubViewOp subview,
- ArrayRef<Value> sizeBounds,
- DataLayout &);
+std::optional<Value> allocateWorkgroupMemory(OpBuilder &builder,
+ memref::SubViewOp subview,
+ ArrayRef<Value> sizeBounds,
+ DataLayout &);
/// In case of GPU group memory there is no need to deallocate.
LogicalResult deallocateWorkgroupMemory(OpBuilder &, Value /*buffer*/);
@@ -544,10 +544,10 @@ LogicalResult deallocateWorkgroupMemory(OpBuilder &, Value /*buffer*/);
LogicalResult copyToWorkgroupMemory(OpBuilder &b, Value src, Value dst);
/// Allocate the subview in the GPU private memory.
-Optional<Value> allocateGPUPrivateMemory(OpBuilder &builder,
- memref::SubViewOp subview,
- ArrayRef<Value> sizeBounds,
- DataLayout &);
+std::optional<Value> allocateGPUPrivateMemory(OpBuilder &builder,
+ memref::SubViewOp subview,
+ ArrayRef<Value> sizeBounds,
+ DataLayout &);
/// Normal copy to between src and dst.
LogicalResult copyToGPUPrivateMemory(OpBuilder &b, Value src, Value dst);
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
index d2d31f777d37b..9ec689c0af66c 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
@@ -403,7 +403,7 @@ mlir::linalg::promoteSubViews(OpBuilder &builder, LinalgOp linalgOp,
/// Allocate the given subview to a memory address space in GPU by creating a
/// allocation operation and setting the memref type address space to desired
/// address space.
-static Optional<Value> allocateSubviewGPUMemoryInAddressSpace(
+static std::optional<Value> allocateSubviewGPUMemoryInAddressSpace(
OpBuilder &builder, memref::SubViewOp subview, ArrayRef<Value> sizeBounds,
gpu::AddressSpace addressSpace) {
OpBuilder::InsertionGuard guard(builder);
@@ -438,7 +438,7 @@ static Optional<Value> allocateSubviewGPUMemoryInAddressSpace(
}
/// Allocate the subview in the GPU workgroup memory.
-Optional<Value> mlir::linalg::allocateWorkgroupMemory(
+std::optional<Value> mlir::linalg::allocateWorkgroupMemory(
OpBuilder &builder, memref::SubViewOp subview, ArrayRef<Value> sizeBounds,
DataLayout &) {
return allocateSubviewGPUMemoryInAddressSpace(
@@ -463,7 +463,7 @@ LogicalResult mlir::linalg::copyToWorkgroupMemory(OpBuilder &b, Value src,
}
/// Allocate the subview in the GPU private memory.
-Optional<Value> mlir::linalg::allocateGPUPrivateMemory(
+std::optional<Value> mlir::linalg::allocateGPUPrivateMemory(
OpBuilder &builder, memref::SubViewOp subview, ArrayRef<Value> sizeBounds,
DataLayout &) {
return allocateSubviewGPUMemoryInAddressSpace(
@@ -482,4 +482,4 @@ LogicalResult mlir::linalg::copyToGPUPrivateMemory(OpBuilder &b, Value src,
LogicalResult mlir::linalg::deallocateGPUPrivateMemory(OpBuilder &,
Value /*buffer*/) {
return success();
-}
\ No newline at end of file
+}
More information about the Mlir-commits
mailing list