[Mlir-commits] [mlir] [mlir][Vector] Move `vector.mask` canonicalization to folder (PR #140324)

Kunwar Grover llvmlistbot at llvm.org
Tue May 20 17:58:21 PDT 2025


================
@@ -6646,13 +6646,42 @@ LogicalResult MaskOp::verify() {
   return success();
 }
 
-/// Folds vector.mask ops with an all-true mask.
+/// Folds empty `vector.mask` with no passthru operand and with or without
+/// return values. For example:
+///
+///   %0 = vector.mask %mask { vector.yield %a : vector<8xf32> } :
+///     vector<8xi1> -> vector<8xf32>
+///   %1 = user_op %0 : vector<8xf32>
+///
+/// becomes:
+///
+///   %0 = user_op %a : vector<8xf32>
+///
+/// `vector.mask` with a passthru is handled by the canonicalizer.
----------------
Groverkss wrote:

But vector.mask doesnt gave a canonicalizer anymore, right?

https://github.com/llvm/llvm-project/pull/140324


More information about the Mlir-commits mailing list