[Mlir-commits] [mlir] e3b350c - [mlir][NFC] Use `BaseMemRefType::isValidElementType` in Parser

Vladislav Vinogradov llvmlistbot at llvm.org
Wed Mar 3 05:03:35 PST 2021


Author: Vladislav Vinogradov
Date: 2021-03-03T16:00:54+03:00
New Revision: e3b350ce83a049c1608147754319c27d5fff684b

URL: https://github.com/llvm/llvm-project/commit/e3b350ce83a049c1608147754319c27d5fff684b
DIFF: https://github.com/llvm/llvm-project/commit/e3b350ce83a049c1608147754319c27d5fff684b.diff

LOG: [mlir][NFC] Use `BaseMemRefType::isValidElementType` in Parser

Instead of hard-coded check.

Reviewed By: ftynse, rriddle

Differential Revision: https://reviews.llvm.org/D97612

Added: 
    

Modified: 
    mlir/lib/Parser/TypeParser.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Parser/TypeParser.cpp b/mlir/lib/Parser/TypeParser.cpp
index 0b916fc5d679..3bb8f1ac7599 100644
--- a/mlir/lib/Parser/TypeParser.cpp
+++ b/mlir/lib/Parser/TypeParser.cpp
@@ -219,8 +219,7 @@ Type Parser::parseMemRefType() {
     return nullptr;
 
   // Check that memref is formed from allowed types.
-  if (!elementType.isIntOrIndexOrFloat() &&
-      !elementType.isa<VectorType, ComplexType>())
+  if (!BaseMemRefType::isValidElementType(elementType))
     return emitError(typeLoc, "invalid memref element type"), nullptr;
 
   // Parse semi-affine-map-composition.


        


More information about the Mlir-commits mailing list