[Mlir-commits] [mlir] fcb4c05 - [mlir][nfc] Rename type constraint for scalable vectors (#68808)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Oct 12 17:40:22 PDT 2023
Author: Andrzej WarzyĆski
Date: 2023-10-12T17:40:16-07:00
New Revision: fcb4c0555e2f8f77c335c386e299093329458209
URL: https://github.com/llvm/llvm-project/commit/fcb4c0555e2f8f77c335c386e299093329458209
DIFF: https://github.com/llvm/llvm-project/commit/fcb4c0555e2f8f77c335c386e299093329458209.diff
LOG: [mlir][nfc] Rename type constraint for scalable vectors (#68808)
For consistency with other predicates, rename:
* allDimsScalableVectorTypePred -> IsVectorTypeWithAllDimsScalablePred
* IsScalableVectorTypePred -> IsVectorTypeWithAnyDimScalablePred
Added:
Modified:
mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
mlir/include/mlir/IR/CommonTypeConstraints.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td b/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
index e09092268082dd3..049c9759d70bf43 100644
--- a/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
+++ b/mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
@@ -27,7 +27,7 @@ include "mlir/Interfaces/InferTypeOpInterface.td"
class SMETileType<Type datatype, list<int> dims, string description>
: ShapedContainerType<[datatype],
- And<[IsVectorOfRankPred<[2]>, allDimsScalableVectorTypePred,
+ And<[IsVectorOfRankPred<[2]>, IsVectorTypeWithAllDimsScalablePred,
IsVectorOfShape<dims>]>,
description>;
diff --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td
index c3f18965e343a23..59249349921a3b6 100644
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
@@ -34,8 +34,9 @@ def IsFixedVectorTypePred : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
!::llvm::cast<VectorType>($_self).isScalable()}]>;
// Whether a type is a scalable VectorType.
-def IsScalableVectorTypePred : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
- ::llvm::cast<VectorType>($_self).isScalable()}]>;
+def IsVectorTypeWithAnyDimScalablePred
+ : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &&
+ ::llvm::cast<VectorType>($_self).isScalable()}]>;
// Whether a type is a scalable VectorType, with a single trailing scalable dimension.
// Examples:
@@ -51,7 +52,7 @@ def IsVectorTypeWithOnlyTrailingDimScalablePred : And<[
]>;
// Whether a type is a VectorType and all dimensions are scalable.
-def allDimsScalableVectorTypePred : And<[
+def IsVectorTypeWithAllDimsScalablePred : And<[
IsVectorTypePred,
CPred<[{::llvm::cast<::mlir::VectorType>($_self).allDimsScalable()}]>
]>;
@@ -414,7 +415,7 @@ class FixedVectorOf<list<Type> allowedTypes> :
"fixed-length vector", "::mlir::VectorType">;
class ScalableVectorOf<list<Type> allowedTypes> :
- ShapedContainerType<allowedTypes, IsScalableVectorTypePred,
+ ShapedContainerType<allowedTypes, IsVectorTypeWithAnyDimScalablePred,
"scalable vector", "::mlir::VectorType">;
// Any vector with a single trailing scalable dimension, with an element type in
@@ -447,7 +448,7 @@ class IsFixedVectorOfRankPred<list<int> allowedRanks> :
// Whether the number of elements of a scalable vector is from the given
// `allowedRanks` list
class IsScalableVectorOfRankPred<list<int> allowedRanks> :
- And<[IsScalableVectorTypePred,
+ And<[IsVectorTypeWithAnyDimScalablePred,
Or<!foreach(allowedlength, allowedRanks,
CPred<[{::llvm::cast<::mlir::VectorType>($_self).getRank()
== }]
@@ -497,7 +498,7 @@ class IsFixedVectorOfLengthPred<list<int> allowedLengths> :
// Whether the number of elements of a scalable vector is from the given
// `allowedLengths` list
class IsScalableVectorOfLengthPred<list<int> allowedLengths> :
- And<[IsScalableVectorTypePred,
+ And<[IsVectorTypeWithAnyDimScalablePred,
Or<!foreach(allowedlength, allowedLengths,
CPred<[{::llvm::cast<::mlir::VectorType>($_self).getNumElements()
== }]
More information about the Mlir-commits
mailing list