[Mlir-commits] [mlir] [MLIR][XeGPU] Matrix load/store subgroup distribution (PR #165008)

Jianhui Li llvmlistbot at llvm.org
Thu Oct 30 22:00:34 PDT 2025


================
@@ -191,11 +191,21 @@ IsValidMatrixOpParams(VectorType dataTy, MemDescType mdescTy,
 
   ArrayRef<int64_t> dataShape = dataTy.getShape();
   ArrayRef<int64_t> mdescShape = mdescTy.getShape();
-
+  if (subgroup_block_io && layout) {
+    auto laneData = layout.getEffectiveLaneDataAsInt();
+    if (!laneData.empty()) {
+      bool isLaneDataLinear =
+          std::all_of(laneData.begin(), std::prev(laneData.end()),
+                      [](int x) { return x == 1; });
+      if (!isLaneDataLinear)
+        return emitError()
+               << "With subgroup_block_io, lane data must be linear.";
----------------
Jianhui-Li wrote:

I think we are checking the tensor tile being accessed by matrix op (with subgroup_block_io) is contiguous. It means we need to check the following : 
1. lanedata = [ 1, ..1] // 1 for each dim
2. for dim x where lane_layout [x]! = 1, stride[x] must be 1, and block[x] must equal to lane_layout[x] if layout is blocked. 

Why call it "linear"?  Can the error message just be "With subgroup_block_io, tensor tile accessed by subgroup must be contiguous" 

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


More information about the Mlir-commits mailing list