[Mlir-commits] [mlir] [mlir][vector] Add finer grained populate methods for multi_reduction (NFC). (PR #180750)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Feb 10 08:32:24 PST 2026


================
@@ -60,6 +60,49 @@ void populateVectorContractLoweringPatterns(
 void populateVectorOuterProductLoweringPatterns(RewritePatternSet &patterns,
                                                 PatternBenefit benefit = 1);
 
+/// Populate the pattern set with the following patterns:
+///
+/// [InnerOuterDimReductionConversion]
+/// Rewrites vector.multi_reduction such that all reduction dimensions are
+/// either innermost or outermost, by adding the proper vector.transpose
+/// operations.
+///
+/// [OneDimMultiReductionToTwoDim]
+/// For cases that reduce to 1-D vector<k> reduction (and are thus missing
+/// either a parallel or a reduction), we lift them back up to 2-D with a simple
+/// vector.shape_cast to vector<1xk> so that the other patterns can kick in,
+/// thus fully exiting out of the vector.multi_reduction abstraction.
----------------
banach-space wrote:

Here and below, please avoid duplicating comments: https://github.com/llvm/llvm-project/blob/20d3aa944fb5cdbeb7e855fcd0800abd6d4a7842/mlir/include/mlir/Dialect/Vector/Transforms/LoweringPatterns.h?plain=1#L63-L92

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


More information about the Mlir-commits mailing list