[Mlir-commits] [mlir] [mlir][IR] Set insertion point when erasing an operation (PR #146955)

Mehdi Amini llvmlistbot at llvm.org
Tue Jul 8 04:03:01 PDT 2025


================
@@ -322,6 +328,11 @@ void RewriterBase::inlineBlockBefore(Block *source, Block *dest,
       moveOpBefore(&source->front(), dest, before);
   }
 
+  // If the current insertion point is within the source block, adjust the
+  // insertion point to the destination block.
+  if (getInsertionBlock() == source)
+    setInsertionPoint(dest, getInsertionPoint());
----------------
joker-eph wrote:

Does this deserve an API documentation update  as well?

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


More information about the Mlir-commits mailing list