[Mlir-commits] [mlir] [mlir][vector] Refine Vector to LLVM lowering options (PR #159553)
Jakub Kuderski
llvmlistbot at llvm.org
Thu Sep 18 18:17:17 PDT 2025
================
@@ -1987,41 +1987,36 @@ struct VectorScalableStepOpLowering
/// %e = add %c, %d
/// ```
/// `vector.matrix_multiply` later lowers to `llvm.matrix.multiply`.
-//
-/// This only kicks in when vectorContractLowering is set to Matmul and
-/// the vector.contract op is a row-major matrix multiply.
class ContractionOpToMatmulOpLowering
: public vector::MaskableOpRewritePattern<vector::ContractionOp> {
public:
using MaskableOpRewritePattern::MaskableOpRewritePattern;
- ContractionOpToMatmulOpLowering(
- vector::VectorContractLowering vectorContractLowering,
- MLIRContext *context, PatternBenefit benefit = 100)
+ ContractionOpToMatmulOpLowering(MLIRContext *context,
+ PatternBenefit benefit = 100)
: MaskableOpRewritePattern<vector::ContractionOp>(context, benefit) {}
FailureOr<Value>
matchAndRewriteMaskableOp(vector::ContractionOp op, MaskingOpInterface maskOp,
PatternRewriter &rewriter) const override;
};
-/// Progressively lower a `vector.contract %a, %b, %c` with row-major matmul
-/// semantics to:
+/// Lower a qualifying `vector.contract %a, %b, %c` (with row-major matmul
+/// semantics directly into `llvm.intr.matrix.multiply`:
+/// BEFORE:
----------------
kuhar wrote:
nit/optional: you can tag code blocks with mlir, e.g.:
````
```mlir
%res = ...
```
````
also below
https://github.com/llvm/llvm-project/pull/159553
More information about the Mlir-commits
mailing list