[Mlir-commits] [mlir] [mlir][vector] Replace OneDimMultiReductionToTwoDim with OneDimMultiReductionToReduction (PR #184241)
Erick Ochoa Lopez
llvmlistbot at llvm.org
Wed Mar 4 07:58:27 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.
----------------
amd-eochoalo wrote:
https://github.com/llvm/llvm-project/pull/184241/commits/eaca0557a3027f5ce22becf6b22695b032ae6388
https://github.com/llvm/llvm-project/pull/184241
More information about the Mlir-commits
mailing list