[PATCH] D74307: [MLIR] Support memrefs with complex element types.

Alexander Belyaev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 00:16:03 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7e5d8a34e341: [MLIR] Support memrefs with complex element types. (authored by pifon2a).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74307/new/

https://reviews.llvm.org/D74307

Files:
  mlir/lib/IR/StandardTypes.cpp
  mlir/test/IR/parser.mlir


Index: mlir/test/IR/parser.mlir
===================================================================
--- mlir/test/IR/parser.mlir
+++ mlir/test/IR/parser.mlir
@@ -133,6 +133,16 @@
 // CHECK: func @complex_types(complex<i1>) -> complex<f32>
 func @complex_types(complex<i1>) -> complex<f32>
 
+
+// CHECK: func @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
+func @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
+
+// CHECK: func @memref_with_vector_elems(memref<1x?xvector<10xf32>>)
+func @memref_with_vector_elems(memref<1x?xvector<10xf32>>)
+
+// CHECK: func @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
+func @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
+
 // CHECK: func @functions((memref<1x?x4x?x?xi32, #map0>, memref<8xi8>) -> (), () -> ())
 func @functions((memref<1x?x4x?x?xi32, #map0, 0>, memref<8xi8, #map1, 0>) -> (), ()->())
 
Index: mlir/lib/IR/StandardTypes.cpp
===================================================================
--- mlir/lib/IR/StandardTypes.cpp
+++ mlir/lib/IR/StandardTypes.cpp
@@ -333,7 +333,8 @@
   auto *context = elementType.getContext();
 
   // Check that memref is formed from allowed types.
-  if (!elementType.isIntOrFloat() && !elementType.isa<VectorType>())
+  if (!elementType.isIntOrFloat() && !elementType.isa<VectorType>() &&
+      !elementType.isa<ComplexType>())
     return emitOptionalError(location, "invalid memref element type"),
            MemRefType();
 
@@ -411,7 +412,8 @@
     Optional<Location> loc, MLIRContext *context, Type elementType,
     unsigned memorySpace) {
   // Check that memref is formed from allowed types.
-  if (!elementType.isIntOrFloat() && !elementType.isa<VectorType>())
+  if (!elementType.isIntOrFloat() && !elementType.isa<VectorType>() &&
+      !elementType.isa<ComplexType>())
     return emitOptionalError(*loc, "invalid memref element type");
   return success();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74307.244079.patch
Type: text/x-patch
Size: 1902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200212/01831fa6/attachment.bin>


More information about the llvm-commits mailing list