[Mlir-commits] [mlir] [MLIR] Setting MemorySpace During Bufferization + Fixes (PR #78484)

Matthias Springer llvmlistbot at llvm.org
Mon Feb 5 02:18:51 PST 2024


================
@@ -234,8 +234,8 @@ AllocTensorOp::getBufferType(Value value, const BufferizationOptions &options,
     if (failed(copyBufferType))
       return failure();
     memorySpace = copyBufferType->getMemorySpace();
-  } else if (options.defaultMemorySpace.has_value()) {
-    memorySpace = *options.defaultMemorySpace;
+  } else if (auto x = options.defaultMemorySpaceFn(getType()); x.has_value()) {
----------------
matthias-springer wrote:

The temporary variable `x` is not needed.


https://github.com/llvm/llvm-project/pull/78484


More information about the Mlir-commits mailing list