Skip to content

Commit fcb4c05

Browse files
authored
[mlir][nfc] Rename type constraint for scalable vectors (#68808)
For consistency with other predicates, rename: * allDimsScalableVectorTypePred -> IsVectorTypeWithAllDimsScalablePred * IsScalableVectorTypePred -> IsVectorTypeWithAnyDimScalablePred
1 parent 5bf701a commit fcb4c05

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include "mlir/Interfaces/InferTypeOpInterface.td"
2727

2828
class SMETileType<Type datatype, list<int> dims, string description>
2929
: ShapedContainerType<[datatype],
30-
And<[IsVectorOfRankPred<[2]>, allDimsScalableVectorTypePred,
30+
And<[IsVectorOfRankPred<[2]>, IsVectorTypeWithAllDimsScalablePred,
3131
IsVectorOfShape<dims>]>,
3232
description>;
3333

mlir/include/mlir/IR/CommonTypeConstraints.td

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def IsFixedVectorTypePred : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
3434
!::llvm::cast<VectorType>($_self).isScalable()}]>;
3535

3636
// Whether a type is a scalable VectorType.
37-
def IsScalableVectorTypePred : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
38-
::llvm::cast<VectorType>($_self).isScalable()}]>;
37+
def IsVectorTypeWithAnyDimScalablePred
38+
: CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
39+
::llvm::cast<VectorType>($_self).isScalable()}]>;
3940

4041
// Whether a type is a scalable VectorType, with a single trailing scalable dimension.
4142
// Examples:
@@ -51,7 +52,7 @@ def IsVectorTypeWithOnlyTrailingDimScalablePred : And<[
5152
]>;
5253

5354
// Whether a type is a VectorType and all dimensions are scalable.
54-
def allDimsScalableVectorTypePred : And<[
55+
def IsVectorTypeWithAllDimsScalablePred : And<[
5556
IsVectorTypePred,
5657
CPred<[{::llvm::cast<::mlir::VectorType>($_self).allDimsScalable()}]>
5758
]>;
@@ -414,7 +415,7 @@ class FixedVectorOf<list<Type> allowedTypes> :
414415
"fixed-length vector", "::mlir::VectorType">;
415416

416417
class ScalableVectorOf<list<Type> allowedTypes> :
417-
ShapedContainerType<allowedTypes, IsScalableVectorTypePred,
418+
ShapedContainerType<allowedTypes, IsVectorTypeWithAnyDimScalablePred,
418419
"scalable vector", "::mlir::VectorType">;
419420

420421
// Any vector with a single trailing scalable dimension, with an element type in
@@ -447,7 +448,7 @@ class IsFixedVectorOfRankPred<list<int> allowedRanks> :
447448
// Whether the number of elements of a scalable vector is from the given
448449
// `allowedRanks` list
449450
class IsScalableVectorOfRankPred<list<int> allowedRanks> :
450-
And<[IsScalableVectorTypePred,
451+
And<[IsVectorTypeWithAnyDimScalablePred,
451452
Or<!foreach(allowedlength, allowedRanks,
452453
CPred<[{::llvm::cast<::mlir::VectorType>($_self).getRank()
453454
== }]
@@ -497,7 +498,7 @@ class IsFixedVectorOfLengthPred<list<int> allowedLengths> :
497498
// Whether the number of elements of a scalable vector is from the given
498499
// `allowedLengths` list
499500
class IsScalableVectorOfLengthPred<list<int> allowedLengths> :
500-
And<[IsScalableVectorTypePred,
501+
And<[IsVectorTypeWithAnyDimScalablePred,
501502
Or<!foreach(allowedlength, allowedLengths,
502503
CPred<[{::llvm::cast<::mlir::VectorType>($_self).getNumElements()
503504
== }]

0 commit comments

Comments
 (0)