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

Andrei Golubev llvmlistbot at llvm.org
Wed Mar 26 03:40:04 PDT 2025


================
@@ -77,9 +77,9 @@ struct CastOpInterface
     // Case 3: Ranked tensor -> ranked tensor. The offsets and strides do not
     // change.
     auto rankedResultType = cast<RankedTensorType>(castOp.getType());
-    return MemRefType::get(
+    return llvm::cast<BaseMemRefType>(MemRefType::get(
----------------
andrey-golubev wrote:

Let me try! Somehow i didn't think of `extra(Shared?)ClassDeclaration` but it might actually be rather nice if it works.
do you think we need  `operator ShapedType() const { return llvm::cast<ShapedType>(*this); }` as well? (i mean, maybe just for the sake of keeping the source compatibility)

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


More information about the Mlir-commits mailing list