[Mlir-commits] [mlir] [mlir][NFC] Add RewriterBase operand/block-arg mutation helpers (PR #187992)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 23 06:43:01 PDT 2026


================
@@ -244,6 +244,37 @@ void RewriterBase::eraseBlock(Block *block) {
   block->erase();
 }
 
+void RewriterBase::eraseBlockArgument(Block *block, unsigned index) {
+  eraseBlockArguments(block, index, /*num=*/1);
+}
+
+void RewriterBase::eraseBlockArguments(Block *block, unsigned start,
+                                       unsigned num) {
+  if (Operation *parentOp = block->getParentOp()) {
+    modifyOpInPlace(parentOp, [&]() { block->eraseArguments(start, num); });
+    return;
+  }
+  block->eraseArguments(start, num);
----------------
joker-eph wrote:

That fallback is surprising to me and seems like a new behavior?

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


More information about the Mlir-commits mailing list