[Mlir-commits] [mlir] [MLIR][Bufferization]: Handle invalid memref element types (PR #173692)
Matthias Springer
llvmlistbot at llvm.org
Sat Dec 27 01:22:58 PST 2025
================
@@ -961,6 +961,16 @@ FailureOr<BufferLikeType> bufferization::detail::defaultGetBufferType(
assert(llvm::isa<TensorType>(value.getType()) && "expected tensor type");
auto tensorType = cast<TensorType>(value.getType());
+ auto elementType = tensorType.getElementType();
+
+ if (!BaseMemRefType::isValidElementType(elementType)) {
+ if (Operation *def = value.getDefiningOp())
----------------
matthias-springer wrote:
Use `getOwnerOfValue(value)->emitError()` to make sure that we print an error message even for block arguments.
https://github.com/llvm/llvm-project/pull/173692
More information about the Mlir-commits
mailing list