mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 14:20:17 +00:00
[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
This commit is contained in:
parent
0e1accd0f7
commit
48c28d58c6
@ -199,7 +199,9 @@ int64_t ShapedType::getNumElements() const {
|
||||
|
||||
int64_t ShapedType::getRank() const { return getShape().size(); }
|
||||
|
||||
bool ShapedType::hasRank() const { return !isa<UnrankedTensorType>(); }
|
||||
bool ShapedType::hasRank() const {
|
||||
return !isa<UnrankedMemRefType>() && !isa<UnrankedTensorType>();
|
||||
}
|
||||
|
||||
int64_t ShapedType::getDimSize(unsigned idx) const {
|
||||
assert(idx < getRank() && "invalid index for shaped type");
|
||||
|
Loading…
Reference in New Issue
Block a user