[Mlir-commits] [mlir] [MLIR][XeGPU] Enable one-step subgroup distribution of cross-lane reduction to shuffle op (PR #182698)

Artem Kroviakov llvmlistbot at llvm.org
Tue Feb 24 01:19:06 PST 2026


================
@@ -727,6 +727,61 @@ Value xegpu::lowerToVectorReductions(TypedValue<VectorType> src,
   return reductionResult;
 }
 
+Value xegpu::lowerCrossLaneReductionToShuffles(
+    TypedValue<VectorType> src, TypedValue<VectorType> acc,
+    vector::CombiningKind kind, int64_t reductionDim, int64_t reductionSize,
+    Location loc, PatternRewriter &rewriter) {
+  // Expecting a 2D source vector.
+  assert(src.getType().getRank() == 2 && "expected a 2D source vector");
+  VectorType sourceType = src.getType();
+  int64_t sourceH = sourceType.getShape()[0];
+  int64_t sourceW = sourceType.getShape()[1];
+  int nSlices = (reductionDim == 0) ? sourceW : sourceH;
----------------
akroviakov wrote:

Perhaps a comment or a variable name change to clarify the meaning of a slice (i.e., 1d vector) early on.

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


More information about the Mlir-commits mailing list