[Mlir-commits] [mlir] [MLIR][XeGPU] Extend SGMapAttr and Add ConvertLayoutOp (PR #132425)
Chao Chen
llvmlistbot at llvm.org
Tue Apr 8 15:02:59 PDT 2025
================
@@ -105,6 +105,29 @@ 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()) {
+ layout = sg_layout.asArrayRef();
+ auto sg_data = attr.getSgData();
+ data = sg_data ? sg_data.asArrayRef() : defaults;
+ } else {
+ layout = attr.getLaneLayout().asArrayRef();
+ auto lane_data = attr.getLaneData();
+ data = lane_data ? lane_data.asArrayRef() : defaults;
+ }
+ for (auto [dimSize, dataFactor, layoutFactor] :
+ llvm::zip_equal(shape, data, layout)) {
+ // check dimSize % (dataFactor * layoutFactor) != 0
----------------
chencha3 wrote:
sure. fixed
https://github.com/llvm/llvm-project/pull/132425
More information about the Mlir-commits
mailing list