[Mlir-commits] [mlir] [MLIR][XeGPU] Extend SGMapAttr and Add ConvertLayoutOp (PR #132425)

Adam Siemieniuk llvmlistbot at llvm.org
Thu Apr 3 04:59:54 PDT 2025


================
@@ -105,6 +105,28 @@ isArgShapesValid(TensorDescType tdescTy, VectorType valueTy,
                    << " for tensor descriptor " << tdescTy;
 }
 
+static bool isEvenDistributed(llvm::ArrayRef<int64_t> shape,
+                              xegpu::LayoutAttr attr) {
+  assert(attr && "Layout attribute is missing.");
+  llvm::SmallVector<int32_t> defaults(shape.size(), 1);
+  llvm::ArrayRef<int32_t> layout, data;
+  if (auto sg_layout = attr.getSgLayout()) {
----------------
adam-smnk wrote:

When both sg and lane layouts are present, `sg` has precedence and lane is not validated.
I assume the intended precedence is that `sg_layout` defines workgroup-level instruction and then distribution will consume and remove the sg layout? Is this the flow we're aiming for?


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


More information about the Mlir-commits mailing list