From: Jacques Pienaar Date: Tue, 9 Jun 2020 01:00:35 +0000 (-0700) Subject: [mlir] Unranked memref type has no rank X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48c28d58c6f2f80c4ebe84d89bb61f740a958463;p=platform%2Fupstream%2Fllvm.git [mlir] Unranked memref type has no rank Summary: UnrankedMemRefType doesn't have a rank but previously this was just checking for unranked tensor. Avoids failure later if one queries the shape post checking if ranked. Differential Revision: https://reviews.llvm.org/D81441 --- diff --git a/mlir/lib/IR/StandardTypes.cpp b/mlir/lib/IR/StandardTypes.cpp index 7a823ee..117cd68 100644 --- a/mlir/lib/IR/StandardTypes.cpp +++ b/mlir/lib/IR/StandardTypes.cpp @@ -199,7 +199,9 @@ int64_t ShapedType::getNumElements() const { int64_t ShapedType::getRank() const { return getShape().size(); } -bool ShapedType::hasRank() const { return !isa(); } +bool ShapedType::hasRank() const { + return !isa() && !isa(); +} int64_t ShapedType::getDimSize(unsigned idx) const { assert(idx < getRank() && "invalid index for shaped type");