[Mlir-commits] [mlir] [MLIR][XeGPU] Support partial subgroup lane distribution (PR #201667)

Jianhui Li llvmlistbot at llvm.org
Sat Jun 6 09:55:45 PDT 2026


================
@@ -729,11 +729,23 @@ bool LayoutAttr::isCompatibleWith(const xegpu::DistributeLayoutAttr &other,
       if (getEffectiveSgLayoutAsInt() == other.getEffectiveSgLayoutAsInt() &&
           getEffectiveSgDataAsInt() == other.getEffectiveSgDataAsInt())
         return true;
-    if (level == xegpu::LayoutKind::Lane)
-      if (getEffectiveLaneLayoutAsInt() ==
-              other.getEffectiveLaneLayoutAsInt() &&
-          getEffectiveLaneDataAsInt() == other.getEffectiveLaneDataAsInt())
-        return true;
+    if (level == xegpu::LayoutKind::Lane) {
+      auto laneLayout = getEffectiveLaneLayoutAsInt();
+      auto otherLaneLayout = other.getEffectiveLaneLayoutAsInt();
+      auto laneData = getEffectiveLaneDataAsInt();
+      auto otherLaneData = other.getEffectiveLaneDataAsInt();
+      if (laneLayout == otherLaneLayout) {
+        return laneData == otherLaneData;
+      } else if (laneData == otherLaneData) {
+        if (laneLayout.size() == 2 && otherLaneLayout.size() == 2) {
+          // Target LaneLayout may be a fraction of this along distibuted dim
+          if (laneLayout[0] == otherLaneLayout[0])
+            return laneLayout[1] % otherLaneLayout[1] == 0;
----------------
Jianhui-Li wrote:

these two conditions are not compatible. What is the reason you need to extend this function?  It is not used in this PR. 

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


More information about the Mlir-commits mailing list