[Mlir-commits] [mlir] [mlir][vector] Replace OneDimMultiReductionToTwoDim with OneDimMultiReductionToReduction (PR #184241)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Mar 3 12:16:03 PST 2026


================
@@ -443,75 +443,44 @@ struct TwoDimMultiReductionToReduction
   }
 };
 
-/// Converts 1d vector.multi_reduction with a single reduction dimension to a 2d
-/// form with both a single parallel and reduction dimension.
-/// This is achieved with a simple vector.shape_cast that inserts a leading 1.
-/// The case with a single parallel dimension is a noop and folds away
-/// separately.
-struct OneDimMultiReductionToTwoDim
-    : public OpRewritePattern<vector::MultiDimReductionOp> {
-  using Base::Base;
+/// Converts 1-D vector.multi_reduction directly to vector.reduction.
+/// This is the terminal case for unrolling - once we reach rank 1,
+/// we convert to vector.reduction which backends can optimize.
----------------
banach-space wrote:

"once we reach rank 1" ? Looks like this comment is still outdated?

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


More information about the Mlir-commits mailing list