Skip to content

Commit

Permalink
[mlir][NFC] Use BaseMemRefType::isValidElementType in Parser
Browse files Browse the repository at this point in the history
Instead of hard-coded check.

Reviewed By: ftynse, rriddle

Differential Revision: https://reviews.llvm.org/D97612
  • Loading branch information
Vladislav Vinogradov committed Mar 3, 2021
1 parent b6ac26f commit e3b350c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mlir/lib/Parser/TypeParser.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit e3b350c

Please sign in to comment.