[Mlir-commits] [mlir] [MLIR] make One-Shot and SCF bufferization TensorLikeType-aware (PR #189073)
Dmitrii Makarenko
llvmlistbot at llvm.org
Thu Apr 16 08:51:45 PDT 2026
================
@@ -315,12 +314,17 @@ struct IfOpInterface
return cast<BufferLikeType>(thenBufferType);
// Memory space mismatch.
- if (thenBufferType.getMemorySpace() != elseBufferType.getMemorySpace())
+ auto thenBaseMemRefType = dyn_cast<BaseMemRefType>(thenBufferType);
+ auto elseBaseMemRefType = dyn_cast<BaseMemRefType>(elseBufferType);
+ if (thenBaseMemRefType && elseBaseMemRefType &&
+ thenBaseMemRefType.getMemorySpace() !=
+ elseBaseMemRefType.getMemorySpace())
return op->emitError("inconsistent memory space on then/else branches");
// Layout maps are different: Promote to fully dynamic layout map.
return cast<BufferLikeType>(getMemRefTypeWithFullyDynamicLayout(
----------------
Devjiu wrote:
Added, please check. I hope all suspicious points are covered with TODO
https://github.com/llvm/llvm-project/pull/189073
More information about the Mlir-commits
mailing list