[Mlir-commits] [mlir] [mlir][linalg] Do not set insertion point inside padding function (PR #165420)
Kunwar Grover
llvmlistbot at llvm.org
Tue Oct 28 08:38:48 PDT 2025
https://github.com/Groverkss created https://github.com/llvm/llvm-project/pull/165420
There is no gurantee that the sizes provided by the user are before the operation to pad. It's better to let the user handle where to insert the newly created operations, as long as they are after the origin operation to pad.
>From 2440ca6e1828c258b44f1dc1bb464e19e9258ed0 Mon Sep 17 00:00:00 2001
From: Kunwar Grover <groverkss at gmail.com>
Date: Tue, 28 Oct 2025 15:36:04 +0000
Subject: [PATCH] [mlir][linalg] Do not set insertion point inside padding
function
---
mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
index 3e787a2ad0ef5..52ab92f180575 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
@@ -288,10 +288,6 @@ FailureOr<PadTilingInterfaceResult> linalg::rewriteAsPaddedOp(
return failure();
}
- OpBuilder::InsertionGuard g(builder);
- // Set IP after toPad because we also take the dims of toPad's output.
- builder.setInsertionPointAfter(toPad);
-
// 1. Get the loopUpperBounds from the TilingInterface.
SmallVector<Range> iterationDomain = toPad.getIterationDomain(builder);
More information about the Mlir-commits
mailing list