[Mlir-commits] [mlir] [mlir][memref]: Fix Bug in GlobalOp Verifier (PR #144900)

Andrzej Warzyński llvmlistbot at llvm.org
Tue Jun 24 06:59:28 PDT 2025


================
@@ -59,7 +59,8 @@ LogicalResult mlir::memref::foldMemRefCast(Operation *op, Value inner) {
 /// type.
 Type mlir::memref::getTensorTypeFromMemRefType(Type type) {
   if (auto memref = llvm::dyn_cast<MemRefType>(type))
-    return RankedTensorType::get(memref.getShape(), memref.getElementType());
+    return RankedTensorType::get(memref.getShape(), memref.getElementType(),
+                                 memref.getMemorySpace());
----------------
banach-space wrote:

OK, so this is setting the tensor encoding based on the memory space 🤔 This looks good and odd at the same time 😅 

@matthias-springer , could you take a look with your expert eye? Based on `-use-encoding-for-memory-space` in https://mlir.llvm.org/docs/Passes/#-one-shot-bufferize, this would make sense. But it still feels like a very strong assumption, so not sure.

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


More information about the Mlir-commits mailing list