[Mlir-commits] [mlir] [mlir][linalg] Add support for scalable vectorization of linalg.mmt4d (PR #146531)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Jul 15 02:55:04 PDT 2025


================
@@ -470,6 +485,21 @@ Value VectorizationState::getOrCreateMaskFor(
     return Value();
   }
 
+  if (assumeScalableVecSizesMatchDimSize) {
+    // Given that all _scalable vector sizes_ match the corresponding
+    // memref/tensor dim sizes, masking can be skipped provided that:
+    // * all vector sizes corresponding to dynamic dims are scalable.
+    if (llvm::all_of(llvm::zip(permutedStaticSizes, maskType.getScalableDims()),
+                     [](auto it) {
+                       return std::get<0>(it) == ShapedType::kDynamic
+                                  ? std::get<1>(it)
+                                  : false;
----------------
banach-space wrote:

> Am I misinterpreting this for some reason or does this imply: "if every size in permutedStaticSizes dynamic and the corresponding dim is scalable".

I've over-iterated on scalable vectors, thanks for pointing out!

> Also, it just prints the debug print and does not guard the following lines that set the mask to nothing and return

Good catch, thanks!

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


More information about the Mlir-commits mailing list