[Mlir-commits] [mlir] [mlir][linalg] Constrain tiling semi-affine maps (PR #212240)

Chuanqi Xu llvmlistbot at llvm.org
Thu Jul 30 17:51:08 PDT 2026


================
@@ -82,6 +82,79 @@ static LogicalResult inlinePayload(OpBuilder &b, LinalgOp linalgOp,
   return success();
 }
 
+/// Verify that tiling can be applied in presence of semi-affine maps.
+static LogicalResult
+validateTilingSemiAffineMaps(LinalgOp linalgOp, ArrayRef<OpFoldResult> offsets,
+                             ArrayRef<OpFoldResult> sizes) {
+  auto isTiledDim = [&](unsigned pos) {
+    return pos < offsets.size() && !isZeroInteger(offsets[pos]);
----------------
ChuanqiXu9 wrote:

> At least with upstream tiling infrastructure, tiling loop, and thus the tile origin, always starts at zero.

Is this guarded by design? I mean, is it possible to construct a case that loops doesn't starts at 0?

Or may be we can add some assertions in this pass if we don't have one.

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


More information about the Mlir-commits mailing list