Skip to content

[mlir][vector] NFC: Rename helper to check for all ones mask for consistency #71810

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

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

qedawkins
Copy link
Contributor

Following up on #71676 (comment)

@llvmbot
Copy link
Member

llvmbot commented Nov 9, 2023

@llvm/pr-subscribers-mlir-vector

@llvm/pr-subscribers-mlir

Author: Quinn Dawkins (qedawkins)

Changes

Following up on #71676 (comment)


Full diff: https://github.com/llvm/llvm-project/pull/71810.diff

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Vector/IR/VectorOps.td (+1-1)
  • (modified) mlir/lib/Dialect/Vector/IR/VectorOps.cpp (+2-2)
diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
index 3a6d81b59aeb1f9..02e80a6446dfb24 100644
--- a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
+++ b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
@@ -2283,7 +2283,7 @@ def Vector_ConstantMaskOp :
     }
 
     /// Return whether the mask is a uniform vector of `1`s.
-    bool isFullMask();
+    bool isAllOnesMask();
   }];
 
   let assemblyFormat = "$mask_dim_sizes attr-dict `:` type(results)";
diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
index 9a2b71e459f56af..9cbfd3dba561914 100644
--- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -3947,7 +3947,7 @@ static LogicalResult foldTransferFullMask(TransferOp op) {
   if (!constantMask)
     return failure();
 
-  if (!constantMask.isFullMask())
+  if (!constantMask.isAllOnesMask())
     return failure();
 
   op.getMaskMutable().clear();
@@ -5622,7 +5622,7 @@ LogicalResult ConstantMaskOp::verify() {
   return success();
 }
 
-bool ConstantMaskOp::isFullMask() {
+bool ConstantMaskOp::isAllOnesMask() {
   auto resultType = getVectorType();
   // Check the corner case of 0-D vectors first.
   if (resultType.getRank() == 0) {

@qedawkins
Copy link
Contributor Author

I can unify any duplicated logic here as well if I can be pointed to where the helpers for recognizing all ones masks are, per #71676 (comment).

Copy link
Contributor

@aartbik aartbik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in title: constency

@qedawkins qedawkins changed the title [mlir][vector] NFC: Rename helper to check for all ones mask for constency [mlir][vector] NFC: Rename helper to check for all ones mask for consistency Nov 10, 2023
@qedawkins qedawkins merged commit 28ace78 into llvm:main Nov 10, 2023
@qedawkins qedawkins deleted the rename_constant_mask_helper branch November 10, 2023 14:32
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants