diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -485,6 +485,29 @@ class VectorOf allowedTypes> : ShapedContainerType; +// Whether the number of elements of a vector is from the given +// `allowedRanks` list +class IsVectorOfRankPred allowedRanks> : + And<[IsVectorTypePred, + Or().getRank() + == }] + # allowedlength>)>]>; + +// Any vector where the rank is from the given `allowedRanks` list +class VectorOfRank allowedRanks> : Type< + IsVectorOfRankPred, + " of ranks " # StrJoinInt.result>; + +// Any vector where the rank is from the given `allowedRanks` list and the type +// is from the given `allowedTypes` list +class VectorOfRankAndType allowedRanks, + list allowedTypes> : Type< + And<[VectorOf.predicate, + VectorOfRank.predicate]>, + VectorOf.description # + VectorOfRank.description>; + // Whether the number of elements of a vector is from the given // `allowedLengths` list class IsVectorOfLengthPred allowedLengths> :