[Mlir-commits] [mlir] [MLIR][XeGPU] Add Layout Propagation support for multi-reduction/reduction op with scalar result (PR #189133)
Jianhui Li
llvmlistbot at llvm.org
Wed Apr 1 11:01:58 PDT 2026
================
@@ -546,6 +548,38 @@ xegpu::SliceAttr xegpu::setupMultiReductionResultLayout(
DenseI64ArrayAttr::get(context, reductionDims));
}
+/// Sets up layout for Reduction operations by creating a SliceAttr for the
+/// result.
+xegpu::SliceAttr
+xegpu::setupReductionResultLayout(xegpu::LayoutKind layoutKind,
+ VectorType srcVecTy,
+ const xegpu::uArch::uArch *uArch) {
+
+ auto srcShape = srcVecTy.getShape();
+ auto context = srcVecTy.getContext();
+ auto subgroupSize = uArch->getSubgroupSize();
+ xegpu::LayoutAttr srcLayout;
+
+ if (layoutKind == xegpu::LayoutKind::Subgroup) {
+ assert(true &&
+ "subgroup layout assignment not supported for insertStridedSlice.");
----------------
Jianhui-Li wrote:
fixed
https://github.com/llvm/llvm-project/pull/189133
More information about the Mlir-commits
mailing list