-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][nfc] Rename type constraint for scalable vectors #68808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
For consistency with other predicates, rename: * allDimsScalableVectorTypePred -> IsVectorTypeWithAllDimsScalablePred
@llvm/pr-subscribers-mlir-sme @llvm/pr-subscribers-mlir-ods Author: Andrzej Warzyński (banach-space) ChangesFor consistency with other predicates, rename:
Full diff: https://github.com/llvm/llvm-project/pull/68808.diff 2 Files Affected:
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 4fc14e30b8a10d0..00dcc66a576f148 100644
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
@@ -38,7 +38,7 @@ def IsScalableVectorTypePred : CPred<[{::llvm::isa<::mlir::VectorType>($_self) &
::llvm::cast<VectorType>($_self).isScalable()}]>;
// 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()}]>
]>;
|
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required: The IsVectorOfRankPred<[2]>
is redundant as the dims
list always has two elements.
And<[IsVectorOfRankPred<[2]>, IsVectorTypeWithAllDimsScalablePred, | |
And<[IsVectorTypeWithAllDimsScalablePred, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, interesting! I will keep it as a useful bit of documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I wonder if IsScalableVectorTypePred
should also be renamed to IsVectorTypeWithAnyDimScalablePred
for clarity
+1 Let me update this. |
For consistency with other predicates, rename: