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

ian Bearman llvmlistbot at llvm.org
Tue Feb 6 08:14:40 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()) {
----------------
manbearian wrote:

Not 100% sure on this one; the variable is to avoid calling the stored function twice. I've updated to remove the `has_value` check since that is unnecessary.

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


More information about the Mlir-commits mailing list