[Mlir-commits] [mlir] [MLIR][Vector] Add unroll pattern for vector.constant_mask (PR #171518)

Erick Ochoa Lopez llvmlistbot at llvm.org
Wed Dec 10 06:51:37 PST 2025


================
@@ -1094,6 +1094,93 @@ struct UnrollCreateMaskPattern : public OpRewritePattern<vector::CreateMaskOp> {
   vector::UnrollVectorOptions options;
 };
 
+/// This pattern unrolls `vector.constant_mask` operations into smaller mask
+/// operations based on the target unroll shape. Each unrolled slice computes
+/// whether its elements should be masked based on the original mask dimensions
+/// and the slice's offset position.
+///
+/// Example:
+///   Given a constant_mask operation:
+///     %0 = vector.constant_mask [6, 10] : vector<8x16xi1>  // mask first 6x10
+///     elements
----------------
amd-eochoalo wrote:

Small-nit.

```suggestion
///     // mask first 6x10 elements
///     %0 = vector.constant_mask [6, 10] : vector<8x16xi1>
```

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


More information about the Mlir-commits mailing list