[Mlir-commits] [mlir] [mlir][linalg] Constrain tiling semi-affine maps (PR #212240)
Adam Siemieniuk
llvmlistbot at llvm.org
Fri Jul 31 04:09: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]);
----------------
adam-smnk wrote:
Now I see your point.
I agree that this check relies a bit too much on preconditions set by the callers.
Based on the current tiling implementations, detecting zero offset is a nice shortcut to telling whether dimension is tiled at all as otherwise offsets are bound to IVs. But it doesn't have to hold universally. Otherwise, offset value is irrelevant.
I'll switch to using tile `sizes` to detect tiling. It's a bit more hassle for dynamic shapes but should work.
https://github.com/llvm/llvm-project/pull/212240
More information about the Mlir-commits
mailing list