[Mlir-commits] [mlir] [mlir][IR] Adjust insertion block when splitting blocks / moving ops (PR #150819)

Markus Böck llvmlistbot at llvm.org
Sun Jul 27 03:26:07 PDT 2025


================
@@ -576,24 +576,39 @@ class RewriterBase : public OpBuilder {
 
   /// Split the operations starting at "before" (inclusive) out of the given
   /// block into a new block, and return it.
+  ///
+  /// If the current insertion point is before the split point, the insertion
+  /// point is adjusted to the new block.
----------------
zero9178 wrote:

I think this could be made clearer in that the insertion point is set to the exact same location in the new block.
Maybe something like:

```suggestion
  ///
  /// The insertion point is updated to insert before the same operation as prior to the split.
  /// If the insertion point was at the end of 'block', the new insertion point is at the end of the returned block.
```

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


More information about the Mlir-commits mailing list