[Mlir-commits] [mlir] [MLIR][XeGPU] Add handling for unit-dim expansion in ShapeCast workgroup-to-subgroup distribution (PR #171758)

Charitha Saumya llvmlistbot at llvm.org
Tue Dec 16 10:11:40 PST 2025


================
@@ -1111,41 +1111,62 @@ struct WgToSgVectorShapeCastOp
     if (!layout || !layout.isForWorkgroup())
       return failure();
 
-    SmallVector<int64_t> sgShape = getSgShapeAndCount(wgShape, layout).first;
-    VectorType newResultType =
-        VectorType::get(sgShape, resultType.getElementType());
-
-    // TODO: Add check for compatible layouts in layout attr.
-    auto srcType = dyn_cast<VectorType>(adaptor.getSource()[0].getType());
+    // Check that srcShape and destShape, if they differ, only differ by
----------------
charithaintc wrote:

nit: this pattern looks bit complex now. best to have some comments and examples at the top. 

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


More information about the Mlir-commits mailing list