[Mlir-commits] [mlir] [MLIR][XeGPU] Extend op definitions to support 3D+: dpas, dpas_mx (PR #199809)

Sang Ik Lee llvmlistbot at llvm.org
Thu May 28 09:04:52 PDT 2026


================
@@ -720,31 +720,78 @@ static LogicalResult verifyDpasDimensions(Operation *op,
   if (aRank == 1 && bRank == 1 && resRank == 1)
     return success();
 
-  // Validate A and B are 2D
-  if (aRank != 2)
-    return op->emitOpError("A operand must be a 2D vector.");
-  if (bRank < 2 || bRank > 3)
-    return op->emitOpError("B operand must be a 2D or 3D vector.");
-  if (resRank != 2)
-    return op->emitOpError("Result must be a 2D vector.");
+  // A must be at least 2D, B must be 2D or 3D (innermost dims), result at
+  // least 2D.
+  if (aRank < 2)
----------------
silee2 wrote:

Value `2` is used many times. Can you define it as a constant instead of using a magic number?
Also `3` is used as `2` + pack_dimension. A symbolic name would make the code more readable.


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


More information about the Mlir-commits mailing list