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

Matthias Springer llvmlistbot at llvm.org
Wed Mar 26 02:59:19 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(
----------------
matthias-springer wrote:

That's a bit odd because `class TensorType` used to be defined as `class TensorType : public Type, public ShapedType::Trait<TensorType>` and it was possible to assign a `TensorType` to a `ShapedType` variable. It looks like it is the same setup here.


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


More information about the Mlir-commits mailing list