[Mlir-commits] [mlir] [MLIR][XeGPU] Consider alignment in dpas sg_layout creation (PR #181141)

Igor Zamyatin llvmlistbot at llvm.org
Thu Feb 12 09:26:17 PST 2026


================
@@ -999,9 +999,15 @@ xegpu::setupDpasLayout(xegpu::LayoutKind layoutKind, VectorType aTy,
     llvm::DenseSet<LayoutRepresentation> setCD(layoutsCD.begin(),
                                                layoutsCD.end());
     std::optional<LayoutRepresentation> bestPick;
+    auto checkSgDataAB = [&](LayoutRepresentation sgLayout) {
+      return aTy.getShape().back() / sgLayout.second ==
+             bTy.getShape().front() / sgLayout.first;
+    };
     for (auto &sgLayout : layoutsB) {
       if (setA.contains(sgLayout) && setCD.contains(sgLayout)) {
         // Is in (A and B and CD) and matches consumer -> best pick
+        if (!checkSgDataAB(sgLayout))
----------------
Garra1980 wrote:

nit: let's move the comment about best pick after this check

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


More information about the Mlir-commits mailing list