[Mlir-commits] [mlir] [MLIR][XeGPU] Unroll Dpasmx Op (PR #195179)

Charitha Saumya llvmlistbot at llvm.org
Fri May 1 11:03:35 PDT 2026


================
@@ -175,16 +177,105 @@ XeGPUBlockingPass::getTileShape(Operation *op) const {
     if ((*aTile)[1] != (*bTile)[0])
       return std::nullopt;
 
+    return std::make_pair(*aTile, *bTile);
+  };
+
+  // Helper lambda to validate C tile
+  auto validateCTile = [&](Operation *op, unsigned cOperandIdx,
+                           const SmallVector<int64_t> &aTile,
+                           const SmallVector<int64_t> &bTile) -> bool {
+    if (op->getNumOperands() <= cOperandIdx)
+      return true;
+
+    std::optional<SmallVector<int64_t>> cTile =
+        getTileShape(op->getOpOperand(cOperandIdx));
+    int64_t expectedCTile[2] = {aTile[0], bTile[1]};
+    if (!cTile || !llvm::equal(*cTile, expectedCTile))
+      return false;
+    return true;
+  };
+
+  // Helper lambda to validate scale A/B tiles for DpasMxOp
+  auto validateABScaleTiles =
+      [&](Operation *op, unsigned scaleAOperandIdx, unsigned scaleBOperandIdx,
+          const SmallVector<int64_t> &aTile,
+          const SmallVector<int64_t> &bTile) -> std::optional<int64_t> {
+    std::optional<SmallVector<int64_t>> aScaleTile =
+        getTileShape(op->getOpOperand(scaleAOperandIdx));
+    std::optional<SmallVector<int64_t>> bScaleTile =
+        getTileShape(op->getOpOperand(scaleBOperandIdx));
+
+    if (!aScaleTile || aScaleTile->size() != 2 || !bScaleTile ||
+        bScaleTile->size() != 2)
----------------
charithaintc wrote:

shouldn't the op verifier check these?

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


More information about the Mlir-commits mailing list