[Mlir-commits] [mlir] [mlir] Convert TensorType and BaseMemRefType to interfaces (PR #133053)

Andrei Golubev llvmlistbot at llvm.org
Wed Mar 26 02:10:42 PDT 2025


================
@@ -41,7 +41,7 @@ TensorType inferReshapeInputType(TypedValue<TensorType> input,
   // 0D tensor. While such construct is not incorrect on its own, bufferization
   // cannot properly handle it at the moment, so we avoid it.
   SmallVector<int64_t> shape(input.getType().getRank(), 1);
-  return input.getType().clone(shape);
+  return mlir::cast<TensorType>(input.getType().clone(shape));
----------------
andrey-golubev wrote:

note to reviewers: i see some types "shadow" `clone` method from ShapedTypeInterface by providing own implementation with different return type. It didn't seem possible to do so for TensorType / BaseMemRefType that are now interfaces unfortunately. i guess, this could be a reasonable inconvenience?

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


More information about the Mlir-commits mailing list