Make MemRefOf tablegen type subclass ShapedContainerType
authorGeoffrey Martin-Noble <gcmn@google.com>
Mon, 3 Jun 2019 20:07:51 +0000 (13:07 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Tue, 4 Jun 2019 02:27:10 +0000 (19:27 -0700)
Possible now because MemRef subclasses ShapedType

PiperOrigin-RevId: 251292951

mlir/include/mlir/IR/OpBase.td

index f046fd2..16a7ca3 100644 (file)
@@ -396,11 +396,9 @@ def F64Tensor  : TensorOf<[F64]>;
 
 // Memref type.
 
-// TODO(b/132735995) Use ShapedContainerType when MemRef subclasses ShapedType.
 // Memrefs are blocks of data with fixed type and rank.
 class MemRefOf<list<Type> allowedTypes> :
-    ContainerType<AnyTypeOf<allowedTypes>, IsMemRefTypePred,
-                    "$_self.cast<MemRefType>().getElementType()", "memref">;
+    ShapedContainerType<allowedTypes, IsMemRefTypePred, "memref">;
 
 def AnyMemRef : MemRefOf<[AnyType]>;