[llvm] [LMI] Support non-power-of-2 types for the matmul remainder (PR #163987)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 17 11:02:12 PDT 2025


================
@@ -1720,6 +1725,31 @@ class LowerMatrixIntrinsics {
     ToRemove.push_back(MatMul);
   }
 
+  /// Given \p Remainder iterations of the the matmul inner loop,
+  /// potentially lower \p Blocksize that is used for the underlying
+  /// vector.
+  unsigned capBlockSize(unsigned BlockSize, unsigned Remainder, Type *EltType) {
+    if (BlockSize <= Remainder)
+      return BlockSize;
+
+    // If the remainder is also a legal type just use it.
+    FixedVectorType *VecTy = FixedVectorType::get(EltType, Remainder);
----------------
jroelofs wrote:

```suggestion
    auto *VecTy = FixedVectorType::get(EltType, Remainder);
```

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


More information about the llvm-commits mailing list