[Mlir-commits] [mlir] [mlir][bufferization] Return BufferLikeType in BufferizableOpInterface (PR #144867)

Andrei Golubev llvmlistbot at llvm.org
Thu Jun 19 03:44:14 PDT 2025


================
@@ -196,17 +196,17 @@ struct SelectOpInterface
     if (failed(trueType) || failed(falseType))
       return failure();
     if (*trueType == *falseType)
-      return *trueType;
+      return cast<BufferLikeType>(*trueType);
     if (trueType->getMemorySpace() != falseType->getMemorySpace())
----------------
andrey-golubev wrote:

`getMemorySpace()` is the main problem here why I couldn't drop `bufferization::detail::asMemRefType()`.

@matthias-springer is this reasonable to assume all buffers have an associated memory space? I guess I could follow this up by another patch that extends the BuferLikeType and streamlines multiple places around the code-base.

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


More information about the Mlir-commits mailing list